openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

tunnel.h (24155B)


      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 __BCM_TUNNEL_H__
     14 #define __BCM_TUNNEL_H__
     15 
     16 #if defined(INCLUDE_L3)
     17 
     18 #include <bcm/types.h>
     19 #include <bcm/qos.h>
     20 #include <bcm/l3.h>
     21 
     22 /* Tunnel flags. */
     23 #define BCM_TUNNEL_TERM_DSCP_TRUST          0x00000001 /* Trust incoming tunnel
     24                                                           DSCP inner or outer
     25                                                           based on
     26                                                           USE_OUTER_DSCP flag. */
     27 #define BCM_TUNNEL_TERM_USE_OUTER_DSCP      0x00000002 /* Use outer header DSCP. */
     28 #define BCM_TUNNEL_TERM_USE_OUTER_TTL       0x00000004 /* Use outer header TTL. */
     29 #define BCM_TUNNEL_TERM_KEEP_INNER_DSCP     0x00000008 /* Keep inner header
     30                                                           DSCP. */
     31 #define BCM_TUNNEL_TERM_WLAN_REMOTE_TERMINATE 0x00000010 /* Remote WLAN tunnel
     32                                                           termination */
     33 #define BCM_TUNNEL_TERM_WLAN_SET_ROAM       0x00000020 /* Set wlan ha/fa roaming
     34                                                           model */
     35 #define BCM_TUNNEL_TERM_TUNNEL_WITH_ID      0x00000040 /* Create tunnel with ID */
     36 #define BCM_TUNNEL_INIT_USE_INNER_DF        0x00000080 /* Copy DF from inner
     37                                                           header. Note:flag
     38                                                           takes precedence over
     39                                                           ipv4_set_df flag. */
     40 #define BCM_TUNNEL_INIT_IPV4_SET_DF         0x00000100 /* Set DF bit in outer
     41                                                           header if inner header
     42                                                           is IPv4. */
     43 #define BCM_TUNNEL_INIT_IPV6_SET_DF         0x00000200 /* Set DF bit in outer
     44                                                           header if inner header
     45                                                           is IPv6. */
     46 #define BCM_TUNNEL_INIT_IP4_ID_SET_FIXED    0x00000400 /* Use fixed starting ID
     47                                                           for IPv4 tunnel */
     48 #define BCM_TUNNEL_INIT_IP4_ID_SET_RANDOM   0x00000800 /* Use random starting ID
     49                                                           for IPv4 tunnel */
     50 #define BCM_TUNNEL_INIT_WLAN_MTU            0x00001000 /* Set MTU for outgoing
     51                                                           WLAN tunnel */
     52 #define BCM_TUNNEL_INIT_WLAN_FRAG_ENABLE    0x00002000 /* Enable Fragmentation
     53                                                           for WLAN Tunnel */
     54 #define BCM_TUNNEL_INIT_WLAN_VLAN_TAGGED    0x00004000 /* Set outgoing WLAN
     55                                                           tunnel vlan */
     56 #define BCM_TUNNEL_INIT_WLAN_TUNNEL_WITH_ID 0x00008000 /* Create outgoing tunnel
     57                                                           with ID */
     58 #define BCM_TUNNEL_REPLACE                  0x00010000 /* Update existing
     59                                                           tunnel. */
     60 #define BCM_TUNNEL_TERM_ETHERNET            0x00020000 /*  Terminate Ethernet
     61                                                           header after
     62                                                           terminated IP. */
     63 #define BCM_TUNNEL_TERM_UDP_CHECKSUM_ENABLE 0x00040000 /* Drop pkts with
     64                                                           non-zero UDP checksum. */
     65 #define BCM_TUNNEL_WITH_ID                  0x00080000 /* Add using the
     66                                                           specified ID. */
     67 #define BCM_TUNNEL_TERM_TUNNEL_DEACTIVATE   0x00100000 /* Use to deactivate
     68                                                           tunnel terminator. */
     69 #define BCM_TUNNEL_TERM_WIDE                0x00200000 /* Use to create tuunel
     70                                                           terminator wide mode. */
     71 #define BCM_TUNNEL_TERM_USE_OUTER_PCP       0x00400000 /* Use outer header PCP. */
     72 #define BCM_TUNNEL_TERM_USE_TUNNEL_CLASS    0x00800000 /* Use tunnel class. */
     73 #define BCM_TUNNEL_INIT_GRE_KEY_USE_LB      0x01000000 /* GRE key presented and
     74                                                           include LB key, used
     75                                                           with bcmTunnelTypeGRE
     76                                                           tunnel types. */
     77 #define BCM_TUNNEL_TERM_ECN_MAP             0x02000000 /* Use to set tunnel
     78                                                           termination ecn map
     79                                                           id. */
     80 #define BCM_TUNNEL_INIT_USE_OUTER_TTL       BCM_TUNNEL_TERM_USE_OUTER_TTL /* Use outer header TTL. */
     81 #define BCM_TUNNEL_INIT_WIDE                0x08000000 /* Use to create tunnel
     82                                                           encapsulation wide
     83                                                           mode. */
     84 #define BCM_TUNNEL_TERM_BUD                 0x10000000 /* Use to create tunnel
     85                                                           termination for BUD
     86                                                           node. */
     87 #define BCM_TUNNEL_INIT_ERSPAN_TYPE3        0x20000000 /* Use to create ERSPANv3
     88                                                           tunnel. */
     89 #define BCM_TUNNEL_TERM_STAT_ENABLE         0x40000000 /* Enable statistics. */
     90 #define BCM_TUNNEL_INIT_STAT_ENABLE         0x80000000 /* Enable statistics. */
     91 #define BCM_TUNNEL_INIT_GRE_WITH_SN         BCM_TUNNEL_TERM_ETHERNET /*  GRE8 with Sequence
     92                                                           Number, used with
     93                                                           bcmTunnelTypeGreAnyIn4
     94                                                           tunnel type. */
     95 
     96 #define BCM_TUNNEL_INIT_SET_DF  \
     97     (BCM_TUNNEL_INIT_IPV6_SET_DF | \
     98      BCM_TUNNEL_INIT_IPV4_SET_DF) 
     99 
    100 /* Tunnel types. */
    101 typedef enum bcm_tunnel_type_e {
    102     bcmTunnelTypeNone = 0,              /* Disable IP tunneling on specific
    103                                            interface. */
    104     bcmTunnelTypeIp4In4 = 1,            /* RFC 2003/2893: IPv4-in-IPv4 tunnel. */
    105     bcmTunnelTypeIp6In4 = 2,            /* RFC 2003/2893: IPv6-in-IPv4 tunnel. */
    106     bcmTunnelTypeIpAnyIn4 = 3,          /* RFC 2003/2893: IPv6/4-in-IPv4 tunnel. */
    107     bcmTunnelTypeIp4In6 = 4,            /* RFC 2003/2893: IPv4-in-IPv6 tunnel. */
    108     bcmTunnelTypeIp6In6 = 5,            /* RFC 2003/2893: IPv6-in-IPv6 tunnel. */
    109     bcmTunnelTypeIpAnyIn6 = 6,          /* RFC 2003/2893: IPv6/4-in-IPv6 tunnel. */
    110     bcmTunnelTypeGre4In4 = 7,           /* RFC 1701/2784/2890: GRE IPv4-in-IPv4
    111                                            tunnel. */
    112     bcmTunnelTypeGre6In4 = 8,           /* RFC 1701/2784/2890: GRE IPv6-in-IPv4
    113                                            tunnel. */
    114     bcmTunnelTypeGreAnyIn4 = 9,         /* RFC 1701/2784/2890: GRE
    115                                            IPv6/4-in-IPv4 tunnel. */
    116     bcmTunnelTypeGre4In6 = 10,          /* RFC 1701/2784/2890: GRE IPv4-in-IPv6
    117                                            tunnel. */
    118     bcmTunnelTypeGre6In6 = 11,          /* RFC 1701/2784/2890: GRE IPv6-in-IPv6
    119                                            tunnel. */
    120     bcmTunnelTypeGreAnyIn6 = 12,        /* RFC 1701/2784/2890: GRE
    121                                            IPv6/4-in-IPv6 tunnel. */
    122     bcmTunnelTypeIsatap = 13,           /* RFC 4214: Intra-Site Automatic Tunnel
    123                                            Addressing Protocol. */
    124     bcmTunnelType6In4Uncheck = 14,      /* RFC 3056: Configured connection of
    125                                            IPv6 Domains via IPv4. */
    126     bcmTunnelType6In4 = 15,             /* RFC 3964: Checked 6to4 tunnel if
    127                                            supported by device otherwise
    128                                            unchecked 6to4 tunnel. */
    129     bcmTunnelTypeMpls = 16,             /* RFC 3031: MPLS tunneling. */
    130     bcmTunnelTypeUdp = 17,              /* UDP tunneling */
    131     bcmTunnelTypePimSmDr1 = 18,         /* Broadcom PIM SM Tunnel */
    132     bcmTunnelTypePimSmDr2 = 19,         /* Broadcom PIM SM Tunnel */
    133     bcmTunnelTypePim6SmDr1 = 20,        /* Broadcom PIM6 SM Tunnel */
    134     bcmTunnelTypePim6SmDr2 = 21,        /* Broadcom PIM6 SM Tunnel */
    135     bcmTunnelTypeWlanWtpToAc = 22,      /* IPv4 WLAN WTP to AC tunnel */
    136     bcmTunnelTypeWlanAcToAc = 23,       /* IPv4 WLAN AC to AC tunnel */
    137     bcmTunnelTypeWlanWtpToAc6 = 24,     /* IPv6 WLAN WTP to AC tunnel */
    138     bcmTunnelTypeWlanAcToAc6 = 25,      /* IPv6 WLAN AC to AC tunnel */
    139     bcmTunnelTypeAutoMulticast = 26,    /* IPV4
    140                                            draft-ietf-mboned-auto-multicast-09:
    141                                            AMT */
    142     bcmTunnelTypeAutoMulticast6 = 27,   /* IPV6
    143                                            draft-ietf-mboned-auto-multicast-09:
    144                                            AMT */
    145     bcmTunnelTypeEtherIp4In4 = 28,      /* EoIP - Fixed encapsulation (2B) */
    146     bcmTunnelTypeL2Gre = 29,            /* L2-GRE Tunnel */
    147     bcmTunnelTypeVxlan = 30,            /* VXLAN Tunnel */
    148     bcmTunnelTypeErspan = 31,           /* Erspan tunnel */
    149     bcmTunnelTypeRspan = 32,            /* Rspan tunnel */
    150     bcmTunnelTypeL2EncapExternalCpu = 33, /* External CPU L2 tunnel */
    151     bcmTunnelTypeL2Flex = 34,           /* Flex L2 tunnel, Flow API only */
    152     bcmTunnelTypeL3Flex = 35,           /* Flex L3 tunnel, Flow API only */
    153     bcmTunnelTypeFlex = 36,             /* Flex Generic tunnel, Flow API only */
    154     bcmTunnelTypeLawfulInterception = 37, /* Lawful Interception tunnel */
    155     bcmTunnelTypeVxlan6 = 38,           /* VXLAN Tunnel */
    156     bcmTunnelTypeL2SrcEncap = 39,       /* L2 Source Mac Encapsulation */
    157     bcmTunnelTypeRoeIn4 = 40,           /* ROE frame Tunnel in IPv4 Header */
    158     bcmTunnelTypeRoeIn6 = 41,           /* ROE Frame Tunnel in IPv6 Header */
    159     bcmTunnelTypeUdp6 = 42,             /* Udp Tunnel */
    160     bcmTunnelTypeVxlanGpe = 43,         /* VXLAN GPE Tunnel */
    161     bcmTunnelTypeVxlan6Gpe = 44,        /* VXLAN GPE Tunnel */
    162     bcmTunnelTypeSR6 = 45,              /* SRv6 Tunnel */
    163     bcmTunnelTypeRspanAdvanced = 46,    /* RSPAN Advanced Tunnel */
    164     bcmTunnelTypeCount = 47             /* Must be last */
    165 } bcm_tunnel_type_t;
    166 
    167 #define BCM_TUNNEL_TYPE_STR \
    168     "None", \
    169     "Ip4In4", \
    170     "Ip6In4", \
    171     "IpAnyIn4", \
    172     "Ip4In6", \
    173     "Ip6In6", \
    174     "IpAnyIn6", \
    175     "Gre4In4", \
    176     "Gre6In4", \
    177     "GreAnyIn4", \
    178     "Gre4In6", \
    179     "Gre6In6", \
    180     "GreAnyIn6", \
    181     "Isatap", \
    182     "6In4Uncheck", \
    183     "6In4", \
    184     "Mpls", \
    185     "Udp", \
    186     "PimSmDr1", \
    187     "PimSmDr2", \
    188     "Pim6SmDr1", \
    189     "Pim6SmDr2", \
    190     "WlanWtpToAc", \
    191     "WlanAcToAc", \
    192     "WlanWtpToAc6", \
    193     "WlanAcToAc6", \
    194     "AutoMulticast", \
    195     "AutoMulticast6", \
    196     "EtherIp4In4", \
    197     "L2Gre", \
    198     "Vxlan", \
    199     "Erspan", \
    200     "Rspan", \
    201     "L2EncapExternalCpu", \
    202     "L2Flex", \
    203     "L3Flex", \
    204     "Flex", \
    205     "LawfulInterception", \
    206     "Vxlan6", \
    207     "L2SrcEncap", \
    208     "RoeIn4", \
    209     "RoeIn6", \
    210     "Udp6", \
    211     "VxlanGpe", \
    212     "Vxlan6Gpe", \
    213     "SR6", \
    214     "RspanAdvanced" 
    215 
    216 /* L3 tunneling terminator. */
    217 typedef struct bcm_tunnel_terminator_s {
    218     uint32 flags;                       /* Configuration flags. */
    219     uint32 multicast_flag;              /* VXLAN Multicast trigger flags. */
    220     bcm_vrf_t vrf;                      /* Virtual router instance. */
    221     bcm_ip_t sip;                       /* SIP for tunnel header match. */
    222     bcm_ip_t dip;                       /* DIP for tunnel header match. */
    223     bcm_ip_t sip_mask;                  /* Source IP mask. */
    224     bcm_ip_t dip_mask;                  /* Destination IP mask. */
    225     bcm_ip6_t sip6;                     /* SIP for tunnel header match (IPv6). */
    226     bcm_ip6_t dip6;                     /* DIP for tunnel header match (IPv6). */
    227     bcm_ip6_t sip6_mask;                /* Source IP mask (IPv6). */
    228     bcm_ip6_t dip6_mask;                /* Destination IP mask (IPv6). */
    229     uint32 udp_dst_port;                /* UDP dst port for UDP packets. */
    230     uint32 udp_src_port;                /* UDP src port for UDP packets */
    231     bcm_tunnel_type_t type;             /* Tunnel type */
    232     bcm_pbmp_t pbmp;                    /* Port bitmap for this tunnel */
    233     bcm_vlan_t vlan;                    /* The VLAN ID for IPMC lookup or WLAN
    234                                            tunnel */
    235     bcm_vlan_t fwd_vlan;                /* VLAN ID for forwarding terminated IP
    236                                            Tunnel */
    237     bcm_gport_t remote_port;            /* Remote termination */
    238     bcm_gport_t tunnel_id;              /* Tunnel id */
    239     int if_class;                       /* L3 interface class this tunnel. */
    240     bcm_multicast_t failover_mc_group;  /* MC group used for bi-cast. */
    241     bcm_failover_t ingress_failover_id; /* 1+1 protection. */
    242     bcm_failover_t failover_id;         /* Failover Object Identifier for
    243                                            protected tunnel. */
    244     bcm_gport_t failover_tunnel_id;     /* Failover Tunnel ID. */
    245     bcm_if_t tunnel_if;                 /* hierarchical interface. */
    246     int tunnel_class;                   /* Tunnel class id for VFP match. */
    247     int qos_map_id;                     /* QoS DSCP map this tunnel. */
    248     int inlif_counting_profile;         /* In LIF counting profile */
    249     int tunnel_term_ecn_map_id;         /* Tunnel termination ecn map id. */
    250     bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos and ttl model */
    251     int priority;                       /* Entry priority. */
    252 } bcm_tunnel_terminator_t;
    253 
    254 /* bcm_tunnel_dscp_select_e */
    255 typedef enum bcm_tunnel_dscp_select_e {
    256     bcmTunnelDscpAssign = 0,    /* Set outer IP header DSCP to tunnel initiator
    257                                    DSCP value. */
    258     bcmTunnelDscpPacket = 1,    /* Copy packet DSCP to outer header. */
    259     bcmTunnelDscpMap = 2,       /* Use DSCP value from DSCP map. */
    260     bcmTunnelDscpCount = 3      /* Unused always last. */
    261 } bcm_tunnel_dscp_select_t;
    262 
    263 /* L3 tunneling initiator. */
    264 typedef struct bcm_tunnel_initiator_s {
    265     uint32 flags;                       /* Configuration flags. */
    266     bcm_tunnel_type_t type;             /* Tunnel type. */
    267     int ttl;                            /* Tunnel header TTL. */
    268     bcm_mac_t dmac;                     /* Destination MAC address. */
    269     bcm_ip_t dip;                       /* Tunnel header DIP (IPv4). */
    270     bcm_ip_t sip;                       /* Tunnel header SIP (IPv4). */
    271     bcm_ip6_t sip6;                     /* Tunnel header SIP (IPv6). */
    272     bcm_ip6_t dip6;                     /* Tunnel header DIP (IPv6). */
    273     uint32 flow_label;                  /* Tunnel header flow label (IPv6). */
    274     bcm_tunnel_dscp_select_t dscp_sel;  /* Tunnel header DSCP select. */
    275     int dscp;                           /* Tunnel header DSCP value. */
    276     int dscp_map;                       /* DSCP-map ID. */
    277     bcm_gport_t tunnel_id;              /* Tunnel ID */
    278     uint16 udp_dst_port;                /* Destination UDP port */
    279     uint16 udp_src_port;                /* Source UDP port */
    280     bcm_mac_t smac;                     /* WLAN outer MAC */
    281     int mtu;                            /* WLAN MTU */
    282     bcm_vlan_t vlan;                    /* Tunnel VLAN */
    283     uint16 tpid;                        /* Tunnel TPID */
    284     uint8 pkt_pri;                      /* Tunnel priority */
    285     uint8 pkt_cfi;                      /* Tunnel CFI */
    286     uint16 ip4_id;                      /* IPv4 ID. */
    287     bcm_if_t l3_intf_id;                /* l3 Interface ID. */
    288     uint16 span_id;                     /* Erspan Span ID. */
    289     uint32 aux_data;                    /* Tunnel associated data. */
    290     int outlif_counting_profile;        /* Out LIF counting profile */
    291     bcm_encap_access_t encap_access;    /* Encapsulation Access stage */
    292     uint8 hw_id;                        /* Unique identifier of an ERSPAN engine
    293                                            within a system */
    294     uint16 switch_id;                   /* Identifies a source switch at the
    295                                            receiving end */
    296     uint16 class_id;                    /* Class ID of the RSPAN advanced tunnel */
    297     bcm_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */
    298     int qos_map_id;                     /* general remark profile */
    299 } bcm_tunnel_initiator_t;
    300 
    301 /* L3 Tunnel Configuration Structure. */
    302 typedef struct bcm_tunnel_config_s {
    303     int ip4_id;             /* Global ID. */
    304     uint32 ms_pimsm_hdr1;   /* Most significant 32 bits of PIMSM-DR1 header */
    305     uint32 ls_pimsm_hdr1;   /* Least significant 32 bits of PIMSM-DR1 header. */
    306     uint32 ms_pimsm_hdr2;   /* Most significant 32 bits of PIMSM-DR2 header. */
    307     uint32 ls_pimsm_hdr2;   /* Least significant 32 bits of PIMSM-DR2 header. */
    308 } bcm_tunnel_config_t;
    309 
    310 /* Tunnel DSCP Map Structure. */
    311 typedef struct bcm_tunnel_dscp_map_s {
    312     int priority;       /* Internal priority. */
    313     bcm_color_t color;  /* Color. */
    314     int dscp;           /* DSCP value. */
    315 } bcm_tunnel_dscp_map_t;
    316 
    317 /* tunnel_terminator_config_key */
    318 typedef struct bcm_tunnel_terminator_config_key_s {
    319     uint32 flags;           /*  Configuration flags. */
    320     bcm_ip_t dip;           /*  DIP for tunnel header match. */
    321     bcm_ip_t dip_mask;      /*  Destination IP mask. */
    322     bcm_ip6_t dip6;         /*  DIP(IPv6) for tunnel header match. */
    323     bcm_ip6_t dip6_mask;    /*  Destination IP mask (IPv6). */
    324     bcm_tunnel_type_t type; /*  Tunnel type. */
    325     uint16 udp_dst_port;    /* Destination UDP port */
    326     bcm_vrf_t vrf;          /* Virtual router instance. */
    327 } bcm_tunnel_terminator_config_key_t;
    328 
    329 /* tunnel_terminator_config_action */
    330 typedef struct bcm_tunnel_terminator_config_action_s {
    331     int tunnel_class;   /* Tunnel class id for VTEP match. */
    332 } bcm_tunnel_terminator_config_action_t;
    333 
    334 /* bcm_tunnel_initiator_traverse_cb */
    335 typedef int (*bcm_tunnel_initiator_traverse_cb)(
    336     int unit, 
    337     bcm_tunnel_initiator_t *info, 
    338     void *user_data);
    339 
    340 /* bcm_tunnel_terminator_traverse_cb */
    341 typedef int (*bcm_tunnel_terminator_traverse_cb)(
    342     int unit, 
    343     bcm_tunnel_terminator_t *info, 
    344     void *user_data);
    345 
    346 /* bcm_tunnel_terminator_config_traverse_cb */
    347 typedef int (*bcm_tunnel_terminator_config_traverse_cb)(
    348     int unit, 
    349     bcm_tunnel_terminator_config_key_t *info, 
    350     void *user_data);
    351 
    352 #ifndef BCM_HIDE_DISPATCHABLE
    353 
    354 /* Set the tunneling initiator parameters on an L3 interface. */
    355 extern int bcm_tunnel_initiator_set(
    356     int unit, 
    357     bcm_l3_intf_t *intf, 
    358     bcm_tunnel_initiator_t *tunnel);
    359 
    360 /* Set the tunneling initiator parameters on an L3 interface. */
    361 extern int bcm_tunnel_initiator_create(
    362     int unit, 
    363     bcm_l3_intf_t *intf, 
    364     bcm_tunnel_initiator_t *tunnel);
    365 
    366 /* Delete the tunnel association for the given L3 interface. */
    367 extern int bcm_tunnel_initiator_clear(
    368     int unit, 
    369     bcm_l3_intf_t *intf);
    370 
    371 /* Get the tunnel property for the given L3 interface. */
    372 extern int bcm_tunnel_initiator_get(
    373     int unit, 
    374     bcm_l3_intf_t *intf, 
    375     bcm_tunnel_initiator_t *tunnel);
    376 
    377 /* Traverse Tunnel Initiator Info */
    378 extern int bcm_tunnel_initiator_traverse(
    379     int unit, 
    380     bcm_tunnel_initiator_traverse_cb cb, 
    381     void *user_data);
    382 
    383 /* Add a tunnel terminator for DIP-SIP key. */
    384 extern int bcm_tunnel_terminator_add(
    385     int unit, 
    386     bcm_tunnel_terminator_t *info);
    387 
    388 /* Add a tunnel terminator for DIP-SIP key. */
    389 extern int bcm_tunnel_terminator_create(
    390     int unit, 
    391     bcm_tunnel_terminator_t *info);
    392 
    393 /* Delete a tunnel terminator for DIP-SIP key. */
    394 extern int bcm_tunnel_terminator_delete(
    395     int unit, 
    396     bcm_tunnel_terminator_t *info);
    397 
    398 /* Update a tunnel terminator for DIP-SIP key. */
    399 extern int bcm_tunnel_terminator_update(
    400     int unit, 
    401     bcm_tunnel_terminator_t *info);
    402 
    403 /* Get a tunnel terminator for DIP-SIP key. */
    404 extern int bcm_tunnel_terminator_get(
    405     int unit, 
    406     bcm_tunnel_terminator_t *info);
    407 
    408 /* Traverse Tunnel Terminator Info */
    409 extern int bcm_tunnel_terminator_traverse(
    410     int unit, 
    411     bcm_tunnel_terminator_traverse_cb cb, 
    412     void *user_data);
    413 
    414 /* Traverse Tunnel Terminator Info */
    415 extern int bcm_tunnel_terminator_config_traverse(
    416     int unit, 
    417     bcm_tunnel_terminator_config_traverse_cb cb, 
    418     void *user_data);
    419 
    420 /* Set the valid payload VLANs for this WLAN tunnel. */
    421 extern int bcm_tunnel_terminator_vlan_set(
    422     int unit, 
    423     bcm_gport_t tunnel, 
    424     bcm_vlan_vector_t vlan_vec);
    425 
    426 /* Get the valid payload VLANs for this WLAN tunnel. */
    427 extern int bcm_tunnel_terminator_vlan_get(
    428     int unit, 
    429     bcm_gport_t tunnel, 
    430     bcm_vlan_vector_t *vlan_vec);
    431 
    432 /* Create a tunnel DSCP map instance. */
    433 extern int bcm_tunnel_dscp_map_create(
    434     int unit, 
    435     uint32 flags, 
    436     int *dscp_map_id);
    437 
    438 /* Destroy a tunnel DSCP map instance. */
    439 extern int bcm_tunnel_dscp_map_destroy(
    440     int unit, 
    441     int dscp_map_id);
    442 
    443 /* 
    444  * Get the { internal priority, color }-to-DSCP mapping in the specified
    445  * DSCP map.
    446  */
    447 extern int bcm_tunnel_dscp_map_get(
    448     int unit, 
    449     int dscp_map_id, 
    450     bcm_tunnel_dscp_map_t *dscp_map);
    451 
    452 /* 
    453  * Set the { internal priority, color }-to-DSCP mapping in the specified
    454  * DSCP map.
    455  */
    456 extern int bcm_tunnel_dscp_map_set(
    457     int unit, 
    458     int dscp_map_id, 
    459     bcm_tunnel_dscp_map_t *dscp_map);
    460 
    461 /* Set port egress { internal priority, color }-to-DSCP mapping. */
    462 extern int bcm_tunnel_dscp_map_port_set(
    463     int unit, 
    464     bcm_port_t port, 
    465     bcm_tunnel_dscp_map_t *dscp_map);
    466 
    467 /* Get port egress { internal priority, color }-to-DSCP mapping. */
    468 extern int bcm_tunnel_dscp_map_port_get(
    469     int unit, 
    470     bcm_port_t port, 
    471     bcm_tunnel_dscp_map_t *dscp_map);
    472 
    473 /* Set or get the global chip tunneling configuration. */
    474 extern int bcm_tunnel_config_get(
    475     int unit, 
    476     bcm_tunnel_config_t *tconfig);
    477 
    478 /* Set or get the global chip tunneling configuration. */
    479 extern int bcm_tunnel_config_set(
    480     int unit, 
    481     bcm_tunnel_config_t *tconfig);
    482 
    483 #endif /* BCM_HIDE_DISPATCHABLE */
    484 
    485 /* Initialize a bcm_tunnel_initiator_t/bcmx_tunnel_initiator_t structure. */
    486 extern void bcm_tunnel_initiator_t_init(
    487     bcm_tunnel_initiator_t *tunnel_init);
    488 
    489 /* 
    490  * Initialize a bcm_tunnel_terminator_t/bcmx_tunnel_terminator_t
    491  * structure.
    492  */
    493 extern void bcm_tunnel_terminator_t_init(
    494     bcm_tunnel_terminator_t *tunnel_term);
    495 
    496 /* Initialize a bcm_tunnel_config_t/bcmx_tunnel_config_t structure. */
    497 extern void bcm_tunnel_config_t_init(
    498     bcm_tunnel_config_t *tconfig);
    499 
    500 /* Initialize a L3 tunnel bcm_tunnel_dscp_map_t structure. */
    501 extern void bcm_tunnel_dscp_map_t_init(
    502     bcm_tunnel_dscp_map_t *dscp_info);
    503 
    504 /* 
    505  * Initialize a tunnel L3 tunnel bcm_tunnel_terminator_config_key_t
    506  * structure.
    507  */
    508 extern void bcm_tunnel_terminator_config_key_t_init(
    509     bcm_tunnel_terminator_config_key_t *config_key);
    510 
    511 /* 
    512  * Initialize a tunnel L3 tunnel bcm_tunnel_terminator_config_action_t
    513  * structure.
    514  */
    515 extern void bcm_tunnel_terminator_config_action_t_init(
    516     bcm_tunnel_terminator_config_action_t *config_action);
    517 
    518 #ifndef BCM_HIDE_DISPATCHABLE
    519 
    520 /* Add tunnel terminator config entries. */
    521 extern int bcm_tunnel_terminator_config_add(
    522     int unit, 
    523     uint32 flags, 
    524     bcm_tunnel_terminator_config_key_t *config_key, 
    525     bcm_tunnel_terminator_config_action_t *config_action);
    526 
    527 /* Get tunnel terminator config entries. */
    528 extern int bcm_tunnel_terminator_config_get(
    529     int unit, 
    530     bcm_tunnel_terminator_config_key_t *config_key, 
    531     bcm_tunnel_terminator_config_action_t *config_action);
    532 
    533 /* Delete tunnel terminator config entries. */
    534 extern int bcm_tunnel_terminator_config_delete(
    535     int unit, 
    536     bcm_tunnel_terminator_config_key_t *config_key);
    537 
    538 #endif /* defined(INCLUDE_L3) */
    539 
    540 #endif /* BCM_HIDE_DISPATCHABLE */
    541 
    542 #endif /* __BCM_TUNNEL_H__ */