diff --git a/pkg/lwip/contrib/_netif.c b/pkg/lwip/contrib/_netif.c index a931e68f1aad..b648abf400ff 100644 --- a/pkg/lwip/contrib/_netif.c +++ b/pkg/lwip/contrib/_netif.c @@ -21,7 +21,7 @@ #include "lwip/netifapi.h" #include "net/netif.h" -int netif_get_name(netif_t *iface, char *name) +int netif_get_name(const netif_t *iface, char *name) { lwip_netif_t *lwip_netif = (lwip_netif_t*) iface; struct netif *netif = &lwip_netif->lwip_netif; @@ -34,7 +34,7 @@ int netif_get_name(netif_t *iface, char *name) return res; } -int netif_get_opt(netif_t *iface, netopt_t opt, uint16_t context, +int netif_get_opt(const netif_t *iface, netopt_t opt, uint16_t context, void *value, size_t max_len) { (void)context; @@ -83,7 +83,7 @@ int netif_get_opt(netif_t *iface, netopt_t opt, uint16_t context, return res; } -int netif_set_opt(netif_t *iface, netopt_t opt, uint16_t context, +int netif_set_opt(const netif_t *iface, netopt_t opt, uint16_t context, void *value, size_t value_len) { (void)context; diff --git a/sys/include/net/netif.h b/sys/include/net/netif.h index 0540c2db992f..a208b372d0d4 100644 --- a/sys/include/net/netif.h +++ b/sys/include/net/netif.h @@ -104,7 +104,7 @@ netif_t *netif_iter(const netif_t *last); * @return length of @p name on success */ -int netif_get_name(netif_t *netif, char *name); +int netif_get_name(const netif_t *netif, char *name); /** * @brief Gets the numeric identifier of an interface @@ -170,7 +170,7 @@ netif_t *netif_get_by_id(int16_t id); * @return Number of bytes written to @p value. * @return `< 0` on error, 0 on success. */ -int netif_get_opt(netif_t *netif, netopt_t opt, uint16_t context, +int netif_get_opt(const netif_t *netif, netopt_t opt, uint16_t context, void *value, size_t max_len); /** @@ -187,7 +187,7 @@ int netif_get_opt(netif_t *netif, netopt_t opt, uint16_t context, * @return Number of bytes used from @p value. * @return `< 0` on error, 0 on success. */ -int netif_set_opt(netif_t *netif, netopt_t opt, uint16_t context, +int netif_set_opt(const netif_t *netif, netopt_t opt, uint16_t context, void *value, size_t value_len); /** diff --git a/sys/net/gnrc/netif/_netif.c b/sys/net/gnrc/netif/_netif.c index 2a919ccf987b..c12e446aedf1 100644 --- a/sys/net/gnrc/netif/_netif.c +++ b/sys/net/gnrc/netif/_netif.c @@ -24,7 +24,7 @@ #include "net/netif.h" -int netif_get_name(netif_t *iface, char *name) +int netif_get_name(const netif_t *iface, char *name) { gnrc_netif_t *netif = container_of(iface, gnrc_netif_t, netif); @@ -45,14 +45,14 @@ netif_t *netif_get_by_id(int16_t id) return &gnrc_netif_get_by_pid((kernel_pid_t)id)->netif; } -int netif_get_opt(netif_t *iface, netopt_t opt, uint16_t context, +int netif_get_opt(const netif_t *iface, netopt_t opt, uint16_t context, void *value, size_t max_len) { const gnrc_netif_t *netif = container_of(iface, gnrc_netif_t, netif); return gnrc_netapi_get(netif->pid, opt, context, value, max_len); } -int netif_set_opt(netif_t *iface, netopt_t opt, uint16_t context, +int netif_set_opt(const netif_t *iface, netopt_t opt, uint16_t context, void *value, size_t value_len) { const gnrc_netif_t *netif = container_of(iface, gnrc_netif_t, netif);