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

compat_6511.h (7157B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * RPC Compatibility with sdk-6.5.11 routines
      8  */
      9 
     10 #ifndef _COMPAT_6511_H_
     11 #define _COMPAT_6511_H_
     12 
     13 #ifdef  BCM_RPC_SUPPORT
     14 #include <bcm/types.h>
     15 #include <bcm/cosq.h>
     16 #include <bcm/pkt.h>
     17 
     18 #define BCM_COMPAT6511_COSQ_PFC_GPORT_COUNT   16
     19 /* PFC mapping array type. */
     20 typedef struct bcm_compat6511_cosq_pfc_class_mapping_s {
     21     int class_id;                                       /* class id */  
     22     bcm_gport_t gport_list[BCM_COMPAT6511_COSQ_PFC_GPORT_COUNT];   /* mapped cosqs */
     23 } bcm_compat6511_cosq_pfc_class_mapping_t;
     24 
     25 /* Set mapping of PFC class to COSQs */
     26 extern int bcm_compat6511_cosq_pfc_class_mapping_set(
     27         int unit, 
     28         bcm_gport_t port,
     29         int array_count,
     30         bcm_compat6511_cosq_pfc_class_mapping_t *mapping_array);
     31 
     32 /* Get mapping of PFC class to COSQs */
     33 extern int bcm_compat6511_cosq_pfc_class_mapping_get(
     34         int unit, 
     35         bcm_gport_t port,
     36         int array_max,
     37         bcm_compat6511_cosq_pfc_class_mapping_t *mapping_array,
     38         int *array_count);
     39 
     40 /*
     41  * Mirror destination Structure
     42  *
     43  * Contains information required for manipulating mirror destinations.
     44  */
     45 typedef struct bcm_compat6511_mirror_destination_s {
     46     bcm_gport_t mirror_dest_id;         /* Unique mirror destination and
     47                                            encapsulation identifier. */
     48     uint32 flags;                       /* See BCM_MIRROR_DEST_xxx flag
     49                                            definitions. */
     50     bcm_gport_t gport;                  /* Mirror destination. */
     51     uint8 version;                      /* IP header version. */
     52     uint8 tos;                          /* Traffic Class/Tos byte. */
     53     uint8 ttl;                          /* Hop limit. */
     54     bcm_ip_t src_addr;                  /* Tunnel source ip address (IPv4). */
     55     bcm_ip_t dst_addr;                  /* Tunnel destination ip address (IPv4). */
     56     bcm_ip6_t src6_addr;                /* Tunnel source ip address (IPv6). */
     57     bcm_ip6_t dst6_addr;                /* Tunnel destination ip address (IPv6). */
     58     uint32 flow_label;                  /* IPv6 header flow label field. */
     59     bcm_mac_t src_mac;                  /* L2 source mac address. */
     60     bcm_mac_t dst_mac;                  /* L2 destination mac address. */
     61     uint16 tpid;                        /* L2 header outer TPID. */
     62     bcm_vlan_t vlan_id;                 /* Vlan id. */
     63     bcm_trill_name_t trill_src_name;    /* TRILL source bridge nickname */
     64     bcm_trill_name_t trill_dst_name;    /* TRILL destination bridge nickname */
     65 
     66     int trill_hopcount;                 /* TRILL hop count */
     67     uint16 niv_src_vif;                 /* Source Virtual Interface of NIV tag */
     68     uint16 niv_dst_vif;                 /* Destination Virtual Interface of NIV
     69                                            tag */
     70     uint32 niv_flags;                   /* NIV flags BCM_MIRROR_NIV_XXX */
     71     uint16 gre_protocol;                /* L3 GRE header protocol */
     72     bcm_policer_t policer_id;           /* policer_id */
     73     int stat_id;                        /* stat_id */
     74     int stat_id2;                       /* stat_id2 for second counter pointer */
     75     bcm_if_t encap_id;                  /* Encapsulation index */
     76     bcm_if_t tunnel_id;                 /* IP tunnel for encapsulation. Valid
     77                                            only if BCM_MIRROR_DEST_TUNNEL_IP_GRE
     78                                            is set */
     79     uint16 span_id;                     /* SPAN-ID. Valid only if
     80                                            BCM_MIRROR_DEST_TUNNEL_WITH_SPAN_ID
     81                                            is set */
     82     uint8 pkt_prio;                     /* L2 header PCP */
     83     uint32 sample_rate_dividend;        /* The probability of mirroring a packet
     84                                            is: sample_rate_dividend >=
     85                                            sample_rate_divisor ? 1 :
     86                                            sample_rate_dividend /
     87                                            sample_rate_divisor */
     88     uint32 sample_rate_divisor;
     89     uint8 int_pri;                      /* Internal Priority */
     90     uint16 etag_src_vid;                /* Extended (source) port vlan id */
     91     uint16 etag_dst_vid;                /* Extended (destination) port vlan id */
     92     uint16 udp_src_port;                /* UDP source port */
     93     uint16 udp_dst_port;                /* UDP destination port */
     94     uint32 egress_sample_rate_dividend; /* The probability of outbound mirroring
     95                                            a packet from the destination is
     96                                            sample_rate_dividend >=
     97                                            sample_rate_divisor ? 1 :
     98                                            sample_rate_dividend /
     99                                            sample_rate_divisor */
    100     uint32 egress_sample_rate_divisor;
    101     uint8 recycle_context;              /* recycle context of egress originating
    102                                            packets */
    103 
    104     uint16 packet_copy_size;            /*  If non zero, the copied packet will
    105                                             be truncated to the first
    106                                             packet_copy_size . Current supported
    107                                             values for DNX are 0, 64, 128, 192 */
    108     uint16 egress_packet_copy_size;     /* If non zero and the packet is copied
    109                                            from the egress, the packet will be
    110                                            truncated to the first
    111                                            packet_copy_size . Current supported
    112                                            values for DNX are 0, 256. */
    113     bcm_mirror_pkt_header_updates_t packet_control_updates;
    114     bcm_mirror_psc_t rtag;              /* specify RTAG HASH algorithm used for
    115                                            shared-id mirror destination */
    116     uint8 df;                           /* Set the do not fragment bit of IP
    117                                            header in mirror encapsulation */
    118     uint8 truncate;                     /* Setting truncate would result in
    119                                            mirroring a truncated frame */
    120     uint16 template_id;                 /* Template ID for IPFIX HDR */
    121     uint32 observation_domain;          /* Observation domain for IPFIX HDR */
    122     uint32 is_recycle_strict_priority;  /* Recycle priority (1-lossless, 0-high) */
    123 } bcm_compat6511_mirror_destination_t;
    124 
    125 /* Create a mirror (destination, encapsulation) pair. */
    126 extern int bcm_compat6511_mirror_destination_create(
    127     int unit,
    128     bcm_compat6511_mirror_destination_t *mirror_dest);
    129 
    130 /* Get mirror (destination, encapsulation) pair. */
    131 extern int bcm_compat6511_mirror_destination_get(
    132     int unit,
    133     bcm_gport_t mirror_dest_id,
    134     bcm_compat6511_mirror_destination_t *mirror_dest);
    135 #endif  /* BCM_RPC_SUPPORT */
    136 #endif  /* !_COMPAT_6511_H */