Warning, cross-references for /kernel/include/lwip/netifapi.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef __LWIP_NETIFAPI_H__
0029 #define __LWIP_NETIFAPI_H__
0030
0031 #include "lwip/opt.h"
0032
0033 #if LWIP_NETIF_API
0034
0035 #include "lwip/sys.h"
0036 #include "lwip/netif.h"
0037 #include "lwip/dhcp.h"
0038 #include "lwip/autoip.h"
0039
0040 #ifdef __cplusplus
0041 extern "C" {
0042 #endif
0043
0044 struct netifapi_msg_msg {
0045 #if !LWIP_TCPIP_CORE_LOCKING
0046 sys_sem_t sem;
0047 #endif
0048 err_t err;
0049 struct netif *netif;
0050 union {
0051 struct {
0052 struct ip_addr *ipaddr;
0053 struct ip_addr *netmask;
0054 struct ip_addr *gw;
0055 void *state;
0056 err_t (* init) (struct netif *netif);
0057 err_t (* input)(struct pbuf *p, struct netif *netif);
0058 } add;
0059 struct {
0060 void (* voidfunc)(struct netif *netif);
0061 err_t (* errtfunc)(struct netif *netif);
0062 } common;
0063 } msg;
0064 };
0065
0066 struct netifapi_msg {
0067 void (* function)(struct netifapi_msg_msg *msg);
0068 struct netifapi_msg_msg msg;
0069 };
0070
0071
0072
0073 err_t netifapi_netif_add ( struct netif *netif,
0074 struct ip_addr *ipaddr,
0075 struct ip_addr *netmask,
0076 struct ip_addr *gw,
0077 void *state,
0078 err_t (* init)(struct netif *netif),
0079 err_t (* input)(struct pbuf *p, struct netif *netif) );
0080
0081 err_t netifapi_netif_set_addr ( struct netif *netif,
0082 struct ip_addr *ipaddr,
0083 struct ip_addr *netmask,
0084 struct ip_addr *gw );
0085
0086 err_t netifapi_netif_common ( struct netif *netif,
0087 void (* voidfunc)(struct netif *netif),
0088 err_t (* errtfunc)(struct netif *netif) );
0089
0090 #define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
0091 #define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
0092 #define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
0093 #define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
0094 #define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
0095 #define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
0096 #define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
0097 #define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
0098
0099 #ifdef __cplusplus
0100 }
0101 #endif
0102
0103 #endif
0104
0105 #endif