mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 05:36:46 +08:00
netifapi.h, netifapi.c: add function netifapi_netif_set_default. Change the common function to reduce a little bit the footprint (for all functions using only the "netif" parameter).
This commit is contained in:
@@ -53,9 +53,13 @@ struct netifapi_msg_msg {
|
||||
struct ip_addr *netmask;
|
||||
struct ip_addr *gw;
|
||||
void *state;
|
||||
err_t (* init)(struct netif *netif);
|
||||
err_t (* init) (struct netif *netif);
|
||||
err_t (* input)(struct pbuf *p, struct netif *netif);
|
||||
} add;
|
||||
struct {
|
||||
void (* voidfunc)(struct netif *netif);
|
||||
err_t (* errtfunc)(struct netif *netif);
|
||||
} common;
|
||||
} msg;
|
||||
};
|
||||
|
||||
@@ -66,8 +70,6 @@ struct netifapi_msg {
|
||||
|
||||
|
||||
/* API for application */
|
||||
err_t netifapi_netif_common ( struct netif *netif, void (* function)(struct netifapi_msg_msg *msg));
|
||||
|
||||
err_t netifapi_netif_add ( struct netif *netif,
|
||||
struct ip_addr *ipaddr,
|
||||
struct ip_addr *netmask,
|
||||
@@ -76,29 +78,18 @@ err_t netifapi_netif_add ( struct netif *netif,
|
||||
err_t (* init)(struct netif *netif),
|
||||
err_t (* input)(struct pbuf *p, struct netif *netif) );
|
||||
|
||||
#define netifapi_netif_remove(n) netifapi_netif_common(n, do_netifapi_netif_remove)
|
||||
#define netifapi_netif_set_up(n) netifapi_netif_common(n, do_netifapi_netif_set_up)
|
||||
#define netifapi_netif_set_down(n) netifapi_netif_common(n, do_netifapi_netif_set_down)
|
||||
#define netifapi_dhcp_start(n) netifapi_netif_common(n, do_netifapi_dhcp_start)
|
||||
#define netifapi_dhcp_stop(n) netifapi_netif_common(n, do_netifapi_dhcp_stop)
|
||||
#define netifapi_autoip_start(n) netifapi_netif_common(n, do_netifapi_autoip_start)
|
||||
#define netifapi_autoip_stop(n) netifapi_netif_common(n, do_netifapi_autoip_stop)
|
||||
|
||||
|
||||
/* API for tcpip_thread */
|
||||
void do_netifapi_netif_add ( struct netifapi_msg_msg *msg);
|
||||
void do_netifapi_netif_remove ( struct netifapi_msg_msg *msg);
|
||||
void do_netifapi_netif_set_up ( struct netifapi_msg_msg *msg);
|
||||
void do_netifapi_netif_set_down( struct netifapi_msg_msg *msg);
|
||||
#if LWIP_DHCP
|
||||
void do_netifapi_dhcp_start ( struct netifapi_msg_msg *msg);
|
||||
void do_netifapi_dhcp_stop ( struct netifapi_msg_msg *msg);
|
||||
#endif /* LWIP_DHCP */
|
||||
#if LWIP_AUTOIP
|
||||
void do_netifapi_autoip_start ( struct netifapi_msg_msg *msg);
|
||||
void do_netifapi_autoip_stop ( struct netifapi_msg_msg *msg);
|
||||
#endif /* LWIP_AUTOIP */
|
||||
err_t netifapi_netif_common ( struct netif *netif,
|
||||
void (* voidfunc)(struct netif *netif),
|
||||
err_t (* errtfunc)(struct netif *netif) );
|
||||
|
||||
#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
|
||||
#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
|
||||
#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
|
||||
#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
|
||||
#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
|
||||
#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
|
||||
#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
|
||||
#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user