CAPL Script

GetPDUsTPIPv4DstAddr

Syntax

long GetPDUsTPIPv4DstAddr(this, dword &IPv4DestinationAddress);

Function

This function can only be used within aon PDUhandler. If the PDU was received via IPv4, with this function the IPv4 destination address can be requested.

Parameters

this Handle to the currently handled (received) PDU object.

destinationIPv4Address

IPv4 destination address in network byte order.

Return Values

0: Data access successful.

-1: Wrong bus type.

-2: The requested information was not available. Most probably the PDU was not received by an IPv4 layer.

-3: The PDU object is invalid.

-4: PDU is not of RX type.

-5: Parameter too small (e.g. array has too less bytes)

-6: Message or PDU is not available (any more)

on PDU engineDataPDU{dword srcAddr, dstAddr, srcPort, dstPort;char srcAddrAsString[16], dstAddrAsString[16];if (GetPDUsTPIPv4SrcAddr(this, srcAddr)==0&& GetPDUsTPIPv4DstAddr(this, dstAddr)==0){IpGetAddressAsString(srcAddr, srcAddrAsString, elcount(srcAddrAsString));IpGetAddressAsString(dstAddr, dstAddrAsString, elcount(dstAddrAsString));if(GetPDUsTPUDPSrcPort(this, srcPort)==0&& GetPDUsTPUDPDstPort(this, dstPort)==0){write("PDU received by UDP from %s:%u to %s:%u", srcAddrAsString, srcPort, dstAddrAsString, dstPort);}if (GetPDUsTPTCPSrcPort(this, srcPort)==0&& GetPDUsTPTCPDstPort(this, dstPort)==0){write("PDU received by TCP from %s:%u to %s:%u", srcAddrAsString, srcPort, dstAddrAsString, dstPort);}}}

GetPDUsTPIPv4SrcAddr | GetPDUsTPIPv6DstAddr | GetPDUsTPIPv6SrcAddr | GetPDUsTPTCPDstPort | GetPDUsTPTCPSrcPort | GetPDUsTPUDPDstPort | GetPDUsTPUDPSrcPort