Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » ethernetPacket::SetSourceIPEndpoint

ethernetPacket::SetSourceIPEndpoint

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

long ethernetPacket.SetSourceIPEndpoint( ip_Endpoint endpoint );

Description

Set source IP address and UDP/TCP port number of ethernetPacket by an ip_Endpoint. Note: The ethernetPacket must contain IPv4 or IPv6 protocol and UDP or TCP protocol.

Parameters

  • endpoint: IP address and port.

Return Values

  • 0: success
  • -1: No IPv4 or IPv6 protocol available in packet.
  • -2: No UDP or TCP protocol available in packet.

Example

ethernetPacket packet;
ip_Endpoint 198.128.1.81:203    endpointSrc;
ip_Endpoint 255.255.255.255:204 endpointDst;

packet.tcp.Init();
packet.SetSourceIPEndpoint(endpointSrc);
packet.SetDestinationIPEndpoint(endpointDst);