mpls.h (4081B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCMX_MPLS_H__ 14 #define __BCMX_MPLS_H__ 15 16 #if defined(INCLUDE_L3) 17 18 #include <bcm/types.h> 19 #include <bcmx/bcmx.h> 20 #include <bcmx/lplist.h> 21 #include <bcmx/l3.h> 22 #include <bcm/mpls.h> 23 24 /* MPLS VPN Config Structure */ 25 typedef bcm_mpls_vpn_config_t bcmx_mpls_vpn_config_t; 26 27 /* MPLS Port Structure */ 28 typedef bcm_mpls_port_t bcmx_mpls_port_t; 29 30 /* MPLS Egress Label Structure */ 31 typedef bcm_mpls_egress_label_t bcmx_mpls_egress_label_t; 32 33 /* MPLS Tunnel Switch Structure */ 34 typedef bcm_mpls_tunnel_switch_t bcmx_mpls_tunnel_switch_t; 35 36 /* Initialize the MPLS VPN config structure. */ 37 extern void bcmx_mpls_vpn_config_t_init( 38 bcmx_mpls_vpn_config_t *info); 39 40 /* Initialize the MPLS port structure. */ 41 extern void bcmx_mpls_port_t_init( 42 bcmx_mpls_port_t *mpls_port); 43 44 /* Initialize the MPLS egress label structure. */ 45 extern void bcmx_mpls_egress_label_t_init( 46 bcmx_mpls_egress_label_t *label); 47 48 /* Initialize the MPLS tunnel switch structure. */ 49 extern void bcmx_mpls_tunnel_switch_t_init( 50 bcmx_mpls_tunnel_switch_t *info); 51 52 /* Initialize the MPLS subsystem. */ 53 extern int bcmx_mpls_init(void); 54 55 /* Detach the MPLS software module. */ 56 extern int bcmx_mpls_cleanup(void); 57 58 extern int bcmx_mpls_vpn_id_create( 59 bcmx_mpls_vpn_config_t *info); 60 61 extern int bcmx_mpls_vpn_id_destroy( 62 bcm_vpn_t vpn); 63 64 extern int bcmx_mpls_vpn_id_destroy_all(void); 65 66 extern int bcmx_mpls_vpn_id_get( 67 bcm_vpn_t vpn, 68 bcmx_mpls_vpn_config_t *info); 69 70 /* Add a MPLS logical port to the specified VPN */ 71 extern int bcmx_mpls_port_add( 72 bcm_vpn_t vpn, 73 bcmx_mpls_port_t *mpls_port); 74 75 /* Delete the given MPLS logical port from the specified VPN */ 76 extern int bcmx_mpls_port_delete( 77 bcm_vpn_t vpn, 78 bcm_gport_t mpls_port_id); 79 80 extern int bcmx_mpls_port_delete_all( 81 bcm_vpn_t vpn); 82 83 extern int bcmx_mpls_port_get( 84 bcm_vpn_t vpn, 85 bcmx_mpls_port_t *mpls_port); 86 87 extern int bcmx_mpls_port_get_all( 88 bcm_vpn_t vpn, 89 int port_max, 90 bcmx_mpls_port_t *port_array, 91 int *port_count); 92 93 extern int bcmx_mpls_tunnel_initiator_set( 94 bcm_if_t intf, 95 int num_labels, 96 bcmx_mpls_egress_label_t *label_array); 97 98 extern int bcmx_mpls_tunnel_initiator_clear( 99 bcm_if_t intf); 100 101 extern int bcmx_mpls_tunnel_initiator_clear_all(void); 102 103 extern int bcmx_mpls_tunnel_initiator_get( 104 bcm_if_t intf, 105 int label_max, 106 bcmx_mpls_egress_label_t *label_array, 107 int *label_count); 108 109 extern int bcmx_mpls_tunnel_switch_add( 110 bcmx_mpls_tunnel_switch_t *info); 111 112 extern int bcmx_mpls_tunnel_switch_delete( 113 bcmx_mpls_tunnel_switch_t *info); 114 115 extern int bcmx_mpls_tunnel_switch_delete_all(void); 116 117 extern int bcmx_mpls_tunnel_switch_get( 118 bcmx_mpls_tunnel_switch_t *info); 119 120 /* Create an MPLS EXP map instance. */ 121 extern int bcmx_mpls_exp_map_create( 122 uint32 flags, 123 int *exp_map_id); 124 125 /* Destroy an MPLS EXP map instance. */ 126 extern int bcmx_mpls_exp_map_destroy( 127 int exp_map_id); 128 129 /* 130 * Set the { internal priority, color }-to-EXP mapping in the specified 131 * EXP map. 132 */ 133 extern int bcmx_mpls_exp_map_set( 134 int exp_map_id, 135 bcm_mpls_exp_map_t *exp_map); 136 137 /* 138 * Get the { internal priority, color }-to-EXP mapping in the specified 139 * EXP map. 140 */ 141 extern int bcmx_mpls_exp_map_get( 142 int exp_map_id, 143 bcm_mpls_exp_map_t *exp_map); 144 145 extern int bcmx_mpls_label_stat_get( 146 bcm_mpls_label_t label, 147 bcm_gport_t port, 148 bcm_mpls_stat_t stat, 149 uint64 *val); 150 151 extern int bcmx_mpls_label_stat_get32( 152 bcm_mpls_label_t label, 153 bcm_gport_t port, 154 bcm_mpls_stat_t stat, 155 uint32 *val); 156 157 extern int bcmx_mpls_label_stat_clear( 158 bcm_mpls_label_t label, 159 bcm_gport_t port, 160 bcm_mpls_stat_t stat); 161 162 #endif /* defined(INCLUDE_L3) */ 163 164 #endif /* __BCMX_MPLS_H__ */