45 |
|
|
46 |
/** must be the maximum of all used hardware address lengths |
/** must be the maximum of all used hardware address lengths |
47 |
across all types of interfaces in use */ |
across all types of interfaces in use */ |
48 |
#define NETIF_HWADDR_LEN 6 |
#define NETIF_MAX_HWADDR_LEN 6 |
49 |
|
|
50 |
/** whether the network interface is 'up'. this is |
/** whether the network interface is 'up'. this is |
51 |
* a software flag used to control whether this network |
* a software flag used to control whether this network |
64 |
struct netif *next; |
struct netif *next; |
65 |
/** The following fields should be filled in by the |
/** The following fields should be filled in by the |
66 |
initialization function for the device driver. */ |
initialization function for the device driver. */ |
|
char name[2]; |
|
|
/** number of this interface */ |
|
|
u8_t num; |
|
|
/** NETIF_FLAG_* */ |
|
|
u8_t flags; |
|
|
/** maximum transfer unit (in bytes) */ |
|
|
u16_t mtu; |
|
67 |
|
|
68 |
|
/** IP address configuration in network byte order */ |
69 |
struct ip_addr ip_addr; |
struct ip_addr ip_addr; |
|
/** netmask in network byte order */ |
|
70 |
struct ip_addr netmask; |
struct ip_addr netmask; |
71 |
struct ip_addr gw; |
struct ip_addr gw; |
72 |
|
|
73 |
/** This function is called by the network device driver |
/** This function is called by the network device driver |
74 |
to pass a packet up the TCP/IP stack. */ |
to pass a packet up the TCP/IP stack. */ |
75 |
err_t (* input)(struct pbuf *p, struct netif *inp); |
err_t (* input)(struct pbuf *p, struct netif *inp); |
|
|
|
76 |
/** This function is called by the IP module when it wants |
/** This function is called by the IP module when it wants |
77 |
to send a packet on the interface. This function typically |
to send a packet on the interface. This function typically |
78 |
first resolves the hardware address, then sends the packet. */ |
first resolves the hardware address, then sends the packet. */ |
90 |
/** number of bytes used in hwaddr */ |
/** number of bytes used in hwaddr */ |
91 |
unsigned char hwaddr_len; |
unsigned char hwaddr_len; |
92 |
/** link level hardware address of this interface */ |
/** link level hardware address of this interface */ |
93 |
unsigned char hwaddr[NETIF_HWADDR_LEN]; |
unsigned char hwaddr[NETIF_MAX_HWADDR_LEN]; |
94 |
|
/** maximum transfer unit (in bytes) */ |
95 |
|
u16_t mtu; |
96 |
|
/** descriptive abbreviation */ |
97 |
|
char name[2]; |
98 |
|
/** number of this interface */ |
99 |
|
u8_t num; |
100 |
|
/** NETIF_FLAG_* */ |
101 |
|
u8_t flags; |
102 |
}; |
}; |
103 |
|
|
104 |
/** The list of network interfaces. */ |
/** The list of network interfaces. */ |