1.2.5.2.38 TCPIP_MAC_PKT_AllocF Type

C

typedef TCPIP_MAC_PACKET* (* TCPIP_MAC_PKT_AllocF)(uint16_t pktLen, uint16_t segLoadLen, TCPIP_MAC_PACKET_FLAGS flags);

Description

Packet Allocation Function: typedef TCPIP_MAC_PACKET* (*TCPIP_MAC_PKT_AllocF)(uint16_t pktLen, uint16_t segLoadLen, TCPIP_MAC_PACKET_FLAGS flags);

This function is used by the MAC to allocate a TCPIP_MAC_PACKET packet.

Parameters

ParametersDescription
pktLenThe size of the packet (it will be 32 bits rounded up).
segLoadLenThe payload size for the segment associated to this packet. Payload is always 32 bit aligned. If 0 no segment is created/attached to the packet.
moduleIdPacket flags.

Returns

  • Valid packet pointer - If the allocation request succeeded.

  • 0 - If the allocation request failed.

Remarks

The returned allocated packet should always have the TCPIP_MAC_ETHERNET_HEADER added to the packet.

The debug version adds the module identifier.