netif.h¶
Common network interface API definitions.
-
NETIF_NAMELENMAX¶ Maximum length for an interface name.
1
(8U)
-
netif_types.h::netif_tnetif_iter(netif_types.h::netif_tlast)¶ Iterator for the interfaces.
Returns interface after
last. To start uselast == NETIF_INVALID.Parameters
last: The previous interface. Usen NETIF_INVALIDto start iteration.Note
Supposed to be implemented by the networking module
Return values
-
int
netif_get_name(netif_types.h::netif_tnetif, char * name)¶ Gets name of an interface.
Note
Supposed to be implemented by the networking module.
namemust be zero-terminated in the result!Parameters
netif: A network interface. name: The name of the interface. Must not be NULL. Must at least holdnetif.h::NETIF_NAMELENMAXbytes.Return values
- length of
nameon success - 0, if
netifwas not a valid interface.
- length of
-
netif_types.h::netif_tnetif_get_by_name(const char * name)¶ Gets interface by name.
Note
Supposed to be implemented by the networking module.
Parameters
name: The name of an interface as a zero-terminated. Must not be NULL.Return values
-
int
netif_get_opt(netif_types.h::netif_tnetif,netopt.h::netopt_topt, uint16_t context, void * value,msp430_types.h::size_tmax_len)¶ Gets option from an interface.
Note
Supposed to be implemented by the networking module
Parameters
netif: A network interface. opt: Option type. context: (Optional) context to the given option value: Pointer to store the option’s value in. max_len: Maximal amount of byte that fit into value.Return values
- Number of bytes written to
value. < 0on error, 0 on success.
- Number of bytes written to
-
int
netif_set_opt(netif_types.h::netif_tnetif,netopt.h::netopt_topt, uint16_t context, void * value,msp430_types.h::size_tvalue_len)¶ Sets option to an interface.
Note
Supposed to be implemented by the networking module
Parameters
netif: A network interface. opt: Option type. context: (Optional) context to the given option value: Pointer to store the option’s value in. value_len: The length of value.Return values
- Number of bytes used from
value. < 0on error, 0 on success.
- Number of bytes used from