[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #14314] Implement interface name/index APIs
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [task #14314] Implement interface name/index APIs |
Date: |
Wed, 1 Feb 2017 13:07:24 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 |
Follow-up Comment #29, task #14314 (project lwip):
Sorry for not seeing this earlier, but I have to comment on this change a
bit:
It seems to break the clean separation between APIs:
- core should not include 'api' header files (thus netif.c should not include
if.h and cannot access IF_NAMESIZE
- the fact that an 'index' is 1-based and 0 is invalid is an RFC3493
definition. To me, the API provided by netif.h would better work on 'num' only
and the conversion +/-1 to index should be done in if.c?
- same thing for netif name conversion, but this is a bit more strange as
'index_to_name' returns a long name but 'name_to_index' only checks the first
2 chars.
--> The netif.h/.c functions should use 'num' instead of 'index' (do we need
an 'invalud num' then?) and we might need to increase the size of struct
netif's 'name' field to make index->name->index check the name correctly.
Coming back on PPP, the core code doesn't call netif_add() often, so that
should be OK? OTOH, there might always be products that add/remove netifs at
runtime (just because it works) and they would not see the limitation until
someone tests it with >255 calls to netif_add(), so I think adding the
uniqueness check to netif_add() would be OK. The question is how would David
improve this for his many-netifs case?
As to the file name change, I think if_api.c is good.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?14314>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [task #14314] Implement interface name/index APIs, Dirk Ziegelmeier, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs,
Simon Goldschmidt <=
- [lwip-devel] [task #14314] Implement interface name/index APIs, Dirk Ziegelmeier, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, David van Moolenbroek, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, David van Moolenbroek, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, Simon Goldschmidt, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, David van Moolenbroek, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, Joel Cunningham, 2017/02/01
- [lwip-devel] [task #14314] Implement interface name/index APIs, Joel Cunningham, 2017/02/02
- [lwip-devel] [task #14314] Implement interface name/index APIs, Simon Goldschmidt, 2017/02/03
- [lwip-devel] [task #14314] Implement interface name/index APIs, Joel Cunningham, 2017/02/03
- [lwip-devel] [task #14314] Implement interface name/index APIs, Joel Cunningham, 2017/02/03