ethernetPacket::protocol::Init
CAPL Functions » Ethernet » Function Overview » ethernetPacket::protocol::InitMethod Syntax
Method SyntaxDescription
Initialize the protocol within an Ethernet packet. It appends the protocol, if it is not already contained in the packet and initialized the protocol header with default values. If a protocol requires other underlaying protocols, it will add these protocols too, i.e. if the UDP protocol is initialized it also adds an IPv4 protocol header by default. If a specific protocol stack is required, theInit() function can be called for every protocol from the lower protocols to the upper protocols, i.e. if UDP over IPv6 is required, first initialize IPv6 and then UDP. Higher protocols than the one which is initialized, will be removed.
Parameters
—Return Values
- 0: Success
- -1: Error