5 #ifndef __PACKET_MATCHES_H__
6 #define __PACKET_MATCHES_H__
11 #include "ternary_fields.h"
12 #include "../openflow/openflow1x/pipeline/of1x_utils.h"
34 uint32_t __pkt_size_bytes;
38 uint32_t __phy_port_in;
54 uint16_t __arp_opcode;
83 uint8_t __icmpv4_type;
84 uint8_t __icmpv4_code;
87 uint32_t __mpls_label;
95 uint64_t __ipv6_flabel;
97 uint64_t __ipv6_nd_sll;
98 uint64_t __ipv6_nd_tll;
99 uint16_t __ipv6_exthdr;
102 uint8_t __icmpv6_code;
103 uint8_t __icmpv6_type;
109 uint64_t __tunnel_id;
116 uint8_t __pppoe_code;
117 uint8_t __pppoe_type;
118 uint16_t __pppoe_sid;
121 uint16_t __ppp_proto;
124 uint8_t __gtp_msg_type;
128 uint8_t __capwap_wbid;
129 uint8_t __capwap_rid;
130 uint16_t __capwap_flags;
135 uint8_t __wlan_subtype;
136 uint8_t __wlan_direction;
137 uint64_t __wlan_address_1;
138 uint64_t __wlan_address_2;
139 uint64_t __wlan_address_3;
142 uint16_t __gre_version;
143 uint16_t __gre_prot_type;
171 return pkt_matches->__pkt_size_bytes;
180 return pkt_matches->__port_in;
188 return pkt_matches->__phy_port_in;
199 return pkt_matches->__metadata;
209 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__eth_dst));
217 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__eth_src));
225 return NTOHB16(pkt_matches->__eth_type);
235 return pkt_matches->__has_vlan;
243 return NTOHB16(pkt_matches->__vlan_vid);
252 return OF1X_VLAN_PCP_VALUE(pkt_matches->__vlan_pcp);
262 return OF1X_MPLS_LABEL_VALUE(NTOHB32(pkt_matches->__mpls_label));
270 return OF1X_MPLS_TC_VALUE(pkt_matches->__mpls_tc);
278 return pkt_matches->__mpls_bos;
288 return NTOHB16(pkt_matches->__arp_opcode);
296 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__arp_tha));
304 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__arp_sha));
312 return NTOHB32(pkt_matches->__arp_tpa);
320 return NTOHB32(pkt_matches->__arp_spa);
331 return pkt_matches->__ip_proto;
339 return pkt_matches->__ip_ecn;
347 return OF1X_IP_DSCP_VALUE(pkt_matches->__ip_dscp);
357 return NTOHB32(pkt_matches->__ipv4_src);
365 return NTOHB32(pkt_matches->__ipv4_dst);
375 return NTOHB16(pkt_matches->__tcp_src);
383 return NTOHB16(pkt_matches->__tcp_dst);
393 return NTOHB16(pkt_matches->__udp_src);
401 return NTOHB16(pkt_matches->__udp_dst);
411 return NTOHB16(pkt_matches->__sctp_src);
419 return NTOHB16(pkt_matches->__sctp_dst);
429 return pkt_matches->__icmpv4_type;
437 return pkt_matches->__icmpv4_code;
467 return OF1X_IP6_FLABEL_VALUE(NTOHB64(pkt_matches->__ipv6_flabel));
475 uint128__t tmp = pkt_matches->__ipv6_nd_target;
485 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__ipv6_nd_sll));
493 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__ipv6_nd_tll));
501 return NTOHB16(pkt_matches->__ipv6_exthdr);
511 return pkt_matches->__icmpv6_type;
519 return pkt_matches->__icmpv6_code;
527 uint32_t packet_matches_get_pbb_isid_value(
packet_matches_t *
const pkt_matches){
528 return NTOHB32(pkt_matches->__pbb_isid);
537 return NTOHB64(pkt_matches->__tunnel_id);
548 return pkt_matches->__pppoe_code;
556 return pkt_matches->__pppoe_type;
564 return NTOHB16(pkt_matches->__pppoe_sid);
574 return NTOHB16(pkt_matches->__ppp_proto);
584 return pkt_matches->__gtp_msg_type;
592 return NTOHB32(pkt_matches->__gtp_teid);
602 return pkt_matches->__capwap_wbid;
610 return pkt_matches->__capwap_rid;
618 return NTOHB16(pkt_matches->__capwap_flags);
628 return NTOHB16(pkt_matches->__wlan_fc);
636 return pkt_matches->__wlan_type;
644 return pkt_matches->__wlan_subtype;
652 return pkt_matches->__wlan_direction;
660 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__wlan_address_1));
668 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__wlan_address_2));
676 return OF1X_MAC_VALUE(NTOHB64(pkt_matches->__wlan_address_3));
686 return NTOHB16(pkt_matches->__gre_version);
694 return NTOHB16(pkt_matches->__gre_prot_type);
702 return NTOHB32(pkt_matches->__gre_key);
708 #endif //PACKET_MATCHES
static bool packet_matches_get_mpls_bos_value(packet_matches_t *const pkt_matches)
Get the packet match MPLS_BOS value in HOST BYTE ORDER.
static uint8_t packet_matches_get_vlan_pcp_value(packet_matches_t *const pkt_matches)
Get the packet match VLAN_PCP value in HOST BYTE ORDER.
static uint16_t packet_matches_get_gre_version_value(packet_matches_t *const pkt_matches)
Get the packet match GRE_VERSION value in HOST BYTE ORDER.
static uint16_t packet_matches_get_ipv6_exthdr_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_EXTHDR value in HOST BYTE ORDER.
static uint8_t packet_matches_get_pppoe_type_value(packet_matches_t *const pkt_matches)
Get the packet match PPPOE_TYPE value in HOST BYTE ORDER.
static uint32_t packet_matches_get_port_in_value(packet_matches_t *const pkt_matches)
Get the packet match PORT_IN value in HOST BYTE ORDER.
static uint8_t packet_matches_get_capwap_wbid_value(packet_matches_t *const pkt_matches)
Get the packet match CAPWAP_WBID value in HOST BYTE ORDER.
static uint64_t packet_matches_get_ipv6_nd_sll_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_ND_SLL value in HOST BYTE ORDER.
static uint16_t packet_matches_get_sctp_dst_value(packet_matches_t *const pkt_matches)
Get the packet match SCTP_DST value in HOST BYTE ORDER.
static uint64_t packet_matches_get_arp_sha_value(packet_matches_t *const pkt_matches)
Get the packet match ARP_SHA value in HOST BYTE ORDER.
static uint8_t packet_matches_get_gtp_msg_type_value(packet_matches_t *const pkt_matches)
Get the packet match PPP_PROTO value in HOST BYTE ORDER.
static uint32_t packet_matches_get_phy_port_in_value(packet_matches_t *const pkt_matches)
Get the packet match PHY_PORT_IN value in HOST BYTE ORDER.
static uint16_t packet_matches_get_arp_opcode_value(packet_matches_t *const pkt_matches)
Get the packet match ARP_OPCODE value in HOST BYTE ORDER.
static uint64_t packet_matches_get_tunnel_id_value(packet_matches_t *const pkt_matches)
Get the packet match TUNNEL_ID value in HOST BYTE ORDER.
static uint16_t packet_matches_get_capwap_flags_value(packet_matches_t *const pkt_matches)
Get the packet match CAPWAP_FLAGS value in HOST BYTE ORDER.
static uint128__t packet_matches_get_ipv6_nd_target_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_ND_TARGET value in HOST BYTE ORDER.
static uint16_t packet_matches_get_gre_prot_type_value(packet_matches_t *const pkt_matches)
Get the packet match GRE_PROT_TYPE value in HOST BYTE ORDER.
static uint16_t packet_matches_get_tcp_src_value(packet_matches_t *const pkt_matches)
Get the packet match TCP_SRC value in HOST BYTE ORDER.
static uint64_t packet_matches_get_wlan_address_3_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_ADDRESS_3 value in HOST BYTE ORDER.
static uint8_t packet_matches_get_wlan_direction_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_DIRECTION value in HOST BYTE ORDER.
static uint32_t packet_matches_get_size_bytes(packet_matches_t *const pkt_matches)
Get the packet match PACKET_LENGTH value in HOST BYTE ORDER.
static uint32_t packet_matches_get_gre_key_value(packet_matches_t *const pkt_matches)
Get the packet match GRE_KEY value in HOST BYTE ORDER.
static uint128__t packet_matches_get_ipv6_src_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_SRC value in HOST BYTE ORDER.
static uint16_t packet_matches_get_tcp_dst_value(packet_matches_t *const pkt_matches)
Get the packet match TCP_DST value in HOST BYTE ORDER.
static uint16_t packet_matches_get_udp_dst_value(packet_matches_t *const pkt_matches)
Get the packet match UDP_DST value in HOST BYTE ORDER.
static uint32_t packet_matches_get_arp_tpa_value(packet_matches_t *const pkt_matches)
Get the packet match ARP_TPA value in HOST BYTE ORDER.
static uint16_t packet_matches_get_wlan_fc_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_FC value in HOST BYTE ORDER.
static uint8_t packet_matches_get_wlan_subtype_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_SUBTYPE value in HOST BYTE ORDER.
static uint8_t packet_matches_get_mpls_tc_value(packet_matches_t *const pkt_matches)
Get the packet match MPLS_TC value in HOST BYTE ORDER.
static uint8_t packet_matches_get_ip_proto_value(packet_matches_t *const pkt_matches)
Get the packet match IP_PROTO value in HOST BYTE ORDER.
static uint64_t packet_matches_get_ipv6_nd_tll_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_ND_TLL value in HOST BYTE ORDER.
static uint16_t packet_matches_get_eth_type_value(packet_matches_t *const pkt_matches)
Get the packet match ETH_TYPE value in HOST BYTE ORDER.
static uint8_t packet_matches_get_wlan_type_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_TYPE value in HOST BYTE ORDER.
static bool packet_matches_has_vlan(packet_matches_t *const pkt_matches)
Get flag has vlan.
static uint8_t packet_matches_get_icmpv6_type_value(packet_matches_t *const pkt_matches)
Get the packet match ICMPV6_TYPE value in HOST BYTE ORDER.
static uint16_t packet_matches_get_sctp_src_value(packet_matches_t *const pkt_matches)
Get the packet match SCTP_SRC value in HOST BYTE ORDER.
static uint64_t packet_matches_get_ipv6_flabel_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_FLABEL value in HOST BYTE ORDER.
static uint8_t packet_matches_get_icmpv6_code_value(packet_matches_t *const pkt_matches)
Get the packet match ICMPV6_CODE value in HOST BYTE ORDER.
static uint32_t packet_matches_get_gtp_teid_value(packet_matches_t *const pkt_matches)
Get the packet match PPP_PROTO value in HOST BYTE ORDER.
static uint32_t packet_matches_get_mpls_label_value(packet_matches_t *const pkt_matches)
Get the packet match MPLS_LABEL value in HOST BYTE ORDER.
static uint64_t packet_matches_get_arp_tha_value(packet_matches_t *const pkt_matches)
Get the packet match ARP_THA value in HOST BYTE ORDER.
static uint32_t packet_matches_get_ipv4_dst_value(packet_matches_t *const pkt_matches)
Get the packet match IP4_DST value in HOST BYTE ORDER.
static uint128__t packet_matches_get_ipv6_dst_value(packet_matches_t *const pkt_matches)
Get the packet match IP6_DST value in HOST BYTE ORDER.
static uint64_t packet_matches_get_wlan_address_1_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_ADDRESS_1 value in HOST BYTE ORDER.
void fill_packet_matches(struct datapacket *const pkt, packet_matches_t *pkt_matches)
Fill in packet_matches (for PKT_INs)
static uint16_t packet_matches_get_ppp_proto_value(packet_matches_t *const pkt_matches)
Get the packet match PPP_PROTO value in HOST BYTE ORDER.
static uint16_t packet_matches_get_udp_src_value(packet_matches_t *const pkt_matches)
Get the packet match UDP_SRC value in HOST BYTE ORDER.
static uint8_t packet_matches_get_icmpv4_type_value(packet_matches_t *const pkt_matches)
Get the packet match ICMPv4_TYPE value in HOST BYTE ORDER.
static uint32_t packet_matches_get_ipv4_src_value(packet_matches_t *const pkt_matches)
Get the packet match IP4_SRC value in HOST BYTE ORDER.
static uint64_t packet_matches_get_eth_src_value(packet_matches_t *const pkt_matches)
Get the packet match ETH_SRC value in HOST BYTE ORDER.
static uint32_t packet_matches_get_arp_spa_value(packet_matches_t *const pkt_matches)
Get the packet match ARP_SPA value in HOST BYTE ORDER.
static uint16_t packet_matches_get_vlan_vid_value(packet_matches_t *const pkt_matches)
Get the packet match VLAN_VID value in HOST BYTE ORDER according to 1.2 semantics (13th bit is a flag...
static uint8_t packet_matches_get_ip_ecn_value(packet_matches_t *const pkt_matches)
Get the packet match IPC_ECN value in HOST BYTE ORDER.
static uint64_t packet_matches_get_eth_dst_value(packet_matches_t *const pkt_matches)
Get the packet match ETH_DST value in HOST BYTE ORDER.
ROFL_BEGIN_DECLS void dump_packet_matches(struct datapacket *const pkt, bool raw_nbo)
Dump the values of packet (header values)
static uint8_t packet_matches_get_ip_dscp_value(packet_matches_t *const pkt_matches)
Get the packet match IP_DSCP value in HOST BYTE ORDER.
static uint8_t packet_matches_get_icmpv4_code_value(packet_matches_t *const pkt_matches)
Get the packet match ICMPv4_CODE value in HOST BYTE ORDER.
static uint16_t packet_matches_get_pppoe_sid_value(packet_matches_t *const pkt_matches)
Get the packet match PPPOE_SESSION value in HOST BYTE ORDER.
static uint64_t packet_matches_get_metadata_value(packet_matches_t *const pkt_matches)
Get the packet match METADATA value in HOST BYTE ORDER.
static uint64_t packet_matches_get_wlan_address_2_value(packet_matches_t *const pkt_matches)
Get the packet match WLAN_ADDRESS_2 value in HOST BYTE ORDER.
static uint8_t packet_matches_get_capwap_rid_value(packet_matches_t *const pkt_matches)
Get the packet match CAPWAP_RID value in HOST BYTE ORDER.
static uint8_t packet_matches_get_pppoe_code_value(packet_matches_t *const pkt_matches)
Get the packet match PPPOE_CODE value in HOST BYTE ORDER.