fdsf

Dependents:   sisk_proj_stat MQTT Hello_FXOS8700Q WireFSHandControl ... more

Committer:
grzemich
Date:
Wed Dec 07 23:47:50 2016 +0000
Revision:
0:d7bd7384a37c
dgd

Who changed what in which revision?

UserRevisionLine numberNew contents of line
grzemich 0:d7bd7384a37c 1 /*
grzemich 0:d7bd7384a37c 2 * Redistribution and use in source and binary forms, with or without modification,
grzemich 0:d7bd7384a37c 3 * are permitted provided that the following conditions are met:
grzemich 0:d7bd7384a37c 4 *
grzemich 0:d7bd7384a37c 5 * 1. Redistributions of source code must retain the above copyright notice,
grzemich 0:d7bd7384a37c 6 * this list of conditions and the following disclaimer.
grzemich 0:d7bd7384a37c 7 * 2. Redistributions in binary form must reproduce the above copyright notice,
grzemich 0:d7bd7384a37c 8 * this list of conditions and the following disclaimer in the documentation
grzemich 0:d7bd7384a37c 9 * and/or other materials provided with the distribution.
grzemich 0:d7bd7384a37c 10 * 3. The name of the author may not be used to endorse or promote products
grzemich 0:d7bd7384a37c 11 * derived from this software without specific prior written permission.
grzemich 0:d7bd7384a37c 12 *
grzemich 0:d7bd7384a37c 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
grzemich 0:d7bd7384a37c 14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
grzemich 0:d7bd7384a37c 15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
grzemich 0:d7bd7384a37c 16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
grzemich 0:d7bd7384a37c 17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
grzemich 0:d7bd7384a37c 18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
grzemich 0:d7bd7384a37c 19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
grzemich 0:d7bd7384a37c 20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
grzemich 0:d7bd7384a37c 21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
grzemich 0:d7bd7384a37c 22 * OF SUCH DAMAGE.
grzemich 0:d7bd7384a37c 23 *
grzemich 0:d7bd7384a37c 24 * This file is part of the lwIP TCP/IP stack.
grzemich 0:d7bd7384a37c 25 *
grzemich 0:d7bd7384a37c 26 */
grzemich 0:d7bd7384a37c 27
grzemich 0:d7bd7384a37c 28 #ifndef __LWIP_NETIFAPI_H__
grzemich 0:d7bd7384a37c 29 #define __LWIP_NETIFAPI_H__
grzemich 0:d7bd7384a37c 30
grzemich 0:d7bd7384a37c 31 #include "lwip/opt.h"
grzemich 0:d7bd7384a37c 32
grzemich 0:d7bd7384a37c 33 #if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
grzemich 0:d7bd7384a37c 34
grzemich 0:d7bd7384a37c 35 #include "lwip/sys.h"
grzemich 0:d7bd7384a37c 36 #include "lwip/netif.h"
grzemich 0:d7bd7384a37c 37 #include "lwip/dhcp.h"
grzemich 0:d7bd7384a37c 38 #include "lwip/autoip.h"
grzemich 0:d7bd7384a37c 39
grzemich 0:d7bd7384a37c 40 #ifdef __cplusplus
grzemich 0:d7bd7384a37c 41 extern "C" {
grzemich 0:d7bd7384a37c 42 #endif
grzemich 0:d7bd7384a37c 43
grzemich 0:d7bd7384a37c 44 typedef void (*netifapi_void_fn)(struct netif *netif);
grzemich 0:d7bd7384a37c 45 typedef err_t (*netifapi_errt_fn)(struct netif *netif);
grzemich 0:d7bd7384a37c 46
grzemich 0:d7bd7384a37c 47 struct netifapi_msg_msg {
grzemich 0:d7bd7384a37c 48 #if !LWIP_TCPIP_CORE_LOCKING
grzemich 0:d7bd7384a37c 49 sys_sem_t sem;
grzemich 0:d7bd7384a37c 50 #endif /* !LWIP_TCPIP_CORE_LOCKING */
grzemich 0:d7bd7384a37c 51 err_t err;
grzemich 0:d7bd7384a37c 52 struct netif *netif;
grzemich 0:d7bd7384a37c 53 union {
grzemich 0:d7bd7384a37c 54 struct {
grzemich 0:d7bd7384a37c 55 ip_addr_t *ipaddr;
grzemich 0:d7bd7384a37c 56 ip_addr_t *netmask;
grzemich 0:d7bd7384a37c 57 ip_addr_t *gw;
grzemich 0:d7bd7384a37c 58 void *state;
grzemich 0:d7bd7384a37c 59 netif_init_fn init;
grzemich 0:d7bd7384a37c 60 netif_input_fn input;
grzemich 0:d7bd7384a37c 61 } add;
grzemich 0:d7bd7384a37c 62 struct {
grzemich 0:d7bd7384a37c 63 netifapi_void_fn voidfunc;
grzemich 0:d7bd7384a37c 64 netifapi_errt_fn errtfunc;
grzemich 0:d7bd7384a37c 65 } common;
grzemich 0:d7bd7384a37c 66 } msg;
grzemich 0:d7bd7384a37c 67 };
grzemich 0:d7bd7384a37c 68
grzemich 0:d7bd7384a37c 69 struct netifapi_msg {
grzemich 0:d7bd7384a37c 70 void (* function)(struct netifapi_msg_msg *msg);
grzemich 0:d7bd7384a37c 71 struct netifapi_msg_msg msg;
grzemich 0:d7bd7384a37c 72 };
grzemich 0:d7bd7384a37c 73
grzemich 0:d7bd7384a37c 74
grzemich 0:d7bd7384a37c 75 /* API for application */
grzemich 0:d7bd7384a37c 76 err_t netifapi_netif_add ( struct netif *netif,
grzemich 0:d7bd7384a37c 77 ip_addr_t *ipaddr,
grzemich 0:d7bd7384a37c 78 ip_addr_t *netmask,
grzemich 0:d7bd7384a37c 79 ip_addr_t *gw,
grzemich 0:d7bd7384a37c 80 void *state,
grzemich 0:d7bd7384a37c 81 netif_init_fn init,
grzemich 0:d7bd7384a37c 82 netif_input_fn input);
grzemich 0:d7bd7384a37c 83
grzemich 0:d7bd7384a37c 84 err_t netifapi_netif_set_addr ( struct netif *netif,
grzemich 0:d7bd7384a37c 85 ip_addr_t *ipaddr,
grzemich 0:d7bd7384a37c 86 ip_addr_t *netmask,
grzemich 0:d7bd7384a37c 87 ip_addr_t *gw );
grzemich 0:d7bd7384a37c 88
grzemich 0:d7bd7384a37c 89 err_t netifapi_netif_common ( struct netif *netif,
grzemich 0:d7bd7384a37c 90 netifapi_void_fn voidfunc,
grzemich 0:d7bd7384a37c 91 netifapi_errt_fn errtfunc);
grzemich 0:d7bd7384a37c 92
grzemich 0:d7bd7384a37c 93 #define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL)
grzemich 0:d7bd7384a37c 94 #define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL)
grzemich 0:d7bd7384a37c 95 #define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL)
grzemich 0:d7bd7384a37c 96 #define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL)
grzemich 0:d7bd7384a37c 97 #define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start)
grzemich 0:d7bd7384a37c 98 #define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL)
grzemich 0:d7bd7384a37c 99 #define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start)
grzemich 0:d7bd7384a37c 100 #define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop)
grzemich 0:d7bd7384a37c 101
grzemich 0:d7bd7384a37c 102 #ifdef __cplusplus
grzemich 0:d7bd7384a37c 103 }
grzemich 0:d7bd7384a37c 104 #endif
grzemich 0:d7bd7384a37c 105
grzemich 0:d7bd7384a37c 106 #endif /* LWIP_NETIF_API */
grzemich 0:d7bd7384a37c 107
grzemich 0:d7bd7384a37c 108 #endif /* __LWIP_NETIFAPI_H__ */