mbeduino + Weatherduino Weather Stations post test

Dependencies:   mbed

Committer:
okini3939
Date:
Tue Oct 26 17:19:28 2010 +0000
Revision:
0:10bcaa7c2253

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okini3939 0:10bcaa7c2253 1 /*
okini3939 0:10bcaa7c2253 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
okini3939 0:10bcaa7c2253 3 * All rights reserved.
okini3939 0:10bcaa7c2253 4 *
okini3939 0:10bcaa7c2253 5 * Redistribution and use in source and binary forms, with or without modification,
okini3939 0:10bcaa7c2253 6 * are permitted provided that the following conditions are met:
okini3939 0:10bcaa7c2253 7 *
okini3939 0:10bcaa7c2253 8 * 1. Redistributions of source code must retain the above copyright notice,
okini3939 0:10bcaa7c2253 9 * this list of conditions and the following disclaimer.
okini3939 0:10bcaa7c2253 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
okini3939 0:10bcaa7c2253 11 * this list of conditions and the following disclaimer in the documentation
okini3939 0:10bcaa7c2253 12 * and/or other materials provided with the distribution.
okini3939 0:10bcaa7c2253 13 * 3. The name of the author may not be used to endorse or promote products
okini3939 0:10bcaa7c2253 14 * derived from this software without specific prior written permission.
okini3939 0:10bcaa7c2253 15 *
okini3939 0:10bcaa7c2253 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
okini3939 0:10bcaa7c2253 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
okini3939 0:10bcaa7c2253 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
okini3939 0:10bcaa7c2253 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
okini3939 0:10bcaa7c2253 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
okini3939 0:10bcaa7c2253 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
okini3939 0:10bcaa7c2253 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
okini3939 0:10bcaa7c2253 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
okini3939 0:10bcaa7c2253 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
okini3939 0:10bcaa7c2253 25 * OF SUCH DAMAGE.
okini3939 0:10bcaa7c2253 26 *
okini3939 0:10bcaa7c2253 27 * This file is part of the lwIP TCP/IP stack.
okini3939 0:10bcaa7c2253 28 *
okini3939 0:10bcaa7c2253 29 * Author: Adam Dunkels <adam@sics.se>
okini3939 0:10bcaa7c2253 30 *
okini3939 0:10bcaa7c2253 31 */
okini3939 0:10bcaa7c2253 32 #ifndef __LWIP_NETIF_H__
okini3939 0:10bcaa7c2253 33 #define __LWIP_NETIF_H__
okini3939 0:10bcaa7c2253 34
okini3939 0:10bcaa7c2253 35 #include "lwip/opt.h"
okini3939 0:10bcaa7c2253 36
okini3939 0:10bcaa7c2253 37 #define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)
okini3939 0:10bcaa7c2253 38
okini3939 0:10bcaa7c2253 39 #include "lwip/err.h"
okini3939 0:10bcaa7c2253 40
okini3939 0:10bcaa7c2253 41 #include "lwip/ip_addr.h"
okini3939 0:10bcaa7c2253 42
okini3939 0:10bcaa7c2253 43 #include "lwip/def.h"
okini3939 0:10bcaa7c2253 44 #include "lwip/pbuf.h"
okini3939 0:10bcaa7c2253 45 #if LWIP_DHCP
okini3939 0:10bcaa7c2253 46 struct dhcp;
okini3939 0:10bcaa7c2253 47 #endif
okini3939 0:10bcaa7c2253 48 #if LWIP_AUTOIP
okini3939 0:10bcaa7c2253 49 struct autoip;
okini3939 0:10bcaa7c2253 50 #endif
okini3939 0:10bcaa7c2253 51
okini3939 0:10bcaa7c2253 52 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 53 extern "C" {
okini3939 0:10bcaa7c2253 54 #endif
okini3939 0:10bcaa7c2253 55
okini3939 0:10bcaa7c2253 56 /* Throughout this file, IP addresses are expected to be in
okini3939 0:10bcaa7c2253 57 * the same byte order as in IP_PCB. */
okini3939 0:10bcaa7c2253 58
okini3939 0:10bcaa7c2253 59 /* must be the maximum of all used hardware address lengths
okini3939 0:10bcaa7c2253 60 across all types of interfaces in use */
okini3939 0:10bcaa7c2253 61 #define NETIF_MAX_HWADDR_LEN 6U
okini3939 0:10bcaa7c2253 62
okini3939 0:10bcaa7c2253 63 /* Whether the network interface is 'up'. This is
okini3939 0:10bcaa7c2253 64 * a software flag used to control whether this network
okini3939 0:10bcaa7c2253 65 * interface is enabled and processes traffic.
okini3939 0:10bcaa7c2253 66 * It is set by the startup code (for static IP configuration) or
okini3939 0:10bcaa7c2253 67 * by dhcp/autoip when an address has been assigned.
okini3939 0:10bcaa7c2253 68 */
okini3939 0:10bcaa7c2253 69 #define NETIF_FLAG_UP 0x01U
okini3939 0:10bcaa7c2253 70 /* If set, the netif has broadcast capability.
okini3939 0:10bcaa7c2253 71 * Set by the netif driver in its init function. */
okini3939 0:10bcaa7c2253 72 #define NETIF_FLAG_BROADCAST 0x02U
okini3939 0:10bcaa7c2253 73 /* If set, the netif is one end of a point-to-point connection.
okini3939 0:10bcaa7c2253 74 * Set by the netif driver in its init function. */
okini3939 0:10bcaa7c2253 75 #define NETIF_FLAG_POINTTOPOINT 0x04U
okini3939 0:10bcaa7c2253 76 /* If set, the interface is configured using DHCP.
okini3939 0:10bcaa7c2253 77 * Set by the DHCP code when starting or stopping DHCP. */
okini3939 0:10bcaa7c2253 78 #define NETIF_FLAG_DHCP 0x08U
okini3939 0:10bcaa7c2253 79 /* If set, the interface has an active link
okini3939 0:10bcaa7c2253 80 * (set by the network interface driver).
okini3939 0:10bcaa7c2253 81 * Either set by the netif driver in its init function (if the link
okini3939 0:10bcaa7c2253 82 * is up at that time) or at a later point once the link comes up
okini3939 0:10bcaa7c2253 83 * (if link detection is supported by the hardware). */
okini3939 0:10bcaa7c2253 84 #define NETIF_FLAG_LINK_UP 0x10U
okini3939 0:10bcaa7c2253 85 /* If set, the netif is an ethernet device using ARP.
okini3939 0:10bcaa7c2253 86 * Set by the netif driver in its init function.
okini3939 0:10bcaa7c2253 87 * Used to check input packet types and use of DHCP. */
okini3939 0:10bcaa7c2253 88 #define NETIF_FLAG_ETHARP 0x20U
okini3939 0:10bcaa7c2253 89 /* If set, the netif is an ethernet device. It might not use
okini3939 0:10bcaa7c2253 90 * ARP or TCP/IP if it is used for PPPoE only.
okini3939 0:10bcaa7c2253 91 */
okini3939 0:10bcaa7c2253 92 #define NETIF_FLAG_ETHERNET 0x40U
okini3939 0:10bcaa7c2253 93 /* If set, the netif has IGMP capability.
okini3939 0:10bcaa7c2253 94 * Set by the netif driver in its init function. */
okini3939 0:10bcaa7c2253 95 #define NETIF_FLAG_IGMP 0x80U
okini3939 0:10bcaa7c2253 96
okini3939 0:10bcaa7c2253 97 /* Function prototype for netif init functions. Set up flags and output/linkoutput
okini3939 0:10bcaa7c2253 98 * callback functions in this function.
okini3939 0:10bcaa7c2253 99 *
okini3939 0:10bcaa7c2253 100 * @param netif The netif to initialize
okini3939 0:10bcaa7c2253 101 */
okini3939 0:10bcaa7c2253 102 typedef err_t (*netif_init_fn)(struct netif *netif);
okini3939 0:10bcaa7c2253 103 /* Function prototype for netif->input functions. This function is saved as 'input'
okini3939 0:10bcaa7c2253 104 * callback function in the netif struct. Call it when a packet has been received.
okini3939 0:10bcaa7c2253 105 *
okini3939 0:10bcaa7c2253 106 * @param p The received packet, copied into a pbuf
okini3939 0:10bcaa7c2253 107 * @param inp The netif which received the packet
okini3939 0:10bcaa7c2253 108 */
okini3939 0:10bcaa7c2253 109 typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp);
okini3939 0:10bcaa7c2253 110 /* Function prototype for netif->output functions. Called by lwIP when a packet
okini3939 0:10bcaa7c2253 111 * shall be sent. For ethernet netif, set this to 'etharp_output' and set
okini3939 0:10bcaa7c2253 112 * 'linkoutput'.
okini3939 0:10bcaa7c2253 113 *
okini3939 0:10bcaa7c2253 114 * @param netif The netif which shall send a packet
okini3939 0:10bcaa7c2253 115 * @param p The packet to send (p->payload points to IP header)
okini3939 0:10bcaa7c2253 116 * @param ipaddr The IP address to which the packet shall be sent
okini3939 0:10bcaa7c2253 117 */
okini3939 0:10bcaa7c2253 118 typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
okini3939 0:10bcaa7c2253 119 ip_addr_t *ipaddr);
okini3939 0:10bcaa7c2253 120 /* Function prototype for netif->linkoutput functions. Only used for ethernet
okini3939 0:10bcaa7c2253 121 * netifs. This function is called by ARP when a packet shall be sent.
okini3939 0:10bcaa7c2253 122 *
okini3939 0:10bcaa7c2253 123 * @param netif The netif which shall send a packet
okini3939 0:10bcaa7c2253 124 * @param p The packet to send (raw ethernet packet)
okini3939 0:10bcaa7c2253 125 */
okini3939 0:10bcaa7c2253 126 typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
okini3939 0:10bcaa7c2253 127 /* Function prototype for netif status- or link-callback functions. */
okini3939 0:10bcaa7c2253 128 typedef void (*netif_status_callback_fn)(struct netif *netif);
okini3939 0:10bcaa7c2253 129 /* Function prototype for netif igmp_mac_filter functions */
okini3939 0:10bcaa7c2253 130 typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
okini3939 0:10bcaa7c2253 131 ip_addr_t *group, u8_t action);
okini3939 0:10bcaa7c2253 132
okini3939 0:10bcaa7c2253 133 /* Generic data structure used for all lwIP network interfaces.
okini3939 0:10bcaa7c2253 134 * The following fields should be filled in by the initialization
okini3939 0:10bcaa7c2253 135 * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */
okini3939 0:10bcaa7c2253 136 struct netif {
okini3939 0:10bcaa7c2253 137 /* pointer to next in linked list */
okini3939 0:10bcaa7c2253 138 struct netif *next;
okini3939 0:10bcaa7c2253 139
okini3939 0:10bcaa7c2253 140 /* IP address configuration in network byte order */
okini3939 0:10bcaa7c2253 141 ip_addr_t ip_addr;
okini3939 0:10bcaa7c2253 142 ip_addr_t netmask;
okini3939 0:10bcaa7c2253 143 ip_addr_t gw;
okini3939 0:10bcaa7c2253 144
okini3939 0:10bcaa7c2253 145 /* This function is called by the network device driver
okini3939 0:10bcaa7c2253 146 * to pass a packet up the TCP/IP stack. */
okini3939 0:10bcaa7c2253 147 netif_input_fn input;
okini3939 0:10bcaa7c2253 148 /* This function is called by the IP module when it wants
okini3939 0:10bcaa7c2253 149 * to send a packet on the interface. This function typically
okini3939 0:10bcaa7c2253 150 * first resolves the hardware address, then sends the packet. */
okini3939 0:10bcaa7c2253 151 netif_output_fn output;
okini3939 0:10bcaa7c2253 152 /* This function is called by the ARP module when it wants
okini3939 0:10bcaa7c2253 153 * to send a packet on the interface. This function outputs
okini3939 0:10bcaa7c2253 154 * the pbuf as-is on the link medium. */
okini3939 0:10bcaa7c2253 155 netif_linkoutput_fn linkoutput;
okini3939 0:10bcaa7c2253 156 #if LWIP_NETIF_STATUS_CALLBACK
okini3939 0:10bcaa7c2253 157 /* This function is called when the netif state is set to up or down
okini3939 0:10bcaa7c2253 158 */
okini3939 0:10bcaa7c2253 159 netif_status_callback_fn status_callback;
okini3939 0:10bcaa7c2253 160 #endif /* LWIP_NETIF_STATUS_CALLBACK */
okini3939 0:10bcaa7c2253 161 #if LWIP_NETIF_LINK_CALLBACK
okini3939 0:10bcaa7c2253 162 /* This function is called when the netif link is set to up or down
okini3939 0:10bcaa7c2253 163 */
okini3939 0:10bcaa7c2253 164 netif_status_callback_fn link_callback;
okini3939 0:10bcaa7c2253 165 #endif /* LWIP_NETIF_LINK_CALLBACK */
okini3939 0:10bcaa7c2253 166 /* This field can be set by the device driver and could point
okini3939 0:10bcaa7c2253 167 * to state information for the device. */
okini3939 0:10bcaa7c2253 168 void *state;
okini3939 0:10bcaa7c2253 169 #if LWIP_DHCP
okini3939 0:10bcaa7c2253 170 /* the DHCP client state information for this netif */
okini3939 0:10bcaa7c2253 171 struct dhcp *dhcp;
okini3939 0:10bcaa7c2253 172 #endif /* LWIP_DHCP */
okini3939 0:10bcaa7c2253 173 #if LWIP_AUTOIP
okini3939 0:10bcaa7c2253 174 /* the AutoIP client state information for this netif */
okini3939 0:10bcaa7c2253 175 struct autoip *autoip;
okini3939 0:10bcaa7c2253 176 #endif
okini3939 0:10bcaa7c2253 177 #if LWIP_NETIF_HOSTNAME
okini3939 0:10bcaa7c2253 178 /* the hostname for this netif, NULL is a valid value */
okini3939 0:10bcaa7c2253 179 char* hostname;
okini3939 0:10bcaa7c2253 180 #endif /* LWIP_NETIF_HOSTNAME */
okini3939 0:10bcaa7c2253 181 /* maximum transfer unit (in bytes) */
okini3939 0:10bcaa7c2253 182 u16_t mtu;
okini3939 0:10bcaa7c2253 183 /* number of bytes used in hwaddr */
okini3939 0:10bcaa7c2253 184 u8_t hwaddr_len;
okini3939 0:10bcaa7c2253 185 /* link level hardware address of this interface */
okini3939 0:10bcaa7c2253 186 u8_t hwaddr[NETIF_MAX_HWADDR_LEN];
okini3939 0:10bcaa7c2253 187 /* flags (see NETIF_FLAG_ above) */
okini3939 0:10bcaa7c2253 188 u8_t flags;
okini3939 0:10bcaa7c2253 189 /* descriptive abbreviation */
okini3939 0:10bcaa7c2253 190 char name[2];
okini3939 0:10bcaa7c2253 191 /* number of this interface */
okini3939 0:10bcaa7c2253 192 u8_t num;
okini3939 0:10bcaa7c2253 193 #if LWIP_SNMP
okini3939 0:10bcaa7c2253 194 /* link type (from "snmp_ifType" enum from snmp.h) */
okini3939 0:10bcaa7c2253 195 u8_t link_type;
okini3939 0:10bcaa7c2253 196 /* (estimate) link speed */
okini3939 0:10bcaa7c2253 197 u32_t link_speed;
okini3939 0:10bcaa7c2253 198 /* timestamp at last change made (up/down) */
okini3939 0:10bcaa7c2253 199 u32_t ts;
okini3939 0:10bcaa7c2253 200 /* counters */
okini3939 0:10bcaa7c2253 201 u32_t ifinoctets;
okini3939 0:10bcaa7c2253 202 u32_t ifinucastpkts;
okini3939 0:10bcaa7c2253 203 u32_t ifinnucastpkts;
okini3939 0:10bcaa7c2253 204 u32_t ifindiscards;
okini3939 0:10bcaa7c2253 205 u32_t ifoutoctets;
okini3939 0:10bcaa7c2253 206 u32_t ifoutucastpkts;
okini3939 0:10bcaa7c2253 207 u32_t ifoutnucastpkts;
okini3939 0:10bcaa7c2253 208 u32_t ifoutdiscards;
okini3939 0:10bcaa7c2253 209 #endif /* LWIP_SNMP */
okini3939 0:10bcaa7c2253 210 #if LWIP_IGMP
okini3939 0:10bcaa7c2253 211 /* This function could be called to add or delete a entry in the multicast
okini3939 0:10bcaa7c2253 212 filter table of the ethernet MAC.*/
okini3939 0:10bcaa7c2253 213 netif_igmp_mac_filter_fn igmp_mac_filter;
okini3939 0:10bcaa7c2253 214 #endif /* LWIP_IGMP */
okini3939 0:10bcaa7c2253 215 #if LWIP_NETIF_HWADDRHINT
okini3939 0:10bcaa7c2253 216 u8_t *addr_hint;
okini3939 0:10bcaa7c2253 217 #endif /* LWIP_NETIF_HWADDRHINT */
okini3939 0:10bcaa7c2253 218 #if ENABLE_LOOPBACK
okini3939 0:10bcaa7c2253 219 /* List of packets to be queued for ourselves. */
okini3939 0:10bcaa7c2253 220 struct pbuf *loop_first;
okini3939 0:10bcaa7c2253 221 struct pbuf *loop_last;
okini3939 0:10bcaa7c2253 222 #if LWIP_LOOPBACK_MAX_PBUFS
okini3939 0:10bcaa7c2253 223 u16_t loop_cnt_current;
okini3939 0:10bcaa7c2253 224 #endif /* LWIP_LOOPBACK_MAX_PBUFS */
okini3939 0:10bcaa7c2253 225 #endif /* ENABLE_LOOPBACK */
okini3939 0:10bcaa7c2253 226 };
okini3939 0:10bcaa7c2253 227
okini3939 0:10bcaa7c2253 228 #if LWIP_SNMP
okini3939 0:10bcaa7c2253 229 #define NETIF_INIT_SNMP(netif, type, speed) \
okini3939 0:10bcaa7c2253 230 /* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \
okini3939 0:10bcaa7c2253 231 (netif)->link_type = (type); \
okini3939 0:10bcaa7c2253 232 /* your link speed here (units: bits per second) */ \
okini3939 0:10bcaa7c2253 233 (netif)->link_speed = (speed); \
okini3939 0:10bcaa7c2253 234 (netif)->ts = 0; \
okini3939 0:10bcaa7c2253 235 (netif)->ifinoctets = 0; \
okini3939 0:10bcaa7c2253 236 (netif)->ifinucastpkts = 0; \
okini3939 0:10bcaa7c2253 237 (netif)->ifinnucastpkts = 0; \
okini3939 0:10bcaa7c2253 238 (netif)->ifindiscards = 0; \
okini3939 0:10bcaa7c2253 239 (netif)->ifoutoctets = 0; \
okini3939 0:10bcaa7c2253 240 (netif)->ifoutucastpkts = 0; \
okini3939 0:10bcaa7c2253 241 (netif)->ifoutnucastpkts = 0; \
okini3939 0:10bcaa7c2253 242 (netif)->ifoutdiscards = 0
okini3939 0:10bcaa7c2253 243 #else /* LWIP_SNMP */
okini3939 0:10bcaa7c2253 244 #define NETIF_INIT_SNMP(netif, type, speed)
okini3939 0:10bcaa7c2253 245 #endif /* LWIP_SNMP */
okini3939 0:10bcaa7c2253 246
okini3939 0:10bcaa7c2253 247
okini3939 0:10bcaa7c2253 248 /* The list of network interfaces. */
okini3939 0:10bcaa7c2253 249 extern struct netif *netif_list;
okini3939 0:10bcaa7c2253 250 /* The default network interface. */
okini3939 0:10bcaa7c2253 251 extern struct netif *netif_default;
okini3939 0:10bcaa7c2253 252
okini3939 0:10bcaa7c2253 253 void netif_init(void);
okini3939 0:10bcaa7c2253 254
okini3939 0:10bcaa7c2253 255 struct netif *netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
okini3939 0:10bcaa7c2253 256 ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input);
okini3939 0:10bcaa7c2253 257
okini3939 0:10bcaa7c2253 258 void
okini3939 0:10bcaa7c2253 259 netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask,
okini3939 0:10bcaa7c2253 260 ip_addr_t *gw);
okini3939 0:10bcaa7c2253 261 void netif_remove(struct netif * netif);
okini3939 0:10bcaa7c2253 262
okini3939 0:10bcaa7c2253 263 /* Returns a network interface given its name. The name is of the form
okini3939 0:10bcaa7c2253 264 "et0", where the first two letters are the "name" field in the
okini3939 0:10bcaa7c2253 265 netif structure, and the digit is in the num field in the same
okini3939 0:10bcaa7c2253 266 structure. */
okini3939 0:10bcaa7c2253 267 struct netif *netif_find(char *name);
okini3939 0:10bcaa7c2253 268
okini3939 0:10bcaa7c2253 269 void netif_set_default(struct netif *netif);
okini3939 0:10bcaa7c2253 270
okini3939 0:10bcaa7c2253 271 void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr);
okini3939 0:10bcaa7c2253 272 void netif_set_netmask(struct netif *netif, ip_addr_t *netmask);
okini3939 0:10bcaa7c2253 273 void netif_set_gw(struct netif *netif, ip_addr_t *gw);
okini3939 0:10bcaa7c2253 274
okini3939 0:10bcaa7c2253 275 void netif_set_up(struct netif *netif);
okini3939 0:10bcaa7c2253 276 void netif_set_down(struct netif *netif);
okini3939 0:10bcaa7c2253 277 /* Ask if an interface is up */
okini3939 0:10bcaa7c2253 278 #define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
okini3939 0:10bcaa7c2253 279
okini3939 0:10bcaa7c2253 280 #if LWIP_NETIF_STATUS_CALLBACK
okini3939 0:10bcaa7c2253 281 void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);
okini3939 0:10bcaa7c2253 282 #endif /* LWIP_NETIF_STATUS_CALLBACK */
okini3939 0:10bcaa7c2253 283
okini3939 0:10bcaa7c2253 284 void netif_set_link_up(struct netif *netif);
okini3939 0:10bcaa7c2253 285 void netif_set_link_down(struct netif *netif);
okini3939 0:10bcaa7c2253 286 /* Ask if a link is up */
okini3939 0:10bcaa7c2253 287 #define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
okini3939 0:10bcaa7c2253 288
okini3939 0:10bcaa7c2253 289 #if LWIP_NETIF_LINK_CALLBACK
okini3939 0:10bcaa7c2253 290 void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback);
okini3939 0:10bcaa7c2253 291 #endif /* LWIP_NETIF_LINK_CALLBACK */
okini3939 0:10bcaa7c2253 292
okini3939 0:10bcaa7c2253 293 #if LWIP_NETIF_HOSTNAME
okini3939 0:10bcaa7c2253 294 #define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
okini3939 0:10bcaa7c2253 295 #define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
okini3939 0:10bcaa7c2253 296 #endif /* LWIP_NETIF_HOSTNAME */
okini3939 0:10bcaa7c2253 297
okini3939 0:10bcaa7c2253 298 #if LWIP_IGMP
okini3939 0:10bcaa7c2253 299 #define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
okini3939 0:10bcaa7c2253 300 #define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)
okini3939 0:10bcaa7c2253 301 #endif /* LWIP_IGMP */
okini3939 0:10bcaa7c2253 302
okini3939 0:10bcaa7c2253 303 #if ENABLE_LOOPBACK
okini3939 0:10bcaa7c2253 304 err_t netif_loop_output(struct netif *netif, struct pbuf *p, ip_addr_t *dest_ip);
okini3939 0:10bcaa7c2253 305 void netif_poll(struct netif *netif);
okini3939 0:10bcaa7c2253 306 #if !LWIP_NETIF_LOOPBACK_MULTITHREADING
okini3939 0:10bcaa7c2253 307 void netif_poll_all(void);
okini3939 0:10bcaa7c2253 308 #endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */
okini3939 0:10bcaa7c2253 309 #endif /* ENABLE_LOOPBACK */
okini3939 0:10bcaa7c2253 310
okini3939 0:10bcaa7c2253 311 #ifdef __cplusplus
okini3939 0:10bcaa7c2253 312 }
okini3939 0:10bcaa7c2253 313 #endif
okini3939 0:10bcaa7c2253 314
okini3939 0:10bcaa7c2253 315 #endif /* __LWIP_NETIF_H__ */