# null

[Open topic with navigation](../../../../../CANoeDEFamily.htm#Topics/CAPLFunctions/IP/EventProcedures/CAPLfunctionOnEthernetPacketForwarded.md)

[CAPL Functions](../../CAPLfunctions.md) » [Ethernet](../CAPLEthernetStartPage.md) » [Function Overview](../CAPLfunctionsIPOverview.md) » on ethernetPacketForwarded

# on ethernetPacketForwarded

[Valid for](../../../Shared/FeatureAvailability.md): CANoe DE • CANoe4SW DE

**Note**\
The `ethernetPacketForwarded` event is no longer generated by interfaces when [network-based](../../../CANoeCANalyzer/Ethernet/EthernetPortBasedNetworkAccess.md) access has been activated. When the Ethernet network interface internal switch forwards Ethernet packets to other ports, the Ethernet packet triggers the [on ethernetPacket](CAPLfunctionOnEthernetPacket.md) event procedure on those ports. All events leaving the internal switch have the [**hwPort** value](../Objects/CAPLfunctionEthernetPacket.md) set to the port in question and have the direction Tx. This replaces the functionality provided by the `ethernetPacketForwarded` event.

## Function Syntax

`on ethernetPacketForwarded` *;\
`on ethernetPacketForwarded` msgChannel`<X>`.*;

## Description

The event procedure is called when the Ethernet network interface has sent a received Ethernet packet on one or more other hardware channels, i.e., with VN5640 which is configured as Ethernet switch. It can only be used with network interfaces which support forwarding of Ethernet packets.

To access the control information you would use **selectors**.

The key word [this](../../Other/EventProcedures/CAPLfunctionKeywordThis.md) is available within an **on ethernetPacketForwarded** procedure, to access the data of the packet that has just been received.

CAPL programs are by default not transparent to bus events. This means that a CAPL node in the evaluation branch of the measurement configuration will block the data flow to its right side. You must explicitly program the passing of messages in CAPL nodes in the evaluation branch.

To make the CAPL node transparent to messages you would write:

```plaintext
on ethernetPacketForwarded *
{
  output(this);
};
```

## Parameters

* **msgChannel`<X>`**: Ethernet channel number, range 1..32.

## Selectors

* **time\_ns**: Point in time, units: nanoseconds\
  Type: int64\
  Access Limitation: Read only

* **dir**: Direction of transmission, event classification; possible values: Rx, Tx\
  Type: byte\
  Access Limitation: Read only

* **msgChannel**: Application channel, i.e., Eth 1\
  Type: word\
  Access Limitation: Read only

* **hwChannel**: Hardware channel. If not supported by network interface, value is 1.\
  Type: word\
  Access Limitation: Read only

* **Length**: Length of Ethernet payload data (starting after the Ethertype).\
  Type: word\
  Access Limitation: Read only

* **FCS**: Ethernet packet checksum. For some Ethernet hardware this value is not available (value 0).\
  Type: dword\
  Access Limitation: Read only

* **FrameLen**: Frame duration in ns. For some Ethernet hardware this value is not available (value 0).\
  Type: int64\
  Access Limitation: Read only

* **SOF**: Start-of-Frame time stamp in ns. For some Ethernet hardware this value is not available (value 0).\
  Type: int64\
  Access Limitation: Read only

* **Type**: Ethertype\
  Type: word\
  Access Limitation: Read only

* **Source**: Source Ethernet MAC address. Only 6 bytes of the QWord are used and network byte order is used.\
  Type: qword\
  Access Limitation: Read only

* **Destination**: Destination Ethernet MAC address. Only 6 bytes of the QWord are used and network byte order is used.\
  Type: qword\
  Access Limitation: Read only

* **byte(x)**: Message data byte (unsigned 8 bit); Offset 0 is the byte directly after the Ethertype.\
  Type: byte\
  Access Limitation: Read only

* **char(x)**: Message data byte (signed 8 bit); Offset 0 is the byte directly after the Ethertype.\
  Type: char\
  Access Limitation: Read only

* **word(x)**: Message data word (unsigned 16 bit); Offset 0 is the word directly after the Ethertype.\
  Type: word\
  Access Limitation: Read only

* **int(x)**: Message data word (signed 16 bit); Offset 0 is the int directly after the Ethertype.\
  Type: int\
  Access Limitation: Read only

* **dword(x)**: Message data word (unsigned 32 bit); Offset 0 is the dword directly after the Ethertype.\
  Type: dword\
  Access Limitation: Read only

* **long(x)**: Message data word (signed 32 bit); Offset 0 is the long directly after the Ethertype.\
  Type: long\
  Access Limitation: Read only

* **qword(x)**: Message data word (unsigned 64 bit); Offset 0 is the qword directly after the Ethertype.\
  Type: qword\
  Access Limitation: Read only

* **int64(x)**: Message data word (signed 64 bit); Offset 0 is the int64 directly after the Ethertype.\
  Type: int64\
  Access Limitation: Read only

## Example

**Example 1**

```plaintext
on ethernetPacketForwarded *
{
  write("Received Ethernet packet forwarded on Eth%d", this.msgChannel );
  output( this ); // only required in CAPL node in measurement setup!
}
```

**Example 2**

```plaintext
on ethernetPacketForwarded msgChannel1.*
{
  write("Ethernet packet forwarded with length %d", this.length );
  output( this ); // only required in CAPL node in measurement setup!
}
```

[See Also](javascript:void\(0\);)
