mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
Made hardware address length definable (was 6 bytes for Ethernet).
This commit is contained in:
parent
5e13d495f0
commit
a5e9b73703
@ -41,6 +41,8 @@
|
|||||||
#include "lwip/inet.h"
|
#include "lwip/inet.h"
|
||||||
#include "lwip/pbuf.h"
|
#include "lwip/pbuf.h"
|
||||||
|
|
||||||
|
/** must be the maximum of all used hardware address lengths */
|
||||||
|
#define NETIF_HWADDR_LEN 6
|
||||||
|
|
||||||
struct netif {
|
struct netif {
|
||||||
struct netif *next;
|
struct netif *next;
|
||||||
@ -49,7 +51,7 @@ struct netif {
|
|||||||
struct ip_addr ip_addr;
|
struct ip_addr ip_addr;
|
||||||
struct ip_addr netmask; /* netmask in network byte order */
|
struct ip_addr netmask; /* netmask in network byte order */
|
||||||
struct ip_addr gw;
|
struct ip_addr gw;
|
||||||
unsigned char hwaddr[6];
|
unsigned char hwaddr[NETIF_HWADDR_LEN];
|
||||||
|
|
||||||
/* This function is called by the network device driver
|
/* This function is called by the network device driver
|
||||||
when it wants to pass a packet to the TCP/IP stack. */
|
when it wants to pass a packet to the TCP/IP stack. */
|
||||||
@ -69,16 +71,16 @@ struct netif {
|
|||||||
the pbuf on the link medium. */
|
the pbuf on the link medium. */
|
||||||
err_t (* linkoutput)(struct netif *netif, struct pbuf *p);
|
err_t (* linkoutput)(struct netif *netif, struct pbuf *p);
|
||||||
|
|
||||||
/* This field can be set bu the device driver and could point
|
/* This field can be set by the device driver and could point
|
||||||
to state information for the device. */
|
to state information for the device. */
|
||||||
void *state;
|
void *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The list of network interfaces. */
|
/** The list of network interfaces. */
|
||||||
extern struct netif *netif_list;
|
extern struct netif *netif_list;
|
||||||
|
/** The default network interface. */
|
||||||
extern struct netif *netif_default;
|
extern struct netif *netif_default;
|
||||||
|
|
||||||
|
|
||||||
/* netif_init() must be called first. */
|
/* netif_init() must be called first. */
|
||||||
void netif_init(void);
|
void netif_init(void);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user