TCPIP_IPV6_PayloadSet Function

C

unsigned short TCPIP_IPV6_PayloadSet(
    IPV6_PACKET * pkt, 
    uint8_t* payload, 
    unsigned short len
);

Description

This function will allocate a data segment header and append it to the end of a chain of segments in a TX packet. It will set the data pointer in the packet segment to a pre-existing buffer of data.

Preconditions

TCPIP_IPV6_Initialize() should be called. TCPIP_IPV6_InterfaceIsReady should be true.

Parameters

ParametersDescription
ptrPacketThe packet.
payloadAddress of the data payload.
lenLength of the data payload.

Returns

IPV6_ADDR *

  • The amount of data added to the packet length - On Success.

  • 0 - On Failure.

Remarks

This function is useful for adding payloads to outgoing packets without copying them if the data is in another pre-existing buffer (i.e., TCP).