76 #include "netif/ppp/pppoe.h" 94 static void ethernetif_input(
struct netif *
netif);
106 struct ethernetif *ethernetif = netif->
state;
123 #if LWIP_IPV6 && LWIP_IPV6_MLD 129 if (netif->mld_mac_filter != NULL) {
130 ip6_addr_t ip6_allnodes_ll;
131 ip6_addr_set_allnodes_linklocal(&ip6_allnodes_ll);
156 low_level_output(
struct netif *netif,
struct pbuf *p)
158 struct ethernetif *ethernetif = netif->
state;
167 for (q = p; q != NULL; q = q->
next) {
174 signal that packet should be sent();
176 MIB2_STATS_NETIF_ADD(netif, ifoutoctets, p->
tot_len);
177 if (((u8_t*)p->
payload)[0] & 1) {
179 MIB2_STATS_NETIF_INC(netif, ifoutnucastpkts);
182 MIB2_STATS_NETIF_INC(netif, ifoutucastpkts);
190 LINK_STATS_INC(link.xmit);
204 low_level_input(
struct netif *netif)
206 struct ethernetif *ethernetif = netif->
state;
229 for (q = p; q != NULL; q = q->
next) {
240 acknowledge that packet has been read();
242 MIB2_STATS_NETIF_ADD(netif, ifinoctets, p->
tot_len);
243 if (((u8_t*)p->
payload)[0] & 1) {
245 MIB2_STATS_NETIF_INC(netif, ifinnucastpkts);
248 MIB2_STATS_NETIF_INC(netif, ifinucastpkts);
254 LINK_STATS_INC(link.recv);
257 LINK_STATS_INC(link.memerr);
258 LINK_STATS_INC(link.drop);
259 MIB2_STATS_NETIF_INC(netif, ifindiscards);
275 ethernetif_input(
struct netif *netif)
277 struct ethernetif *ethernetif;
281 ethernetif = netif->
state;
284 p = low_level_input(netif);
309 ethernetif_init(
struct netif *netif)
311 struct ethernetif *ethernetif;
313 LWIP_ASSERT(
"netif != NULL", (netif != NULL));
315 ethernetif =
mem_malloc(
sizeof(
struct ethernetif));
316 if (ethernetif == NULL) {
321 #if LWIP_NETIF_HOSTNAME 323 netif->hostname =
"lwip";
331 MIB2_INIT_NETIF(netif, snmp_ifType_ethernet_csmacd, LINK_SPEED_OF_YOUR_NETIF_IN_BPS);
333 netif->
state = ethernetif;
334 netif->
name[0] = IFNAME0;
335 netif->
name[1] = IFNAME1;
340 netif->output = etharp_output;
342 netif->output_ip6 = ethip6_output;
349 low_level_init(netif);
u8_t hwaddr[NETIF_MAX_HWADDR_LEN]
u8_t pbuf_header(struct pbuf *p, s16_t header_size_increment)
#define NETIF_FLAG_BROADCAST
#define NETIF_FLAG_LINK_UP
#define LWIP_DEBUGF(debug, message)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
#define NETIF_FLAG_ETHARP
u8_t pbuf_free(struct pbuf *p)
void * mem_malloc(mem_size_t size)
netif_linkoutput_fn linkoutput