FastClick

Elements / Ethernet

EnsureEther

ensures that IP packets are Ethernet encapsulated

SYNOPSIS§

EnsureEther([ETHERTYPE, SRC, DST])

Batching: Batching natively supported
Ports: 1 input, 1 output
Processing: agnostic

DESCRIPTION§

Ensures that IP packets are encapsulated in an Ethernet header. Non-IP packets, and IP packets that look Ethernet-encapsulated, are emitted on the first output unchanged. Other IP packets are encapsulated in an Ethernet header before being emitted. If the IP packet looks like it had an Ethernet header that was stripped off, then that header is used. Otherwise, the header specified by the arguments is prepended to the packet.

EXAMPLES§

Encapsulate packets without an Ethernet header with type ETHERTYPE_IP (0x0800), source address 1\:1\:1\:1\:1:1, and destination address 2\:2\:2\:2\:2\:2:

  EnsureEther(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2)

SEE ALSO§

EtherEncap, EtherRewrite

Generated by click-elem2man from ../elements/ethernet/ensureether.hh:7 on 2026/11/02.