Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Ethernet

Enumerations

enum  eth_type {
  ETHTYPE_IP = 0x0800U, ETHTYPE_ARP = 0x0806U, ETHTYPE_WOL = 0x0842U, ETHTYPE_RARP = 0x8035U,
  ETHTYPE_VLAN = 0x8100U, ETHTYPE_IPV6 = 0x86DDU, ETHTYPE_PPPOEDISC = 0x8863U, ETHTYPE_PPPOE = 0x8864U,
  ETHTYPE_JUMBO = 0x8870U, ETHTYPE_PROFINET = 0x8892U, ETHTYPE_ETHERCAT = 0x88A4U, ETHTYPE_LLDP = 0x88CCU,
  ETHTYPE_SERCOS = 0x88CDU, ETHTYPE_MRP = 0x88E3U, ETHTYPE_PTP = 0x88F7U, ETHTYPE_QINQ = 0x9100U
}
 

A list of often ethtypes (although lwIP does not use all of them):

More...

Functions

err_t ethernet_input (struct pbuf *p, struct netif *netif)
 Process received ethernet frames.

Enumeration Type Documentation

enum eth_type

A list of often ethtypes (although lwIP does not use all of them):

Enumerator:
ETHTYPE_IP 

Internet protocol v4.

ETHTYPE_ARP 

Address resolution protocol.

ETHTYPE_WOL 

Wake on lan.

ETHTYPE_RARP 

RARP.

ETHTYPE_VLAN 

Virtual local area network.

ETHTYPE_IPV6 

Internet protocol v6.

ETHTYPE_PPPOEDISC 

PPP Over Ethernet Discovery Stage.

ETHTYPE_PPPOE 

PPP Over Ethernet Session Stage.

ETHTYPE_JUMBO 

Jumbo Frames.

ETHTYPE_PROFINET 

Process field network.

ETHTYPE_ETHERCAT 

Ethernet for control automation technology.

ETHTYPE_LLDP 

Link layer discovery protocol.

ETHTYPE_SERCOS 

Serial real-time communication system.

ETHTYPE_MRP 

Media redundancy protocol.

ETHTYPE_PTP 

Precision time protocol.

ETHTYPE_QINQ 

Q-in-Q, 802.1ad.

Definition at line 108 of file lwip/prot/lwip_ethernet.h.


Function Documentation

err_t ethernet_input ( struct pbuf p,
struct netif netif 
)

Process received ethernet frames.

Using this function instead of directly calling ip_input and passing ARP frames through etharp in ethernetif_input, the ARP cache is protected from concurrent access.
Don't call directly, pass to netif_add() and call netif->input().

Parameters:
pthe received packet, p->payload pointing to the ethernet header
netifthe network interface on which the packet was received
See also:
LWIP_HOOK_UNKNOWN_ETH_PROTOCOL
ETHARP_SUPPORT_VLAN
LWIP_HOOK_VLAN_CHECK

Send an ethernet packet on the network using netif->linkoutput(). The ethernet header is filled in before sending.

See also:
LWIP_HOOK_VLAN_SET
Parameters:
netifthe lwIP network interface on which to send the packet
pthe packet to send. pbuf layer must be PBUF_LINK.
srcthe source MAC address to be copied into the ethernet header
dstthe destination MAC address to be copied into the ethernet header
eth_typeethernet type (eth_type)
Returns:
ERR_OK if the packet was sent, any other err_t on failure

Definition at line 81 of file lwip_ethernet.c.