OpenFlow Data Plane Abstraction (OF-DPA) API Guide and Reference Manual
ofdpa_datatypes.h
Go to the documentation of this file.
1 
7 /*********************************************************************
8 *
9 * (C) Copyright Broadcom Corporation 2003-2016
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 *
23 **********************************************************************
24 *
25 * @filename ofdpa_datatypes.h
26 *
27 * @purpose OF-DPA datatypes header
28 *
29 * @component OF-DPA
30 *
31 * @note none
32 *
33 * @create 27 June 2013
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef INCLUDE_OFDPA_DATATYPES_H
39 #define INCLUDE_OFDPA_DATATYPES_H
40 
41 #include <stdint.h>
42 #include <sys/time.h>
43 #include <netinet/in.h>
44 
46 typedef enum
47 {
51  OFDPA_E_RPC = -20,
59  OFDPA_E_FULL = -24,
65  OFDPA_E_FAIL = -27,
79 
80 typedef enum
81 {
82  OFDPA_FEATURE_INVALID = 0,
83  OFDPA_FEATURE_VXLAN, /* If VXLAN is supported */
84  OFDPA_FEATURE_ACLIPV6MAC, /* IPv6 addresses plus MAC addresses in ACLs*/
85  OFDPA_FEATURE_MPLSTHREELABELS, /* Able to pop three MPLS labels */
86  OFDPA_FEATURE_MPLSSUPPORTED, /* Is MPLS supported at all */
87  OFDPA_FEATURE_MPLSECMP, /* Is MPLS ECMP supported */
88  OFDPA_FEATURE_OAM, /* Is OAM supported */
89  OFDPA_FEATURE_SERVICE_METER, /* Is Service Meter supported */
90  /* DOT1AG Features */
91  OFDPA_DOT1AG_MPLS_TP_CCM_SUPPORT,
92  OFDPA_DOT1AG_LTR_SORT_FEATURE_ID,
93 
94  OFDPA_FEATURE_MAX,
95 } OFDPA_FEATURE_t;
96 
97 typedef enum
98 {
99  OFDPA_FALSE = 0,
100  OFDPA_TRUE
101 } OFDPA_BOOL;
102 
104 #define OFDPA_MAC_ADDR_LEN 6
105 
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))
110 
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))
115 
117 #define OFDPA_IP_ADDR_LEN 4
118 
120 #define OFDPA_PORT_CONTROLLER 0xfffffffdu
121 
123 #define OFDPA_PORT_LOCAL 0xfffffffeu
124 
126 #define OFDPA_VID_FIELD_MASK 0x0000
127 
128 #define OFDPA_VID_EXACT_MASK 0x0fff
129 
131 #define OFDPA_VID_NONE 0x0000
132 
133 #define OFDPA_VID_PRESENT 0x1000
134 
136 #define OFDPA_INPORT_EXACT_MASK 0xffffffffu
137 
138 #define OFDPA_INPORT_FIELD_MASK 0x00000000u
139 
140 #define OFDPA_INPORT_INDEX_MASK 0x0000ffffu
141 
142 #define OFDPA_INPORT_TYPE_MASK 0xffff0000u
143 
145 #define OFDPA_ETHERTYPE_EXACT_MASK 0xffffu
146 
147 #define OFDPA_ETHERTYPE_ALL_MASK 0x0u
148 
150 #define OFDPA_LMEP_ID_EXACT_MASK 0xffffffffu
151 
153 #define OFDPA_IPV4_ADDR_EXACT_MASK 0xffffffffu
154 
155 #define OFDPA_IPV4_ADDR_FIELD_MASK 0x00000000u
156 
158 #define OFDPA_OAM_Y1731_OPCODE_EXACT_MASK 0xffu
159 #define OFDPA_OAM_Y1731_OPCODE_ALL_MASK 0x0u
160 
162 #define OFDPA_OAM_Y1731_MDL_EXACT_MASK 0x7u
163 #define OFDPA_OAM_Y1731_MDL_ALL_MASK 0x0u
164 
166 #define OFDPA_ZERO_MASK 0x0u
167 
168 #define OFDPA_VLAN_DEI_VALUE_MASK 0x1u
169 
170 #define OFDPA_VLAN_DEI_MAX_VALUE (OFDPA_VLAN_DEI_VALUE_MASK)
171 
172 #define OFDPA_VRF_VALUE_MASK 0xffffu
173 
174 #define OFDPA_ECN_VALUE_MASK 0x3u
175 
176 #define OFDPA_ECN_MAX_VALUE (OFDPA_ECN_VALUE_MASK)
177 
178 #define OFDPA_DSCP_VALUE_MASK 0x3fu
179 
180 #define OFDPA_DSCP_MAX_VALUE (OFDPA_DSCP_VALUE_MASK)
181 
182 #define OFDPA_VLAN_PCP_MAX_VALUE 7
183 
184 #define OFDPA_MPLS_TC_MAX_VALUE 7
185 
186 #define OFDPA_MDL_MAX_VALUE 7
187 
188 #define OFDPA_TRAFFIC_CLASS_MAX_VALUE 15
189 
190 #define OFDPA_L2_POLICER_METERID_MIN_VALUE 0xffff
191 
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
203 
206 typedef enum
207 {
208  ODFPA_PROTECTION_PATH = 0,
209  ODFPA_WORKING_PATH = 1,
211 
212 typedef enum
213 {
221 
222 typedef enum
223 {
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;
229 
231 #define OFDPA_MPLS_L2_PORT_EXACT_MASK 0xffffffffu
232 
233 #define OFDPA_MPLS_L2_PORT_FIELD_MASK 0x00000000u
234 
235 #define OFDPA_MPLS_L2_PORT_INDEX_MASK 0x0000ffffu
236 
237 #define OFDPA_MPLS_L2_PORT_TYPE_MASK 0xffff0000u
238 
239 typedef enum
240 {
241  OFDPA_QOS_GREEN = 0,
242  OFDPA_QOS_YELLOW = 1,
243  OFDPA_QOS_RED = 2,
244  OFDPA_QOS_RESERVED = 3
245 } OFDPA_QOS_COLORS_t;
246 
248 typedef struct ofdpaMacAddr_s
249 {
253 
254 
268 typedef struct
269 {
271  uint32_t size;
273  char *pstart;
275 
277 typedef enum
278 {
279  OFDPA_DISABLE = 0,
280  OFDPA_ENABLE = 1,
281 
283 
284 /*
285  * Debugging and Logging definitions
286  */
287 
289 typedef enum
290 {
310 
312 typedef enum
313 {
324 
328 
330 #define OFDPA_TUNNEL_ID_EXACT_MASK 0xffffffffu
331 
332 #define OFDPA_TUNNEL_ID_FIELD_MASK 0x00000000u
333 
334 #define OFDPA_TUNNEL_ID_INDEX_MASK 0x0000ffffu
335 
336 #define OFDPA_TUNNEL_ID_TYPE_MASK 0xffff0000u
337 
338 typedef enum
339 {
345 
347 typedef enum
348 {
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,
354 
356 
357 typedef enum
358 {
372 
373 /* Flow Tables.
374 */
375 
377 typedef enum
378 {
413 
415 #define OFDPA_FLOW_TABLE_ID_SA_LOOKUP 254
416 
419 {
421  uint32_t inPort;
422  uint32_t inPortMask;
423 
426  uint32_t tunnelId;
427  uint32_t tunnelIdMask;
428 
432  uint16_t etherType;
433  uint16_t etherTypeMask;
434 
437  uint32_t lmepId;
438  uint32_t lmepIdMask;
439 
441 
444 {
445  /* Match Criteria */
446  ofdpaIngressPortFlowMatch_t match_criteria;
447 
448  /* flow instructions */
459 
461  uint16_t vrfAction;
462  uint16_t vrf;
464  uint8_t qosIndex;
465  uint8_t qosIndexAction;
466 
468 
471 {
473  uint32_t lmepId;
474 
476 
479 {
480  /* Match Criteria */
481  ofdpaInjectedOamFlowMatch_t match_criteria;
482 
483  /* flow instructions */
488 
490  uint32_t tunnelIdAction;
491  uint32_t tunnelId;
492  uint32_t mplsL2PortAction;
493  uint32_t mplsL2Port;
495  uint32_t pushMplsGalHdr;
496  uint32_t mplsGalTTLAction;
497  uint32_t mplsGalTTL;
498  uint32_t mplsGalTCAction;
499  uint32_t mplsGalTC;
500 
501  uint32_t pushMplsLabelHdr;
502  uint32_t mplsLabel;
503  uint32_t mplsBOS;
504  uint32_t mplsTCAction;
505  uint32_t mplsTC;
506  uint32_t mplsTTLAction;
507  uint32_t mplsTTL;
508 
509  uint32_t mplsDataFirstNibbleAction;
510  uint32_t mplsDataFirstNibble;
511  uint32_t mplsAchChannelAction;
512  uint32_t mplsAchChannel;
513  uint32_t pushCW;
514 
515  uint32_t mplsVlanPcpAction;
516  uint32_t mplsVlanPcp;
517 
520  uint32_t groupId;
521 
523 
524 /*------------------------------------------------------------------------------------*/
525 
528 {
529  uint8_t qosIndex;
530  uint8_t dscpValue;
531 
532  uint32_t mplsL2Port;
533  uint32_t mplsL2PortMask;
534 
536 
539 {
540  ofdpaDscpTrustFlowMatch_t match_criteria;
541 
542  OFDPA_FLOW_TABLE_ID_t gotoTableId;
543 
545  /* both actions are required so no flag indicating if they are valid */
546  uint8_t trafficClass;
547  OFDPA_QOS_COLORS_t color;
548 
550 
551 /*------------------------------------------------------------------------------------*/
552 
555 {
556  uint8_t qosIndex;
557  uint8_t pcpValue;
558  uint8_t dei;
559 
560  uint32_t mplsL2Port;
561  uint32_t mplsL2PortMask;
562 
564 
567 {
568  ofdpaPcpTrustFlowMatch_t match_criteria;
569 
570  OFDPA_FLOW_TABLE_ID_t gotoTableId;
571 
573  /* both actions are required so no flag indicating if they are valid */
574  uint8_t trafficClass;
575  OFDPA_QOS_COLORS_t color;
576 
578 
579 /*------------------------------------------------------------------------------------*/
580 
582 typedef struct ofdpaVlanFlowMatch_s
583 {
585  uint32_t inPort;
586 
587  uint16_t vlanId;
588  uint16_t vlanIdMask;
589 
591 
593 typedef struct ofdpaVlanFlowEntry_s
594 {
595  /* Match Criteria */
596  ofdpaVlanFlowMatch_t match_criteria;
597 
598  /* flow instructions */
599 
608 
619  uint16_t setVlanIdAction;
620  uint16_t newVlanId;
627  uint16_t popVlanAction;
629  uint16_t pushVlan2Action;
630  uint16_t newTpid2;
632  uint16_t setVlanId2Action;
633  uint16_t newVlanId2;
635  uint16_t ovidAction;
637  uint16_t ovid;
640  uint16_t vrfAction;
641  uint16_t vrf;
643  uint16_t mplsL2PortAction;
644  uint32_t mplsL2Port;
646  uint32_t tunnelIdAction;
647  uint32_t tunnelId;
649  uint32_t mplsTypeAction;
650  uint32_t mplsType;
653 
654 /*------------------------------------------------------------------------------------*/
655 
657 typedef struct ofdpaVlan1FlowMatch_s
658 {
660  uint32_t inPort;
661  uint16_t vlanId;
662  uint16_t ovid;
663 
665 
667 typedef struct ofdpaVlan1FlowEntry_s
668 {
669  /* Match Criteria */
670  ofdpaVlan1FlowMatch_t match_criteria;
671 
672  /* flow instructions */
673 
681 
683  uint16_t setVlanIdAction;
684  uint16_t newVlanId;
686  uint16_t pushVlan2Action;
687  uint16_t newTpid2;
689  uint16_t setVlanId2Action;
690  uint16_t newVlanId2;
692  uint16_t vrfAction;
693  uint16_t vrf;
695  uint32_t mplsL2PortAction;
696  uint32_t mplsL2Port;
698  uint32_t tunnelIdAction;
699  uint32_t tunnelId;
701  uint32_t mplsTypeAction;
702  uint32_t mplsType;
705 
706 /*------------------------------------------------------------------------------------*/
707 
709 typedef struct ofdpaMpFlowMatch_s
710 {
711  uint16_t etherType;
712  uint16_t etherTypeMask;
713 
715  uint8_t oamY1731Mdl;
716  uint8_t oamY1731MdlMask;
717 
718  uint8_t oamY1731Opcode;
719  uint8_t oamY1731OpcodeMask;
720 
722  uint32_t inPort;
723 
724  uint16_t vlanId;
725  uint16_t vlanIdMask;
726 
727  ofdpaMacAddr_t destMac;
728  ofdpaMacAddr_t destMacMask;
729 
731 
733 typedef struct ofdpaMpFlowEntry_s
734 {
735  /* Match Criteria */
736  ofdpaMpFlowMatch_t match_criteria;
737 
738  /* flow instructions */
739 
745 
746  uint8_t clearAction;
749  uint32_t lmepIdAction;
753  uint32_t lmepId;
755  uint32_t outputPort;
758 
759 /*------------------------------------------------------------------------------------*/
762 {
770  uint32_t mplsL2Port;
771  uint32_t mplsL2PortMask;
772 
773  uint16_t etherType;
774  uint16_t etherTypeMask;
775 
776  uint32_t tunnelId;
777 
779 
782 {
783  /* Match Criteria */
784  ofdpaMplsL2PortFlowMatch_t match_criteria;
785 
786  /* flow instructions */
787 
796 
797  /* apply actions */
798  uint8_t qosIndex;
799  uint8_t qosIndexAction;
801  /* write actions */
802  uint32_t groupId;
805 
806 /*------------------------------------------------------------------------------------*/
807 
810 {
812  uint32_t inPort;
813 
815  uint32_t inPortMask;
816 
818  uint16_t etherType;
819 
822 
825 
827  uint16_t vlanId;
829  uint16_t vlanIdMask;
830 
832 
835 {
836  /* Match Criteria */
837  ofdpaTerminationMacFlowMatch_t match_criteria;
838 
839  /* flow instructions */
840 
849 
851  /* If specified, must be CONTROLLER, set to 0 otherwise */
852  uint32_t outputPort;
853 
855 
856 /*------------------------------------------------------------------------------------*/
857 
859 typedef struct ofdpaMplsFlowMatch_s
860 {
862  uint16_t etherType;
863 
865  uint16_t mplsBos;
866 
868  uint32_t mplsLabel;
869 
871  uint32_t inPort;
872  uint32_t inPortMask;
873 
876  uint8_t mplsTtl;
877  uint8_t mplsTtlMask;
878 
882  uint8_t mplsDataFirstNibbleMask;
883 
887  uint16_t mplsAchChannel;
888  uint16_t mplsAchChannelMask;
889 
891  uint8_t nextLabelIsGal;
892  uint8_t nextLabelIsGalMask;
893 
895  in_addr_t destIp4;
896  in_addr_t destIp4Mask;
897 
899  struct in6_addr destIp6;
900  struct in6_addr destIp6Mask;
901 
904  uint8_t ipProto;
905  uint8_t ipProtoMask;
906 
908  uint16_t udpSrcPort;
909  uint16_t udpSrcPortMask;
910 
912  uint16_t udpDstPort;
913  uint16_t udpDstPortMask;
914 
916 
918 typedef struct ofdpaMplsFlowEntry_s
919 {
920  /* Match Criteria */
921  ofdpaMplsFlowMatch_t match_criteria;
922 
923  /* flow instructions */
926  uint8_t clearAction;
927 
930 
933  uint32_t popLabelAction;
934  uint32_t newEtherType;
937  uint32_t copyTtlInAction;
938  uint32_t copyTcInAction;
940  uint32_t vrfAction;
941  uint32_t vrf;
943  uint32_t mplsL2PortAction;
944  uint32_t mplsL2Port;
946  uint32_t tunnelIdAction;
947  uint32_t tunnelId;
949  uint32_t qosIndexAction;
950  uint32_t qosIndex;
953  uint32_t trafficClass;
955  uint32_t vlanIdAction;
956  uint32_t vlanId;
958  uint32_t popCwAction;
959  uint32_t popVlanAction;
960  uint32_t popL2HeaderAction;
962  uint32_t lmepIdAction;
963  uint32_t lmepId;
968  uint32_t dropIndex;
969  uint32_t dropType;
972  uint8_t protectionId;
974  uint32_t mplsTypeAction;
975  uint32_t mplsType;
980  uint32_t groupID;
981 
982  uint32_t outputPort;
983 
985 
986 /*------------------------------------------------------------------------------------*/
987 
990 {
992  uint32_t lmepId;
993 
995  uint8_t oamY1731Opcode;
996 
997  uint16_t etherType;
998 
1000 
1003 {
1004  /* Match Criteria */
1005  ofdpaMplsMpFlowMatch_t match_criteria;
1006 
1007  /* flow instructions */
1008  uint8_t clearAction;
1015 
1019  uint32_t lmepId;
1020 
1022  uint32_t outputPort;
1024 
1025 /*------------------------------------------------------------------------------------*/
1026 
1029 {
1031  uint16_t etherType;
1032 
1034  uint16_t vrf;
1035  uint16_t vrfMask;
1036 
1038  in_addr_t dstIp4;
1039 
1041  in_addr_t dstIp4Mask;
1042 
1044  struct in6_addr dstIp6;
1045 
1047  struct in6_addr dstIp6Mask;
1048 
1050 
1053 {
1054  /* Match Criteria */
1055  ofdpaUnicastRoutingFlowMatch_t match_criteria;
1056 
1057  /* flow instructions */
1062 
1067  uint32_t groupID;
1068 
1069  uint32_t outputPort;
1070 
1072 
1073 /*------------------------------------------------------------------------------------*/
1074 
1077 {
1079  uint16_t etherType;
1080 
1082  uint16_t vlanId;
1083 
1085  uint16_t vrf;
1086  uint16_t vrfMask;
1087 
1089  in_addr_t srcIp4;
1090 
1092  in_addr_t srcIp4Mask;
1093 
1095  in_addr_t dstIp4;
1096 
1098  struct in6_addr srcIp6;
1099 
1101  struct in6_addr srcIp6Mask;
1102 
1104  struct in6_addr dstIp6;
1105 
1107 
1110 {
1111  /* Match Criteria */
1112  ofdpaMulticastRoutingFlowMatch_t match_criteria;
1113 
1114  /* flow instructions */
1119 
1122  uint32_t groupID;
1123 
1125 
1126 /*------------------------------------------------------------------------------------*/
1127 
1130 {
1132  uint16_t vlanId;
1133  uint16_t vlanIdMask;
1134 
1135  uint32_t tunnelId;
1136  uint32_t tunnelIdMask;
1137 
1142 
1144 
1147 {
1148  /* Match Criteria */
1149  ofdpaBridgingFlowMatch_t match_criteria;
1150 
1151  /* flow instructions */
1157 
1161  uint32_t groupID;
1164 
1168  uint32_t outputPort;
1169 
1171 
1172 /*------------------------------------------------------------------------------------*/
1173 
1176 {
1177  uint32_t tunnelId;
1178 
1179  uint32_t mplsL2Port;
1180 
1181  uint32_t mplsL2PortMask;
1182 
1184 
1187 {
1188  /* Match Criteria */
1189  ofdpaL2PolicerFlowMatch_t match_criteria;
1190 
1191  /* flow instructions */
1192 
1197 
1201  uint32_t meterId;
1202 
1207 
1208 /*------------------------------------------------------------------------------------*/
1209 
1212 {
1213 
1215  OFDPA_QOS_COLORS_t color;
1216 
1217  uint32_t colorActionsIndex;
1218 
1220 
1223 {
1224  /* Match Criteria */
1225  ofdpaL2PolicerActionsFlowMatch_t match_criteria;
1226 
1227  /* flow instructions */
1228 
1233 
1234  uint8_t clearAction;
1239  uint8_t dscpAction;
1240 
1241  uint8_t dscp;
1242 
1244  uint8_t ecnAction;
1245 
1246  uint8_t ecn;
1247 
1249  uint8_t vlanPcpAction;
1250 
1251  uint8_t vlanPcp;
1252 
1255 
1256  uint8_t trafficClass;
1257 
1262 
1264 
1265 /*------------------------------------------------------------------------------------*/
1266 
1269 {
1271  uint32_t inPort;
1272 
1274  uint32_t inPortMask;
1275 
1277  uint32_t mplsL2Port;
1278 
1280  uint32_t mplsL2PortMask;
1281 
1284 
1287 
1290 
1293 
1296  uint16_t etherType;
1297  uint16_t etherTypeMask;
1298 
1300  uint16_t vlanId;
1301 
1303  uint16_t vlanIdMask;
1304 
1306  uint16_t vlanPcp;
1307 
1309  uint16_t vlanPcpMask;
1310 
1313  uint8_t vlanDei;
1314 
1316  uint8_t vlanDeiMask;
1317 
1319  uint32_t tunnelId;
1320  uint32_t tunnelIdMask;
1321 
1323  uint16_t vrf;
1324 
1326  uint16_t vrfMask;
1327 
1329  in_addr_t sourceIp4;
1330 
1332  in_addr_t sourceIp4Mask;
1333 
1335  in_addr_t destIp4;
1336 
1338  in_addr_t destIp4Mask;
1339 
1341  struct in6_addr sourceIp6;
1342 
1344  struct in6_addr sourceIp6Mask;
1345 
1347  struct in6_addr destIp6;
1348 
1350  struct in6_addr destIp6Mask;
1351 
1353  uint32_t ipv4ArpSpa;
1354 
1356  uint32_t ipv4ArpSpaMask;
1357 
1359  uint16_t ipProto;
1360 
1362  uint16_t ipProtoMask;
1363 
1365  uint16_t dscp;
1366 
1368  uint16_t dscpMask;
1369 
1371  uint16_t ecn;
1372 
1374  uint16_t ecnMask;
1375 
1377  uint32_t srcL4Port;
1378 
1380  uint32_t srcL4PortMask;
1381 
1383  uint32_t destL4Port;
1384 
1386  uint32_t destL4PortMask;
1387 
1389  uint8_t icmpType;
1390 
1392  uint8_t icmpTypeMask;
1393 
1395  uint8_t icmpCode;
1396 
1398  uint8_t icmpCodeMask;
1399 
1401  uint32_t ipv6FlowLabel;
1402 
1405 
1407 
1408 /* NOTE: ACL Flow Table entries are indexed by the priority value.
1409  * This indexing establishes the rule precedence in the TCAM.
1410  */
1411 
1414 {
1417 
1418  /* flow instructions */
1422  uint8_t vlanPcpAction;
1423 
1425  uint8_t vlanPcp;
1426 
1429 
1431  uint16_t trafficClass;
1432 
1434  uint8_t colorAction;
1435 
1437  OFDPA_QOS_COLORS_t color;
1438 
1441 
1443  uint32_t colorEntryId;
1444 
1446  uint16_t ecnAction;
1447 
1449  uint16_t ecn;
1450 
1452  uint8_t dscpAction;
1453 
1455  uint8_t dscp;
1456 
1460  uint32_t groupID;
1461 
1464 
1466  uint32_t meterIdAction;
1467 
1469  uint32_t meterId;
1470 
1473 
1475  uint32_t outputPort;
1476 
1479  uint32_t clearAction;
1480 
1482 
1483 /*------------------------------------------------------------------------------------*/
1484 
1487 {
1489  OFDPA_QOS_COLORS_t color;
1490 
1492  uint32_t index;
1493 
1495 
1498 {
1501 
1502  /* flow instructions */
1505  uint8_t clearAction;
1506 
1510  uint32_t outputPort;
1511 
1516 
1518  uint8_t trafficClass;
1519 
1521  uint8_t vlanPcpAction;
1522 
1524  uint8_t vlanPcp;
1525 
1527  uint8_t ecnAction;
1528 
1530  uint8_t ecn;
1531 
1533  uint8_t dscpAction;
1534 
1536  uint8_t dscp;
1537 
1539 
1540 /*------------------------------------------------------------------------------------*/
1541 
1544 {
1545  uint32_t outPort;
1546  uint16_t vlanId;
1547  uint16_t allowVlanTranslation;
1548 
1550 
1553 {
1554  /* Match Criteria */
1555  ofdpaEgressVlanFlowMatch_t match_criteria;
1556 
1557  /* flow instructions */
1558 
1565 
1568  uint16_t setVlanIdAction;
1569  uint16_t newVlanId;
1576  uint16_t popVlanAction;
1578  uint16_t pushVlan2Action;
1579  uint16_t newTpid2;
1581  uint16_t setVlanId2Action;
1582  uint16_t newVlanId2;
1584  uint16_t ovidAction;
1586  uint16_t ovid;
1590 
1591 /*------------------------------------------------------------------------------------*/
1592 
1595 {
1596  uint32_t outPort;
1597  uint16_t vlanId;
1598  uint16_t ovid;
1599 
1601 
1604 {
1605  /* Match Criteria */
1606  ofdpaEgressVlan1FlowMatch_t match_criteria;
1607 
1608  /* flow instructions */
1609 
1615 
1617  uint16_t setVlanIdAction;
1618  uint16_t newVlanId;
1620  uint16_t pushVlan2Action;
1621  uint16_t newTpid2;
1623  uint16_t setVlanId2Action;
1624  uint16_t newVlanId2;
1627 
1628 /*------------------------------------------------------------------------------------*/
1629 
1632 {
1633  uint16_t etherType;
1634  uint16_t etherTypeMask;
1635 
1637  uint8_t oamY1731Mdl;
1638  uint8_t oamY1731MdlMask;
1639 
1640  uint8_t oamY1731Opcode;
1641  uint8_t oamY1731OpcodeMask;
1642 
1644  uint32_t outPort;
1645  uint16_t vlanId;
1646  uint16_t vlanIdMask;
1647 
1648  ofdpaMacAddr_t destMac;
1649  ofdpaMacAddr_t destMacMask;
1650 
1652 
1655 {
1656  /* Match Criteria */
1657  ofdpaEgressMpFlowMatch_t match_criteria;
1658 
1659  /* flow instructions */
1660  uint8_t clearAction;
1663  uint32_t lmepIdAction;
1667  uint32_t lmepId;
1668 
1670  uint32_t outputPort;
1672 
1673 /*------------------------------------------------------------------------------------*/
1674 
1677 {
1679  uint16_t etherType;
1680  uint16_t etherTypeMask;
1681 
1683  uint8_t trafficClass;
1684  OFDPA_QOS_COLORS_t color;
1685 
1687  uint32_t outPort;
1688 
1690 
1691 
1694 {
1697 
1698  /* flow instructions */
1699 
1702 
1703 
1707  uint8_t vlanPcpAction;
1708 
1710  uint8_t vlanPcp;
1711 
1713  uint8_t vlanDeiAction;
1714 
1716  uint8_t vlanDei;
1717 
1719  uint8_t dscpAction;
1720 
1722  uint8_t dscp;
1723 
1725 
1726 /*------------------------------------------------------------------------------------*/
1727 
1730 {
1731  uint32_t outPort;
1734 
1747 {
1748  ofdpaEgressTpidFlowMatch_t match_criteria;
1749 
1750  /* flow instructions */
1751 
1752  uint16_t newTpid;
1753 
1755 
1756 /*------------------------------------------------------------------------------------*/
1757 
1760 typedef struct ofdpaFlowEntry_s
1761 {
1764 
1766  uint32_t priority;
1767 
1768  union
1769  {
1772 
1775 
1778 
1781 
1784 
1785  ofdpaVlan1FlowEntry_t vlan1FlowEntry;
1786 
1789 
1790  ofdpaMplsL2PortFlowEntry_t mplsL2PortFlowEntry;
1791 
1794 
1797 
1800 
1803 
1806 
1809 
1812 
1815 
1818 
1821 
1824 
1827 
1830 
1833 
1836 
1837  } flowData;
1838 
1840  uint32_t hard_time;
1841 
1843  uint32_t idle_time;
1844 
1846  uint64_t cookie;
1847 
1849 
1852 {
1854  uint32_t durationSec;
1855 
1859 
1862  uint64_t receivedBytes;
1863 
1865 
1866 /*------------------------------------------------------------------------------------*/
1867 /* group table APIs */
1868 
1870 typedef enum
1871 {
1896 
1900 
1902 typedef enum
1903 {
1912 
1914 
1916 typedef enum
1917 {
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
1925 
1927 typedef enum
1928 {
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
1940 
1972 typedef struct ofdpaGroupEntry_s
1973 {
1975  uint32_t groupId;
1976 
1978 
1981 {
1982  uint32_t refCount;
1983 
1985  uint32_t duration;
1986 
1988  uint32_t bucketCount;
1990 
1991 /*
1992  Group Table entries contain one or more Action Buckets depending on their type.
1993  The Group Bucket Table stores these references. It is indexed by groupId and referenceGroupId. The presence
1994  of an entry in this table creates a referral by the Group Table entry specified in groupId to the Group Table
1995  entry specified in referenceGroupId. Restrictions on the number of references and the allowable type of the
1996  referenced Group Table entries varies by entry type.
1997 */
1998 
2001 {
2006  uint32_t outputPort;
2007 
2012  uint32_t popVlanTag;
2013 
2017 
2018 
2020 
2023 {
2027  uint32_t vlanId;
2028  ofdpaMacAddr_t srcMac;
2029 
2031 
2034 {
2039  ofdpaMacAddr_t dstMac;
2040  uint32_t vlanId;
2041 
2043 
2046 {
2048  uint32_t outputPort; /* controller responsible for assuring data in outputPort
2049  and the port identifier data encoded in the groupId are equal */
2050  /* only Access and Tunnel Endpoint Logical ports are accepted */
2052 
2053 
2056 {
2061  ofdpaMacAddr_t dstMac;
2062  uint32_t vlanId;
2063 
2065 
2068 {
2074  ofdpaMacAddr_t dstMac;
2075  uint32_t vlanId;
2076  uint32_t lmepIdAction;
2077  uint32_t lmepId;
2079 
2082 {
2084  uint32_t pushL2Hdr;
2085  uint32_t pushVlan;
2086  uint16_t newTpid;
2087  uint32_t pushMplsHdr;
2088  uint16_t mplsEtherType;
2089  uint32_t pushCW;
2090 
2092  uint32_t mplsLabel;
2093  uint32_t mplsBOS;
2094  uint32_t mplsEXPAction;
2095  uint32_t mplsEXP;
2096  uint32_t mplsCopyEXPOutwards;
2097  uint32_t remarkTableIndexAction;
2098  uint32_t remarkTableIndex;
2099  uint32_t mplsTTLAction;
2100  uint32_t mplsTTL;
2101  uint32_t mplsCopyTTLOutwards;
2102  uint32_t lmepIdAction;
2103  uint32_t lmepId;
2107 
2110 {
2112  uint32_t watchPort;
2114 
2117 {
2119  uint32_t pushVlan;
2120  uint16_t newTpid;
2121  uint32_t popVlan;
2122  uint32_t vlanId;
2124 
2127 {
2132  uint32_t outputPort;
2133 
2137 
2139 
2142 {
2144  uint32_t groupId;
2145 
2147  uint32_t bucketIndex;
2148 
2153 
2154  union
2155  {
2176  } bucketData;
2177 
2179 
2182 {
2185 
2188 
2191 
2193 
2194 
2195 /*------------------------------------------------------------------------------------*/
2196 /* Port Table */
2197 
2199 #define OFDPA_PORT_NAME_STRING_SIZE 16
2200 
2205 typedef enum
2206 {
2209 
2213 typedef enum
2214 {
2219 
2221 typedef enum
2222 {
2225 
2228 
2231 
2234 
2237 
2240 
2243 
2246 
2249 
2252 
2255 
2258 
2261 
2264 
2267 
2271 
2274 typedef struct ofdpaPortFeature_s
2275 {
2278 
2281 
2284 
2288 
2292 typedef struct ofdpaPortStats_s
2293 {
2295  uint64_t rx_packets;
2296 
2298  uint64_t tx_packets;
2299 
2301  uint64_t rx_bytes;
2302 
2304  uint64_t tx_bytes;
2305 
2307  uint64_t rx_errors;
2308 
2310  uint64_t tx_errors;
2311 
2313  uint64_t rx_drops;
2314 
2316  uint64_t tx_drops;
2317 
2319  uint64_t rx_frame_err;
2320 
2322  uint64_t rx_over_err;
2323 
2325  uint64_t rx_crc_err;
2326 
2328  uint64_t collisions;
2329 
2333 
2335 #define OFDPA_PKT_LOOKUP 1
2336 
2338 typedef enum
2339 {
2346 
2347  OFDPA_PACKET_IN_REASON_OAM,
2348 
2350 
2352 typedef struct ofdpaPacket_s
2353 {
2356 
2359 
2361  uint32_t inPortNum;
2362 
2365 } ofdpaPacket_t;
2366 
2367 /* Asynchronous Control Events */
2368 
2370 typedef enum
2371 {
2374 
2377 
2380 
2382 
2384 typedef struct ofdpaPortEvent_s
2385 {
2388 
2390  uint32_t portNum;
2391 
2395 
2397 typedef enum
2398 {
2401 
2404 
2406 
2408 typedef struct ofdpaFlowEvent_s
2409 {
2412 
2415 
2417 
2418 /*------------------------------------------------------------------------------------*/
2419 /* Tunnel Logical Port APIs */
2420 
2421 typedef enum
2422 {
2427 
2429 
2430 typedef enum
2431 {
2434 
2436 
2437 typedef struct
2438 {
2441  uint16_t initiatorUdpDstPort;
2442 
2443  uint16_t udpSrcPortIfNoEntropy;
2444  uint16_t useEntropy;
2445 
2447 
2448 typedef struct
2449 {
2450  uint32_t physicalPortNum;
2451  uint16_t vlanId;
2452  uint16_t etag;
2453  uint16_t untagged;
2454  uint16_t useEtag;
2455 
2457 
2458 typedef struct
2459 {
2460  in_addr_t remoteEndpoint;
2461  in_addr_t localEndpoint;
2462  uint32_t ttl;
2463  uint32_t ecmp;
2464 
2465  uint32_t nextHopId;
2466 
2467  union
2468  {
2469  ofdpaVxlanProtoInfo_t vxlan;
2470  } protocolInfo;
2471 
2473 
2474 typedef struct
2475 {
2477  OFDPA_TUNNEL_PROTO_t tunnelProtocol;
2478 
2479  union
2480  {
2481  ofdpaAccessPortConfig_t access;
2482  ofdpaEndpointConfig_t endpoint;
2483  } configData;
2485 
2486 typedef struct
2487 {
2488  uint32_t refCount;
2489  uint32_t tenantCount;
2490 
2492 
2493 typedef struct
2494 {
2495  uint32_t refCount;
2496 
2498 
2499 typedef struct
2500 {
2501  OFDPA_TUNNEL_PROTO_t protocol;
2502  uint32_t virtualNetworkId;
2503 
2504  in_addr_t mcastIp;
2505  uint32_t mcastNextHopId;
2506 
2508 
2509 typedef struct
2510 {
2511  uint32_t refCount;
2512 
2514 
2515 typedef struct
2516 {
2517  OFDPA_TUNNEL_PROTO_t protocol;
2518  ofdpaMacAddr_t srcAddr;
2519  ofdpaMacAddr_t dstAddr;
2520  uint32_t physicalPortNum;
2521  uint16_t vlanId;
2522 
2524 
2525 typedef struct
2526 {
2527  uint32_t refCount;
2528 
2530 
2531 typedef struct
2532 {
2533  OFDPA_TUNNEL_PROTO_t protocol;
2534 
2536 
2537 typedef struct
2538 {
2539  uint32_t refCount;
2540  uint32_t memberCount;
2541 
2543 
2544 /*------------------------------------------------------------------------------------*/
2545 /* Table APIs */
2546 
2548 #define OFDPA_TABLE_NAME_LEN 32
2549 
2551 typedef struct ofdpaFlowTableInfo_s
2552 {
2554  uint32_t numEntries;
2555 
2557  uint32_t maxEntries;
2558 
2559  /* Not supporting any features etc as they will be well documented in programmers
2560  guide
2561  */
2563 
2564 /*------------------------------------------------------------------------------------*/
2565 /* Queue APIs */
2566 
2569 {
2571  uint64_t txBytes;
2572 
2574  uint64_t txPkts;
2575 
2578 
2580 
2581 /*------------------------------------------------------------------------------------*/
2582 /* Vendor Extension APIs */
2583 
2586 {
2589  uint32_t destPortNum;
2591 
2592 /*------------------------------------------------------------------------------------*/
2593 /* Meter APIs */
2594 
2595 typedef enum
2596 {
2597  OFDPA_METER_RATE_KBPS = 1,
2598  OFDPA_METER_RATE_PKTPS = 2,
2599 
2600 } OFDPA_METER_RATE_UNIT_t;
2601 
2602 typedef enum
2603 {
2604  OFDPA_METER_COLOR_BLIND = 0,
2605  OFDPA_METER_COLOR_AWARE = 1,
2606 } OFDPA_METER_COLOR_MODE_t;
2607 
2608 typedef enum
2609 {
2610  OFDPA_METER_TYPE_TCM = 3,
2611 } OFDPA_METER_TYPE_t;
2612 
2613 typedef enum
2614 {
2615  OFDPA_TCM_METER_MODE_TRTCM = 1,
2616  OFDPA_TCM_METER_MODE_SRTCM = 2,
2617  OFDPA_TCM_METER_MODE_MOD_TRTCM = 3,
2618 
2619 } OFDPA_TCM_METER_MODE_t;
2620 
2623 {
2624  OFDPA_TCM_METER_MODE_t tcmMode;
2625  OFDPA_METER_COLOR_MODE_t colorAwareMode;
2626  OFDPA_METER_RATE_UNIT_t tcmRateUnit;
2627  uint32_t yellowRate;
2628  uint32_t yellowBurst;
2629  uint32_t redRate;
2630  uint32_t redBurst;
2633 
2635 typedef struct ofdpaMeterEntry_s
2636 {
2637  OFDPA_METER_TYPE_t meterType;
2638  union
2639  {
2640  ofdpaMeterParametersTcm_t tcmParameters;
2641  } u;
2642 
2644 
2646 {
2647  uint32_t refCount;
2648  uint32_t duration;
2649 
2651 
2652 /*------------------------------------------------------------------------------------*/
2653 /* OAM APIs */
2654 
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
2663 typedef enum
2664 {
2665  OFDPA_MP_DIRECTION_DOWN = 1,
2666  OFDPA_MP_DIRECTION_UP = 2
2667 
2668 } OFDPA_MP_DIRECTION_t;
2669 
2670 typedef enum
2671 {
2672 /* 802.1ag clauses 12.14.6.1.3:e, 20.8.1 and 21.6.1.3 */
2673  OFDPA_CCM_INTERVAL_Invalid = 0, /* No CCMs are sent (disabled). */
2674  OFDPA_CCM_INTERVAL_300Hz = 1, /* CCMs are sent every 3 1/3 milliseconds (300Hz). */
2675  OFDPA_CCM_INTERVAL_10ms = 2, /* CCMs are sent every 10 milliseconds. */
2676  OFDPA_CCM_INTERVAL_100ms = 3, /* CCMs are sent every 100 milliseconds. */
2677  OFDPA_CCM_INTERVAL_1s = 4, /* CCMs are sent every 1 second. */
2678  OFDPA_CCM_INTERVAL_10s = 5, /* CCMs are sent every 10 seconds. */
2679  OFDPA_CCM_INTERVAL_1min = 6, /* CCMs are sent every minute. */
2680  OFDPA_CCM_INTERVAL_10min = 7 /* CCMs are sent every 10 minutes. */
2681 
2682 } OFDPA_CCM_INTERVAL_t;
2683 
2684 typedef enum
2685 {
2686  OFDPA_OAM_MEG_TYPE_ETHERNET,
2687  OFDPA_OAM_MEG_TYPE_G8113_1
2688 
2689 } OFDPA_OAM_MEG_TYPE_t;
2690 
2691 typedef enum
2692 {
2693  OFDPA_OAM_PM_TOOL_TYPE_CCM = 0,
2694  OFDPA_OAM_PM_TOOL_TYPE_LM = 1,
2695  OFDPA_OAM_PM_TOOL_TYPE_SLM = 2
2696 
2697 } OFDPA_OAM_PM_TOOL_TYPE_t;
2698 
2699 typedef enum
2700 {
2701  OFDPA_OAM_MP_TYPE_MEP = 0,
2702  OFDPA_OAM_MP_TYPE_MIP = 1
2703 
2704 } OFDPA_OAM_MP_TYPE_t;
2705 
2706 typedef enum
2707 {
2708  OFDPA_OAM_PM_ROLE_INITIATOR = 0,
2709  OFDPA_OAM_PM_ROLE_RESPONDER = 1,
2710  OFDPA_OAM_PM_ROLE_BOTH = 2
2711 
2712 } OFDPA_OAM_PM_ROLE_t;
2713 
2714 typedef enum
2715 {
2716  OFDPA_OAM_PM_STATE_STOPPED = 0,
2717  OFDPA_OAM_PM_STATE_RUNNING = 1
2718 
2719 } OFDPA_OAM_PM_STATE_t;
2720 
2721 typedef enum
2722 {
2723  OFDPA_OAM_DM_TYPE_PROACTIVE = 1,
2724  OFDPA_OAM_DM_TYPE_ONDEMAND = 2
2725 
2726 } OFDPA_OAM_DM_TYPE_t;
2727 
2728 /* MEG Entry */
2729 typedef struct ofdpaOamMegConfig_s
2730 {
2731  OFDPA_OAM_MEG_TYPE_t megType;
2732  char megId[OFDPA_MEG_ID_LENGTH];
2733  uint16_t level;
2734  uint16_t managedInstanceType;
2735  uint32_t primVid;
2736  uint32_t mipCreation;
2737  OFDPA_CCM_INTERVAL_t ccmInterval;
2738 
2740 
2741 typedef struct ofdpaOamMegStatus_s
2742 {
2743  uint32_t refCount;
2745 
2746 typedef enum
2747 {
2748  OFDPA_MLP_ROLE_NONE = 0,
2749  OFDPA_MLP_ROLE_PRIMARY = 1,
2750  OFDPA_MLP_ROLE_BACKUP = 2,
2751 } OFDPA_MLP_ROLE_t;
2752 
2753 typedef struct mlpConfig_s
2754 {
2755  OFDPA_MLP_ROLE_t mlpRole;
2756  union
2757  {
2759  uint32_t dropStatusId;
2760  } u;
2761 } mlpConfig_t;
2762 
2763 typedef struct ofdpaOamMepConfig_s
2764 {
2765  uint32_t megIndex;
2766  uint16_t mepId;
2767  uint32_t ifIndex;
2768  OFDPA_MP_DIRECTION_t direction;
2771  uint32_t ccmPriority;
2773  mlpConfig_t mlp;
2774 
2776 
2777 typedef struct ofdpaOamMepStatus_s
2778 {
2779  uint32_t refCount;
2780 
2781  uint32_t ccmFramesSent;
2782  uint32_t ccmFramesReceived;
2783 
2785 
2786 typedef struct ofdpaOamMipConfig_s
2787 {
2788  uint32_t megIndex;
2789  uint32_t ifIndex;
2790  OFDPA_MP_DIRECTION_t direction;
2795 
2796 typedef struct ofdpaOamMipStatus_s
2797 {
2798  uint32_t refCount;
2799 
2801 
2803 {
2804  uint32_t lmepId;
2805  OFDPA_OAM_MP_TYPE_t rmpType;
2806  uint16_t mepId;
2808  uint32_t ttlToMip;
2812 
2813 typedef enum
2814 {
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;
2820 
2821 typedef enum
2822 {
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;
2830 
2831 typedef struct ofdpaOamLbConfig_s
2832 {
2833  uint32_t lbDestMpId;
2834  uint32_t lbPeriod;
2835  uint32_t lbPriority;
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;
2842  uint32_t lbTtl;
2844 
2845 typedef struct ofdpaOamLbStatus_s
2846 {
2847  OFDPA_BOOL lbResultOk;
2848  uint32_t lbrIn;
2849  uint32_t lbrInOutOfOrder;
2850  uint32_t lbrBadMsdu;
2851 
2853 
2854 typedef struct ofdpaOamLckConfig_s
2855 {
2856  uint32_t lckClientMegLevel;
2857  uint32_t lckPeriod;
2858  uint32_t lckTrafficClass;
2861 
2862 typedef struct ofdpaOamAisConfig_s
2863 {
2864  uint32_t aisClientMegLevel;
2865  OFDPA_CCM_INTERVAL_t aisPeriod;
2866  uint32_t aisPriority;
2869 
2870 typedef struct ofdpaOamCsfConfig_s
2871 {
2872  OFDPA_CCM_INTERVAL_t csfPeriod;
2873  uint32_t csfPriority;
2876 
2877 typedef struct ofdpaOamLtConfig_s
2878 {
2879  uint32_t ltDestMpId;
2880  uint32_t ltPriority;
2881  uint32_t ltTtl;
2883 
2884 typedef struct ofdpaOamLtStatus_s
2885 {
2886  uint32_t ltResultOK;
2887  uint32_t ltUnexpLtrIn;
2889 
2890 typedef enum
2891 {
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;
2897 
2899 {
2900  OFDPA_OAM_RMEP_STATE_t remoteMepState;
2901  ofdpaMacAddr_t remoteMepMacAddr;
2902  uint32_t lastUpdateTime;
2903 
2905 
2906 typedef struct ofdpaOamLtrEntry_s
2907 {
2908  uint32_t ttl;
2909  uint32_t forwarded;
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;
2915  ofdpaMacAddr_t ingressMac;
2916  uint32_t ingressPortIdSubtype;
2917  uint32_t ingressPortId;
2918  uint32_t egressAction;
2919  ofdpaMacAddr_t egressMac;
2920  uint32_t egressPortIdSubtype;
2921  uint32_t egressPortId;
2922  ofdpa_buffdesc organizationSpecificTlv;
2923  ofdpa_buffdesc senderIdTlv;
2924 
2926 
2928 {
2929  OFDPA_OAM_PM_TOOL_TYPE_t toolType;
2930  uint32_t proLmDestMpId;
2931  OFDPA_CCM_INTERVAL_t period;
2932  uint32_t trafficClass;
2933  uint32_t testId;
2935 
2937 {
2938  OFDPA_OAM_PM_STATE_t proLmState;
2940 
2941 typedef struct ofdpaOamOdLmConfig_s
2942 {
2943  OFDPA_OAM_PM_TOOL_TYPE_t toolType;
2944  uint32_t odLmDestMpId;
2945  OFDPA_CCM_INTERVAL_t period;
2946  uint32_t trafficClass;
2947  OFDPA_OAM_PM_ROLE_t role;
2948  uint32_t testId;
2950 
2951 typedef struct ofdpaOamOdLmStatus_s
2952 {
2953  OFDPA_OAM_PM_STATE_t odLmState;
2955 
2957 {
2958  uint32_t proDmDestMpId;
2959  OFDPA_CCM_INTERVAL_t period;
2960  uint32_t trafficClass;
2961  uint32_t frameLen;
2963 
2965 {
2966  OFDPA_OAM_PM_STATE_t proDmState;
2968 
2969 typedef struct ofdpaOamOdDmConfig_s
2970 {
2971  uint32_t odDmDestMpId;
2972  OFDPA_CCM_INTERVAL_t period;
2973  uint32_t trafficClass;
2974  uint32_t frameLen;
2975  OFDPA_OAM_PM_ROLE_t role;
2977 
2978 typedef struct ofdpaOamOdDmStatus_s
2979 {
2980  OFDPA_OAM_PM_STATE_t odDmState; /* this is a placeholder member, the correct status elements to be reported need to be designed */
2982 
2983 typedef enum
2984 {
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;
2989 
2990 
2992 {
2993  uint32_t mN_FLR;
2994  uint32_t aN_FLR;
2995  uint32_t xN_FLR;
2996  uint32_t mF_FLR;
2997  uint32_t aF_FLR;
2998  uint32_t xF_FLR;
3000 
3002 {
3003  ofdpaOamProLmCounterBin_t bin_15min;
3004  ofdpaOamProLmCounterBin_t bin_24hr;
3006 
3008 {
3009  uint32_t tNTFCnt;
3010  uint32_t tNLFCnt;
3011  uint32_t tNFLR;
3012  uint32_t tFTFCnt;
3013  uint32_t tFLFCnt;
3014  uint32_t tFFLR;
3015  uint32_t sLMCnt;
3016  uint32_t uLMCnt;
3018 
3020 {
3021  uint32_t mB_FD;
3022  uint32_t aB_FD;
3023  uint32_t xB_FD;
3024  uint32_t mN_FDV;
3025  uint32_t aN_FDV;
3026  uint32_t xN_FDV;
3027  uint32_t mF_FDV;
3028  uint32_t aF_FDV;
3029  uint32_t xF_FDV;
3031 
3033 {
3034  ofdpaOamProDmCounterBin_t bin_15min;
3035  ofdpaOamProDmCounterBin_t bin_24hr;
3037 
3039 {
3040  uint32_t tN_FD;
3041  uint32_t tF_FD;
3042  uint32_t tB_FD;
3043  uint32_t elapsedTime;
3044  uint32_t sFDMCnt;
3045  uint32_t uFDMCnt;
3047 
3048 typedef enum
3049 {
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;
3056 
3057 typedef enum
3058 {
3062 
3064 {
3066  uint32_t holdOffTime;
3067  uint32_t wtrTime;
3068  OFDPA_BOOL revertiveMode;
3071 
3073 {
3074  uint32_t lastLReq; /*last local request*/
3075  uint32_t lastRReq; /*last remote request*/
3076  uint32_t lastSReq; /*last send request, it's used for continuing sending APS packets*/
3077 
3078  uint32_t sfwState; /*local SF-W exist flag: True/False*/
3079  uint32_t sfpState; /*local SF-P exist flag: True/False*/
3080  uint32_t sdwState; /*local SD-W exist flag: True/False*/
3081  uint32_t sdpState; /*local SD-P exist flag: True/False*/
3082 
3083  uint32_t workingStatus; /*working LSP link status: UP/DOWN*/
3084  uint32_t standbyStatus; /*standby LSP link status: UP/DOWN*/
3085 
3086  uint8_t holdOffBlock; /*Received events are blocked by hold-off-timer*/
3087  uint32_t dfop_cm; /*ALARM: dFOP-CM*/
3088  uint32_t dfop_pm; /*ALARM: dFOP-PM*/
3089  uint32_t dfop_nr; /*ALARM: dFOP-NR*/
3090  uint32_t dfop_to; /*ALARM: dFOP-TO*/
3091 
3092  uint32_t refCount;
3093 
3095 
3097 typedef enum
3098 {
3099  OFDPA_OAM_EVENT_ON_DEMAND_LM_SESSION_COMPLETED = 1 << 0,
3100  OFDPA_OAM_EVENT_ON_DEMAND_DM_SESSION_COMPLETED = 1 << 1
3101 
3103 
3105 typedef struct ofdpaOamEvent_s
3106 {
3107  OFDPA_OAM_EVENT_MASK_t eventMask;
3108 
3109  uint32_t megIndex;
3110  uint32_t mepId;
3111 
3112 } ofdpaOamEvent_t;
3113 
3114 /*------------------------------------------------------------------------------------*/
3115 /* Mpls Set QoS Action table */
3116 
3117 typedef struct ofdpaMplsQosEntry_s
3118 {
3120  uint8_t qosIndex;
3122  uint8_t mpls_tc;
3123 
3124  /* both actions are required so no flag indicating if they are valid */
3126  uint8_t trafficClass;
3128  OFDPA_QOS_COLORS_t color;
3129 
3131 
3132 /*------------------------------------------------------------------------------------*/
3133 /* Drop Status Action table */
3134 
3136 #define OFDPA_DROP_TABLE_STATUS_LOCK 0
3137 
3140 {
3141  uint32_t lmepId;
3142  uint8_t type;
3143  uint8_t dropAction;
3146 
3147 /*------------------------------------------------------------------------------------*/
3148 /* Data Plane Counter Table */
3149 
3152 {
3153  uint32_t lmepId;
3154  uint8_t trafficClass;
3155 
3157 
3160 {
3161  uint8_t refCount;
3162 
3164 
3165 /*------------------------------------------------------------------------------------*/
3166 /* Remark Action Table */
3167 
3170 {
3171  uint8_t remarkData; /* MPLS_TC or DSCP */
3172  uint8_t vlanPcp; /* New PRI value for outermost VLAN tag. */
3173  uint8_t vlanDei; /* New DEI value for outermost VLAN tag. */
3174 
3176 
3179 {
3180  /* keys of the remark action entry */
3181  OFDPA_ACTION_TABLE_TYPE_t actionTableType; /* Action table type */
3182  uint32_t index; /* Mapping profile index */
3183  uint8_t trafficClass; /* Traffic Class */
3184  OFDPA_QOS_COLORS_t color; /* Color */
3185  /* actions */
3186  ofdpaRemarkSetActions_t actions; /* Set Actions */
3187 
3189 
3190 #endif /* INCLUDE_OFDPA_DATATYPES_H */
3191