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

mpls_lm_dm.h (4800B)


      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-2019 Broadcom Inc. All rights reserved.
      7  */
      8 #ifndef __BCM_INT_ESW_MPLS_LM_DM_H__
      9 #define __BCM_INT_ESW_MPLS_LM_DM_H__
     10 #if defined(INCLUDE_MPLS_LM_DM)
     11 
     12 #include <soc/uc_msg.h>
     13 #include <soc/shared/mos_msg_common.h>
     14 #include <soc/shared/mpls_lm_dm_pkt.h>
     15 #include <soc/shared/mpls_lm_dm_msg.h>
     16 #include <soc/shared/mpls_lm_dm_pack.h>
     17 
     18 #include <bcm_int/common/rx.h>
     19 
     20 #if defined(BCM_TRIUMPH_SUPPORT)
     21 #include <bcm_int/esw/triumph.h>
     22 #endif /* BCM_TRIUMPH_SUPPORT */
     23 
     24 /*
     25  * MPLS_LM_DM Encapsulation Definitions
     26  *
     27  * Defines for building the MPLS_LM_DM packet encapsulation
     28  */
     29 
     30 #define MPLS_LM_DM_THREAD_PRI_DFLT           200
     31 #define MPLS_LMDM_EVENT_THREAD_PRIORITY      200
     32 
     33 #define _MPLS_LM_DM_UC_MSG_TIMEOUT_USECS    5000000 /* 5 sec for FW response */
     34 
     35 /*
     36  * MPLS_LM_DM Encapsulation Format Header flags
     37  *
     38  * Indicates the type of headers/labels present in a MPLS_LM_DM packet.
     39  * Bottom 4 bits are reserved to indicate the GACH Type (A-E)
     40  */
     41 /* ACH type Mask */
     42 #define _MPLS_LM_DM_ACH_TYPE_MASK                     0x000F
     43 
     44 #define _MPLS_LM_DM_ENCAP_PKT_MPLS_LSP                (1 << 4) 
     45 #define _MPLS_LM_DM_ENCAP_PKT_MPLS_ROUTER_ALERT       (1 << 5) 
     46 #define _MPLS_LM_DM_ENCAP_PKT_MPLS_BOTTOM             (1 << 6) 
     47 #define _MPLS_LM_DM_ENCAP_PKT_PW                      (1 << 7) 
     48 #define _MPLS_LM_DM_ENCAP_PKT_GAL                     (1 << 8) 
     49 #define _MPLS_LM_DM_ENCAP_PKT_G_ACH                   (1 << 9)
     50 
     51 
     52 #define _MPLS_LM_DM_MPLS_DFLT_TTL      16
     53 
     54 #ifndef INCLUDE_BHH
     55 /* ACH - Associated Channel Header */
     56 typedef struct _ach_header_s {
     57     uint8   f_nibble;        /*  4: First nibble, must be 1 */
     58     uint8   version;         /*  4: Version */
     59     uint8   reserved;        /*  8: Reserved */
     60     uint16  channel_type;    /* 16: Channel Type */
     61 } _ach_header_t;
     62 
     63 /* MPLS - Multiprotocol Label Switching Label */
     64 typedef struct _mpls_label_s {
     65     uint32  label;    /* 20: Label */
     66     uint8   exp;      /*  3: Experimental, Traffic Class, ECN */
     67     uint8   s;        /*  1: Bottom of Stack */
     68     uint8   ttl;      /*  8: Time to Live */
     69 } _mpls_label_t;
     70 
     71 /* VLAN Tag - 802.1Q */
     72 typedef struct _vlan_tag_s {
     73     uint16      tpid;    /* 16: Tag Protocol Identifier */
     74     struct {
     75         uint8   prio;    /*  3: Priority Code Point */
     76         uint8   cfi;     /*  1: Canonical Format Indicator */
     77         uint16  vid;     /* 12: Vlan Identifier */
     78     } tci;               /* Tag Control Identifier */
     79 } _vlan_tag_t;
     80 
     81 /* L2 Header */
     82 typedef struct _l2_header_t {
     83     bcm_mac_t    dst_mac;           /* 48: Destination MAC */
     84     bcm_mac_t    src_mac;           /* 48: Source MAC */
     85     _vlan_tag_t  vlan_tag;          /* VLAN Tag */
     86     _vlan_tag_t  vlan_tag_inner;    /* VLAN Tag */
     87     uint16       etype;             /* 16: Ether Type */
     88 } _l2_header_t;
     89 #endif /* !INCLUDE_BHH */
     90 
     91 /*
     92  * Typedef:
     93  *     _bcm_fp_oam_mpls_lm_dm_ep_data_s
     94  * Purpose:
     95  *     MPLS LM/DM EP data structure.
     96  */
     97 typedef struct _bcm_fp_oam_mpls_lm_dm_ep_data_s {
     98     uint8                      in_use;
     99     bcm_oam_endpoint_t         id;
    100     uint32                     flags;
    101     bcm_oam_endpoint_type_t    type;
    102     bcm_oam_vccv_type_t        vccv_type;
    103     bcm_gport_t                gport;
    104     bcm_gport_t                tx_gport;
    105     uint8                      trunk_index;
    106     bcm_mac_t                  dst_mac;
    107     bcm_mac_t                  src_mac;
    108     bcm_vlan_t                 outer_vlan;
    109     uint16                     outer_tpid;
    110     uint8                      outer_pri;
    111     bcm_vlan_t                 inner_vlan;
    112     uint16                     inner_tpid;
    113     uint8                      inner_pri;
    114     bcm_mpls_label_t           egress_label;
    115     bcm_if_t                   intf_id;
    116     bcm_vpn_t                  vpn;
    117     uint8                      lm_exp;
    118     bcm_cos_t                  lm_int_pri;
    119     uint32                     lm_ctr_base_id[BCM_OAM_LM_COUNTER_MAX];
    120     uint8                      lm_ctr_offset[BCM_OAM_LM_COUNTER_MAX];
    121     uint8                      lm_ctr_action[BCM_OAM_LM_COUNTER_MAX];
    122     uint8                      lm_ctr_size;
    123     uint8                      dm_exp;
    124     bcm_cos_t                  dm_int_pri;
    125     uint32                     dm_ctr_base_id[BCM_OAM_LM_COUNTER_MAX];
    126     uint8                      dm_ctr_offset[BCM_OAM_LM_COUNTER_MAX];
    127     uint8                      dm_ctr_size;
    128     uint32                     session_id;
    129     uint8                      session_num_entries;
    130     uint16                     hw_base_session_id;
    131     bcm_oam_pm_profile_t       pm_profile;
    132 } _bcm_fp_oam_mpls_lm_dm_ep_data_t;
    133 
    134 #endif /* INCLUDE_MPLS_LM_DM */
    135 #endif /* __BCM_INT_ESW_MPLS_LM_DM_H__ */