OpenNSL API Guide and Reference Manual
mplsX.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * This software is governed by the Broadcom Advanced Switch APIs license.
7  * This license is set out in the
8  * https://github.com/Broadcom-Switch/OpenNSL/Legal/LICENSE-Adv file.
9  *
10  * Copyright 2015-2016 Broadcom Corporation. All rights reserved.
11  *
12  ***************************************************************************/
16 #ifndef __OPENNSL_MPLSX_H__
17 #define __OPENNSL_MPLSX_H__
18 
19 #include <opennsl/types.h>
20 #include <opennsl/vlan.h>
21 #include <opennsl/switch.h>
22 
23 #if defined(INCLUDE_L3)
24 
25 typedef struct opennsl_mpls_exp_map_s {
26  int priority;
33 /* __doxy_func_body_end__ */
34 #endif
35 
36 #define OPENNSL_MPLS_EGRESS_LABEL_TTL_SET 0x00000001
37 #define OPENNSL_MPLS_EGRESS_LABEL_TTL_COPY 0x00000002
38 #define OPENNSL_MPLS_EGRESS_LABEL_TTL_DECREMENT 0x00000004
39 #define OPENNSL_MPLS_EGRESS_LABEL_ACTION_VALID 0x00002000
42 #define OPENNSL_MPLS_EGRESS_LABEL_REPLACE 0x00004000
44 #define OPENNSL_MPLS_EGRESS_LABEL_WITH_ID 0x00008000
47 typedef enum opennsl_mpls_egress_action_e {
54 /* __doxy_func_body_end__ */
55 
60  int qos_map_id;
70  int reserved1;
71  int reserved2;
80 /* __doxy_func_body_end__ */
81 
82 #if defined(INCLUDE_L3)
83 
108 /* __doxy_func_body_end__ */
109 #endif
110 
111 #if defined(INCLUDE_L3)
112 #endif
113 #if defined(INCLUDE_L3)
114 #endif
115 #if defined(INCLUDE_L3)
116 
124 /* __doxy_func_body_end__ */
125 #endif
126 
127 #if defined(INCLUDE_L3)
128 
129 typedef struct opennsl_mpls_port_s {
133  int if_class;
134  int exp_map;
135  int int_pri;
146  int mtu;
178 /* __doxy_func_body_end__ */
179 #endif
180 
181 #if defined(INCLUDE_L3)
182 
192 /* __doxy_func_body_end__ */
193 #endif
194 
195 #if defined(INCLUDE_L3)
196 #define OPENNSL_MPLS_SWITCH_INNER_TTL 0x00000100
199 #define OPENNSL_MPLS_SWITCH_TTL_DECREMENT 0x00000200
201 #endif
202 #if defined(INCLUDE_L3)
203 #endif
204 #if defined(INCLUDE_L3)
205 
216  int exp_map;
217  int int_pri;
224  int mtu;
239  int reserved2;
240  int reserved3;
242 /* __doxy_func_body_end__ */
243 #endif
244 
245 #if defined(INCLUDE_L3)
246 
250  int pri;
253 /* __doxy_func_body_end__ */
254 #endif
255 
256 #if defined(INCLUDE_L3)
257 /***************************************************************************/
266 extern void opennsl_mpls_port_t_init(
268 #endif
269 
270 #if defined(INCLUDE_L3)
271 /***************************************************************************/
282 #endif
283 
284 #if defined(INCLUDE_L3)
285 /***************************************************************************/
296 #endif
297 
298 #if defined(INCLUDE_L3)
299 /***************************************************************************/
310 #endif
311 
312 #if defined(INCLUDE_L3)
313 /***************************************************************************/
322 extern void opennsl_mpls_exp_map_t_init(
324 #endif
325 
326 #if defined(INCLUDE_L3)
327 /***************************************************************************/
337 extern int opennsl_mpls_init(
338  int unit) LIB_DLL_EXPORTED ;
339 #endif
340 
341 #if defined(INCLUDE_L3)
342 /***************************************************************************/
351 extern int opennsl_mpls_cleanup(
352  int unit) LIB_DLL_EXPORTED ;
353 #endif
354 
355 #if defined(INCLUDE_L3)
356 #define OPENNSL_MPLS_VPN_L3 0x00000001
357 #define OPENNSL_MPLS_VPN_VPWS 0x00000002
358 #define OPENNSL_MPLS_VPN_VPLS 0x00000004
359 #define OPENNSL_MPLS_VPN_REPLACE 0x00000008
360 #define OPENNSL_MPLS_VPN_WITH_ID 0x00000010
361 #endif
362 #if defined(INCLUDE_L3)
363 #endif
364 #if defined(INCLUDE_L3)
365 #endif
366 #if defined(INCLUDE_L3)
367 
371  int lookup_id;
378 /* __doxy_func_body_end__ */
379 #endif
380 
381 #if defined(INCLUDE_L3)
382 /***************************************************************************/
393 #endif
394 
395 #if defined(INCLUDE_L3)
396 /***************************************************************************/
407 extern int opennsl_mpls_vpn_id_create(
408  int unit,
410 #endif
411 
412 #if defined(INCLUDE_L3)
413 /***************************************************************************/
423 extern int opennsl_mpls_vpn_id_destroy(
424  int unit,
426 #endif
427 
428 #if defined(INCLUDE_L3)
429 /***************************************************************************/
439  int unit) LIB_DLL_EXPORTED ;
440 #endif
441 
442 #if defined(INCLUDE_L3)
443 /***************************************************************************/
454 extern int opennsl_mpls_vpn_id_get(
455  int unit,
456  opennsl_vpn_t vpn,
458 #endif
459 
460 #if defined(INCLUDE_L3)
462  int unit,
464  void *user_data);
465 #endif
466 
467 #if defined(INCLUDE_L3)
468 /***************************************************************************/
481 extern int opennsl_mpls_vpn_traverse(
482  int unit,
484  void *user_data) LIB_DLL_EXPORTED ;
485 #endif
486 
487 #if defined(INCLUDE_L3)
488 /***************************************************************************/
510 extern int opennsl_mpls_port_add(
511  int unit,
512  opennsl_vpn_t vpn,
514 #endif
515 
516 #if defined(INCLUDE_L3)
517 /***************************************************************************/
528 extern int opennsl_mpls_port_delete(
529  int unit,
530  opennsl_vpn_t vpn,
531  opennsl_gport_t mpls_port_id) LIB_DLL_EXPORTED ;
532 #endif
533 
534 #if defined(INCLUDE_L3)
535 /***************************************************************************/
546  int unit,
548 #endif
549 
550 #if defined(INCLUDE_L3)
551 /***************************************************************************/
562 extern int opennsl_mpls_port_get(
563  int unit,
564  opennsl_vpn_t vpn,
566 #endif
567 
568 #if defined(INCLUDE_L3)
569 /***************************************************************************/
582 extern int opennsl_mpls_port_get_all(
583  int unit,
584  opennsl_vpn_t vpn,
585  int port_max,
586  opennsl_mpls_port_t *port_array,
587  int *port_count) LIB_DLL_EXPORTED ;
588 #endif
589 
590 #if defined(INCLUDE_L3)
591 
592 typedef enum opennsl_mpls_stat_e {
598 /* __doxy_func_body_end__ */
599 #endif
600 
601 #if defined(INCLUDE_L3)
602 /***************************************************************************/
617  int unit,
618  opennsl_if_t intf_id,
619  uint32 stat_counter_id) LIB_DLL_EXPORTED ;
620 #endif
621 
622 #if defined(INCLUDE_L3)
623 /***************************************************************************/
637  int unit,
638  opennsl_if_t intf_id) LIB_DLL_EXPORTED ;
639 #endif
640 
641 #if defined(INCLUDE_L3)
642 /***************************************************************************/
662  int unit,
663  opennsl_if_t intf_id,
664  opennsl_mpls_stat_t stat,
665  uint32 num_entries,
666  uint32 *counter_indexes,
667  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
668 #endif
669 
670 #if defined(INCLUDE_L3)
671 /***************************************************************************/
689  int unit,
690  opennsl_if_t intf_id,
691  opennsl_mpls_stat_t stat,
692  uint32 num_entries,
693  uint32 *counter_indexes,
694  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
695 #endif
696 
697 #if defined(INCLUDE_L3)
698 /***************************************************************************/
714  int unit,
715  opennsl_if_t intf_id,
716  opennsl_mpls_stat_t stat,
717  uint32 *stat_counter_id) LIB_DLL_EXPORTED ;
718 #endif
719 
720 #if defined(INCLUDE_L3)
721 /***************************************************************************/
740  int unit,
741  opennsl_if_t intf_id,
742  opennsl_mpls_stat_t stat,
743  uint32 num_entries,
744  uint32 *counter_indexes,
745  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
746 #endif
747 
748 #if defined(INCLUDE_L3)
749 /***************************************************************************/
770  int unit,
771  opennsl_if_t intf,
772  int num_labels,
774 #endif
775 
776 #if defined(INCLUDE_L3)
777 /***************************************************************************/
788  int unit,
789  opennsl_if_t intf,
790  int num_labels,
792 #endif
793 
794 #if defined(INCLUDE_L3)
795 /***************************************************************************/
806  int unit,
808 #endif
809 
810 #if defined(INCLUDE_L3)
811 /***************************************************************************/
821  int unit) LIB_DLL_EXPORTED ;
822 #endif
823 
824 #if defined(INCLUDE_L3)
825 /***************************************************************************/
839  int unit,
840  opennsl_if_t intf,
841  int label_max,
842  opennsl_mpls_egress_label_t *label_array,
843  int *label_count) LIB_DLL_EXPORTED ;
844 #endif
845 
846 #if defined(INCLUDE_L3)
847 /***************************************************************************/
892  int unit,
894 #endif
895 
896 #if defined(INCLUDE_L3)
897 /***************************************************************************/
942  int unit,
944 #endif
945 
946 #if defined(INCLUDE_L3)
947 /***************************************************************************/
958  int unit,
960 #endif
961 
962 #if defined(INCLUDE_L3)
963 /***************************************************************************/
973  int unit) LIB_DLL_EXPORTED ;
974 #endif
975 
976 #if defined(INCLUDE_L3)
977 /***************************************************************************/
988  int unit,
990 #endif
991 
992 #if defined(INCLUDE_L3)
994  int unit,
996  void *user_data);
997 #endif
998 
999 #if defined(INCLUDE_L3)
1000 /***************************************************************************/
1014  int unit,
1016  void *user_data) LIB_DLL_EXPORTED ;
1017 #endif
1018 
1019 #if defined(INCLUDE_L3)
1020 #endif
1021 #if defined(INCLUDE_L3)
1022 /***************************************************************************/
1042  int unit,
1043  uint32 options,
1045 #endif
1046 
1047 #if defined(INCLUDE_L3)
1048 /***************************************************************************/
1062  int unit,
1064 #endif
1065 
1066 #if defined(INCLUDE_L3)
1067 /***************************************************************************/
1081  int unit,
1083 #endif
1084 
1085 #if defined(INCLUDE_L3)
1086 /***************************************************************************/
1096  int unit) LIB_DLL_EXPORTED ;
1097 #endif
1098 
1099 #if defined(INCLUDE_L3)
1101  int unit,
1103  void *user_data);
1104 #endif
1105 
1106 #if defined(INCLUDE_L3)
1107 /***************************************************************************/
1123  int unit,
1125  void *user_data) LIB_DLL_EXPORTED ;
1126 #endif
1127 
1128 #if defined(INCLUDE_L3)
1129 #endif
1130 #if defined(INCLUDE_L3)
1131 /***************************************************************************/
1152 extern int opennsl_mpls_exp_map_create(
1153  int unit,
1154  uint32 flags,
1155  int *exp_map_id) LIB_DLL_EXPORTED ;
1156 #endif
1157 
1158 #if defined(INCLUDE_L3)
1159 /***************************************************************************/
1169 extern int opennsl_mpls_exp_map_destroy(
1170  int unit,
1171  int exp_map_id) LIB_DLL_EXPORTED ;
1172 #endif
1173 
1174 #if defined(INCLUDE_L3)
1175 /***************************************************************************/
1191 extern int opennsl_mpls_exp_map_set(
1192  int unit,
1193  int exp_map_id,
1195 #endif
1196 
1197 #if defined(INCLUDE_L3)
1198 /***************************************************************************/
1216 extern int opennsl_mpls_exp_map_get(
1217  int unit,
1218  int exp_map_id,
1220 #endif
1221 
1222 #if defined(INCLUDE_L3)
1223 /***************************************************************************/
1240  int unit,
1241  opennsl_mpls_label_t label,
1243  int enable) LIB_DLL_EXPORTED ;
1244 #endif
1245 
1246 #if defined(INCLUDE_L3)
1247 /***************************************************************************/
1265 extern int opennsl_mpls_label_stat_get(
1266  int unit,
1267  opennsl_mpls_label_t label,
1269  opennsl_mpls_stat_t stat,
1270  uint64 *val) LIB_DLL_EXPORTED ;
1271 #endif
1272 
1273 #if defined(INCLUDE_L3)
1274 /***************************************************************************/
1289  int unit,
1290  opennsl_mpls_label_t label,
1292  opennsl_mpls_stat_t stat,
1293  uint64 *val) LIB_DLL_EXPORTED ;
1294 #endif
1295 
1296 #if defined(INCLUDE_L3)
1297 /***************************************************************************/
1316  int unit,
1317  opennsl_mpls_label_t label,
1319  opennsl_mpls_stat_t stat,
1320  uint32 *val) LIB_DLL_EXPORTED ;
1321 #endif
1322 
1323 #if defined(INCLUDE_L3)
1324 /***************************************************************************/
1339  int unit,
1340  opennsl_mpls_label_t label,
1342  opennsl_mpls_stat_t stat,
1343  uint32 *val) LIB_DLL_EXPORTED ;
1344 #endif
1345 
1346 #if defined(INCLUDE_L3)
1347 /***************************************************************************/
1365  int unit,
1366  opennsl_mpls_label_t label,
1369 #endif
1370 
1371 #if defined(INCLUDE_L3)
1372 /***************************************************************************/
1384  int unit,
1385  opennsl_gport_t mpls_port,
1386  int enable) LIB_DLL_EXPORTED ;
1387 #endif
1388 
1389 #if defined(INCLUDE_L3)
1390 
1409 /* __doxy_func_body_end__ */
1410 #endif
1411 
1412 #if defined(INCLUDE_L3)
1413 /***************************************************************************/
1426 extern int opennsl_mpls_port_stat_set(
1427  int unit,
1428  opennsl_gport_t mpls_port,
1429  opennsl_cos_t cos,
1431  uint64 val) LIB_DLL_EXPORTED ;
1432 #endif
1433 
1434 #if defined(INCLUDE_L3)
1435 /***************************************************************************/
1446 extern int opennsl_mpls_port_stat_set32(
1447  int unit,
1448  opennsl_gport_t mpls_port,
1449  opennsl_cos_t cos,
1451  uint32 val) LIB_DLL_EXPORTED ;
1452 #endif
1453 
1454 #if defined(INCLUDE_L3)
1455 /***************************************************************************/
1468 extern int opennsl_mpls_port_stat_get(
1469  int unit,
1470  opennsl_gport_t mpls_port,
1471  opennsl_cos_t cos,
1473  uint64 *val) LIB_DLL_EXPORTED ;
1474 #endif
1475 
1476 #if defined(INCLUDE_L3)
1477 /***************************************************************************/
1490 extern int opennsl_mpls_port_stat_get32(
1491  int unit,
1492  opennsl_gport_t mpls_port,
1493  opennsl_cos_t cos,
1495  uint32 *val) LIB_DLL_EXPORTED ;
1496 #endif
1497 
1498 #if defined(INCLUDE_L3)
1499 /***************************************************************************/
1515  int unit,
1516  opennsl_vpn_t vpn,
1518  opennsl_mpls_stat_t stat,
1519  uint32 *stat_counter_id) LIB_DLL_EXPORTED ;
1520 #endif
1521 
1522 #if defined(INCLUDE_L3)
1523 /***************************************************************************/
1539  int unit,
1540  opennsl_mpls_label_t label,
1542  opennsl_mpls_stat_t stat,
1543  uint32 *stat_counter_id) LIB_DLL_EXPORTED ;
1544 #endif
1545 
1546 #if defined(INCLUDE_L3)
1547 /***************************************************************************/
1562  int unit,
1563  opennsl_vpn_t vpn,
1565  uint32 stat_counter_id) LIB_DLL_EXPORTED ;
1566 #endif
1567 
1568 #if defined(INCLUDE_L3)
1569 /***************************************************************************/
1583  int unit,
1584  opennsl_vpn_t vpn,
1586 #endif
1587 
1588 #if defined(INCLUDE_L3)
1589 /***************************************************************************/
1608  int unit,
1609  opennsl_vpn_t vpn,
1611  opennsl_mpls_stat_t stat,
1612  uint32 num_entries,
1613  uint32 *counter_indexes,
1614  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1615 #endif
1616 
1617 #if defined(INCLUDE_L3)
1618 /***************************************************************************/
1638  int unit,
1639  opennsl_vpn_t vpn,
1641  opennsl_mpls_stat_t stat,
1642  uint32 num_entries,
1643  uint32 *counter_indexes,
1644  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1645 #endif
1646 
1647 #if defined(INCLUDE_L3)
1648 /***************************************************************************/
1666  int unit,
1667  opennsl_vpn_t vpn,
1669  opennsl_mpls_stat_t stat,
1670  uint32 num_entries,
1671  uint32 *counter_indexes,
1672  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1673 #endif
1674 
1675 #if defined(INCLUDE_L3)
1676 /***************************************************************************/
1691  int unit,
1692  opennsl_mpls_label_t label,
1694  uint32 stat_counter_id) LIB_DLL_EXPORTED ;
1695 #endif
1696 
1697 #if defined(INCLUDE_L3)
1698 /***************************************************************************/
1712  int unit,
1713  opennsl_mpls_label_t label,
1715 #endif
1716 
1717 #if defined(INCLUDE_L3)
1718 /***************************************************************************/
1737  int unit,
1738  opennsl_mpls_label_t label,
1740  opennsl_mpls_stat_t stat,
1741  uint32 num_entries,
1742  uint32 *counter_indexes,
1743  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1744 #endif
1745 
1746 #if defined(INCLUDE_L3)
1747 /***************************************************************************/
1766  int unit,
1767  opennsl_mpls_label_t label,
1769  opennsl_mpls_stat_t stat,
1770  uint32 num_entries,
1771  uint32 *counter_indexes,
1772  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1773 #endif
1774 
1775 #if defined(INCLUDE_L3)
1776 /***************************************************************************/
1795  int unit,
1796  opennsl_mpls_label_t label,
1798  opennsl_mpls_stat_t stat,
1799  uint32 num_entries,
1800  uint32 *counter_indexes,
1801  opennsl_stat_value_t *counter_values) LIB_DLL_EXPORTED ;
1802 #endif
1803 
1804 #if defined(INCLUDE_L3)
1805 #endif
1806 #if defined(INCLUDE_L3)
1807 
1812 /* __doxy_func_body_end__ */
1813 #endif
1814 
1815 #if defined(INCLUDE_L3)
1816 /***************************************************************************/
1829  int unit,
1830  opennsl_mpls_label_t label_low,
1831  opennsl_mpls_label_t label_high,
1833 #endif
1834 
1835 #if defined(INCLUDE_L3)
1836 /***************************************************************************/
1848  int unit,
1849  opennsl_mpls_label_t label_low,
1851 #endif
1852 
1853 #if defined(INCLUDE_L3)
1854 /***************************************************************************/
1867  int unit,
1868  opennsl_mpls_label_t label_low,
1869  opennsl_mpls_label_t label_high,
1871 #endif
1872 
1873 #if defined(INCLUDE_L3)
1874 /***************************************************************************/
1885 #endif
1886 
1887 #endif /* __OPENNSL_MPLSX_H__ */
1888