net/netif: add function to get interface by name from a buffer#16709
net/netif: add function to get interface by name from a buffer#16709miri64 merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
I like the idea. In fact, I think we should use this new function instead of I would be in favour of changing the API and deprecate the current EDIT: I just noticed |
I don't really have a strong opinion here, there is no overhead in keeping the current function the way it is implemented. |
jia200x
left a comment
There was a problem hiding this comment.
ACK. tests/gnrc_netif passes:
make all test && echo "OK"
...
~~ SNIP 1 - size: 20 byte, type: NETTYPE_NETIF (-1)
if_pid: 6 rssi: -32768 lqi: 0
flags: 0x0
src_l2addr: 3E:E6:B5:22:FD:0B
dst_l2addr: 3E:E6:B5:22:FD:0A
~~ PKT - 2 snips, total size: 61 byte
OK
Regarding the API change of netif_get_by_name, this can be discussed later.
|
Lol, I just added the same thing to #16705 ^^ |
sys/net/netif/netif.c
Outdated
| netif_t *netif_get_by_name(const char *name) | ||
| { | ||
| return netif_get_by_name_buffer(name, strlen(name)); | ||
| } |
There was a problem hiding this comment.
This can be static inline in the header now.
There was a problem hiding this comment.
Moved to the header
miri64
left a comment
There was a problem hiding this comment.
The old style function could be inline (Github does not let me make a change request without a comment and I forgot to make one before...)
miri64
left a comment
There was a problem hiding this comment.
Please squash immediately with my last suggestion.
c9c6c89 to
78c415f
Compare
|
Squashed directly! |
|
Ci found some issues |
78c415f to
d2d1c7e
Compare
Fixed, |
Contribution description
This adds a function to
netifthat allows to search an interface by name, using a buffer and length (like the one provided by the URI parser), instead a null-terminated string.tests/gnrc_netifhas been extended accordingly.Testing procedure
tests/gnrc_netifshould pass.Issues/PRs references
Split from #16233