/* <:copyright-BRCM:2007:DUAL/GPL:standard Copyright (c) 2007 Broadcom All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation (the "GPL"). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. :> */ #ifndef __RDPA_DRV__H_INCLUDED__ #define __RDPA_DRV__H_INCLUDED__ #include #include "bcmtypes.h" #include "rdpa_types.h" #include "rdpa_filter.h" #define RDPA_DRV_VERSION "0.2" #define RDPA_DRV_VER_STR "v" RDPA_DRV_VERSION #define RDPA_DRV_MODNAME "Broadcom Runner Packet Processor" #define RDPA_DRV_NAME "bcmrdpa" /* RDPA_DRV Character Device */ #define RDPADRV_MAJOR 3037 #define RDPADRV_NAME RDPA_DRV_NAME #define RDPADRV_DEVICE_NAME "/dev/" RDPADRV_NAME /* RDPA Control Utility Executable */ #define RDPA_CTL_UTILITY_PATH "/bin/rdpactl" /* RDPA Proc FS Directory Path */ #define RDPA_PROC_FS_DIR_PATH RDPA_NAME #define RDPA_IFNAME_SIZE 36 /* Port TM scheduling capability */ #define RDPA_TM_SP_CAPABLE 0x1 #define RDPA_TM_WRR_CAPABLE 0x2 #define RDPA_TM_WDRR_CAPABLE 0x4 #define RDPA_TM_WFQ_CAPABLE 0x8 #define RDPA_TM_SP_WRR_CAPABLE 0x10 /* Support rate limit + mixed (SP + WRR) with one egress TM level. */ #define RDPA_TM_1LEVEL_CAPABLE 0x20 typedef enum { RDPA_DRV_SUCCESS = 0, RDPA_DRV_ERROR = 1, RDPA_DRV_NO_ROOT = 2, RDPA_DRV_PORT_NOT_ALLOC = 3, RDPA_DRV_PORT_ID_NOT_VALID = 4, RDPA_DRV_NO_MORE_TMS = 5, RDPA_DRV_TM_NOT_ALLOC = 6, RDPA_DRV_NEW_TM_ALLOC = 7, RDPA_DRV_TM_GET = 8, RDPA_DRV_TM_CFG_GET = 9, RDPA_DRV_TM_CFG_SET = 10, RDPA_DRV_TM_INDEX_GET = 11, RDPA_DRV_PORT_GET = 12, RDPA_DRV_Q_CFG_GET = 13, RDPA_DRV_Q_CFG_SET = 14, RDPA_DRV_Q_RATE_SET = 15, RDPA_DRV_GET_ROOT_BY_IF = 16, RDPA_DRV_SUBS_SET = 17, RDPA_DRV_MODE_GET = 18, RDPA_DRV_SH_DESTROY = 19, RDPA_DRV_IC_ERROR = 20, RDPA_DRV_IC_NOT_FOUND = 21, RDPA_DRV_IC_FLOW_ERROR = 22, RDPA_DRV_ORL_LINK = 23, RDPA_DRV_ORL_UNLINK = 24, RDPA_DRV_BR_GET = 25, RDPA_DRV_BR_LOCAL_SWITCH_SET = 26, RDPA_DRV_LLID_GET = 27, RDPA_DRV_LLID_TM_SET = 28, RDPA_DRV_LLID_TM_GET = 29, RDPA_DRV_LLID_CTRL_TM_SET = 30, RDPA_DRV_LLID_TM_ID_GET = 31, RDPA_DRV_LLID_CTRL_EN_SET = 32, RDPA_DRV_NEW_LLID_ALLOC = 33, RDPA_DRV_QUEUE_STATS_GET = 34, RDPA_DRV_TCONT_GET = 35, RDPA_DRV_TCONT_TM_SET = 36, RDPA_DRV_TCONT_TM_GET = 37, RDPA_DRV_TCONT_TM_ID_GET = 38, RDPA_DRV_Q_ID_NOT_VALID = 39, RDPA_DRV_DSCP_TO_PBIT_GET = 40, RDPA_DRV_D_TO_P_QOS_MAP_GET = 41, RDPA_DRV_D_TO_P_QOS_MAP_SET = 42, RDPA_DRV_D_TO_P_NO_CFG_BEFORE = 43, RDPA_DRV_NEW_D_TO_P_ALLOC = 44, RDPA_DRV_NEW_D_TO_P_INDEX_GET = 45, RDPA_DRV_PBIT_TO_Q_GET = 46, RDPA_DRV_P_TO_Q_QOS_MAP_GET = 47, RDPA_DRV_P_TO_Q_QOS_MAP_SET = 48, RDPA_DRV_NEW_P_TO_Q_ALLOC = 49, RDPA_DRV_PKT_BASED_QOS_GET = 50, RDPA_DRV_PKT_BASED_QOS_SET = 51, RDPA_DRV_Q_OCCUPANCY_GET = 52 } rdpaDrvReturn_code_t; /* *------------------------------------------------------------------------------ * Common defines for RDPA layers. *------------------------------------------------------------------------------ */ #undef RDPA_DECL #define RDPA_DECL(x) _IO(RDPADRV_MAJOR,x) typedef enum { RDPA_IOC_TM = RDPA_DECL(0), RDPA_IOC_IPTV = RDPA_DECL(1), RDPA_IOC_IC = RDPA_DECL(2), RDPA_IOC_SYS = RDPA_DECL(3), RDPA_IOC_PORT = RDPA_DECL(4), RDPA_IOC_BRIDGE = RDPA_DECL(5), RDPA_IOC_LLID = RDPA_DECL(6), RDPA_IOC_DS_WAN_UDP_FILTER = RDPA_DECL(7), RDPA_IOC_RDPA_MW_SET_MCAST_DSCP_REMARK = RDPA_DECL(8), RDPA_IOC_RDPA_MW = RDPA_DECL(9), RDPA_IOC_TIME_SYNC = RDPA_DECL(10), RDPA_IOC_FILTERS = RDPA_DECL(11), RDPA_IOC_DSCP_TO_PBIT = RDPA_DECL(12), RDPA_IOC_PBIT_TO_Q = RDPA_DECL(13), RDPA_IOC_MISC = RDPA_DECL(14), RDPA_IOC_MAX = RDPA_DECL(15), } rdpa_drv_ioctl_t; #define RDPACTL_MCAST_REMARK_DISABLE -1 typedef enum { RDPA_IOCTL_DEV_PORT, RDPA_IOCTL_DEV_LLID, RDPA_IOCTL_DEV_TCONT, RDPA_IOCTL_DEV_XTM, RDPA_IOCTL_DEV_NONE, //standalone tm, for service q feature RDPA_IOCTL_DEV_TYPE_MAX } rdpa_drv_ioctl_dev_type; /** IP address family */ typedef enum { rdpactl_ip_family_ipv4, rdpactl_ip_family_ipv6 } rdpactl_ip_family; /** IPv4 address */ typedef uint32_t rdpactl_ipv4; /** IPv6 address */ typedef struct { uint8_t data[16]; } rdpactl_ipv6_t; /** IPv4 or IPv6 address */ typedef struct { rdpactl_ip_family family; /**< Address family: IPv4 / IPv6 */ union { rdpactl_ipv4 ipv4; /**< IPv4 address */ rdpactl_ipv6_t ipv6; /**< IPv6 address */ } addr; } rdpactl_ip_t; typedef enum { RDPA_IOCTL_TM_CMD_GET_ROOT_TM = 0, RDPA_IOCTL_TM_GET_BY_QID = 1, RDPA_IOCTL_TM_CMD_ROOT_TM_CONFIG = 2, RDPA_IOCTL_TM_CMD_TM_CONFIG = 3, RDPA_IOCTL_TM_CMD_ROOT_TM_REMOVE = 4, RDPA_IOCTL_TM_CMD_TM_REMOVE = 5, RDPA_IOCTL_TM_CMD_QUEUE_CONFIG = 6, RDPA_IOCTL_TM_CMD_QUEUE_REMOVE = 7, RDPA_IOCTL_TM_CMD_GET_ROOT_SP_TM = 8, RDPA_IOCTL_TM_CMD_GET_ROOT_WRR_TM = 9, RDPA_IOCTL_TM_CMD_GET_PORT_ORL = 10, RDPA_IOCTL_TM_CMD_ORL_CONFIG = 11, RDPA_IOCTL_TM_CMD_ORL_REMOVE = 12, RDPA_IOCTL_TM_CMD_ORL_LINK = 13, RDPA_IOCTL_TM_CMD_ORL_UNLINK = 14, RDPA_IOCTL_TM_CMD_TM_RL_CONFIG = 15, RDPA_IOCTL_TM_CMD_GET_QUEUE_CONFIG = 16, RDPA_IOCTL_TM_CMD_GET_TM_CAPS = 17, RDPA_IOCTL_TM_CMD_QUEUE_ALLOCATE = 18, RDPA_IOCTL_TM_CMD_QUEUE_DISLOCATE = 19, RDPA_IOCTL_TM_CMD_GET_QUEUE_STATS = 20, RDPA_IOCTL_TM_CMD_GET_TM_CONFIG = 21, RDPA_IOCTL_TM_CMD_SET_Q_DROP_ALG = 22, RDPA_IOCTL_TM_CMD_SET_Q_SIZE = 23, RDPA_IOCTL_TM_CMD_MAX } rdpa_drv_ioctl_tm_cmd_t; typedef struct { rdpa_drv_ioctl_tm_cmd_t cmd; rdpa_drv_ioctl_dev_type dev_type; uint32_t dev_id; uint32_t root_tm_id; uint32_t tm_id; uint32_t dir; uint32_t q_id; uint32_t index; uint32_t level; /* Next TM level */ uint32_t arbiter_mode; uint32_t rl_mode; uint32_t priority; uint32_t qsize; uint32_t min_rate; uint32_t shaping_rate; uint32_t burst; uint32_t weight; uint32_t port_sched_caps; /* port tm setting */ uint32_t max_queues; /* port tm setting */ uint32_t max_sp_queues; /* port tm setting */ uint32_t drop_alg; uint32_t red_min_thr_lo; uint32_t red_max_thr_lo; uint32_t red_drop_percent_lo; uint32_t red_min_thr_hi; uint32_t red_max_thr_hi; uint32_t red_drop_percent_hi; uint32_t priority_mask_0; uint32_t priority_mask_1; uint32_t cfg_flags; BOOL port_shaper; /* port tm setting */ BOOL queue_shaper; /* port tm setting */ BOOL orl_linked; BOOL found; BOOL service_queue; BOOL q_clean; rdpa_stat_1way_t qstats; } rdpa_drv_ioctl_tm_t; typedef enum { RDPA_IOCTL_IPTV_CMD_LOOKUP_METHOD_SET, RDPA_IOCTL_IPTV_CMD_LOOKUP_METHOD_GET, RDPA_IOCTL_IPTV_CMD_ENTRY_ADD, RDPA_IOCTL_IPTV_CMD_ENTRY_REMOVE, RDPA_IOCTL_IPTV_CMD_ENTRY_FLUSH, RDPA_IOCTL_IPTV_CMD_PREFIX_FILTER_SET, RDPA_IOCTL_IPTV_CMD_PREFIX_FILTER_GET, RDPA_IOCTL_IPTV_CMD_MAX } rdpa_drv_ioctl_iptv_cmd_t; typedef enum { RDPA_IOCTL_IPTV_METHOD_MAC, RDPA_IOCTL_IPTV_METHOD_MAC_VID, RDPA_IOCTL_IPTV_METHOD_GROUP_IP, RDPA_IOCTL_IPTV_METHOD_GROUP_IP_SOURCE_IP, RDPA_IOCTL_IPTV_METHOD_GROUP_IP_SOURCE_IP_VID, RDPA_IOCTL_IPTV_METHOD_MAX } rdpa_drv_ioctl_iptv_lookup_method_t; typedef enum { RDPA_IOCTL_IPTV_FILTER_NONE, RDPA_IOCTL_IPTV_FILTER_MAC, RDPA_IOCTL_IPTV_FILTER_IP, RDPA_IOCTL_IPTV_FILTER_MAX } rdpa_drv_ioctl_iptv_filter_method_t; typedef enum { RDPA_IOCTL_IPTV_VLAN_UNTAG, RDPA_IOCTL_IPTV_VLAN_TRANPARENT, RDPA_IOCTL_IPTV_VLAN_TRANSLATION, RDPA_IOCTL_IPTV_VLAN_MAX } rdpa_drv_ioctl_iptv_vlan_action_t; typedef enum { RDPA_IOCTL_IPTV_PORT_LAN0, RDPA_IOCTL_IPTV_PORT_LAN1, RDPA_IOCTL_IPTV_PORT_LAN2, RDPA_IOCTL_IPTV_PORT_LAN3, RDPA_IOCTL_IPTV_PORT_LAN4, RDPA_IOCTL_IPTV_PORT_LAN5, RDPA_IOCTL_IPTV_PORT_LAN6, RDPA_IOCTL_IPTV_PORT_LAN7, RDPA_IOCTL_IPTV_PORT_MAX } rdpa_drv_ioctl_iptv_egress_port_t; typedef enum { RDPACTL_IP_FAMILY_IPV4, RDPACTL_IP_FAMILY_IPV6 } rdpactl_ip_family_t; typedef enum { RDPA_L3_PROTOCOL_OTHER = 0, /**< IC L3 Protocol field = Other */ RDPA_L3_PROTOCOL_IPV4 = 1, /**< IC L3 Protocol field = IPv4 */ RDPA_L3_PROTOCOL_IPV6 = 2 /**< IC L3 Protocol field = IPv6 */ } rdpa_l3_protocol_t; typedef struct { rdpactl_ip_family_t ip_family; union { uint8_t mac[6]; uint32_t ipv4; uint8_t ipv6[16]; } group; /**< multicast group */ union { uint32_t ipv4; uint8_t ipv6[16]; } src_ip; /**< multicast ssm ip address */ uint16_t vid; } rdpa_drv_ioctl_iptv_key_t; typedef struct { rdpa_drv_ioctl_iptv_vlan_action_t action; uint16_t vid; } rdpa_drv_ioctl_iptv_vlan_entry_t; typedef struct { rdpa_drv_ioctl_iptv_key_t key; rdpa_drv_ioctl_iptv_vlan_entry_t vlan; } rdpa_drv_ioctl_iptv_entry_t; typedef struct { rdpa_drv_ioctl_iptv_cmd_t cmd; rdpa_drv_ioctl_iptv_lookup_method_t method; rdpa_drv_ioctl_iptv_filter_method_t filter_method; rdpa_drv_ioctl_iptv_egress_port_t egress_port; rdpa_drv_ioctl_iptv_entry_t entry; uint16_t index; } rdpa_drv_ioctl_iptv_t; /* Actions of the optional actions vector */ typedef enum{ /*4 bytes fields*/ RDPACTL_IC_SRC_IP = 0, RDPACTL_IC_DST_IP = 1, RDPACTL_IC_IPV6_FLOW_LABEL = 2, /*2 bytes fields*/ RDPACTL_IC_OUTER_TPID = 3, RDPACTL_IC_INNER_TPID = 4, RDPACTL_IC_SRC_PORT = 5, RDPACTL_IC_DST_PORT = 6, RDPACTL_IC_OUTER_VID = 7, RDPACTL_IC_INNER_VID = 8, RDPACTL_IC_DST_MAC = 9, RDPACTL_IC_SRC_MAC = 10, RDPACTL_IC_ETHER_TYPE = 11, /*1 byte fields*/ RDPACTL_IC_IP_PROTOCOL = 12, RDPACTL_IC_DSCP = 13, RDPACTL_IC_SSID = 14, RDPACTL_IC_INGRESS_PORT = 15, RDPACTL_IC_OUTER_PBIT = 16, RDPACTL_IC_INNER_PBIT = 17, RDPACTL_IC_NUM_OF_VLANS = 18, RDPACTL_IC_L3_PROTOCOL = 19, RDPACTL_IC_GENERIC_1 = 20, RDPACTL_IC_GENERIC_2 = 21, RDPACTL_IC_INGRESS_WANFLOW = 22 } rdpactl_ic_value ; /** Classification rule mask fields bitmask */ typedef enum { RDPACTL_IC_MASK_SRC_IP = ( 1 << RDPACTL_IC_SRC_IP ), /**< Source IP address */ RDPACTL_IC_MASK_DST_IP = ( 1 << RDPACTL_IC_DST_IP ), /**< Destination IP address */ RDPACTL_IC_MASK_IPV6_FLOW_LABEL = ( 1 << RDPACTL_IC_IPV6_FLOW_LABEL ), /**< IPv6 Flow Label field */ RDPACTL_IC_MASK_OUTER_TPID = ( 1 << RDPACTL_IC_OUTER_TPID ), /**< Outer TPID */ RDPACTL_IC_MASK_INNER_TPID = ( 1 << RDPACTL_IC_INNER_TPID ), /**< Inner TPID */ RDPACTL_IC_MASK_SRC_PORT = ( 1 << RDPACTL_IC_SRC_PORT ), /**< Source port */ RDPACTL_IC_MASK_DST_PORT = ( 1 << RDPACTL_IC_DST_PORT ), /**< Destination port */ RDPACTL_IC_MASK_OUTER_VID = ( 1 << RDPACTL_IC_OUTER_VID ), /**< Outer VID */ RDPACTL_IC_MASK_INNER_VID = ( 1 << RDPACTL_IC_INNER_VID ), /**< Inner VID */ RDPACTL_IC_MASK_DST_MAC = ( 1 << RDPACTL_IC_DST_MAC ), /**< Destination MAC address */ RDPACTL_IC_MASK_SRC_MAC = ( 1 << RDPACTL_IC_SRC_MAC ), /**< Source MAC address */ RDPACTL_IC_MASK_ETHER_TYPE = ( 1 << RDPACTL_IC_ETHER_TYPE ), /**< Ether Type */ RDPACTL_IC_MASK_IP_PROTOCOL = ( 1 << RDPACTL_IC_IP_PROTOCOL ), /**< Protocol */ RDPACTL_IC_MASK_DSCP = ( 1 << RDPACTL_IC_DSCP ), /**< IP Differentiated Services Code Point */ RDPACTL_IC_MASK_SSID = ( 1 << RDPACTL_IC_SSID ), /**< Ingress SSID */ RDPACTL_IC_MASK_INGRESS_PORT = ( 1 << RDPACTL_IC_INGRESS_PORT ), RDPACTL_IC_MASK_OUTER_PBIT = ( 1 << RDPACTL_IC_OUTER_PBIT ), /**< Outer PBIT */ RDPACTL_IC_MASK_INNER_PBIT = ( 1 << RDPACTL_IC_INNER_PBIT ), /**< Inner PBIT */ RDPACTL_IC_MASK_NUM_OF_VLANS = ( 1 << RDPACTL_IC_NUM_OF_VLANS ), /**< Number of VLAN in packet */ RDPACTL_IC_MASK_L3_PROTOCOL = ( 1 << RDPACTL_IC_L3_PROTOCOL ), /**< L3 Protocol (Other-0, IPv4-1, IPv6-2) */ RDPACTL_IC_MASK_GENERIC_1 = ( 1 << RDPACTL_IC_GENERIC_1 ), /**< Generic key 0 (type L2/L3/L4, offset, mask */ RDPACTL_IC_MASK_GENERIC_2 = ( 1 << RDPACTL_IC_GENERIC_2 ), /**< Generic key 1 (type L2/L3/L4, offset, mask */ RDPACTL_IC_MASK_INGRESS_WANFLOW = ( 1 << RDPACTL_IC_INGRESS_WANFLOW), /**< Gem port index or llid index */ } rdpactl_ic_fields; typedef enum { RDPACTL_IF_LAN0 = 2, /**< LAN0 port */ RDPACTL_IF_LAN1, /**< LAN1 port */ RDPACTL_IF_LAN2, /**< LAN2 port */ RDPACTL_IF_LAN3, /**< LAN3 port */ RDPACTL_IF_LAN4, /**< LAN4 port */ RDPACTL_IF_LAN5, /**< LAN5 port */ RDPACTL_IF_LAN6, /**< LAN6 port */ RDPACTL_IF_LAN7, /**< LAN7 port */ RDPACTL_IF_MAX, } rdpactl_ingress_port; typedef enum { RDPACTL_IC_TYPE_ACL = 1, /**< Classification type ACL */ RDPACTL_IC_TYPE_FLOW = 2, /**< Classification type Flow */ RDPACTL_IC_TYPE_QOS = 3, /**< Classification type QoS */ } rdpactl_ic_type; /** Forwarding mode */ typedef enum { rdpactl_forwarding_mode_pkt, /**< Packet-based forwarding */ rdpactl_forwarding_mode_flow, /**< Flow-based forwarding */ } rdpactl_forwarding_mode; typedef enum { /** Transparent action */ RDPACTL_VLAN_CMD_TRANSPARENT = 0, /** Add VLAN tag */ RDPACTL_VLAN_CMD_PUSH = 0x00000001, /** Add VLAN tag always (even if packet is double-tagged) */ RDPACTL_VLAN_CMD_PUSH_ALWAYS = 0x00000002, /** Remove VLAN tag */ RDPACTL_VLAN_CMD_POP = 0x00000004, /** Replace VLAN tag */ RDPACTL_VLAN_CMD_REPLACE = 0x00000008, /** Add 2 VLAN tags */ RDPACTL_VLAN_CMD_PUSH2 = 0x00000010, /** Add 2 VLAN tag always (even if packet is double-tagged) */ RDPACTL_VLAN_CMD_PUSH2_ALWAYS = 0x00000020, /** Remove 2 VLAN tags */ RDPACTL_VLAN_CMD_POP2 = 0x00000040, /** Replace 2 VLAN tags */ RDPACTL_VLAN_CMD_REPLACE2 = 0x00000080, /** P-Bit re-marking in VLAN tag*/ RDPACTL_VLAN_CMD_REMARK = 0x00000100, /** Re-mapping according to P-bit in VLAN tag */ RDPACTL_VLAN_CMD_REMAP = 0x00000200, /** Remap DSCP -> P-bit in VLAN tag mapping */ RDPACTL_VLAN_CMD_DSCP = 0x00000400, /** Replace TPID in VLAN tag */ RDPACTL_VLAN_CMD_TPID = 0x00000800, } rdpactl_vlan_command; /** Max number of tags supported by vlan_action */ #define RDPACTL_VLAN_MAX_TAGS 2 /** Outer tag index */ #define RDPACTL_VLAN_TAG_OUT 0 /** Inner tag index */ #define RDPACTL_VLAN_TAG_IN 1 /** VLAN tag + pbit */ typedef struct { uint16_t vid; /**< VID */ uint8_t pbit; /**< PBIT */ uint16_t tpid; /**< TPID */ } rdpactl_vtag_cmd_parm_t; /** VLAN action parameters */ typedef struct { uint32_t cmd; /**< Action command - combination of ::rdpa_vlan_command bits */ rdpactl_vtag_cmd_parm_t parm[RDPACTL_VLAN_MAX_TAGS]; /**< Command parameters */ } rdpactl_vtag_action_t; /** Traffic direction */ typedef enum { rdpactl_dir_ds, /**< Downstream */ rdpactl_dir_us /**< Upstream */ } rdpactl_traffic_dir; /** Generic field configuration */ typedef struct { rdpa_offset_t type; /**< Packet offset type ::rdpa_offset_t */ uint32_t offset; /**< Packet offset, must be 2-bytes aligned */ uint32_t mask; /**< 4-byte key binary mask */ } rdpactl_ic_gen_rule_cfg_t; #define RDPACTL_QUEUEID_BITS_NUMBER 16 #define RDPACTL_WANFLOW_MASK ((~0) << RDPACTL_QUEUEID_BITS_NUMBER) #define RDPACTL_SERVICEACT_Q_MASK (0x10000UL) #define RDPACTL_SERVICEQUEUE_MASK (0xFFFFUL) typedef struct { rdpactl_ic_type type; rdpactl_traffic_dir dir; //Classification Mask & rule priority uint8_t prty; /**< Defined the priority of classifier. value between 0 - 256, 0 is highest priority */ uint32_t field_mask; /**< Fields used for classification. A combination of rdpactl_ic_fields */ uint16_t port_mask; rdpactl_ic_gen_rule_cfg_t gen_rule_cfg1; rdpactl_ic_gen_rule_cfg_t gen_rule_cfg2; //Classification key rdpactl_ip_family_t ip_family; union { uint32_t ipv4; uint8_t ipv6[16]; } src_ip; /**< source ipv4/ipv6 ip */ union { uint32_t ipv4; uint8_t ipv6[16]; } dst_ip; /**< dest ipv4/ipv6 ip */ uint16_t src_port; /**< source port */ uint16_t dst_port; /**< destination port */ uint8_t protocol; /**< IP protocols. For example, UDP(17) */ uint16_t outer_vid; /**< Outer VID */ uint16_t inner_vid; /**< Inner VID */ uint8_t dst_mac[6]; /**