ROFL-pipeline  v0.6.0dev
Functions

Packet Mangling API is in charge of packet manipulation and must be implemented by the library users. More...

Functions

ROFL_BEGIN_DECLS uint32_t platform_packet_get_size_bytes (datapacket_t *const pkt)
 Gets the complete packet size in bytes. More...
 
void platform_packet_output (datapacket_t *pkt, switch_port_t *port)
 Output packet to the port(s) The action HAS to implement the destruction/release of the pkt (including if this pkt is a replica). More...
 
void platform_packet_drop (datapacket_t *pkt)
 Creates a copy (in heap) of the datapacket_t structure including any platform specific state (->platform_state). More...
 
datapacket_tplatform_packet_replicate (datapacket_t *pkt)
 Creates a copy (in heap) of the datapacket_t structure including any platform specific state (->platform_state). More...
 
uint32_t * platform_packet_get_port_in (datapacket_t *const pkt)
 Retrieves the port in identifier (position in the of1x_switch_t->logical_ports array) where the packet got in. More...
 
uint32_t * platform_packet_get_phy_port_in (datapacket_t *const pkt)
 Retrieves the PHY port in identifier where the packet got in. More...
 
void platform_packet_set_queue (datapacket_t *pkt, uint32_t queue)
 Set output queue of the packet. More...
 
uint64_t * platform_packet_get_eth_src (datapacket_t *const pkt)
 Retrieve the Ethernet src MAC address of the packet. More...
 
uint64_t * platform_packet_get_eth_dst (datapacket_t *const pkt)
 Retrieve the Ethernet dst MAC address of the packet. More...
 
uint16_t * platform_packet_get_eth_type (datapacket_t *const pkt)
 Retrieve the Ethernet ETH_TYPE of the packet. More...
 
void platform_packet_set_eth_src (datapacket_t *pkt, uint64_t eth_src)
 Set a new Ethernet src MAC address to the packet. More...
 
void platform_packet_set_eth_dst (datapacket_t *pkt, uint64_t eth_dst)
 Set a new Ethernet dst MAC address to the packet. More...
 
void platform_packet_set_eth_type (datapacket_t *pkt, uint16_t eth_type)
 Set a new ETH_TYPE to the packet if it is 802.X. More...
 
bool platform_packet_has_vlan (datapacket_t *const pkt)
 Retrieves boolean if the packet contains a 802.1q VLAN tag. More...
 
uint16_t * platform_packet_get_vlan_vid (datapacket_t *const pkt)
 Retrieves the VLAN id of the outer-most 802.1q VLAN tag. More...
 
uint8_t * platform_packet_get_vlan_pcp (datapacket_t *const pkt)
 Retrieves the VLAN PCP of the outer-most 802.1q VLAN tag. More...
 
void platform_packet_set_vlan_vid (datapacket_t *pkt, uint16_t vlan_vid)
 Set a new VLAN VID value to the outer-most VLAN of the packet. More...
 
void platform_packet_set_vlan_pcp (datapacket_t *pkt, uint8_t vlan_pcp)
 Set a new VLAN PCP value to the outer-most VLAN of the packet. More...
 
void platform_packet_pop_vlan (datapacket_t *pkt)
 Pop the outer-most 802.1q VLAN tag. More...
 
void platform_packet_push_vlan (datapacket_t *pkt, uint16_t ether_type)
 Push a new 802.1q VLAN tag (outer-most) More...
 
uint32_t * platform_packet_get_mpls_label (datapacket_t *const pkt)
 Retrieves the outer-most MPLS tag label. More...
 
uint8_t * platform_packet_get_mpls_tc (datapacket_t *const pkt)
 Retrieves the outer-most MPLS tag tc flag. More...
 
bool platform_packet_get_mpls_bos (datapacket_t *const pkt)
 Retrieves the outer-most MPLS tag BoS flag. More...
 
void platform_packet_set_mpls_label (datapacket_t *pkt, uint32_t label)
 Set a new label to the outer-most MPLS tag of the packet. More...
 
void platform_packet_set_mpls_tc (datapacket_t *pkt, uint8_t tc)
 Set a new TC value to the outer-most MPLS MPLS tag of the packet. More...
 
void platform_packet_set_mpls_bos (datapacket_t *pkt, bool bos)
 Set a new MPLS BoS value to the outer-most MPLS tag of the packet. More...
 
void platform_packet_set_mpls_ttl (datapacket_t *pkt, uint8_t new_ttl)
 Set a new TTL value to the outer-most MPLS tag of the packet. More...
 
void platform_packet_dec_mpls_ttl (datapacket_t *pkt)
 Decrement the ttl from the outer-most MPLS tag of the packet. More...
 
void platform_packet_pop_mpls (datapacket_t *pkt, uint16_t ether_type)
 Pop outer-most MPLS tag, setting the BoS accordingly. More...
 
void platform_packet_push_mpls (datapacket_t *pkt, uint16_t ether_type)
 Push a new MPLS tag (outer-most), and set inner and outer tag BoS accordingly. More...
 
uint64_t * platform_packet_get_tunnel_id (datapacket_t *const pkt)
 Get Tunnel ID. More...
 
void platform_packet_set_tunnel_id (datapacket_t *pkt, uint64_t tunnel_id)
 Set Tunnel ID. More...
 
uint32_t * platform_packet_get_pbb_isid (datapacket_t *const pkt)
 Get PBB I-SID value of the packet. More...
 
void platform_packet_set_pbb_isid (datapacket_t *pkt, uint32_t pbb_isid)
 Set a new value for the PBB I-SID of the packet. More...
 
void platform_packet_pop_pbb (datapacket_t *pkt)
 Pop outer-most PBB header. More...
 
void platform_packet_push_pbb (datapacket_t *pkt, uint16_t ether_type)
 Push PBB header (outer-most) More...
 
void platform_packet_copy_ttl_in (datapacket_t *pkt)
 Copy ttl in. More...
 
void platform_packet_copy_ttl_out (datapacket_t *pkt)
 Copy ttl out. More...
 
void platform_packet_dec_nw_ttl (datapacket_t *pkt)
 Decrement ttl. More...
 
void platform_packet_set_nw_ttl (datapacket_t *pkt, uint8_t new_ttl)
 Set new ttl value. More...
 
uint8_t * platform_packet_get_ip_proto (datapacket_t *const pkt)
 Get the ip proto value of the packet. More...
 
uint8_t platform_packet_get_ip_ecn (datapacket_t *const pkt)
 Get the ip ECN value of the packet. More...
 
uint8_t platform_packet_get_ip_dscp (datapacket_t *const pkt)
 Get the ip DSCP value of the packet. More...
 
void platform_packet_set_ip_proto (datapacket_t *pkt, uint8_t ip_proto)
 Set a new value for the IP PROTO header field. More...
 
void platform_packet_set_ip_dscp (datapacket_t *pkt, uint8_t ip_dscp)
 Set a new value for the IP DSCP header field. More...
 
void platform_packet_set_ip_ecn (datapacket_t *pkt, uint8_t ip_ecn)
 Set a new value for the IP ECN header field. More...
 
uint16_t * platform_packet_get_arp_opcode (datapacket_t *const pkt)
 Get the ARP OPCODE value of the packet. More...
 
uint64_t * platform_packet_get_arp_sha (datapacket_t *const pkt)
 Get the ARP SHA value of the packet. More...
 
uint32_t * platform_packet_get_arp_spa (datapacket_t *const pkt)
 Get the ARP SPA value of the packet. More...
 
uint64_t * platform_packet_get_arp_tha (datapacket_t *const pkt)
 Get the ARP THA value of the packet. More...
 
uint32_t * platform_packet_get_arp_tpa (datapacket_t *const pkt)
 Get the ARP TPA value of the packet. More...
 
void platform_packet_set_arp_opcode (datapacket_t *pkt, uint16_t arp_opcode)
 Set a new value for the ARP OPCODE header field. More...
 
void platform_packet_set_arp_sha (datapacket_t *pkt, uint64_t arp_sha)
 Set a new value for the ARP SHA header field. More...
 
void platform_packet_set_arp_spa (datapacket_t *pkt, uint32_t arp_spa)
 Set a new value for the ARP SPA header field. More...
 
void platform_packet_set_arp_tha (datapacket_t *pkt, uint64_t arp_tha)
 Set a new value for the ARP THA header field. More...
 
void platform_packet_set_arp_tpa (datapacket_t *pkt, uint32_t arp_tpa)
 Set a new value for the ARP TPA header field. More...
 
uint32_t * platform_packet_get_ipv4_src (datapacket_t *const pkt)
 Get the IPv4 src address of the packet. More...
 
uint32_t * platform_packet_get_ipv4_dst (datapacket_t *const pkt)
 Get the IPv4 dst address of the packet. More...
 
void platform_packet_set_ipv4_src (datapacket_t *pkt, uint32_t ip_src)
 Set a new value for the IPv4 src address. More...
 
void platform_packet_set_ipv4_dst (datapacket_t *pkt, uint32_t ip_dst)
 Set a new value for the IPv4 dst address. More...
 
uint128__tplatform_packet_get_ipv6_src (datapacket_t *const pkt)
 Get the IPv6 src address of the packet. More...
 
uint128__tplatform_packet_get_ipv6_dst (datapacket_t *const pkt)
 Get the IPv6 dst address of the packet. More...
 
uint32_t * platform_packet_get_ipv6_flabel (datapacket_t *const pkt)
 Get the IPv6 label of the packet. More...
 
uint128__tplatform_packet_get_ipv6_nd_target (datapacket_t *const pkt)
 Get the IPv6 nd target of the packet. More...
 
uint64_t * platform_packet_get_ipv6_nd_sll (datapacket_t *const pkt)
 Get the IPv6 nd sll of the packet. More...
 
uint64_t * platform_packet_get_ipv6_nd_tll (datapacket_t *const pkt)
 Get the IPv6 nd tll of the packet. More...
 
uint16_t * platform_packet_get_ipv6_exthdr (datapacket_t *const pkt)
 Get the IPv6 exthdr of the packet. More...
 
void platform_packet_set_ipv6_src (datapacket_t *pkt, uint128__t ipv6_src)
 Set a new value for the IPv6 src address. More...
 
void platform_packet_set_ipv6_dst (datapacket_t *pkt, uint128__t ipv6_dst)
 Set a new value for the IPv6 dst address. More...
 
void platform_packet_set_ipv6_flabel (datapacket_t *pkt, uint64_t ipv6_flabel)
 Set a new value for the IPv6 label. More...
 
void platform_packet_set_ipv6_nd_target (datapacket_t *pkt, uint128__t ipv6_nd_target)
 Set a new value for the IPv6 nd target. More...
 
void platform_packet_set_ipv6_nd_sll (datapacket_t *pkt, uint64_t ipv6_nd_sll)
 Set a new value for the IPv6 nd sll. More...
 
void platform_packet_set_ipv6_nd_tll (datapacket_t *pkt, uint64_t ipv6_nd_tll)
 Set a new value for the IPv6 nd tll. More...
 
void platform_packet_set_ipv6_exthdr (datapacket_t *pkt, uint16_t ipv6_exthdr)
 Set a new value for the IPv6 exthdr. More...
 
uint16_t * platform_packet_get_tcp_src (datapacket_t *const pkt)
 Get the TCP src port. More...
 
uint16_t * platform_packet_get_tcp_dst (datapacket_t *const pkt)
 Get the TCP dst port. More...
 
void platform_packet_set_tcp_src (datapacket_t *pkt, uint16_t tcp_src)
 Set a new value for the TCP src port. More...
 
void platform_packet_set_tcp_dst (datapacket_t *pkt, uint16_t tcp_dst)
 Set a new value for the TCP dst port. More...
 
uint16_t * platform_packet_get_udp_src (datapacket_t *const pkt)
 Get the UDP src port. More...
 
uint16_t * platform_packet_get_udp_dst (datapacket_t *const pkt)
 Get the UDP dst port. More...
 
void platform_packet_set_udp_src (datapacket_t *pkt, uint16_t udp_src)
 Set a new value for the UDP src port. More...
 
void platform_packet_set_udp_dst (datapacket_t *pkt, uint16_t udp_dst)
 Set a new value for the UDP dst port. More...
 
uint16_t * platform_packet_get_sctp_src (datapacket_t *const pkt)
 Get the SCTP src port. More...
 
uint16_t * platform_packet_get_sctp_dst (datapacket_t *const pkt)
 Get the SCTP dst port. More...
 
void platform_packet_set_sctp_src (datapacket_t *pkt, uint16_t sctp_src)
 Set a new value for the SCTP src port. More...
 
void platform_packet_set_sctp_dst (datapacket_t *pkt, uint16_t sctp_dst)
 Set a new value for the SCTP dst port. More...
 
uint8_t * platform_packet_get_icmpv4_type (datapacket_t *const pkt)
 Get the ICMPv4 type. More...
 
uint8_t * platform_packet_get_icmpv4_code (datapacket_t *const pkt)
 Get the ICMPv4 code. More...
 
void platform_packet_set_icmpv4_type (datapacket_t *pkt, uint8_t type)
 Set a new value for the ICMPv4 type. More...
 
void platform_packet_set_icmpv4_code (datapacket_t *pkt, uint8_t code)
 Set a new value for the ICMPv4 code. More...
 
uint8_t * platform_packet_get_icmpv6_type (datapacket_t *const pkt)
 Get the ICMPv6 type. More...
 
uint8_t * platform_packet_get_icmpv6_code (datapacket_t *const pkt)
 Get the ICMPv6 code. More...
 
void platform_packet_set_icmpv6_type (datapacket_t *pkt, uint8_t icmpv6_type)
 Set a new value for the ICMPv6 type. More...
 
void platform_packet_set_icmpv6_code (datapacket_t *pkt, uint8_t icmpv6_code)
 Set a new value for the ICMPv6 code. More...
 

Detailed Description

Packet Mangling API is in charge of packet manipulation and must be implemented by the library users.

Function Documentation

void platform_packet_copy_ttl_in ( datapacket_t pkt)

Copy ttl in.

void platform_packet_copy_ttl_out ( datapacket_t pkt)

Copy ttl out.

void platform_packet_dec_mpls_ttl ( datapacket_t pkt)

Decrement the ttl from the outer-most MPLS tag of the packet.

void platform_packet_dec_nw_ttl ( datapacket_t pkt)

Decrement ttl.

void platform_packet_drop ( datapacket_t pkt)

Creates a copy (in heap) of the datapacket_t structure including any platform specific state (->platform_state).

The following behaviour is expected from this hook:

  • All data fields and pointers of datapacket_t struct must be memseted to 0, except:
  • datapacket_t flag is_replica must be set to true
  • platform_state, if used, must be replicated (copied) otherwise NULL
uint16_t* platform_packet_get_arp_opcode ( datapacket_t *const  pkt)

Get the ARP OPCODE value of the packet.

Returns
value if existing, 0x0 otherwise.
uint64_t* platform_packet_get_arp_sha ( datapacket_t *const  pkt)

Get the ARP SHA value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint32_t* platform_packet_get_arp_spa ( datapacket_t *const  pkt)

Get the ARP SPA value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint64_t* platform_packet_get_arp_tha ( datapacket_t *const  pkt)

Get the ARP THA value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint32_t* platform_packet_get_arp_tpa ( datapacket_t *const  pkt)

Get the ARP TPA value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint64_t* platform_packet_get_eth_dst ( datapacket_t *const  pkt)

Retrieve the Ethernet dst MAC address of the packet.

Warning
Return value comes in aligned NBO endianness
uint64_t* platform_packet_get_eth_src ( datapacket_t *const  pkt)

Retrieve the Ethernet src MAC address of the packet.

Warning
Return value comes in aligned NBO endianness
uint16_t* platform_packet_get_eth_type ( datapacket_t *const  pkt)

Retrieve the Ethernet ETH_TYPE of the packet.

Warning
Return value comes in normal NBO endianness
uint8_t* platform_packet_get_icmpv4_code ( datapacket_t *const  pkt)

Get the ICMPv4 code.

Returns
value if existing, 0x0 otherwise.
uint8_t* platform_packet_get_icmpv4_type ( datapacket_t *const  pkt)

Get the ICMPv4 type.

Returns
value if existing, 0x0 otherwise.
uint8_t* platform_packet_get_icmpv6_code ( datapacket_t *const  pkt)

Get the ICMPv6 code.

Returns
value if existing, 0x0 otherwise.
uint8_t* platform_packet_get_icmpv6_type ( datapacket_t *const  pkt)

Get the ICMPv6 type.

Returns
value if existing, 0x0 otherwise.
uint8_t platform_packet_get_ip_dscp ( datapacket_t *const  pkt)

Get the ip DSCP value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes specially aligned
uint8_t platform_packet_get_ip_ecn ( datapacket_t *const  pkt)

Get the ip ECN value of the packet.

Returns
value if existing, 0x0 otherwise.
uint8_t* platform_packet_get_ip_proto ( datapacket_t *const  pkt)

Get the ip proto value of the packet.

Returns
value if existing, 0x0 otherwise.
uint32_t* platform_packet_get_ipv4_dst ( datapacket_t *const  pkt)

Get the IPv4 dst address of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint32_t* platform_packet_get_ipv4_src ( datapacket_t *const  pkt)

Get the IPv4 src address of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint128__t* platform_packet_get_ipv6_dst ( datapacket_t *const  pkt)

Get the IPv6 dst address of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint16_t* platform_packet_get_ipv6_exthdr ( datapacket_t *const  pkt)

Get the IPv6 exthdr of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint32_t* platform_packet_get_ipv6_flabel ( datapacket_t *const  pkt)

Get the IPv6 label of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in alligned NBO endianness
uint64_t* platform_packet_get_ipv6_nd_sll ( datapacket_t *const  pkt)

Get the IPv6 nd sll of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint128__t* platform_packet_get_ipv6_nd_target ( datapacket_t *const  pkt)

Get the IPv6 nd target of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint64_t* platform_packet_get_ipv6_nd_tll ( datapacket_t *const  pkt)

Get the IPv6 nd tll of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint128__t* platform_packet_get_ipv6_src ( datapacket_t *const  pkt)

Get the IPv6 src address of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
bool platform_packet_get_mpls_bos ( datapacket_t *const  pkt)

Retrieves the outer-most MPLS tag BoS flag.

Returns
flag if existing, 0x0 otherwise.
uint32_t* platform_packet_get_mpls_label ( datapacket_t *const  pkt)

Retrieves the outer-most MPLS tag label.

Returns
label if existing, 0x0 otherwise.
Warning
Return value comes in aligned NBO endianness
uint8_t* platform_packet_get_mpls_tc ( datapacket_t *const  pkt)

Retrieves the outer-most MPLS tag tc flag.

Returns
flag if existing, 0x0 otherwise.
Warning
Return value comes specially aligned
uint32_t* platform_packet_get_pbb_isid ( datapacket_t *const  pkt)

Get PBB I-SID value of the packet.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in specially aligned HBO endianness
uint32_t* platform_packet_get_phy_port_in ( datapacket_t *const  pkt)

Retrieves the PHY port in identifier where the packet got in.

Returns
id if existing, 0x0 otherwise.
Warning
Return value comes in HBO endianness
uint32_t* platform_packet_get_port_in ( datapacket_t *const  pkt)

Retrieves the port in identifier (position in the of1x_switch_t->logical_ports array) where the packet got in.

Warning
Return value comes in HBO endianness
uint16_t* platform_packet_get_sctp_dst ( datapacket_t *const  pkt)

Get the SCTP dst port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint16_t* platform_packet_get_sctp_src ( datapacket_t *const  pkt)

Get the SCTP src port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
ROFL_BEGIN_DECLS uint32_t platform_packet_get_size_bytes ( datapacket_t *const  pkt)

Gets the complete packet size in bytes.

uint16_t* platform_packet_get_tcp_dst ( datapacket_t *const  pkt)

Get the TCP dst port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint16_t* platform_packet_get_tcp_src ( datapacket_t *const  pkt)

Get the TCP src port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint64_t* platform_packet_get_tunnel_id ( datapacket_t *const  pkt)

Get Tunnel ID.

Warning
Return value comes in HBO endianness
uint16_t* platform_packet_get_udp_dst ( datapacket_t *const  pkt)

Get the UDP dst port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint16_t* platform_packet_get_udp_src ( datapacket_t *const  pkt)

Get the UDP src port.

Returns
value if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
uint8_t* platform_packet_get_vlan_pcp ( datapacket_t *const  pkt)

Retrieves the VLAN PCP of the outer-most 802.1q VLAN tag.

Returns
id if existing, 0x0 otherwise.
Warning
Return value comes specially aligned
uint16_t* platform_packet_get_vlan_vid ( datapacket_t *const  pkt)

Retrieves the VLAN id of the outer-most 802.1q VLAN tag.

Returns
id if existing, 0x0 otherwise.
Warning
Return value comes in normal NBO endianness
bool platform_packet_has_vlan ( datapacket_t *const  pkt)

Retrieves boolean if the packet contains a 802.1q VLAN tag.

void platform_packet_output ( datapacket_t pkt,
switch_port_t port 
)

Output packet to the port(s) The action HAS to implement the destruction/release of the pkt (including if this pkt is a replica).

If a flooding output actions needs to be done, the function has itself to deal with packet replication.

void platform_packet_pop_mpls ( datapacket_t pkt,
uint16_t  ether_type 
)

Pop outer-most MPLS tag, setting the BoS accordingly.

Warning
ether_type must be in normal NBO
void platform_packet_pop_pbb ( datapacket_t pkt)

Pop outer-most PBB header.

Warning
ether_type must be in normal NBO
void platform_packet_pop_vlan ( datapacket_t pkt)

Pop the outer-most 802.1q VLAN tag.

void platform_packet_push_mpls ( datapacket_t pkt,
uint16_t  ether_type 
)

Push a new MPLS tag (outer-most), and set inner and outer tag BoS accordingly.

Warning
ether_type must be in normal NBO
void platform_packet_push_pbb ( datapacket_t pkt,
uint16_t  ether_type 
)

Push PBB header (outer-most)

Warning
ether_type must be in normal NBO
void platform_packet_push_vlan ( datapacket_t pkt,
uint16_t  ether_type 
)

Push a new 802.1q VLAN tag (outer-most)

Warning
ether_type must be in normal NBO
datapacket_t* platform_packet_replicate ( datapacket_t pkt)

Creates a copy (in heap) of the datapacket_t structure including any platform specific state (->platform_state).

The following behaviour is expected from this hook:

  • All data fields and pointers of datapacket_t struct must be memseted to 0, except:
  • datapacket_t flag is_replica must be set to true
  • platform_state, if used, must be replicated (copied) otherwise NULL
  • Real packet buffer may or may not be copied, depending on the platform ability to handle copies (lazy copying)
void platform_packet_set_arp_opcode ( datapacket_t pkt,
uint16_t  arp_opcode 
)

Set a new value for the ARP OPCODE header field.

void platform_packet_set_arp_sha ( datapacket_t pkt,
uint64_t  arp_sha 
)

Set a new value for the ARP SHA header field.

Warning
arp_sha must be in aligned NBO endianness
void platform_packet_set_arp_spa ( datapacket_t pkt,
uint32_t  arp_spa 
)

Set a new value for the ARP SPA header field.

Warning
arp_spa must be in normal NBO endianness
void platform_packet_set_arp_tha ( datapacket_t pkt,
uint64_t  arp_tha 
)

Set a new value for the ARP THA header field.

Warning
arp_tha must be in aligned NBO endianness
void platform_packet_set_arp_tpa ( datapacket_t pkt,
uint32_t  arp_tpa 
)

Set a new value for the ARP TPA header field.

Warning
arp_tpa must be in normal NBO endianness
void platform_packet_set_eth_dst ( datapacket_t pkt,
uint64_t  eth_dst 
)

Set a new Ethernet dst MAC address to the packet.

Warning
eth_dst must be in aligned NBO endianness
void platform_packet_set_eth_src ( datapacket_t pkt,
uint64_t  eth_src 
)

Set a new Ethernet src MAC address to the packet.

Warning
eth_src must be in aligned NBO endianness
void platform_packet_set_eth_type ( datapacket_t pkt,
uint16_t  eth_type 
)

Set a new ETH_TYPE to the packet if it is 802.X.

Warning
eth_type must be in normal NBO endianness
void platform_packet_set_icmpv4_code ( datapacket_t pkt,
uint8_t  code 
)

Set a new value for the ICMPv4 code.

void platform_packet_set_icmpv4_type ( datapacket_t pkt,
uint8_t  type 
)

Set a new value for the ICMPv4 type.

void platform_packet_set_icmpv6_code ( datapacket_t pkt,
uint8_t  icmpv6_code 
)

Set a new value for the ICMPv6 code.

void platform_packet_set_icmpv6_type ( datapacket_t pkt,
uint8_t  icmpv6_type 
)

Set a new value for the ICMPv6 type.

void platform_packet_set_ip_dscp ( datapacket_t pkt,
uint8_t  ip_dscp 
)

Set a new value for the IP DSCP header field.

Warning
ip_dscp must be specially aligned
void platform_packet_set_ip_ecn ( datapacket_t pkt,
uint8_t  ip_ecn 
)

Set a new value for the IP ECN header field.

void platform_packet_set_ip_proto ( datapacket_t pkt,
uint8_t  ip_proto 
)

Set a new value for the IP PROTO header field.

void platform_packet_set_ipv4_dst ( datapacket_t pkt,
uint32_t  ip_dst 
)

Set a new value for the IPv4 dst address.

Warning
ip_dst must be in normal NBO endianness
void platform_packet_set_ipv4_src ( datapacket_t pkt,
uint32_t  ip_src 
)

Set a new value for the IPv4 src address.

Warning
ip_src must be in normal NBO endianness
void platform_packet_set_ipv6_dst ( datapacket_t pkt,
uint128__t  ipv6_dst 
)

Set a new value for the IPv6 dst address.

Warning
ipv6_dst must be in normal NBO endianness
void platform_packet_set_ipv6_exthdr ( datapacket_t pkt,
uint16_t  ipv6_exthdr 
)

Set a new value for the IPv6 exthdr.

Warning
ipv6_exthdr must be in alligned NBO endianness
void platform_packet_set_ipv6_flabel ( datapacket_t pkt,
uint64_t  ipv6_flabel 
)

Set a new value for the IPv6 label.

Warning
ipv6_flabel must be in aligned NBO endianness
void platform_packet_set_ipv6_nd_sll ( datapacket_t pkt,
uint64_t  ipv6_nd_sll 
)

Set a new value for the IPv6 nd sll.

Warning
ipv6_nd_sll must be in aligned NBO endianness
void platform_packet_set_ipv6_nd_target ( datapacket_t pkt,
uint128__t  ipv6_nd_target 
)

Set a new value for the IPv6 nd target.

Warning
ipv6_nd_target must be in normal NBO endianness
void platform_packet_set_ipv6_nd_tll ( datapacket_t pkt,
uint64_t  ipv6_nd_tll 
)

Set a new value for the IPv6 nd tll.

Warning
ipv6_nd_tll must be in aligned NBO endianness
void platform_packet_set_ipv6_src ( datapacket_t pkt,
uint128__t  ipv6_src 
)

Set a new value for the IPv6 src address.

Warning
ipv6_src must be in normal NBO endianness
void platform_packet_set_mpls_bos ( datapacket_t pkt,
bool  bos 
)

Set a new MPLS BoS value to the outer-most MPLS tag of the packet.

void platform_packet_set_mpls_label ( datapacket_t pkt,
uint32_t  label 
)

Set a new label to the outer-most MPLS tag of the packet.

Warning
label must be in aligned NBO endianness
void platform_packet_set_mpls_tc ( datapacket_t pkt,
uint8_t  tc 
)

Set a new TC value to the outer-most MPLS MPLS tag of the packet.

Warning
tc must be specially aligned
void platform_packet_set_mpls_ttl ( datapacket_t pkt,
uint8_t  new_ttl 
)

Set a new TTL value to the outer-most MPLS tag of the packet.

void platform_packet_set_nw_ttl ( datapacket_t pkt,
uint8_t  new_ttl 
)

Set new ttl value.

void platform_packet_set_pbb_isid ( datapacket_t pkt,
uint32_t  pbb_isid 
)

Set a new value for the PBB I-SID of the packet.

Warning
pbb_isid must be in specially aligned NBO endianness
void platform_packet_set_queue ( datapacket_t pkt,
uint32_t  queue 
)

Set output queue of the packet.

Warning
queue must be in HBO endianness
void platform_packet_set_sctp_dst ( datapacket_t pkt,
uint16_t  sctp_dst 
)

Set a new value for the SCTP dst port.

Warning
sctp_dst must be in normal NBO endianness
void platform_packet_set_sctp_src ( datapacket_t pkt,
uint16_t  sctp_src 
)

Set a new value for the SCTP src port.

Warning
sctp_src must be in normal NBO endianness
void platform_packet_set_tcp_dst ( datapacket_t pkt,
uint16_t  tcp_dst 
)

Set a new value for the TCP dst port.

Warning
tcp_dst must be in normal NBO endianness
void platform_packet_set_tcp_src ( datapacket_t pkt,
uint16_t  tcp_src 
)

Set a new value for the TCP src port.

Warning
tcp_src must be in normal NBO endianness
void platform_packet_set_tunnel_id ( datapacket_t pkt,
uint64_t  tunnel_id 
)

Set Tunnel ID.

Warning
tunnel_id must be in HBO endianness
void platform_packet_set_udp_dst ( datapacket_t pkt,
uint16_t  udp_dst 
)

Set a new value for the UDP dst port.

Warning
udp_dst must be in normal NBO endianness
void platform_packet_set_udp_src ( datapacket_t pkt,
uint16_t  udp_src 
)

Set a new value for the UDP src port.

Warning
udp_src must be in normal NBO endianness
void platform_packet_set_vlan_pcp ( datapacket_t pkt,
uint8_t  vlan_pcp 
)

Set a new VLAN PCP value to the outer-most VLAN of the packet.

Warning
vlan_pcp must be specially aligned
void platform_packet_set_vlan_vid ( datapacket_t pkt,
uint16_t  vlan_vid 
)

Set a new VLAN VID value to the outer-most VLAN of the packet.

Warning
vlan_vid must be in normal NBO endianness