38 #ifndef INCLUDE_OFDPA_DATATYPES_H
39 #define INCLUDE_OFDPA_DATATYPES_H
43 #include <netinet/in.h>
82 OFDPA_FEATURE_INVALID = 0,
84 OFDPA_FEATURE_ACLIPV6MAC,
85 OFDPA_FEATURE_MPLSTHREELABELS,
86 OFDPA_FEATURE_MPLSSUPPORTED,
87 OFDPA_FEATURE_MPLSECMP,
89 OFDPA_FEATURE_SERVICE_METER,
91 OFDPA_DOT1AG_MPLS_TP_CCM_SUPPORT,
92 OFDPA_DOT1AG_LTR_SORT_FEATURE_ID,
104 #define OFDPA_MAC_ADDR_LEN 6
107 #define OFDPA_MAC_ADDR_IS_NULL(mac) \
108 ((mac[0] == 0) && (mac[1] == 0) && (mac[2] == 0) && \
109 (mac[3] == 0) && (mac[4] == 0) && (mac[5] == 0))
112 #define OFDPA_MAC_ADDR_IS_ALL_ONES(mac) \
113 ((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) && \
114 (mac[3] == 0xff) && (mac[4] == 0xff) && (mac[5] == 0xff))
117 #define OFDPA_IP_ADDR_LEN 4
120 #define OFDPA_PORT_CONTROLLER 0xfffffffdu
123 #define OFDPA_PORT_LOCAL 0xfffffffeu
126 #define OFDPA_VID_FIELD_MASK 0x0000
128 #define OFDPA_VID_EXACT_MASK 0x0fff
131 #define OFDPA_VID_NONE 0x0000
133 #define OFDPA_VID_PRESENT 0x1000
136 #define OFDPA_INPORT_EXACT_MASK 0xffffffffu
138 #define OFDPA_INPORT_FIELD_MASK 0x00000000u
140 #define OFDPA_INPORT_INDEX_MASK 0x0000ffffu
142 #define OFDPA_INPORT_TYPE_MASK 0xffff0000u
145 #define OFDPA_ETHERTYPE_EXACT_MASK 0xffffu
147 #define OFDPA_ETHERTYPE_ALL_MASK 0x0u
150 #define OFDPA_LMEP_ID_EXACT_MASK 0xffffffffu
153 #define OFDPA_IPV4_ADDR_EXACT_MASK 0xffffffffu
155 #define OFDPA_IPV4_ADDR_FIELD_MASK 0x00000000u
158 #define OFDPA_OAM_Y1731_OPCODE_EXACT_MASK 0xffu
159 #define OFDPA_OAM_Y1731_OPCODE_ALL_MASK 0x0u
162 #define OFDPA_OAM_Y1731_MDL_EXACT_MASK 0x7u
163 #define OFDPA_OAM_Y1731_MDL_ALL_MASK 0x0u
166 #define OFDPA_ZERO_MASK 0x0u
168 #define OFDPA_VLAN_DEI_VALUE_MASK 0x1u
170 #define OFDPA_VLAN_DEI_MAX_VALUE (OFDPA_VLAN_DEI_VALUE_MASK)
172 #define OFDPA_VRF_VALUE_MASK 0xffffu
174 #define OFDPA_ECN_VALUE_MASK 0x3u
176 #define OFDPA_ECN_MAX_VALUE (OFDPA_ECN_VALUE_MASK)
178 #define OFDPA_DSCP_VALUE_MASK 0x3fu
180 #define OFDPA_DSCP_MAX_VALUE (OFDPA_DSCP_VALUE_MASK)
182 #define OFDPA_VLAN_PCP_MAX_VALUE 7
184 #define OFDPA_MPLS_TC_MAX_VALUE 7
186 #define OFDPA_MDL_MAX_VALUE 7
188 #define OFDPA_TRAFFIC_CLASS_MAX_VALUE 15
190 #define OFDPA_L2_POLICER_METERID_MIN_VALUE 0xffff
192 #define OFDPA_MPLS_NEXT_LABEL_GAL_EXACT_MASK 0xffu
193 #define OFDPA_MPLS_NEXT_LABEL_GAL_ALL_MASK 0x0u
194 #define OFDPA_MPLS_LABEL_GAL 13
195 #define OFDPA_MPLS_DATA_FIRST_NIBBLE_EXACT_MASK 0xffu
196 #define OFDPA_MPLS_DATA_FIRST_NIBBLE_ALL_MASK 0x0u
197 #define OFDPA_MPLS_DATA_FIRST_NIBBLE_IPV4 4
198 #define OFDPA_MPLS_DATA_FIRST_NIBBLE_IPV6 6
199 #define OFDPA_MPLS_CHANNEL_TYPE_EXACT_MASK 0xffff
200 #define OFDPA_MPLS_CHANNEL_TYPE_ALL_MASK 0x0
201 #define OFDPA_MPLS_ACH_CHANNEL_TYPE 0x8902
202 #define OFDPA_MPLS_TTL_EXACT_MASK 0xffu
208 ODFPA_PROTECTION_PATH = 0,
209 ODFPA_WORKING_PATH = 1,
224 OFDPA_MPLS_L2_PORT_TYPE_VPWS_LOCAL = 0x0,
225 OFDPA_MPLS_L2_PORT_TYPE_VPLS_LOCAL = 0x1,
226 OFDPA_MPLS_L2_PORT_TYPE_VPWS_NW = 0x2,
227 OFDPA_MPLS_L2_PORT_TYPE_VPLS_NW = 0x3,
228 } OFDPA_MPLS_L2_PORT_TYPE_t;
231 #define OFDPA_MPLS_L2_PORT_EXACT_MASK 0xffffffffu
233 #define OFDPA_MPLS_L2_PORT_FIELD_MASK 0x00000000u
235 #define OFDPA_MPLS_L2_PORT_INDEX_MASK 0x0000ffffu
237 #define OFDPA_MPLS_L2_PORT_TYPE_MASK 0xffff0000u
242 OFDPA_QOS_YELLOW = 1,
244 OFDPA_QOS_RESERVED = 3
245 } OFDPA_QOS_COLORS_t;
330 #define OFDPA_TUNNEL_ID_EXACT_MASK 0xffffffffu
332 #define OFDPA_TUNNEL_ID_FIELD_MASK 0x00000000u
334 #define OFDPA_TUNNEL_ID_INDEX_MASK 0x0000ffffu
336 #define OFDPA_TUNNEL_ID_TYPE_MASK 0xffff0000u
349 OFDPA_ACTION_TABLE_TYPE_MPLS_SET_QOS = 1,
350 OFDPA_ACTION_TABLE_TYPE_OAM_DATAPLANE_COUNTER = 2,
351 OFDPA_ACTION_TABLE_TYPE_DROP_STATUS = 3,
352 OFDPA_ACTION_TABLE_TYPE_MPLS_VPN_LABEL_REMARK = 4,
353 OFDPA_ACTION_TABLE_TYPE_MPLS_TUNNEL_LABEL_REMARK = 5,
415 #define OFDPA_FLOW_TABLE_ID_SA_LOOKUP 254
427 uint32_t tunnelIdMask;
433 uint16_t etherTypeMask;
465 uint8_t qosIndexAction;
495 uint32_t pushMplsGalHdr;
496 uint32_t mplsGalTTLAction;
498 uint32_t mplsGalTCAction;
501 uint32_t pushMplsLabelHdr;
504 uint32_t mplsTCAction;
506 uint32_t mplsTTLAction;
509 uint32_t mplsDataFirstNibbleAction;
510 uint32_t mplsDataFirstNibble;
511 uint32_t mplsAchChannelAction;
512 uint32_t mplsAchChannel;
515 uint32_t mplsVlanPcpAction;
516 uint32_t mplsVlanPcp;
533 uint32_t mplsL2PortMask;
547 OFDPA_QOS_COLORS_t color;
561 uint32_t mplsL2PortMask;
575 OFDPA_QOS_COLORS_t color;
712 uint16_t etherTypeMask;
716 uint8_t oamY1731MdlMask;
718 uint8_t oamY1731Opcode;
719 uint8_t oamY1731OpcodeMask;
771 uint32_t mplsL2PortMask;
774 uint16_t etherTypeMask;
882 uint8_t mplsDataFirstNibbleMask;
888 uint16_t mplsAchChannelMask;
892 uint8_t nextLabelIsGalMask;
896 in_addr_t destIp4Mask;
900 struct in6_addr destIp6Mask;
909 uint16_t udpSrcPortMask;
913 uint16_t udpDstPortMask;
1069 uint32_t outputPort;
1133 uint16_t vlanIdMask;
1136 uint32_t tunnelIdMask;
1179 uint32_t mplsL2Port;
1181 uint32_t mplsL2PortMask;
1217 uint32_t colorActionsIndex;
1256 uint8_t trafficClass;
1297 uint16_t etherTypeMask;
1320 uint32_t tunnelIdMask;
1547 uint16_t allowVlanTranslation;
1634 uint16_t etherTypeMask;
1638 uint8_t oamY1731MdlMask;
1640 uint8_t oamY1731Opcode;
1641 uint8_t oamY1731OpcodeMask;
1646 uint16_t vlanIdMask;
1680 uint16_t etherTypeMask;
1684 OFDPA_QOS_COLORS_t color;
1918 OFDPA_MPLS_INTERFACE = 0,
1919 OFDPA_MPLS_L2_VPN_LABEL = 1,
1920 OFDPA_MPLS_L3_VPN_LABEL = 2,
1921 OFDPA_MPLS_TUNNEL_LABEL1 = 3,
1922 OFDPA_MPLS_TUNNEL_LABEL2 = 4,
1923 OFDPA_MPLS_SWAP_LABEL = 5
1929 OFDPA_MPLS_L2_FLOOD = 0,
1930 OFDPA_MPLS_L2_MULTICAST = 1,
1931 OFDPA_MPLS_L2_LOCAL_FLOOD = 2,
1932 OFDPA_MPLS_L2_LOCAL_MULTICAST = 3,
1933 OFDPA_MPLS_L2_FLOOD_SPLIT_HORIZON = 4,
1934 OFDPA_MPLS_L2_MULTICAST_SPLIT_HORIZON = 5,
1935 OFDPA_MPLS_FAST_FAILOVER = 6,
1936 OFDPA_MPLS_1_1_HEAD_END_PROTECT = 7,
1937 OFDPA_MPLS_ECMP = 8,
1938 OFDPA_MPLS_L2_TAG = 10
2087 uint32_t pushMplsHdr;
2088 uint16_t mplsEtherType;
2094 uint32_t mplsEXPAction;
2096 uint32_t mplsCopyEXPOutwards;
2097 uint32_t remarkTableIndexAction;
2098 uint32_t remarkTableIndex;
2099 uint32_t mplsTTLAction;
2101 uint32_t mplsCopyTTLOutwards;
2199 #define OFDPA_PORT_NAME_STRING_SIZE 16
2335 #define OFDPA_PKT_LOOKUP 1
2347 OFDPA_PACKET_IN_REASON_OAM,
2441 uint16_t initiatorUdpDstPort;
2443 uint16_t udpSrcPortIfNoEntropy;
2444 uint16_t useEntropy;
2450 uint32_t physicalPortNum;
2460 in_addr_t remoteEndpoint;
2461 in_addr_t localEndpoint;
2489 uint32_t tenantCount;
2502 uint32_t virtualNetworkId;
2505 uint32_t mcastNextHopId;
2520 uint32_t physicalPortNum;
2540 uint32_t memberCount;
2548 #define OFDPA_TABLE_NAME_LEN 32
2597 OFDPA_METER_RATE_KBPS = 1,
2598 OFDPA_METER_RATE_PKTPS = 2,
2600 } OFDPA_METER_RATE_UNIT_t;
2604 OFDPA_METER_COLOR_BLIND = 0,
2605 OFDPA_METER_COLOR_AWARE = 1,
2606 } OFDPA_METER_COLOR_MODE_t;
2610 OFDPA_METER_TYPE_TCM = 3,
2611 } OFDPA_METER_TYPE_t;
2615 OFDPA_TCM_METER_MODE_TRTCM = 1,
2616 OFDPA_TCM_METER_MODE_SRTCM = 2,
2617 OFDPA_TCM_METER_MODE_MOD_TRTCM = 3,
2619 } OFDPA_TCM_METER_MODE_t;
2624 OFDPA_TCM_METER_MODE_t tcmMode;
2625 OFDPA_METER_COLOR_MODE_t colorAwareMode;
2626 OFDPA_METER_RATE_UNIT_t tcmRateUnit;
2637 OFDPA_METER_TYPE_t meterType;
2655 #define OFDPA_MEG_ID_LENGTH 48
2656 #define OFDPA_LTR_EGRESS_ID_SIZE 8
2657 #define OFDPA_ORG_SPECIFIC_TLV_SIZE 1500
2658 #define OFDPA_ORG_SENDER_ID_TLV_SIZE 1500
2659 #define OFDPA_OAM_PM_FRAME_LEN_MIN 64
2660 #define OFDPA_OAM_PM_FRAME_LEN_MAX 9600
2661 #define OFDPA_OAM_ICC_MIP_ID_LENGTH 14
2665 OFDPA_MP_DIRECTION_DOWN = 1,
2666 OFDPA_MP_DIRECTION_UP = 2
2668 } OFDPA_MP_DIRECTION_t;
2673 OFDPA_CCM_INTERVAL_Invalid = 0,
2674 OFDPA_CCM_INTERVAL_300Hz = 1,
2675 OFDPA_CCM_INTERVAL_10ms = 2,
2676 OFDPA_CCM_INTERVAL_100ms = 3,
2677 OFDPA_CCM_INTERVAL_1s = 4,
2678 OFDPA_CCM_INTERVAL_10s = 5,
2679 OFDPA_CCM_INTERVAL_1min = 6,
2680 OFDPA_CCM_INTERVAL_10min = 7
2682 } OFDPA_CCM_INTERVAL_t;
2686 OFDPA_OAM_MEG_TYPE_ETHERNET,
2687 OFDPA_OAM_MEG_TYPE_G8113_1
2689 } OFDPA_OAM_MEG_TYPE_t;
2693 OFDPA_OAM_PM_TOOL_TYPE_CCM = 0,
2694 OFDPA_OAM_PM_TOOL_TYPE_LM = 1,
2695 OFDPA_OAM_PM_TOOL_TYPE_SLM = 2
2697 } OFDPA_OAM_PM_TOOL_TYPE_t;
2701 OFDPA_OAM_MP_TYPE_MEP = 0,
2702 OFDPA_OAM_MP_TYPE_MIP = 1
2704 } OFDPA_OAM_MP_TYPE_t;
2708 OFDPA_OAM_PM_ROLE_INITIATOR = 0,
2709 OFDPA_OAM_PM_ROLE_RESPONDER = 1,
2710 OFDPA_OAM_PM_ROLE_BOTH = 2
2712 } OFDPA_OAM_PM_ROLE_t;
2716 OFDPA_OAM_PM_STATE_STOPPED = 0,
2717 OFDPA_OAM_PM_STATE_RUNNING = 1
2719 } OFDPA_OAM_PM_STATE_t;
2723 OFDPA_OAM_DM_TYPE_PROACTIVE = 1,
2724 OFDPA_OAM_DM_TYPE_ONDEMAND = 2
2726 } OFDPA_OAM_DM_TYPE_t;
2731 OFDPA_OAM_MEG_TYPE_t megType;
2732 char megId[OFDPA_MEG_ID_LENGTH];
2734 uint16_t managedInstanceType;
2736 uint32_t mipCreation;
2737 OFDPA_CCM_INTERVAL_t ccmInterval;
2748 OFDPA_MLP_ROLE_NONE = 0,
2749 OFDPA_MLP_ROLE_PRIMARY = 1,
2750 OFDPA_MLP_ROLE_BACKUP = 2,
2755 OFDPA_MLP_ROLE_t mlpRole;
2768 OFDPA_MP_DIRECTION_t direction;
2781 uint32_t ccmFramesSent;
2782 uint32_t ccmFramesReceived;
2790 OFDPA_MP_DIRECTION_t direction;
2805 OFDPA_OAM_MP_TYPE_t rmpType;
2815 OFDPA_OAM_LB_TEST_TLV_NULL = 0,
2816 OFDPA_OAM_LB_TEST_TLV_NULL_CRC32,
2817 OFDPA_OAM_LB_TEST_TLV_PRBS,
2818 OFDPA_OAM_LB_TEST_TLV_PRBS_CRC32
2819 } OFDPA_OAM_LB_TEST_TLV_TYPE_t;
2823 OFDPA_OAM_LB_DISCOVERY_NONE = 0,
2824 OFDPA_OAM_LB_DISCOVERY_INGRESS,
2825 OFDPA_OAM_LB_DISCOVERY_EGRESS,
2826 OFDPA_OAM_LB_DISCOVERY_ICC_MEPID,
2827 OFDPA_OAM_LB_DISCOVERY_ICC_MIPID,
2828 OFDPA_OAM_LB_DISCOVERY_RESERVED
2829 } OFDPA_OAM_LB_DISCOVERY_TYPE_t;
2836 uint32_t lbDropEligibility;
2837 uint32_t lbNbrPacketsToSend;
2838 uint32_t lbPacketLength;
2839 OFDPA_BOOL lbTestPatternTlvPresent;
2840 OFDPA_OAM_LB_TEST_TLV_TYPE_t lbTestPatternTlvType;
2841 OFDPA_OAM_LB_DISCOVERY_TYPE_t lbDiscovery;
2847 OFDPA_BOOL lbResultOk;
2849 uint32_t lbrInOutOfOrder;
2850 uint32_t lbrBadMsdu;
2856 uint32_t lckClientMegLevel;
2864 uint32_t aisClientMegLevel;
2865 OFDPA_CCM_INTERVAL_t aisPeriod;
2879 uint32_t ltDestMpId;
2880 uint32_t ltPriority;
2886 uint32_t ltResultOK;
2887 uint32_t ltUnexpLtrIn;
2892 OFDPA_OAM_RMEP_STATE_IDLE = 1,
2893 OFDPA_OAM_RMEP_STATE_START = 2,
2894 OFDPA_OAM_RMEP_STATE_FAILED = 3,
2895 OFDPA_OAM_RMEP_STATE_OK = 4
2896 } OFDPA_OAM_RMEP_STATE_t;
2900 OFDPA_OAM_RMEP_STATE_t remoteMepState;
2902 uint32_t lastUpdateTime;
2910 uint32_t terminalMep;
2911 uint8_t lastEgressId[OFDPA_LTR_EGRESS_ID_SIZE];
2912 uint8_t nextEgressId[OFDPA_LTR_EGRESS_ID_SIZE];
2913 uint32_t relayAction;
2914 uint32_t ingressAction;
2916 uint32_t ingressPortIdSubtype;
2917 uint32_t ingressPortId;
2918 uint32_t egressAction;
2920 uint32_t egressPortIdSubtype;
2921 uint32_t egressPortId;
2930 uint32_t proLmDestMpId;
2938 OFDPA_OAM_PM_STATE_t proLmState;
2944 uint32_t odLmDestMpId;
2953 OFDPA_OAM_PM_STATE_t odLmState;
2958 uint32_t proDmDestMpId;
2966 OFDPA_OAM_PM_STATE_t proDmState;
2971 uint32_t odDmDestMpId;
2980 OFDPA_OAM_PM_STATE_t odDmState;
2985 OFDPA_OAM_BIN_MODE_15M = 0,
2986 OFDPA_OAM_BIN_MODE_24H = 1,
2987 OFDPA_OAM_BIN_MODE_MAX = 2
2988 } OFDPA_OAM_BIN_MODE_t;
3050 OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_CLEAR = 2,
3051 OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_MANUAL_LOCK = 3,
3052 OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_FORCE_SWITCH = 4,
3053 OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_MANUAL_SWITCH_P = 5,
3054 OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_MANUAL_SWITCH = 6,
3055 } OFDPA_PROTECTION_SWITCH_REQUEST_TYPE_t;
3083 uint32_t workingStatus;
3084 uint32_t standbyStatus;
3086 uint8_t holdOffBlock;
3099 OFDPA_OAM_EVENT_ON_DEMAND_LM_SESSION_COMPLETED = 1 << 0,
3100 OFDPA_OAM_EVENT_ON_DEMAND_DM_SESSION_COMPLETED = 1 << 1
3136 #define OFDPA_DROP_TABLE_STATUS_LOCK 0
3154 uint8_t trafficClass;
3183 uint8_t trafficClass;
3184 OFDPA_QOS_COLORS_t color;