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_6519.h (99297B)


      1 /*
      2  * $Id: compat_6519.h,v 1.0 2019/04/03
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      6  *
      7  * RPC Compatibility with sdk-6.5.19 routines
      8  */
      9 
     10 #ifndef _COMPAT_6519_H_
     11 #define _COMPAT_6519_H_
     12 
     13 #ifdef BCM_RPC_SUPPORT
     14 #if defined(INCLUDE_L3)
     15 #include <bcm/l2gre.h>
     16 #endif /* defined(INCLUDE_L3) */
     17 #if defined(INCLUDE_L3)
     18 #include <bcm/wlan.h>
     19 #endif /* defined(INCLUDE_L3) */
     20 #if defined(INCLUDE_L3)
     21 #include <bcm/vxlan.h>
     22 #endif /* defined(INCLUDE_L3) */
     23 #if defined(INCLUDE_L3)
     24 #include <bcm/tunnel.h>
     25 #endif /* defined(INCLUDE_L3) */
     26 #include <bcm/types.h>
     27 #include <bcm/l2.h>
     28 #include <bcm/cosq.h>
     29 
     30 #if defined(INCLUDE_L3)
     31 #include <bcm/flow.h>
     32 #include <bcm/l3.h>
     33 #include <bcm/ipmc.h>
     34 #include <bcm/failover.h>
     35 #endif
     36 #include <bcm/stat.h>
     37 #include <bcm/cosq.h>
     38 #include <bcm/policer.h>
     39 #include <bcm/mirror.h>
     40 #include <bcm/l2.h>
     41 #include <bcm/flexctr.h>
     42 #include <bcm/oam.h>
     43 #include <bcm/time.h>
     44 #include <bcm/port.h>
     45 
     46 /*
     47  * Queue congestion monitor export trigger info. Calculate InterestFactor
     48  * of each view and export to collector.
     49  */
     50 typedef struct bcm_compat6519_cosq_burst_monitor_export_trigger_s {
     51     uint32 export_threshold;    /* Export threshold */
     52     uint8 drop_weight;          /* Flow drop counter weight */
     53     uint8 rx_weight;            /* Flow Rx counter weight */
     54 } bcm_compat6519_cosq_burst_monitor_export_trigger_t;
     55 
     56 /* Queue congestion monitor flow view Configuration. */
     57 typedef struct bcm_compat6519_cosq_burst_monitor_flow_view_info_s {
     58     bcm_compat6519_cosq_burst_monitor_export_trigger_t export_param; /* Queue congestion monitor export
     59                                                                         trigger Info */
     60     uint64 start_timer_usecs;           /* Start time of Queue congestion
     61                                            monitor */
     62     uint64 age_timer_usecs;             /* Replace existing flow view in host
     63                                            memory based on age timer */
     64     uint32 scan_interval_usecs;         /* sample/scan Interval */
     65     uint32 age_threshold;               /* Aging persistent flows if sum of all
     66                                            sampled rx_byte_count values goes
     67                                            below threshold */
     68     uint32 num_samples;                 /* Number of samples captured per view */
     69     uint32 num_flows;                   /* Number of flows captured per view */
     70     uint32 num_flows_clear;             /* Clears configured number of flows
     71                                            with low Rx byte count from total
     72                                            number of flows, to allow new flows
     73                                            learning */
     74 } bcm_compat6519_cosq_burst_monitor_flow_view_info_t;
     75 
     76 /* Set Queue congestion monitoring flow view configuration. */
     77 extern int bcm_compat6519_cosq_burst_monitor_flow_view_config_set(
     78         int unit,
     79         uint32 options,
     80         bcm_compat6519_cosq_burst_monitor_flow_view_info_t *flow_view_data);
     81 
     82 /* Get Queue congestion monitoring flow view configuration. */
     83 extern int bcm_compat6519_cosq_burst_monitor_flow_view_config_get(
     84         int unit,
     85         bcm_compat6519_cosq_burst_monitor_flow_view_info_t *flow_view_data);
     86 
     87 #if defined(INCLUDE_L3)
     88 
     89 typedef struct bcm_compat6519_flow_encap_config_s {
     90     bcm_vpn_t vpn;                      /* VPN representing a vfi or vrf */
     91     bcm_gport_t flow_port;              /* flow port id representing a DVP */
     92     bcm_if_t intf_id;                   /* l3 interface id */
     93     uint32 dvp_group;                   /* DVP group ID */
     94     uint32 oif_group;                   /* L3 OUT interface group ID */
     95     uint32 vnid;                        /* VN_ID. */
     96     uint8 pri;                          /* service tag priority. */
     97     uint8 cfi;                          /* service tag cfi */
     98     uint16 tpid;                        /* service tag tpid */
     99     bcm_vlan_t vlan;                    /* service VLAN ID. */
    100     uint32 flags;                       /* BCM_FLOW_ENCAP_FLAG_xxx. */
    101     uint32 options;                     /* BCM_FLOW_ENCAP_OPTION_xxx. */
    102     bcm_flow_encap_criteria_t criteria; /* flow encap criteria. */
    103     uint32 valid_elements;              /* bitmap of valid fields for the encap
    104                                            action */
    105     bcm_flow_handle_t flow_handle;      /* flow handle derived from flow name */
    106     uint32 flow_option;                 /* flow option derived from flow option
    107                                            name */
    108     bcm_gport_t src_flow_port;          /* flow port id representing a SVP */
    109     uint32 class_id;                    /* used by EFP as input key */
    110 } bcm_compat6519_flow_encap_config_t;
    111 
    112 /* Add a flow encap rule. */
    113 extern int bcm_compat6519_flow_encap_add(
    114     int unit,
    115     bcm_compat6519_flow_encap_config_t *info,
    116     uint32 num_of_fields,
    117     bcm_flow_logical_field_t *field);
    118 
    119 /* Delete a flow encap rule on the given encap key. */
    120 extern int bcm_compat6519_flow_encap_delete(
    121     int unit,
    122     bcm_compat6519_flow_encap_config_t *info,
    123     uint32 num_of_fields,
    124     bcm_flow_logical_field_t *field);
    125 
    126 /* Get the encap attributes on the given encap key. */
    127 extern int bcm_compat6519_flow_encap_get(
    128     int unit,
    129     bcm_compat6519_flow_encap_config_t *info,
    130     uint32 num_of_fields,
    131     bcm_flow_logical_field_t *field);
    132 
    133 /* flow port encap config structure. */
    134 typedef struct bcm_compat6519_flow_port_encap_s {
    135     bcm_gport_t flow_port;          /* flow port id identifies DVP. */
    136     uint32 options;                 /* BCM_FLOW_PORT_ENCAP_xxx. */
    137     uint32 flags;                   /* BCM_FLOW_PORT_ENCAP_FLAG_xxx. */
    138     uint32 class_id;                /* class id. */
    139     uint16 mtu;                     /* MTU. */
    140     uint32 network_group;           /* network group ID */
    141     uint32 dvp_group;               /* DVP group ID */
    142     uint8 pri;                      /* service tag priority. */
    143     uint8 cfi;                      /* service tag cfi */
    144     uint16 tpid;                    /* service tag tpid */
    145     bcm_vlan_t vlan;                /* service VLAN ID. */
    146     bcm_if_t egress_if;             /* egress object */
    147     uint32 valid_elements;          /* bitmap of valid fields for hardware
    148                                        parameters */
    149     bcm_flow_handle_t flow_handle;  /* flow handle */
    150     uint32 flow_option;             /* flow option id */
    151     uint16 ip4_id;                  /* IPv4 ID */
    152     int vlan_pri_map_id;            /* Remarking map ID for the payload VLAN
    153                                        priority and CFI. */
    154     bcm_gport_t dst_port;           /* Destination port / trunk. */
    155 } bcm_compat6519_flow_port_encap_t;
    156 
    157 /*! Bind the egress object and tunnel initiator with the DVP. */
    158 extern int bcm_compat6519_flow_port_encap_set(
    159     int unit,
    160     bcm_compat6519_flow_port_encap_t *info,
    161     uint32 num_of_fields,
    162     bcm_flow_logical_field_t *field);
    163 
    164 /* Get the encap configuration info for the given DVP. */
    165 extern int bcm_compat6519_flow_port_encap_get(
    166     int unit,
    167     bcm_compat6519_flow_port_encap_t *info,
    168     uint32 num_of_fields,
    169     bcm_flow_logical_field_t *field);
    170 
    171 
    172 /* Flow tunneling terminator structure. */
    173 typedef struct bcm_compat6519_flow_tunnel_terminator_s {
    174     uint32 flags;           /* Configuration flags. Use BCM_TUNNEL flags */
    175     uint32 multicast_flag;  /* VXLAN Multicast trigger flags. */
    176     bcm_vrf_t vrf;          /* Virtual router instance. */
    177     bcm_ip_t sip;           /* SIP for tunnel header match. */
    178     bcm_ip_t dip;           /* DIP for tunnel header match. */
    179     bcm_ip_t sip_mask;      /* Source IP mask. */
    180     bcm_ip_t dip_mask;      /* Destination IP mask. */
    181     bcm_ip6_t sip6;         /* SIP for tunnel header match (IPv6). */
    182     bcm_ip6_t dip6;         /* DIP for tunnel header match (IPv6). */
    183     bcm_ip6_t sip6_mask;    /* Source IP mask (IPv6). */
    184     bcm_ip6_t dip6_mask;    /* Destination IP mask (IPv6). */
    185     uint32 udp_dst_port;    /* UDP dst port for UDP packets. */
    186     uint32 udp_src_port;    /* UDP src port for UDP packets */
    187     bcm_tunnel_type_t type; /* Tunnel type */
    188     bcm_vlan_t vlan;        /* The VLAN ID for IPMC lookup */
    189     uint32 protocol;        /* Protocol type */
    190     uint32 valid_elements;  /* bitmap of valid fields */
    191     uint32 flow_handle;     /* flow handle */
    192     uint32 flow_option;     /* flow option */
    193 } bcm_compat6519_flow_tunnel_terminator_t;
    194 
    195 /* Create a flow tunnel terminator match. */
    196 extern int bcm_compat6519_flow_tunnel_terminator_create(
    197     int unit,
    198     bcm_compat6519_flow_tunnel_terminator_t *info,
    199     uint32 num_of_fields,
    200     bcm_flow_logical_field_t *field);
    201 
    202 /* Delete a tunnel termination entry. */
    203 extern int bcm_compat6519_flow_tunnel_terminator_destroy(
    204     int unit,
    205     bcm_compat6519_flow_tunnel_terminator_t *info,
    206     uint32 num_of_fields,
    207     bcm_flow_logical_field_t *field);
    208 
    209 /* Get a tunnel termination entry. */
    210 extern int bcm_compat6519_flow_tunnel_terminator_get(
    211     int unit,
    212     bcm_compat6519_flow_tunnel_terminator_t *info,
    213     uint32 num_of_fields,
    214     bcm_flow_logical_field_t *field);
    215 
    216 /* MPLS port type <= 6.5.19. */
    217 typedef struct bcm_compat6519_mpls_port_s {
    218     bcm_gport_t mpls_port_id;           /* GPORT identifier. */
    219     uint32 flags;                       /* BCM_MPLS_PORT_xxx. */
    220     uint32 flags2;                      /* BCM_MPLS_PORT2_xxx. */
    221     int if_class;                       /* Interface class ID. */
    222     int exp_map;                        /* Incoming EXP map ID. */
    223     int int_pri;                        /* Internal priority. */
    224     uint8 pkt_pri;                      /* Packet priority. */
    225     uint8 pkt_cfi;                      /* Packet CFI. */
    226     uint16 service_tpid;                /* Service VLAN TPID value. */
    227     bcm_gport_t port;                   /* Match port and/or egress port. */
    228     bcm_mpls_port_match_t criteria;     /* Match criteria. */
    229     bcm_vlan_t match_vlan;              /* Outer VLAN ID to match. */
    230     bcm_vlan_t match_inner_vlan;        /* Inner VLAN ID to match. */
    231     bcm_mpls_label_t match_label;       /* VC label to match. */
    232     bcm_if_t egress_tunnel_if;          /* MPLS tunnel egress object. */
    233     bcm_mpls_egress_label_t egress_label; /* Outgoing VC label. */
    234     int mtu;                            /* MPLS port MTU. */
    235     bcm_vlan_t egress_service_vlan;     /* Service VLAN to Add/Replace. */
    236     uint32 pw_seq_number;               /* Initial-value of Pseudo-wire Sequence
    237                                            number */
    238     bcm_if_t encap_id;                  /* Encap Identifier. */
    239     bcm_failover_t ingress_failover_id; /* Ingress Failover Object Identifier. */
    240     bcm_gport_t ingress_failover_port_id; /* Ingress Failover MPLS Port
    241                                            Identifier. */
    242     bcm_failover_t failover_id;         /* Failover Object Identifier. */
    243     bcm_gport_t failover_port_id;       /* Failover MPLS Port Identifier. */
    244     bcm_policer_t policer_id;           /* Policer ID to be associated with the
    245                                            MPLS gport */
    246     bcm_multicast_t failover_mc_group;  /* MC group used for bi-cast. */
    247     bcm_failover_t pw_failover_id;      /* Failover Object Identifier for
    248                                            Redundant PW. */
    249     bcm_gport_t pw_failover_port_id;    /* Redundant PW port Identifier. */
    250     bcm_mpls_port_control_channel_type_t vccv_type; /* Indicate VCCV Control Channel */
    251     bcm_switch_network_group_t network_group_id; /* Split Horizon network group
    252                                            identifier */
    253     bcm_vlan_t match_subport_pkt_vid;   /* LLTAG VLAN ID to match. */
    254     bcm_gport_t tunnel_id;              /* Tunnel Id pointing to ingress LSP. */
    255     bcm_gport_t per_flow_queue_base;    /* Base queue of the per flow queue set.
    256                                            Actual queue is decided based on
    257                                            internal priority and qos map. */
    258     int qos_map_id;                     /* QOS map identifier. */
    259     bcm_failover_t egress_failover_id;  /* Failover object index for Egress
    260                                            Protection */
    261     bcm_gport_t egress_failover_port_id; /* Failover MPLS Port identifier for
    262                                            Egress Protection */
    263     int ecn_map_id;                     /* ECN map identifier. */
    264     uint32 class_id;                    /* Class ID */
    265     uint32 egress_class_id;             /* Egress Class ID */
    266     int inlif_counting_profile;         /* In LIF counting profile */
    267     bcm_mpls_egress_label_t egress_tunnel_label; /* A mpls tunnel to be binded with the
    268                                            pwe */
    269     int nof_service_tags;               /* Number of Service-Tags expected on
    270                                            Native-ETH header */
    271     bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos&ttl model */
    272     bcm_mpls_label_t context_label;     /* Ingress match - context label. */
    273     bcm_if_t ingress_if;                /* Ingress match - context interface. */
    274     int port_group;                     /* Port group to match. */
    275 } bcm_compat6519_mpls_port_t;
    276 
    277 extern int bcm_compat6519_mpls_port_add(
    278     int unit,
    279     bcm_vpn_t vpn,
    280     bcm_compat6519_mpls_port_t *mpls_port);
    281 
    282 extern int bcm_compat6519_mpls_port_get(
    283     int unit,
    284     bcm_vpn_t vpn,
    285     bcm_compat6519_mpls_port_t *mpls_port);
    286 
    287 extern int bcm_compat6519_mpls_port_get_all(
    288     int unit,
    289     bcm_vpn_t vpn,
    290     int port_max,
    291     bcm_compat6519_mpls_port_t *port_array,
    292     int *port_count);
    293     
    294 /* L3 Host Structure. */
    295 typedef struct bcm_compat6519_l3_host_s {
    296     uint32 l3a_flags;                   /* See BCM_L3_xxx flag definitions. */
    297     uint32 l3a_flags2;                  /* See BCM_L3_FLAGS2_xxx flag
    298                                            definitions. */
    299     bcm_vrf_t l3a_vrf;                  /* Virtual router instance. */
    300     bcm_ip_t l3a_ip_addr;               /* Destination host IP address (IPv4). */
    301     bcm_ip6_t l3a_ip6_addr;             /* Destination host IP address (IPv6). */
    302     bcm_cos_t l3a_pri;                  /* New priority in packet. */
    303     bcm_if_t l3a_intf;                  /* L3 intf associated with this address. */
    304     bcm_if_t l3a_ul_intf;               /* Underlay L3 egress object associated
    305                                            with this address. */
    306     bcm_mac_t l3a_nexthop_mac;          /* Next hop MAC addr. */
    307     bcm_module_t l3a_modid;             /* Module ID packet is switched to. */
    308     bcm_port_t l3a_port_tgid;           /* Port/TGID packet is switched to. */
    309     bcm_port_t l3a_stack_port;          /* Used if modid not local (Strata
    310                                            Only). */
    311     int l3a_ipmc_ptr;                   /* Pointer to IPMC table. */
    312     int l3a_lookup_class;               /* Classification lookup class ID. */
    313     bcm_if_t encap_id;                  /* Encapsulation index. */
    314     bcm_if_t native_intf;               /*  L3 native interface (source MAC). */
    315     uint32 flow_handle;                 /* FLOW handle for flex entries. */
    316     uint32 flow_option_handle;          /* FLOW option handle for flex entries. */
    317     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex
    318                                            entries. */
    319     uint32 num_of_fields;               /* number of logical fields. */
    320     int l3a_ipmc_ptr_l2;                /* Pointer to IPMC table for L2
    321                                            recipients if TTL/RPF check fails. */
    322     uint32 stat_id;                     /* Object statistics ID. */
    323     int stat_pp_profile;                /* Statistics profile. */
    324     int l3a_mtu;                        /* Multicast packet MTU. */
    325 } bcm_compat6519_l3_host_t;
    326 
    327 /* Look up an L3 host table entry based on IP address. */
    328 extern int bcm_compat6519_l3_host_find(
    329     int unit,
    330     bcm_compat6519_l3_host_t *info);
    331 
    332 /* Add an entry into the L3 switching table. */
    333 extern int bcm_compat6519_l3_host_add(
    334     int unit,
    335     bcm_compat6519_l3_host_t *info);
    336 
    337 /* Delete an entry from the L3 host table. */
    338 extern int bcm_compat6519_l3_host_delete(
    339     int unit,
    340     bcm_compat6519_l3_host_t *ip_addr);
    341 
    342 /*
    343  * Deletes L3 entries that match or do not match a specified L3 interface
    344  * number
    345  */
    346 extern int bcm_compat6519_l3_host_delete_by_interface(
    347     int unit,
    348     bcm_compat6519_l3_host_t *info);
    349 
    350 /* Deletes all L3 host table entries. */
    351 extern int bcm_compat6519_l3_host_delete_all(
    352     int unit,
    353     bcm_compat6519_l3_host_t *info);
    354 
    355 /* Attach counters entries to the given L3 host entry */
    356 extern int bcm_compat6519_l3_host_stat_attach(
    357     int unit,
    358     bcm_compat6519_l3_host_t *info,
    359     uint32 stat_counter_id);
    360 
    361 /* Detach  counters entries to the given L3 host entry */
    362 extern int bcm_compat6519_l3_host_stat_detach(
    363     int unit,
    364     bcm_compat6519_l3_host_t *info);
    365 
    366 /* Get the specified counter statistic for a L3 host entry. */
    367 extern int bcm_compat6519_l3_host_stat_counter_get(
    368     int unit,
    369     bcm_compat6519_l3_host_t *info,
    370     bcm_l3_stat_t stat,
    371     uint32 num_entries,
    372     uint32 *counter_indexes,
    373     bcm_stat_value_t *counter_values);
    374 
    375 /*
    376  * Force an immediate counter update and retrieve the specified counter
    377  * statistic for a L3 host entry.
    378  */
    379 extern int bcm_compat6519_l3_host_stat_counter_sync_get(
    380     int unit,
    381     bcm_compat6519_l3_host_t *info,
    382     bcm_l3_stat_t stat,
    383     uint32 num_entries,
    384     uint32 *counter_indexes,
    385     bcm_stat_value_t *counter_values);
    386 
    387 /* Set the specified counter statistic for a L3 host entry */
    388 extern int bcm_compat6519_l3_host_stat_counter_set(
    389     int unit,
    390     bcm_compat6519_l3_host_t *info,
    391     bcm_l3_stat_t stat,
    392     uint32 num_entries,
    393     uint32 *counter_indexes,
    394     bcm_stat_value_t *counter_values);
    395 
    396 /* Provide stat counter ids associated with given L3 host entry */
    397 extern int bcm_compat6519_l3_host_stat_id_get(
    398     int unit,
    399     bcm_compat6519_l3_host_t *info,
    400     bcm_l3_stat_t stat,
    401     uint32 *stat_counter_id);
    402 
    403 /* L3 Route Structure. */
    404 typedef struct bcm_compat6519_l3_route_s {
    405     uint32 l3a_flags;                   /* See BCM_L3_xxx flag definitions. */
    406     uint32 l3a_flags2;                  /* See BCM_L3_FLAGS2_xxx flag
    407                                            definitions. */
    408     uint32 l3a_ipmc_flags;              /* Used for multicast route entry. See
    409                                            BCM_IPMC_xxx flag definitions. */
    410     bcm_vrf_t l3a_vrf;                  /* Virtual router instance. */
    411     bcm_ip_t l3a_subnet;                /* IP subnet address (IPv4). */
    412     bcm_ip6_t l3a_ip6_net;              /* IP subnet address (IPv6). */
    413     bcm_ip_t l3a_ip_mask;               /* IP subnet mask (IPv4). */
    414     bcm_ip6_t l3a_ip6_mask;             /* IP subnet mask (IPv6). */
    415     bcm_if_t l3a_intf;                  /* L3 interface associated with route. */
    416     bcm_if_t l3a_ul_intf;               /* Underlay L3 egress object associated
    417                                            with this address. */
    418     bcm_ip_t l3a_nexthop_ip;            /* Next hop IP address (XGS1/2, IPv4). */
    419     bcm_mac_t l3a_nexthop_mac;          /* Next hop MAC address. */
    420     bcm_module_t l3a_modid;             /* Module ID. */
    421     bcm_port_t l3a_port_tgid;           /* Port or trunk group ID. */
    422     bcm_port_t l3a_stack_port;          /* Used if modid is not local (Strata
    423                                            Only). */
    424     bcm_vlan_t l3a_vid;                 /* BCM5695 only - for per-VLAN def
    425                                            route. */
    426     bcm_cos_t l3a_pri;                  /* Priority (COS). */
    427     uint32 l3a_tunnel_option;           /* Tunnel option value. */
    428     bcm_mpls_label_t l3a_mpls_label;    /* MPLS label. */
    429     int l3a_lookup_class;               /* Classification class ID. */
    430     bcm_if_t l3a_expected_intf;         /* Expected L3 Interface used for
    431                                            multicast RPF check */
    432     int l3a_rp;                         /* Rendezvous point ID */
    433     bcm_multicast_t l3a_mc_group;       /* L3 Multicast group index */
    434     bcm_gport_t l3a_expected_src_gport; /* L3 Multicast group expected source
    435                                            port/trunk */
    436     uint32 flow_handle;                 /* FLOW handle for flex entries. */
    437     uint32 flow_option_handle;          /* FLOW option handle for flex entries. */
    438     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex
    439                                            entries. */
    440     uint32 num_of_fields;               /* number of logical fields. */
    441     uint32 stat_id;                     /* Object statistics ID. */
    442     int stat_pp_profile;                /* Statistics profile. */
    443     int l3a_mtu;                        /* Multicast packet MTU. */
    444 } bcm_compat6519_l3_route_t;
    445 
    446 /* Delete L3 entries based on IP prefix (network). */
    447 extern int bcm_compat6519_l3_host_delete_by_network(
    448     int unit,
    449     bcm_compat6519_l3_route_t *ip_addr);
    450 
    451 /* Add an IP route to the L3 route table. */
    452 extern int bcm_compat6519_l3_route_add(
    453     int unit,
    454     bcm_compat6519_l3_route_t *info);
    455 
    456 /* Delete an IP route from the DEFIP table. */
    457 extern int bcm_compat6519_l3_route_delete(
    458     int unit,
    459     bcm_compat6519_l3_route_t *info);
    460 
    461 /* Delete routes based on matching or non-matching L3 interface number. */
    462 extern int bcm_compat6519_l3_route_delete_by_interface(
    463     int unit,
    464     bcm_compat6519_l3_route_t *info);
    465 
    466 /* Delete all routes. */
    467 extern int bcm_compat6519_l3_route_delete_all(
    468     int unit,
    469     bcm_compat6519_l3_route_t *info);
    470 
    471 /* Look up a route given the network and netmask. */
    472 extern int bcm_compat6519_l3_route_get(
    473     int unit,
    474     bcm_compat6519_l3_route_t *info);
    475 
    476 /* Given a network, return all the paths for this route. */
    477 extern int bcm_compat6519_l3_route_multipath_get(
    478     int unit,
    479     bcm_compat6519_l3_route_t *the_route,
    480     bcm_compat6519_l3_route_t *path_array,
    481     int max_path,
    482     int *path_count);
    483 
    484 /* Set flex counter object value for the given L3 unicast route. */
    485 extern int bcm_compat6519_l3_route_flexctr_object_set(
    486     int unit,
    487     bcm_compat6519_l3_route_t *info,
    488     uint32 value);
    489 
    490 /* Get flex counter object value for the given L3 unicast route. */
    491 extern int bcm_compat6519_l3_route_flexctr_object_get(
    492     int unit,
    493     bcm_compat6519_l3_route_t *info,
    494     uint32 *value);
    495 
    496 /* Get L3 route statistics. */
    497 extern int bcm_compat6519_l3_route_stat_get(
    498     int unit,
    499     bcm_compat6519_l3_route_t *route,
    500     bcm_l3_stat_t stat,
    501     uint64 *val);
    502 
    503 /* Get L3 route statistics. */
    504 extern int bcm_compat6519_l3_route_stat_get32(
    505     int unit,
    506     bcm_compat6519_l3_route_t *route,
    507     bcm_l3_stat_t stat,
    508     uint32 *val);
    509 
    510 /* Set L3 route statistics. */
    511 extern int bcm_compat6519_l3_route_stat_set(
    512     int unit,
    513     bcm_compat6519_l3_route_t *route,
    514     bcm_l3_stat_t stat,
    515     uint64 val);
    516 
    517 /* Set L3 route statistics. */
    518 extern int bcm_compat6519_l3_route_stat_set32(
    519     int unit,
    520     bcm_compat6519_l3_route_t *route,
    521     bcm_l3_stat_t stat,
    522     uint32 val);
    523 
    524 /* Enable/disable collection of statistics for the indicated L3 route. */
    525 extern int bcm_compat6519_l3_route_stat_enable_set(
    526     int unit,
    527     bcm_compat6519_l3_route_t *route,
    528     int enable);
    529 
    530 /* Attach counters entries to the given L3 route index */
    531 extern int bcm_compat6519_l3_route_stat_attach(
    532     int unit,
    533     bcm_compat6519_l3_route_t *info,
    534     uint32 stat_counter_id);
    535 
    536 /* Detach  counters entries to the given L3 route index. */
    537 extern int bcm_compat6519_l3_route_stat_detach(
    538     int unit,
    539     bcm_compat6519_l3_route_t *info);
    540 
    541 /* Get counter statistic values for a l3 route index. */
    542 extern int bcm_compat6519_l3_route_stat_counter_get(
    543     int unit,
    544     bcm_compat6519_l3_route_t *info,
    545     bcm_l3_route_stat_t stat,
    546     uint32 num_entries,
    547     uint32 *counter_indexes,
    548     bcm_stat_value_t *counter_values);
    549 
    550 /* 
    551  * Force an immediate counter update and retrieve counter statistic
    552  * values for a l3 route index.
    553  */
    554 extern int bcm_compat6519_l3_route_stat_counter_sync_get(
    555     int unit,
    556     bcm_compat6519_l3_route_t *info,
    557     bcm_l3_route_stat_t stat,
    558     uint32 num_entries,
    559     uint32 *counter_indexes,
    560     bcm_stat_value_t *counter_values);
    561 
    562 /* Set counter statistic values for a l3 route index */
    563 extern int bcm_compat6519_l3_route_stat_counter_set(
    564     int unit,
    565     bcm_compat6519_l3_route_t *info,
    566     bcm_l3_route_stat_t stat,
    567     uint32 num_entries,
    568     uint32 *counter_indexes,
    569     bcm_stat_value_t *counter_values);
    570 
    571 /* Get multiple counter statistic values for multiple l3 route index. */
    572 extern int bcm_compat6519_l3_route_stat_multi_get(
    573     int unit,
    574     bcm_compat6519_l3_route_t *info,
    575     int nstat,
    576     bcm_l3_route_stat_t *stat_arr,
    577     uint64 *value_arr);
    578 
    579 /* Get 32bit multiple counter statistic values for multiple l3 route index. */
    580 extern int bcm_compat6519_l3_route_stat_multi_get32(
    581     int unit,
    582     bcm_compat6519_l3_route_t *info,
    583     int nstat,
    584     bcm_l3_route_stat_t *stat_arr,
    585     uint32 *value_arr);
    586 
    587 /* Set multiple counter statistic values for multiple l3 route index. */
    588 extern int bcm_compat6519_l3_route_stat_multi_set(
    589     int unit,
    590     bcm_compat6519_l3_route_t *info,
    591     int nstat,
    592     bcm_l3_route_stat_t *stat_arr,
    593     uint64 *value_arr);
    594 
    595 /* Set 32bit multiple counter statistic values for multiple l3 route index. */
    596 extern int bcm_compat6519_l3_route_stat_multi_set32(
    597     int unit,
    598     bcm_compat6519_l3_route_t *info,
    599     int nstat,
    600     bcm_l3_route_stat_t *stat_arr,
    601     uint32 *value_arr);
    602 
    603 /* Get stat counter ID associated with given L3 route index. */
    604 extern int bcm_compat6519_l3_route_stat_id_get(
    605     int unit,
    606     bcm_compat6519_l3_route_t *info,
    607     bcm_l3_route_stat_t stat,
    608     uint32 *stat_counter_id);
    609 
    610 /* Find a longest prefix matched route given an IP address. */
    611 extern int bcm_compat6519_l3_route_find(
    612     int unit,
    613     bcm_compat6519_l3_host_t *host,
    614     bcm_compat6519_l3_route_t *route);
    615 
    616 /* Find a longest prefix matched route given the ip and netmask. */
    617 extern int bcm_compat6519_l3_subnet_route_find(
    618     int unit,
    619     bcm_compat6519_l3_route_t *input,
    620     bcm_compat6519_l3_route_t *route);
    621 
    622 /* IPMC address structure. */
    623 typedef struct bcm_compat6519_ipmc_addr_s {
    624     bcm_ip_t s_ip_addr;                 /* IPv4 Source address. */
    625     bcm_ip_t mc_ip_addr;                /* IPv4 Destination address. */
    626     bcm_ip6_t s_ip6_addr;               /* IPv6 Source address. */
    627     bcm_ip6_t mc_ip6_addr;              /* IPv6 Destination address. */
    628     bcm_vlan_t vid;                     /* VLAN identifier. */
    629     bcm_vrf_t vrf;                      /* Virtual Router Instance. */
    630     bcm_cos_t cos;                      /* COS based on dst IP multicast addr. */
    631     int ts;                             /* Source port or TGID bit. */
    632     int port_tgid;                      /* Source port or TGID. */
    633     int v;                              /* Valid bit. */
    634     int mod_id;                         /* Module ID. */
    635     bcm_multicast_t group;              /* Use this index to program IPMC table
    636                                            for XGS chips based on flags value */
    637     uint32 flags;                       /* See BCM_IPMC_XXX flag definitions. */
    638     int lookup_class;                   /* Classification lookup class ID. */
    639     bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */
    640     bcm_if_t l3a_intf;                  /* L3 interface associated with route. */
    641     int rp_id;                          /* Rendezvous point ID. */
    642     bcm_ip_t s_ip_mask;                 /* IPv4 Source subnet mask. */
    643     bcm_if_t ing_intf;                  /* L3 interface associated with this
    644                                            Entry */
    645     bcm_ip_t mc_ip_mask;                /* IPv4 Destination subnet mask. */
    646     bcm_ip6_t mc_ip6_mask;              /* IPv6 Destination subnet mask. */
    647     bcm_multicast_t group_l2;           /* Use this index to program IPMC table
    648                                            for l2 recipients if TTL/RPF check
    649                                            fails. */
    650     uint32 stat_id;                     /* Object statistics ID. */
    651     int stat_pp_profile;                /* Statistics profile. */
    652     bcm_ip6_t s_ip6_mask;               /* IPv6 Source subnet mask. */
    653     int priority;                       /* Entry priority. */
    654     uint32 flow_handle;                 /* FLOW handle for flex entries. */
    655     uint32 flow_option_handle;          /* FLOW option handle for flex entries. */
    656     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex
    657                                            entries. */
    658     uint32 num_logical_fields;          /* number of logical fields. */
    659     int mtu;                            /* MTU. */
    660 } bcm_compat6519_ipmc_addr_t;
    661 
    662 /* Add a new entry to IPMC table. */
    663 extern int bcm_compat6519_ipmc_add(
    664     int unit,
    665     bcm_compat6519_ipmc_addr_t *data);
    666 
    667 /* Find info about an IPMC entry. */
    668 extern int bcm_compat6519_ipmc_find(
    669     int unit,
    670     bcm_compat6519_ipmc_addr_t *data);
    671 
    672 /* Remove an entry from IPMC table. */
    673 extern int bcm_compat6519_ipmc_remove(
    674     int unit,
    675     bcm_compat6519_ipmc_addr_t *data);
    676 
    677 /* Attach counters entries to the given IPMC group. */
    678 extern int bcm_compat6519_ipmc_stat_attach(
    679     int unit,
    680     bcm_compat6519_ipmc_addr_t *info,
    681     uint32 stat_counter_id);
    682 
    683 /* Detach counters entries to the given IPMC group. */
    684 extern int bcm_compat6519_ipmc_stat_detach(
    685     int unit,
    686     bcm_compat6519_ipmc_addr_t *info);
    687 
    688 /* Get counter statistic values for an IPMC group. */
    689 extern int bcm_compat6519_ipmc_stat_counter_get(
    690     int unit,
    691     bcm_compat6519_ipmc_addr_t *info,
    692     bcm_ipmc_stat_t stat,
    693     uint32 num_entries,
    694     uint32 *counter_indexes,
    695     bcm_stat_value_t *counter_values);
    696 
    697 /*
    698  * Force an immediate counter update and retrieve counter statistic
    699  * values for an IPMC group.
    700  */
    701  extern int bcm_compat6519_ipmc_stat_counter_sync_get(
    702     int unit,
    703     bcm_compat6519_ipmc_addr_t *info,
    704     bcm_ipmc_stat_t stat,
    705     uint32 num_entries,
    706     uint32 *counter_indexes,
    707     bcm_stat_value_t *counter_values);
    708 
    709 /* Set counter statistic values for an IPMC group. */
    710 extern int bcm_compat6519_ipmc_stat_counter_set(
    711     int unit,
    712     bcm_compat6519_ipmc_addr_t *info,
    713     bcm_ipmc_stat_t stat,
    714     uint32 num_entries,
    715     uint32 *counter_indexes,
    716     bcm_stat_value_t *counter_values);
    717 
    718 /* Get multiple counter statistic values for multiple IPMC group. */
    719 extern int bcm_compat6519_ipmc_stat_multi_get(
    720     int unit,
    721     bcm_compat6519_ipmc_addr_t *info,
    722     int nstat,
    723     bcm_ipmc_stat_t *stat_arr,
    724     uint64 *value_arr);
    725 
    726 /* Get 32bit multiple counter statistic values for multiple IPMC group. */
    727 extern int bcm_compat6519_ipmc_stat_multi_get32(
    728     int unit,
    729     bcm_compat6519_ipmc_addr_t *info,
    730     int nstat,
    731     bcm_ipmc_stat_t *stat_arr,
    732     uint32 *value_arr);
    733 
    734 /* Set multiple counter statistic values for multiple IPMC group. */
    735 extern int bcm_compat6519_ipmc_stat_multi_set(
    736     int unit,
    737     bcm_compat6519_ipmc_addr_t *info,
    738     int nstat,
    739     bcm_ipmc_stat_t *stat_arr,
    740     uint64 *value_arr);
    741 
    742 /* Set 32bit multiple counter statistic values for multiple IPMC group. */
    743 extern int bcm_compat6519_ipmc_stat_multi_set32(
    744     int unit,
    745     bcm_compat6519_ipmc_addr_t *info,
    746     int nstat,
    747     bcm_ipmc_stat_t *stat_arr,
    748     uint32 *value_arr);
    749 
    750 /* Get stat counter ID associated with given IPMC group. */
    751 extern int bcm_compat6519_ipmc_stat_id_get(
    752     int unit,
    753     bcm_compat6519_ipmc_addr_t *info,
    754     bcm_ipmc_stat_t stat,
    755     uint32 *stat_counter_id);
    756 
    757 /* Add a new configurational entry. */
    758 extern int bcm_compat6519_ipmc_config_add(
    759     int unit,
    760     bcm_compat6519_ipmc_addr_t *config);
    761 
    762 /* Find a configurational entry. */
    763 extern int bcm_compat6519_ipmc_config_find(
    764     int unit,
    765     bcm_compat6519_ipmc_addr_t *config);
    766 
    767 /* Remove a configurational entry */
    768 extern int bcm_compat6519_ipmc_config_remove(
    769     int unit,
    770     bcm_compat6519_ipmc_addr_t *config);
    771 
    772 /* L3 Egress Structure.
    773 
    774 @p Description of an L3 forwarding destination.
    775  */
    776 typedef struct bcm_compat6519_l3_egress_s {
    777     uint32 flags;    /* Interface flags (BCM_L3_TGID, BCM_L3_L2TOCPU). */
    778     uint32 flags2;    /* See BCM_L3_FLAGS2_xxx flag definitions. */
    779     bcm_if_t intf;    /* L3 interface (source MAC, tunnel). */
    780     bcm_mac_t mac_addr;    /* Next hop forwarding destination mac. */
    781     bcm_vlan_t vlan;    /* Next hop vlan id. */
    782     bcm_module_t module;    /*  */
    783     bcm_port_t port;    /* Port packet switched to (if !BCM_L3_TGID). */
    784     bcm_trunk_t trunk;    /* Trunk packet switched to (if BCM_L3_TGID). */
    785     uint32 mpls_flags;    /* BCM_MPLS flag definitions. */
    786     bcm_mpls_label_t mpls_label;    /* MPLS label. */
    787     bcm_mpls_egress_action_t mpls_action;    /* MPLS action. */
    788     int mpls_qos_map_id;    /* MPLS EXP map ID. */
    789     int mpls_ttl;    /* MPLS TTL threshold. */
    790     uint8 mpls_pkt_pri;    /* MPLS Packet Priority Value. */
    791     uint8 mpls_pkt_cfi;    /* MPLS Packet CFI Value. */
    792     uint8 mpls_exp;    /* MPLS Exp. */
    793     int qos_map_id;    /* General QOS map id */
    794     bcm_if_t encap_id;    /* Encapsulation index. */
    795     bcm_failover_t failover_id;    /* Failover Object Index. */
    796     bcm_if_t failover_if_id;    /* Failover Egress Object index. */
    797     bcm_multicast_t failover_mc_group;    /* Failover Multicast Group. */
    798     int dynamic_scaling_factor;    /* Scaling factor for dynamic load balancing thresholds. */
    799     int dynamic_load_weight;    /* Weight of traffic load in determining a dynamic load balancing member's quality. */
    800     int dynamic_queue_size_weight;    /* Weight of queue size in determining a dynamic load balancing member's quality. */
    801     int intf_class;    /* L3 interface class ID */
    802     uint32 multicast_flags;    /* BCM_L3_MULTICAST flag definitions. */
    803     uint16 oam_global_context_id;    /* OAM global context id passed from ingress to egress XGS chip. */
    804     bcm_vntag_t vntag;    /* VNTAG. */
    805     bcm_vntag_action_t vntag_action;    /* VNTAG action. */
    806     bcm_etag_t etag;    /* ETAG. */
    807     bcm_etag_action_t etag_action;    /* ETAG action. */
    808     uint32 flow_handle;    /* FLOW handle for flex entries. */
    809     uint32 flow_option_handle;    /* FLOW option handle for flex entries. */
    810     uint32 flow_label_option_handle;    /* FLOW option handle for egress label flex entries. */
    811     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS];    /* logical fields array for flex entries. */
    812     uint32 num_of_fields;    /* number of logical fields. */
    813     int counting_profile;    /* counting profile. If not required, set it to BCM_STAT_LIF_COUNTING_PROFILE_NONE */
    814     int mpls_ecn_map_id;    /* IP ECN/INT CN to MPLS EXP map ID. */
    815     bcm_l3_ingress_urpf_mode_t urpf_mode;    /* fec rpf mode. */
    816     bcm_multicast_t mc_group;    /* Multicast Group. */
    817     bcm_mac_t src_mac_addr;    /* Source MAC Address. */
    818     bcm_gport_t hierarchical_gport;    /* Hierarchical TM-Flow. */
    819     uint32 stat_id;    /* Object statistics ID. */
    820     int stat_pp_profile;    /* Statistics profile. */
    821     bcm_gport_t vlan_port_id;    /* Pointer to egress vlan translation lif entry in EEDB. */
    822     int replication_id;    /* Replication copy ID of multicast Egress object. */
    823     int mtu;    /* MTU. */
    824     int nat_realm_id;    /* NAT destination realm ID. */
    825     bcm_qos_egress_model_t egress_qos_model;    /* egress qos and ttl model */
    826     int egress_opaque_ctrl_id;    /* Egress opaque control ID. */
    827 } bcm_compat6519_l3_egress_t;
    828 
    829 /* Create an Egress forwarding object. */
    830 extern int bcm_compat6519_l3_egress_create(
    831     int unit,
    832     uint32 flags,
    833     bcm_compat6519_l3_egress_t *egr,
    834     bcm_if_t *if_id);
    835 
    836 /* Get an Egress forwarding object. */
    837 extern int bcm_compat6519_l3_egress_get(
    838     int unit,
    839     bcm_if_t intf,
    840     bcm_compat6519_l3_egress_t *egr);
    841 
    842 /* Find an interface pointing to an Egress forwarding object. */
    843 extern int bcm_compat6519_l3_egress_find(
    844     int unit,
    845     bcm_compat6519_l3_egress_t *egr,
    846     bcm_if_t *intf);
    847 
    848 /* Retrieve valid allocation for a given number of FECs. */
    849 extern int bcm_compat6519_l3_egress_allocation_get(
    850     int unit,
    851     uint32 flags,
    852     bcm_compat6519_l3_egress_t *egr,
    853     uint32 nof_members,
    854     bcm_if_t *if_id);
    855 
    856 /* Set a failover egress object with fixed offset to protect primary NH intf. */
    857 extern int bcm_compat6519_failover_egress_set(
    858     int unit,
    859     bcm_if_t intf,
    860     bcm_compat6519_l3_egress_t *failover_egr);
    861 
    862 /* Get a failover egress object with fixed offset to protect primary NH intf. */
    863 extern int bcm_compat6519_failover_egress_get(
    864     int unit,
    865     bcm_if_t intf,
    866     bcm_compat6519_l3_egress_t *failover_egr);
    867 
    868 /* L3 Ingress Structure.
    869 
    870 @p Description of an L3 Ingress interface.
    871  */
    872 typedef struct bcm_compat6519_l3_ingress_s {
    873     uint32 flags;    /* Interface flags. */
    874     bcm_vrf_t vrf;    /* Virtual router id. */
    875     bcm_l3_ingress_urpf_mode_t urpf_mode;    /* URPF mode setting for L3 Ingress Interface. */
    876     int intf_class;    /* Classification class ID. */
    877     bcm_vlan_t ipmc_intf_id;    /* IPMC L2 distribution Vlan. */
    878     int qos_map_id;    /* QoS DSCP priority map. */
    879     int ip4_options_profile_id;    /* IP4 Options handling Profile ID */
    880     int nat_realm_id;    /* Realm id of the interface for NAT */
    881     int tunnel_term_ecn_map_id;    /* Tunnel termination ecn map id */
    882     uint32 intf_class_route_disable;    /* routing enablers bit map in rif profile */
    883     int oam_default_profile;    /* OAM profile for RIF */
    884     uint32 hash_layers_disable;    /* load balancing disable hash layers bit map using the BCM_HASH_LAYER_XXX_DISABLE flags */
    885     int opaque_ctrl_id;    /* Opaque control ID. */
    886 } bcm_compat6519_l3_ingress_t;
    887 
    888 /* Create L3 Ingress Interface object. */
    889 extern int bcm_compat6519_l3_ingress_create(
    890     int unit,
    891     bcm_compat6519_l3_ingress_t *ing_intf,
    892     bcm_if_t *intf_id);
    893 
    894 /* Get an Ingress Interface object. */
    895 extern int bcm_compat6519_l3_ingress_get(
    896     int unit,
    897     bcm_if_t intf,
    898     bcm_compat6519_l3_ingress_t *ing_intf);
    899 
    900 /* Find an interface pointing to an Ingress Interface object. */
    901 extern int bcm_compat6519_l3_ingress_find(
    902     int unit,
    903     bcm_compat6519_l3_ingress_t *ing_intf,
    904     bcm_if_t *intf_id);
    905 
    906 #endif /* INCLUDE_L3 */
    907 
    908 /* Packet protocol match structure. */
    909 typedef struct bcm_compat6519_switch_pkt_protocol_match_s {
    910     uint8 l2_iif_opaque_ctrl_id;        /* L2 iif based control id. */
    911     uint8 l2_iif_opaque_ctrl_id_mask;   /* L2 iif based control id mask. */
    912     bcm_vlan_t vfi;                     /* Virtual forwarding instance. */
    913     bcm_vlan_t vfi_mask;                /* VFI mask. */
    914     bcm_mac_t macda;                    /* Destination MAC address. */
    915     bcm_mac_t macda_mask;               /* Destination MAC address mask. */
    916     uint16 ethertype;                   /* Ethernet type. */
    917     uint16 ethertype_mask;              /* Ethernet type mask. */
    918     uint16 arp_rarp_opcode;             /* ARP/RARP packet operation code. */
    919     uint16 arp_rarp_opcode_mask;        /* ARP/RARP packet operation code mask. */
    920     uint8 icmp_type;                    /* ICMP type. */
    921     uint8 icmp_type_mask;               /* ICMP type mask. */
    922     uint8 igmp_type;                    /* IGMP type. */
    923     uint8 igmp_type_mask;               /* IGMP type mask. */
    924     uint8 l4_valid;                     /* If set, layer 4 header present. */
    925     uint8 l4_valid_mask;                /* L4_valid mask. */
    926     uint16 l4_src_port;                 /* Layer 4 source port. */
    927     uint16 l4_src_port_mask;            /* Layer 4 source port mask. */
    928     uint16 l4_dst_port;                 /* Layer 4 destination port. */
    929     uint16 l4_dst_port_mask;            /* Layer 4 destination port mask. */
    930     uint16 l5_bytes_0_1;                /* First 2 bytes of layer 5 header. */
    931     uint16 l5_bytes_0_1_mask;           /* L5_bytes_0_1 mask. */
    932     uint16 outer_l5_bytes_0_1;          /* Outer l5 bytes 0 1. */
    933     uint16 outer_l5_bytes_0_1_mask;     /* Outer l5 bytes 0 1 mask. */
    934     uint8 ip_last_protocol;             /* Protocol from IP extension header if
    935                                            present, otherwise from IP header. */
    936     uint8 ip_last_protocol_mask;        /* Ip_last_protocol mask. */
    937     uint8 fixed_hve_result_set_1;       /* Fixed HVE result 1. */
    938     uint8 fixed_hve_result_set_1_mask;  /* Fixed HVE result 1 mask. */
    939     uint8 fixed_hve_result_set_5;       /* Fixed HVE result 5. */
    940     uint8 fixed_hve_result_set_5_mask;  /* Fixed HVE result 5 mask. */
    941     uint8 flex_hve_result_set_1;        /* Flex HVE result 1. */
    942     uint8 flex_hve_result_set_1_mask;   /* Flex HVE result 1 mask. */
    943     uint8 tunnel_processing_results_1;  /* Tunnel processing results 1. */
    944     uint8 tunnel_processing_results_1_mask; /* Tunnel processing results 1 mask. */
    945     uint8 vfp_opaque_ctrl_id;           /* VFP opaque ctrl id. */
    946     uint8 vfp_opaque_ctrl_id_mask;      /* VFP opaque ctrl id mask. */
    947     uint8 vlan_xlate_opaque_ctrl_id;    /* VLAN_XLATE opaque ctrl id: Bit 0 :
    948                                            VLAN_XLATE drop; Bit 1 : VLAN_XLATE
    949                                            copy to CPU; Bits 2-3: The highest 2
    950                                            bits of VLAN_XLATE opaque control id. */
    951     uint8 vlan_xlate_opaque_ctrl_id_mask; /* vlan_xlate_opaque_ctrl_id - Mask. */
    952     uint8 vlan_xlate_opaque_ctrl_id_1;  /* VLAN_XLATE opaque ctrl id_1: Bits
    953                                            0-3: The lowest 4 bits of VLAN_XLATE
    954                                            opaque control id. */
    955     uint8 vlan_xlate_opaque_ctrl_id_1_mask; /* vlan_xlate_opaque_ctrl_id_1 - Mask. */
    956 } bcm_compat6519_switch_pkt_protocol_match_t;
    957 
    958 /* An API to add a protocol control entry. */
    959 extern int bcm_compat6519_switch_pkt_protocol_control_add(
    960     int unit,
    961     uint32 options,
    962     bcm_compat6519_switch_pkt_protocol_match_t *match,
    963     bcm_switch_pkt_control_action_t *action,
    964     int priority);
    965 
    966 /* An API to get action and priority for a protocol control entry. */
    967 extern int bcm_compat6519_switch_pkt_protocol_control_get(
    968     int unit,
    969     bcm_compat6519_switch_pkt_protocol_match_t *match,
    970     bcm_switch_pkt_control_action_t *action,
    971     int *priority);
    972 
    973 /* An API to delete a protocol control entry. */
    974 extern int bcm_compat6519_switch_pkt_protocol_control_delete(
    975     int unit,
    976     bcm_compat6519_switch_pkt_protocol_match_t *match);
    977 
    978 /* Learning events distibution. */
    979 typedef struct bcm_compat6519_l2_addr_distribute_s {
    980     uint32 flags;    /* BCM_L2_ADDR_DIST_XXX flags. */
    981     bcm_vlan_t vid;    /* VLAN or VPN identifier. */
    982 } bcm_compat6519_l2_addr_distribute_t;
    983 
    984 /* Per VSI set which events (learn, station move (transplant), aged-out)
    985 to inform CPU about. */
    986 extern int bcm_compat6519_l2_addr_msg_distribute_set(
    987     int unit,
    988     bcm_compat6519_l2_addr_distribute_t *distribution);
    989 
    990 /* Per VSI, get which events (learn, station move (transplant), aged-out)
    991 to inform CPU about. */
    992 extern int bcm_compat6519_l2_addr_msg_distribute_get(
    993     int unit,
    994     bcm_compat6519_l2_addr_distribute_t *distribution);
    995 
    996 /*
    997  * Mirror destination Structure
    998  *
    999  * Contains information required for manipulating mirror destinations.
   1000  */
   1001 typedef struct bcm_compat6519_mirror_destination_s {
   1002     bcm_gport_t mirror_dest_id;         /* Unique mirror destination and
   1003                                            encapsulation identifier. */
   1004     uint32 flags;                       /* See BCM_MIRROR_DEST_xxx flag
   1005                                            definitions. */
   1006     bcm_gport_t gport;                  /* Mirror destination. */
   1007     uint8 version;                      /* IP header version. */
   1008     uint8 tos;                          /* Traffic Class/Tos byte. */
   1009     uint8 ttl;                          /* Hop limit. */
   1010     bcm_ip_t src_addr;                  /* Tunnel source ip address (IPv4). */
   1011     bcm_ip_t dst_addr;                  /* Tunnel destination ip address (IPv4). */
   1012     bcm_ip6_t src6_addr;                /* Tunnel source ip address (IPv6). */
   1013     bcm_ip6_t dst6_addr;                /* Tunnel destination ip address (IPv6). */
   1014     uint32 flow_label;                  /* IPv6 header flow label field. */
   1015     bcm_mac_t src_mac;                  /* L2 source mac address. */
   1016     bcm_mac_t dst_mac;                  /* L2 destination mac address. */
   1017     uint16 tpid;                        /* L2 header outer TPID. */
   1018     bcm_vlan_t vlan_id;                 /* Vlan id. */
   1019     bcm_trill_name_t trill_src_name;    /* TRILL source bridge nickname */
   1020     bcm_trill_name_t trill_dst_name;    /* TRILL destination bridge nickname */
   1021     int trill_hopcount;                 /* TRILL hop count */
   1022     uint16 niv_src_vif;                 /* Source Virtual Interface of NIV tag */
   1023     uint16 niv_dst_vif;                 /* Destination Virtual Interface of NIV
   1024                                            tag */
   1025     uint32 niv_flags;                   /* NIV flags BCM_MIRROR_NIV_XXX */
   1026     uint16 gre_protocol;                /* L3 GRE header protocol */
   1027     bcm_policer_t policer_id;           /* policer_id */
   1028     int stat_id;                        /* stat_id */
   1029     int stat_id2;                       /* stat_id2 for second counter pointer */
   1030     bcm_if_t encap_id;                  /* Encapsulation index */
   1031     bcm_if_t tunnel_id;                 /* IP tunnel for encapsulation. Valid
   1032                                            only if BCM_MIRROR_DEST_TUNNEL_IP_GRE
   1033                                            is set */
   1034     uint16 span_id;                     /* SPAN-ID. Valid only if
   1035                                            BCM_MIRROR_DEST_TUNNEL_WITH_SPAN_ID
   1036                                            is set */
   1037     uint8 pkt_prio;                     /* L2 header PCP */
   1038     uint32 sample_rate_dividend;        /* The probability of mirroring a packet
   1039                                            is: sample_rate_dividend >=
   1040                                            sample_rate_divisor ? 1 :
   1041                                            sample_rate_dividend /
   1042                                            sample_rate_divisor */
   1043     uint32 sample_rate_divisor;
   1044     uint8 int_pri;                      /* Internal Priority */
   1045     uint16 etag_src_vid;                /* Extended (source) port vlan id */
   1046     uint16 etag_dst_vid;                /* Extended (destination) port vlan id */
   1047     uint16 udp_src_port;                /* UDP source port */
   1048     uint16 udp_dst_port;                /* UDP destination port */
   1049     uint32 egress_sample_rate_dividend; /* The probability of outbound mirroring
   1050                                            a packet from the destination is
   1051                                            sample_rate_dividend >=
   1052                                            sample_rate_divisor ? 1 :
   1053                                            sample_rate_dividend /
   1054                                            sample_rate_divisor */
   1055     uint32 egress_sample_rate_divisor;
   1056     uint8 recycle_context;              /* recycle context of egress originating
   1057                                            packets */
   1058     uint16 packet_copy_size;            /*  If non zero, the copied packet will
   1059                                            be truncated to the first
   1060                                            packet_copy_size . Current supported
   1061                                            values for DNX are 0, 64, 128, 192 */
   1062     uint16 egress_packet_copy_size;     /* If non zero and the packet is copied
   1063                                            from the egress, the packet will be
   1064                                            truncated to the first
   1065                                            packet_copy_size . Current supported
   1066                                            values for DNX are 0, 256. */
   1067     bcm_mirror_pkt_header_updates_t packet_control_updates;
   1068     bcm_mirror_psc_t rtag;              /* specify RTAG HASH algorithm used for
   1069                                            shared-id mirror destination */
   1070     uint8 df;                           /* Set the do not fragment bit of IP
   1071                                            header in mirror encapsulation */
   1072     uint8 truncate;                     /* Setting truncate would result in
   1073                                            mirroring a truncated frame */
   1074     uint16 template_id;                 /* Template ID for IPFIX HDR */
   1075     uint32 observation_domain;          /* Observation domain for IPFIX HDR */
   1076     uint32 is_recycle_strict_priority;  /* Recycle priority (1-lossless, 0-high) */
   1077     int ext_stat_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* ext_stat_id to support statistic
   1078                                            interface for mirror packets. */
   1079     uint32 flags2;                      /* See BCM_MIRROR_DEST_FLAGS2_xxx flag
   1080                                            definitions. */
   1081     uint32 vni;                         /* Virtual Network Interface ID. */
   1082     uint32 gre_seq_number;              /* Sequence number value used in GRE
   1083                                            header. If no value is provided,
   1084                                            gre_seq_number will start with 0.
   1085                                            Valid only if
   1086                                            BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */
   1087     bcm_mirror_pkt_erspan_encap_t erspan_header; /* ERSPAN encapsulation header fields.
   1088                                            Valid only if only
   1089                                            BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */
   1090     uint32 initial_seq_number;          /* Starting seq number in SFLOW or PSAMP
   1091                                            header */
   1092     bcm_mirror_psamp_fmt2_meta_data_t meta_data_type; /* Type of item in 'meta_data' */
   1093     uint16 meta_data;                   /* Actual value of class id or meta
   1094                                            data, based on 'meta_data_type' */
   1095     int ext_stat_valid;                 /* Validates the ext_stat. */
   1096     int ext_stat_type_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* Type ids for statistic interface. */
   1097     uint16 ipfix_version;               /* IPFIX version number in PSAMP
   1098                                            encapsulation. */
   1099     uint16 psamp_epoch;                 /* PSAMP epoch field. */
   1100     int cosq;                           /* Queue id that mirror copy is enqueued
   1101                                            into. */
   1102     uint8 cfi;                          /* CFI of VLAN tag. */
   1103     bcm_mirror_timestamp_mode_t timestamp_mode; /* Set timestamp mode for mirror
   1104                                            encapsulation. */
   1105     bcm_mirror_multi_dip_group_t multi_dip_group; /* Multiple destination IP group. */
   1106     int drop_group_bmp;
   1107     bcm_port_t second_pass_src_port;    /* Source port in the second pass. */
   1108     bcm_mirror_truncate_mode_t encap_truncate_mode; /* Truncate mode for mirror
   1109                                            encapsulation packets. */
   1110     int encap_truncate_profile_id;      /* Truncate length profile ID for mirror
   1111                                            encapsulation packets. */
   1112 } bcm_compat6519_mirror_destination_t;
   1113 
   1114 /* Create a mirror (destination, encapsulation) pair. */
   1115 extern int bcm_compat6519_mirror_destination_create(
   1116     int unit,
   1117     bcm_compat6519_mirror_destination_t *mirror_dest);
   1118 
   1119 /* Get  mirror (destination, encapsulation) pair. */
   1120 extern int bcm_compat6519_mirror_destination_get(
   1121     int unit,
   1122     bcm_gport_t mirror_dest_id,
   1123     bcm_compat6519_mirror_destination_t *mirror_dest);
   1124 
   1125 /* Mirror payload zeroing profile information */
   1126 typedef struct bcm_compat6519_mirror_payload_zero_offsets_s {
   1127     int l2_offset;          /* offset from the end of the known L2 headers to
   1128                                start zeroing */
   1129     int l3_offset;          /* offset from the end of the known L3 headers to
   1130                                start zeroing for non-UDP packets */
   1131     int udp_offset;         /* offset from the end of the known L3 headers to
   1132                                start zeroing for UDP packets */
   1133 } bcm_compat6519_mirror_payload_zero_offsets_t;
   1134 
   1135 /* Create mirror zero payload offset profile. */
   1136 extern int bcm_compat6519_mirror_payload_zero_profile_create(
   1137     int unit,
   1138     bcm_compat6519_mirror_payload_zero_offsets_t *mirror_payload_offset_info,
   1139     uint32 flags,
   1140     uint32 *profile_index);
   1141 
   1142 /* Mirror source structure. */
   1143 typedef struct bcm_compat6519_mirror_source_s {
   1144     bcm_mirror_source_type_t type;    /* Mirror source type. */
   1145     uint32 flags;    /* Mirror source flags only with port source type. */
   1146     bcm_port_t port;    /* Port/gport id. */
   1147     bcm_pkt_trace_event_t trace_event;    /* Trace event. */
   1148     bcm_pkt_drop_event_t drop_event;    /* Drop event. */
   1149     int mod_profile_id;    /* Mirror-on-drop profile id. */
   1150     uint32 sample_profile_id;    /* Sample profile id. */
   1151 } bcm_compat6519_mirror_source_t;
   1152 
   1153 /* Add a mirror destination to a mirror source. */
   1154 extern int bcm_compat6519_mirror_source_dest_add(
   1155     int unit,
   1156     bcm_compat6519_mirror_source_t *source,
   1157     bcm_gport_t mirror_dest_id);
   1158 
   1159 /* Delete a mirror destination from a mirror source. */
   1160 extern int bcm_compat6519_mirror_source_dest_delete(
   1161     int unit,
   1162     bcm_compat6519_mirror_source_t *source,
   1163     bcm_gport_t mirror_dest_id);
   1164 
   1165 /* Delete all mirror destinations applied on a mirror source. */
   1166 extern int bcm_compat6519_mirror_source_dest_delete_all(
   1167     int unit,
   1168     bcm_compat6519_mirror_source_t *source);
   1169 
   1170 /* Get all mirror destinations applied on a mirror source. */
   1171 extern int bcm_compat6519_mirror_source_dest_get_all(
   1172     int unit,
   1173     bcm_compat6519_mirror_source_t *source,
   1174     int array_size,
   1175     bcm_gport_t *mirror_dest,
   1176     int *count);
   1177 
   1178 /* Flowtracker tracking parameter information. */
   1179 typedef struct bcm_compat6519_flowtracker_tracking_param_info_s {
   1180     uint32 flags;                       /* Flags for tracking parameters. */
   1181     bcm_flowtracker_tracking_param_type_t param; /* Type of tracking parameter. */
   1182     bcm_flowtracker_tracking_param_user_data_t tracking_data; /* Element data for the tracking param
   1183                                            to be used to add a flow. */
   1184     bcm_flowtracker_tracking_param_mask_t mask; /* Mask to select granular information
   1185                                            from tracking parameter. By default,
   1186                                            mask is set to all enabled. */
   1187     bcm_flowtracker_check_t check_id;   /* Flowtracker check to be used to
   1188                                            tracking flow check data. */
   1189     bcm_flowtracker_timestamp_source_t src_ts; /* Timestamp source info, valid in case
   1190                                            of timestamp and delay related
   1191                                            tracking params. */
   1192     bcm_udf_id_t udf_id;                /* UDF Id associated with the tracking
   1193                                            param. */
   1194 } bcm_compat6519_flowtracker_tracking_param_info_t;
   1195 
   1196 /* Stats of the Flows on the group. */
   1197 typedef struct bcm_compat6519_flowtracker_group_stat_s {
   1198     uint64 flow_exceeded_count;         /* Count of flows not tracked in this
   1199                                            group after maximum number of flows
   1200                                            configured for this group are already
   1201                                            learnt. */
   1202     uint64 flow_missed_count;           /* Count of Aged out flows in the group. */
   1203     uint64 flow_aged_out_count;         /* Count of flows which are Aged out in
   1204                                            the group. */
   1205     uint64 flow_learnt_count;           /* Count of flows learnt on the group. */
   1206     uint64 flow_meter_exceeded_count;   /* Count of flows which exceeded the
   1207                                            metering limits in the group. */
   1208 } bcm_compat6519_flowtracker_group_stat_t;
   1209 
   1210 /* Actions related information for Flow check. */
   1211 typedef struct bcm_compat6519_flowtracker_check_action_info_s {
   1212     uint32 flags;                       /* Action flags. */
   1213     bcm_flowtracker_tracking_param_type_t param; /* The attribute of flow on which the
   1214                                            check is performed. */
   1215     bcm_flowtracker_check_action_t action; /* Action to be performed if check
   1216                                            passes. */
   1217     uint32 mask_value;                  /* Mask value to be applied on flow
   1218                                            attribute. */
   1219     uint8 shift_value;                  /* Right shift value to be applied on
   1220                                            flow attribute. */
   1221     bcm_flowtracker_tracking_param_weight_t weight; /* Weight given to current data over
   1222                                            running average. */
   1223 } bcm_compat6519_flowtracker_check_action_info_t;
   1224 
   1225 /* Set tracking parameter for this flowtracker group. */
   1226 extern int bcm_compat6519_flowtracker_group_tracking_params_set(
   1227     int unit,
   1228     bcm_flowtracker_group_t id,
   1229     int num_tracking_params,
   1230     bcm_compat6519_flowtracker_tracking_param_info_t *list_of_tracking_params);
   1231 
   1232 /* Get flowtracker tracking parameters for this group. */
   1233 extern int bcm_compat6519_flowtracker_group_tracking_params_get(
   1234     int unit,
   1235     bcm_flowtracker_group_t id,
   1236     int max_size,
   1237     bcm_compat6519_flowtracker_tracking_param_info_t *list_of_tracking_params,
   1238     int *list_size);
   1239 
   1240 /* Set flow group's statistics. */
   1241 extern int bcm_compat6519_flowtracker_group_stat_set(
   1242     int unit,
   1243     bcm_flowtracker_group_t group_id,
   1244     bcm_compat6519_flowtracker_group_stat_t *group_stats);
   1245 
   1246 /* Get flow group's statistics. */
   1247 extern int bcm_compat6519_flowtracker_group_stat_get(
   1248     int unit,
   1249     bcm_flowtracker_group_t group_id,
   1250     bcm_compat6519_flowtracker_group_stat_t *group_stats);
   1251 
   1252 /* Initialize a flow check action information structure. */
   1253 extern int bcm_compat6519_flowtracker_check_action_info_set(
   1254     int unit,
   1255     bcm_flowtracker_check_t check_id,
   1256     bcm_compat6519_flowtracker_check_action_info_t info);
   1257 
   1258 /* Initialize a flow check action information structure. */
   1259 extern int bcm_compat6519_flowtracker_check_action_info_get(
   1260     int unit,
   1261     bcm_flowtracker_check_t check_id,
   1262     bcm_compat6519_flowtracker_check_action_info_t *info);
   1263 
   1264 /*
   1265  * Add a user flow entry basis user input key elements. API expects that
   1266  * all tracking parametrs of type = 'KEY' in the group are specified.
   1267  */
   1268 extern int bcm_compat6519_flowtracker_user_entry_add(
   1269     int unit,
   1270     bcm_flowtracker_group_t flow_group_id,
   1271     uint32 options,
   1272     int num_user_entry_params,
   1273     bcm_compat6519_flowtracker_tracking_param_info_t *user_entry_param_list,
   1274     bcm_flowtracker_user_entry_handle_t *entry_handle);
   1275 
   1276 /* Fetch user entry info given the entry handle. */
   1277 extern int bcm_compat6519_flowtracker_user_entry_get(
   1278     int unit,
   1279     bcm_flowtracker_user_entry_handle_t *entry_handle,
   1280     int num_user_entry_params,
   1281     bcm_compat6519_flowtracker_tracking_param_info_t *user_entry_param_list,
   1282     int *actual_user_entry_params);
   1283 
   1284 /* Flowtracker export trigger information. */
   1285 typedef struct bcm_compat6519_flowtracker_export_trigger_info_s {
   1286     SHR_BITDCL trigger_bmp[_SHR_BITDCLSIZE(bcmFlowtrackerExportTriggerCount)];
   1287                                         /* The bitmap of export triggers which
   1288                                            will result in the export of the
   1289                                            IPFIX packets. */
   1290     uint32 interval_usecs;              /* If one of the export triggers is
   1291                                            bcmFlowtrackerExportTriggerTimer,
   1292                                            this provides the interval for the
   1293                                            timer. */
   1294 } bcm_compat6519_flowtracker_export_trigger_info_t;
   1295 
   1296 /* Set flow group's export triggers. */
   1297 extern int bcm_compat6519_flowtracker_group_export_trigger_set(
   1298     int unit,
   1299     bcm_flowtracker_group_t id,
   1300     bcm_compat6519_flowtracker_export_trigger_info_t *export_trigger_info);
   1301 
   1302 /* Get flow group's export triggers. */
   1303 extern int bcm_compat6519_flowtracker_group_export_trigger_get(
   1304     int unit,
   1305     bcm_flowtracker_group_t id,
   1306     bcm_compat6519_flowtracker_export_trigger_info_t *export_trigger_info);
   1307 
   1308 /*
   1309  * IPFIX header in the encap used to send the data packet to the remote
   1310  * collector.
   1311  */
   1312 typedef struct bcm_compat6519_collector_ipfix_header_s {
   1313     int version;                        /* Ipfix Protocol Version. */
   1314     int initial_sequence_num;           /* Ipfix initial sequence number. */
   1315     bcm_collector_ipfix_observation_domain_t observation_domain_id; /* IPFIX observation domain from which
   1316                                            this collector is receiving the
   1317                                            export data.. */
   1318 } bcm_compat6519_collector_ipfix_header_t;
   1319 
   1320 /* Collector information. */
   1321 typedef struct bcm_compat6519_collector_info_s {
   1322     bcm_collector_type_t collector_type; /* Collector type. Remote vs Local */
   1323     bcm_collector_transport_type_t transport_type; /* Transport type used for exporting
   1324                                                       data to the collector. This
   1325                                                       identifies the usable fields within
   1326                                                       the encap structure member defined
   1327                                                       below. */
   1328     bcm_collector_eth_header_t eth;     /* Ethernet encapsulation of the packet
   1329                                            sent to collector. */
   1330     bcm_collector_ipv4_header_t ipv4;   /* IPv4 encapsulation of the packet sent
   1331                                            to collector. */
   1332     bcm_collector_ipv6_header_t ipv6;   /* IPv6 encapsulation of the packet sent
   1333                                            to collector. */
   1334     bcm_collector_udp_header_t udp;     /* UDP encapsulation of the packet sent
   1335                                            to collector. */
   1336     bcm_compat6519_collector_ipfix_header_t ipfix; /* IPFIX encapsulation of the packet
   1337                                            sent to collector. */
   1338     bcm_collector_protobuf_header_t protobuf; /* Protobuf header information. */
   1339     bcm_collector_timestamp_source_t src_ts; /* Timestamp source info. */
   1340 } bcm_compat6519_collector_info_t;
   1341 
   1342 /* Create a collector with given collector info. */
   1343 extern int bcm_compat6519_collector_create(
   1344         int unit,
   1345         uint32 options,
   1346         bcm_collector_t *collector_id,
   1347         bcm_compat6519_collector_info_t *collector_info);
   1348 
   1349 /* Get collector information with ID. */
   1350 extern int bcm_compat6519_collector_get(
   1351         int unit,
   1352         bcm_collector_t id,
   1353         bcm_compat6519_collector_info_t *collector_info);
   1354 
   1355 /* Device-independent L2 address structure. */
   1356 typedef struct bcm_compat6519_l2_addr_s {
   1357     uint32 flags;                       /* BCM_L2_xxx flags. */
   1358     uint32 flags2;                      /* BCM_L2_FLAGS2_xxx flags. */
   1359     uint32 station_flags;               /* BCM_L2_STATION_xxx flags. */
   1360     bcm_mac_t mac;                      /* 802.3 MAC address. */
   1361     bcm_vlan_t vid;                     /* VLAN identifier. */
   1362     int port;                           /* Zero-based port number. */
   1363     int modid;                          /* XGS: modid. */
   1364     bcm_trunk_t tgid;                   /* Trunk group ID. */
   1365     bcm_cos_t cos_dst;                  /* COS based on dst addr. */
   1366     bcm_cos_t cos_src;                  /* COS based on src addr. */
   1367     bcm_multicast_t l2mc_group;         /* XGS: index in L2MC table */
   1368     bcm_if_t egress_if;                 /* XGS: index in Next Hop Tables. Used
   1369                                            it with BCM_L2_FLAGS2_ROE_NHI flag */
   1370     bcm_multicast_t l3mc_group;         /* XGS: index in L3_IPMC table. Use it
   1371                                            with BCM_L2_FLAGS2_L3_MULTICAST. */
   1372     bcm_pbmp_t block_bitmap;            /* XGS: blocked egress bitmap. */
   1373     int auth;                           /* Used if auth enabled on port. */
   1374     int group;                          /* Group number for FP. */
   1375     bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */
   1376     int encap_id;                       /* out logical interface */
   1377     int age_state;                      /* Age state of the entry */
   1378     uint32 flow_handle;                 /* FLOW handle for flex entries. */
   1379     uint32 flow_option_handle;          /* FLOW option handle for flex entries. */
   1380     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex
   1381                                            entries. */
   1382     uint32 num_of_fields;               /* number of logical fields. */
   1383     bcm_pbmp_t sa_source_filter_pbmp;   /* Source port filter bitmap for this SA */
   1384     bcm_tsn_flowset_t tsn_flowset;      /* Time-Sensitive Networking: associated
   1385                                            flow set */
   1386     bcm_tsn_sr_flowset_t sr_flowset;    /* Seamless Redundancy: associated flow
   1387                                            set */
   1388     bcm_policer_t policer_id;           /* Base policer to be used */
   1389     bcm_tsn_pri_map_t taf_gate_primap;  /* TAF (Time Aware Filtering) gate
   1390                                            priority mapping */
   1391     uint32 stat_id;                     /* Object statistics ID */
   1392     int stat_pp_profile;                /* Statistics profile */
   1393     uint16 gbp_src_id;                  /* GBP Source ID */
   1394 } bcm_compat6519_l2_addr_t;
   1395 
   1396 extern int bcm_compat6519_l2_addr_add(int unit,
   1397                                       bcm_compat6519_l2_addr_t *l2addr);
   1398 extern int bcm_compat6519_l2_addr_multi_add(int unit,
   1399                                             bcm_compat6519_l2_addr_t *l2addr, int count);
   1400 extern int bcm_compat6519_l2_addr_multi_delete(int unit,
   1401                                                bcm_compat6519_l2_addr_t *l2addr, int count);
   1402 extern int bcm_compat6519_l2_addr_get(int unit, bcm_mac_t mac_addr, bcm_vlan_t vid,
   1403                                       bcm_compat6519_l2_addr_t *l2addr);
   1404 extern int bcm_compat6519_l2_conflict_get(int unit, bcm_compat6519_l2_addr_t *addr,
   1405                                           bcm_compat6519_l2_addr_t *cf_array, int cf_max,
   1406                                           int *cf_count);
   1407 extern int bcm_compat6519_l2_replace(int unit, uint32 flags,
   1408                                      bcm_compat6519_l2_addr_t *match_addr,
   1409                                      bcm_module_t new_module,
   1410                                      bcm_port_t new_port, bcm_trunk_t new_trunk);
   1411 extern int bcm_compat6519_l2_replace_match(int unit, uint32 flags,
   1412                                            bcm_compat6519_l2_addr_t *match_addr,
   1413                                            bcm_compat6519_l2_addr_t *mask_addr,
   1414                                            bcm_compat6519_l2_addr_t *replace_addr,
   1415                                            bcm_compat6519_l2_addr_t *replace_mask_addr);
   1416 extern int bcm_compat6519_l2_stat_get(int unit,
   1417                                       bcm_compat6519_l2_addr_t *l2addr,
   1418                                       bcm_l2_stat_t stat, uint64 *val);
   1419 extern int bcm_compat6519_l2_stat_get32(int unit,
   1420                                         bcm_compat6519_l2_addr_t *l2addr,
   1421                                         bcm_l2_stat_t stat, uint32 *val);
   1422 extern int bcm_compat6519_l2_stat_set(int unit,
   1423                                       bcm_compat6519_l2_addr_t *l2addr,
   1424                                       bcm_l2_stat_t stat, uint64 val);
   1425 extern int bcm_compat6519_l2_stat_set32(int unit,
   1426                                         bcm_compat6519_l2_addr_t *l2addr,
   1427                                         bcm_l2_stat_t stat, uint32 val);
   1428 extern int bcm_compat6519_l2_stat_enable_set(int unit,
   1429                                              bcm_compat6519_l2_addr_t *l2addr,
   1430                                              int enable);
   1431 extern int bcm_compat6519_l2_addr_by_struct_get(int unit, bcm_compat6519_l2_addr_t *l2addr);
   1432 extern int bcm_compat6519_l2_addr_by_struct_delete(int unit, bcm_compat6519_l2_addr_t *l2addr);
   1433 
   1434 #define BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE   2          /* Operation object array
   1435                                                           size number. */
   1436 
   1437 /*
   1438  * Flex counter index operation structure.
   1439  *
   1440  * This data structure lists the operation of a flex counter index.
   1441  * Flex counter index would be generated as below:
   1442  *      value0 = (SEL(object0) >> shift0) & ((1 << mask_size0) - 1)).
   1443  *      value1 = (SEL(object1) & ((1 << mask_size1) - 1)) << shift1.
   1444  *      index = (value1 | value0).
   1445  */
   1446 typedef struct bcm_compat6519_flexctr_index_operation_s {
   1447     bcm_flexctr_object_t object[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Flex counter object array. */
   1448     uint32 quant_id[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Quantization ID. */
   1449     uint8 mask_size[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Object mask size array. */
   1450     uint8 shift[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Object shift array. */
   1451     uint32 object_id[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Flex counter object ID. */
   1452 } bcm_compat6519_flexctr_index_operation_t;
   1453 
   1454 /*
   1455  * Flex counter value operation structure.
   1456  *
   1457  * This data structure lists the operation of a flex counter update
   1458  * value.
   1459  * Flex counter update value would be generated as below:
   1460  *      value0 = (SEL(object0) >> shift0) & ((1 << mask_size0) - 1)).
   1461  *      value1 = (SEL(object1) & ((1 << mask_size1) - 1)) << shift1.
   1462  *      value = (value1 | value0).
   1463  *      New_counter = UPDATE_TYPE(old_counter, value).
   1464  */
   1465 typedef struct bcm_compat6519_flexctr_value_operation_s {
   1466     bcm_flexctr_value_select_t select;  /* Select counter value. */
   1467     bcm_flexctr_object_t object[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Flex counter object array. */
   1468     uint32 quant_id[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Quantization ID. */
   1469     uint8 mask_size[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Object mask size array. */
   1470     uint8 shift[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Object shift array. */
   1471     bcm_flexctr_value_operation_type_t type; /* Counter value operation type. */
   1472     uint32 object_id[BCM_COMPAT6519_FLEXCTR_OPERATION_OBJECT_SIZE]; /* Flex counter object ID. */
   1473 } bcm_compat6519_flexctr_value_operation_t;
   1474 
   1475 /*
   1476  * Flex counter trigger structure.
   1477  *
   1478  * This data structure lists the properties of the flex counter trigger.
   1479  */
   1480 typedef struct bcm_compat6519_flexctr_trigger_s {
   1481     bcm_flexctr_trigger_type_t trigger_type; /* Trigger type. */
   1482     uint8 period_num;                   /* Time trigger period number. */
   1483     bcm_flexctr_trigger_interval_t interval; /* Time trigger interval scale. */
   1484     bcm_flexctr_object_t object;        /* Flex counter object. */
   1485     uint16 object_value_start;          /* Conditional trigger start value. */
   1486     uint16 object_value_stop;           /* Conditional trigger stop value. */
   1487     uint16 object_value_mask;           /* Conditional trigger mask. */
   1488     uint16 interval_shift;              /* Time trigger interval shift. */
   1489     uint16 interval_size;               /* Time trigger interval size. */
   1490     uint32 object_id;                   /* Flex counter object ID. */
   1491 } bcm_compat6519_flexctr_trigger_t;
   1492 
   1493 /*
   1494  * Flex counter action structure.
   1495  *
   1496  * This data structure lists the properties of a flex counter action.
   1497  */
   1498 typedef struct bcm_compat6519_flexctr_action_s {
   1499     uint32 flags;                       /* Action flags. */
   1500     bcm_flexctr_source_t source;        /* Flex counter source. */
   1501     bcm_pbmp_t ports;                   /* Flex counter ports. */
   1502     int hint;                           /* Flex counter hint. */
   1503     bcm_flexctr_drop_count_mode_t drop_count_mode; /* Counter drop mode for functional
   1504                                            packet drops. */
   1505     int exception_drop_count_enable;    /* Enable to count on hardware exception
   1506                                            drops. */
   1507     int egress_mirror_count_enable;     /* Enable to count egress mirrored
   1508                                            packets also. */
   1509     bcm_flexctr_counter_mode_t mode;    /* Action mode. */
   1510     uint32 index_num;                   /* Total counter index number. */
   1511     bcm_compat6519_flexctr_index_operation_t index_operation; /* Flex counter index operation
   1512                                            structure. */
   1513     bcm_compat6519_flexctr_value_operation_t operation_a; /* Flex counter value A operation
   1514                                            structure. */
   1515     bcm_compat6519_flexctr_value_operation_t operation_b; /* Flex counter value B operation
   1516                                            structure. */
   1517     bcm_compat6519_flexctr_trigger_t trigger;      /* Flex counter trigger structure. */
   1518 } bcm_compat6519_flexctr_action_t;
   1519 
   1520 /* Flex counter action creation function. */
   1521 extern int bcm_compat6519_flexctr_action_create(
   1522     int unit,
   1523     int options,
   1524     bcm_compat6519_flexctr_action_t *action,
   1525     uint32 *stat_counter_id);
   1526 
   1527 /* Flex counter action get function. */
   1528 extern int bcm_compat6519_flexctr_action_get(
   1529     int unit,
   1530     uint32 stat_counter_id,
   1531     bcm_compat6519_flexctr_action_t *action);
   1532 
   1533 /* Flowtracker export template elements information. */
   1534 typedef struct bcm_compat6519_flowtracker_export_element_info_s {
   1535     uint32 flags;                       /* See
   1536                                            BCM_FLOWTRACKER_EXPORT_ELEMENT_FLAGS_XXX. */
   1537     bcm_flowtracker_export_element_type_t element; /* Type of export element. */
   1538     uint32 data_size;                   /* Size of information element in the
   1539                                            export record in bytes. If the
   1540                                            data_size is given as 0, then the
   1541                                            default RFC size is used. */
   1542     uint16 info_elem_id;                /* Information element to be used, when
   1543                                            the template set is exported. */
   1544     bcm_flowtracker_check_t check_id;   /* Flowtracker Check Id for exporting
   1545                                            check data. */
   1546 } bcm_compat6519_flowtracker_export_element_info_t;
   1547 
   1548 /* Validate the template and return the list supported by the device. */
   1549 extern int bcm_compat6519_flowtracker_export_template_validate(
   1550     int unit,
   1551     bcm_flowtracker_group_t flow_group_id,
   1552     int max_in_export_elements,
   1553     bcm_compat6519_flowtracker_export_element_info_t *in_export_elements,
   1554     int max_out_export_elements,
   1555     bcm_compat6519_flowtracker_export_element_info_t *out_export_elements,
   1556     int *actual_out_export_elements);
   1557 
   1558 /* Create a flowtracker export template. */
   1559 extern int bcm_compat6519_flowtracker_export_template_create(
   1560     int unit,
   1561     uint32 options,
   1562     bcm_flowtracker_export_template_t *id,
   1563     uint16 set_id,
   1564     int num_export_elements,
   1565     bcm_compat6519_flowtracker_export_element_info_t *list_of_export_elements);
   1566 
   1567 /* Get a flowtracker export template. */
   1568 extern int bcm_compat6519_flowtracker_export_template_get(
   1569     int unit,
   1570     bcm_flowtracker_export_template_t id,
   1571     uint16 *set_id,
   1572     int max_size,
   1573     bcm_compat6519_flowtracker_export_element_info_t *list_of_export_elements,
   1574     int *list_size);
   1575 
   1576 /* Truncate length profile structure. */
   1577 typedef struct bcm_compat6519_mirror_truncate_length_profile_s {
   1578     int adjustment_length;    /* Mirror payload adjustment length after truncation. */
   1579 } bcm_compat6519_mirror_truncate_length_profile_t;
   1580 
   1581 /* Create the truncate length profile. */
   1582 extern int bcm_compat6519_mirror_truncate_length_profile_create(
   1583     int unit,
   1584     uint32 options,
   1585     int *profile_id,
   1586     bcm_compat6519_mirror_truncate_length_profile_t *profile);
   1587 
   1588 /* Get the truncate length profile entry with a given profile id. */
   1589 extern int bcm_compat6519_mirror_truncate_length_profile_get(
   1590     int unit,
   1591     int profile_id,
   1592     bcm_compat6519_mirror_truncate_length_profile_t *profile);
   1593 
   1594 /* OAM delay object. */
   1595 typedef struct bcm_compat6519_oam_delay_s {
   1596     uint32 flags;    /*  */
   1597     int delay_id;    /* Oam Delay ID. */
   1598     bcm_oam_endpoint_t id;    /* Endpoint ID of Local MEP. */
   1599     bcm_oam_endpoint_t remote_id;    /* Endpoint ID of Remote MEP. */
   1600     int period;    /* Frequency of delay tx period in milliseconds. Zero indicates single shot, -1 indicates disabling delay packets transmission */
   1601     bcm_time_spec_t delay_min;    /* Minimal recorded delay to remote peer. Reset when read. */
   1602     bcm_time_spec_t delay_max;    /* Maximul recorded delay to remote peer. Reset when read. */
   1603     bcm_time_spec_t delay;    /* Last recorded delay to remote peer. */
   1604     bcm_time_spec_t txf;    /* Time of transmit in forward direction. */
   1605     bcm_time_spec_t rxf;    /* Time of reception in forward direction. */
   1606     bcm_time_spec_t txb;    /* Time of transmit in backward direction. */
   1607     bcm_time_spec_t rxb;    /* Time of reception in backward direction. */
   1608     uint8 pkt_pri;    /* Egress marking for outgoing DM messages */
   1609     uint8 pkt_pri_bitmap;    /* Bitmap of packet priorities which should be measured for DM. A value of zero is the equivalent of all ones. */
   1610     bcm_cos_t int_pri;    /* Egress queuing for outgoing DM messages */
   1611     uint32 rx_oam_packets;    /* Count of OAM packets received by this endpoint */
   1612     uint32 tx_oam_packets;    /* Count of OAM packets transmitted by this endpoint */
   1613     bcm_oam_timestamp_format_t timestamp_format;    /* OAM timestamp type */
   1614     bcm_mac_t peer_da_mac_address;    /* MAC DA in DMM injection in case peer endpoint is not configured in remote_id */
   1615     uint32 pm_id;    /* Performance measurement ID in BTE */
   1616     uint32 dm_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX];    /* The base index of the LM counter to be updated by Tx DM packets */
   1617     uint32 dm_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX];    /* Offset to the Base LM counter Id to be incremented by Tx DM packets */
   1618     uint32 dm_tx_update_lm_counter_byte_offset[BCM_OAM_LM_COUNTER_MAX];    /* Byte offset in the Tx DM packet from which to increment the LM byte counter */
   1619     uint8 dm_tx_update_lm_counter_size;    /* Number of LM counters to be incremented by Tx DM packets */
   1620     bcm_oam_tlv_t tlvs[BCM_OAM_MAX_NUM_TLVS_FOR_DM];    /* TLV contents of DM */
   1621 } bcm_compat6519_oam_delay_t;
   1622 
   1623 /* Add an OAM delay object */
   1624 extern int bcm_compat6519_oam_delay_add(
   1625     int unit,
   1626     bcm_compat6519_oam_delay_t *delay_ptr);
   1627 
   1628 /* Get an OAM delay object */
   1629 extern int bcm_compat6519_oam_delay_get(
   1630     int unit,
   1631     bcm_compat6519_oam_delay_t *delay_ptr);
   1632 
   1633 /* Delete an OAM delay object */
   1634 extern int bcm_compat6519_oam_delay_delete(
   1635     int unit,
   1636     bcm_compat6519_oam_delay_t *delay_ptr);
   1637 
   1638 /* Structure for Time of the day values. */
   1639 typedef struct bcm_compat6519_time_tod_s {
   1640     bcm_time_format_t time_format;    /* Time format for counter */
   1641     bcm_time_spec_t ts;    /* time of the day values. */
   1642     uint64 ts_adjustment_counter_ns;    /* tod value adjustment in nanoseconds. */
   1643 } bcm_compat6519_time_tod_t;
   1644 
   1645 /* Set time of the day values at various stages in ASIC. */
   1646 extern int bcm_compat6519_time_tod_set(
   1647     int unit,
   1648     uint32 stages,
   1649     bcm_compat6519_time_tod_t *tod);
   1650 
   1651 /* Get time of the day values at various stages in ASIC. */
   1652 extern int bcm_compat6519_time_tod_get(
   1653     int unit,
   1654     uint32 stages,
   1655     bcm_compat6519_time_tod_t *tod);
   1656 
   1657 #if defined(INCLUDE_L3)
   1658 /* L3 tunneling initiator. */
   1659 typedef struct bcm_compat6519_tunnel_initiator_s {
   1660     uint32 flags;    /* Configuration flags. */
   1661     bcm_tunnel_type_t type;    /* Tunnel type. */
   1662     int ttl;    /* Tunnel header TTL. */
   1663     bcm_mac_t dmac;    /* Destination MAC address. */
   1664     bcm_ip_t dip;    /* Tunnel header DIP (IPv4). */
   1665     bcm_ip_t sip;    /* Tunnel header SIP (IPv4). */
   1666     bcm_ip6_t sip6;    /* Tunnel header SIP (IPv6). */
   1667     bcm_ip6_t dip6;    /* Tunnel header DIP (IPv6). */
   1668     uint32 flow_label;    /* Tunnel header flow label (IPv6). */
   1669     bcm_tunnel_dscp_select_t dscp_sel;    /* Tunnel header DSCP select. */
   1670     int dscp;    /* Tunnel header DSCP value. */
   1671     int dscp_map;    /* DSCP-map ID. */
   1672     bcm_gport_t tunnel_id;    /* Tunnel ID */
   1673     uint16 udp_dst_port;    /* Destination UDP port */
   1674     uint16 udp_src_port;    /* Source UDP port */
   1675     bcm_mac_t smac;    /* WLAN outer MAC */
   1676     int mtu;    /* WLAN MTU */
   1677     bcm_vlan_t vlan;    /* Tunnel VLAN */
   1678     uint16 tpid;    /* Tunnel TPID */
   1679     uint8 pkt_pri;    /* Tunnel priority */
   1680     uint8 pkt_cfi;    /* Tunnel CFI */
   1681     uint16 ip4_id;    /* IPv4 ID. */
   1682     bcm_if_t l3_intf_id;    /* l3 Interface ID. */
   1683     uint16 span_id;    /* Erspan Span ID. */
   1684     uint32 aux_data;    /* Tunnel associated data. */
   1685     int outlif_counting_profile;    /* Out LIF counting profile */
   1686     bcm_encap_access_t encap_access;    /* Encapsulation Access stage */
   1687     uint8 hw_id;    /* Unique identifier of an ERSPAN engine within a system */
   1688     uint16 switch_id;    /* Identifies a source switch at the receiving end */
   1689     uint16 class_id;    /* Class ID of the RSPAN advanced tunnel */
   1690     bcm_qos_egress_model_t egress_qos_model;    /* egress qos and ttl model */
   1691     int qos_map_id;    /* general remark profile */
   1692     uint8 ecn;    /* Tunnel header ECN value. */
   1693     bcm_tunnel_flow_label_select_t flow_label_sel;    /* Tunnel header flow label select. */
   1694     bcm_tunnel_dscp_ecn_select_t dscp_ecn_sel;    /* Tunnel header DSCP and ECN select. */
   1695     int dscp_ecn_map;    /* DSCP and ECN map ID. */
   1696 } bcm_compat6519_tunnel_initiator_t;
   1697 
   1698 /* Set the tunneling initiator parameters on an L3 interface. */
   1699 extern int bcm_compat6519_tunnel_initiator_set(
   1700     int unit,
   1701     bcm_l3_intf_t *intf,
   1702     bcm_compat6519_tunnel_initiator_t *tunnel);
   1703 
   1704 /* Set the tunneling initiator parameters on an L3 interface. */
   1705 extern int bcm_compat6519_tunnel_initiator_create(
   1706     int unit,
   1707     bcm_l3_intf_t *intf,
   1708     bcm_compat6519_tunnel_initiator_t *tunnel);
   1709 
   1710 /* Get the tunnel property for the given L3 interface. */
   1711 extern int bcm_compat6519_tunnel_initiator_get(
   1712     int unit,
   1713     bcm_l3_intf_t *intf,
   1714     bcm_compat6519_tunnel_initiator_t *tunnel);
   1715 
   1716 /* Create VXLAN Tunnel Initiator.  */
   1717 extern int bcm_compat6519_vxlan_tunnel_initiator_create(
   1718     int unit,
   1719     bcm_compat6519_tunnel_initiator_t *info);
   1720 
   1721 /* Get  VXLAN Tunnel Initiator.  */
   1722 extern int bcm_compat6519_vxlan_tunnel_initiator_get(
   1723     int unit,
   1724     bcm_compat6519_tunnel_initiator_t *info);
   1725 
   1726 /* Set the tunneling initiator parameters for a WLAN tunnel. */
   1727 extern int bcm_compat6519_wlan_tunnel_initiator_create(
   1728     int unit,
   1729     bcm_compat6519_tunnel_initiator_t *info);
   1730 
   1731 /* Get the tunnel properties for an outgoing WLAN tunnel. */
   1732 extern int bcm_compat6519_wlan_tunnel_initiator_get(
   1733     int unit,
   1734     bcm_compat6519_tunnel_initiator_t *info);
   1735 
   1736 /* Create L2GRE Tunnel Initiator.  */
   1737 extern int bcm_compat6519_l2gre_tunnel_initiator_create(
   1738     int unit,
   1739     bcm_compat6519_tunnel_initiator_t *info);
   1740 
   1741 /* Get  L2GRE Tunnel Initiator.  */
   1742 extern int bcm_compat6519_l2gre_tunnel_initiator_get(
   1743     int unit,
   1744     bcm_compat6519_tunnel_initiator_t *info);
   1745 
   1746 /* L3 tunneling terminator. */
   1747 typedef struct bcm_compat6519_tunnel_terminator_s {
   1748     uint32 flags;    /* Configuration flags. */
   1749     uint32 multicast_flag;    /* VXLAN Multicast trigger flags. */
   1750     bcm_vrf_t vrf;    /* Virtual router instance. */
   1751     bcm_ip_t sip;    /* SIP for tunnel header match. */
   1752     bcm_ip_t dip;    /* DIP for tunnel header match. */
   1753     bcm_ip_t sip_mask;    /* Source IP mask. */
   1754     bcm_ip_t dip_mask;    /* Destination IP mask. */
   1755     bcm_ip6_t sip6;    /* SIP for tunnel header match (IPv6). */
   1756     bcm_ip6_t dip6;    /* DIP for tunnel header match (IPv6). */
   1757     bcm_ip6_t sip6_mask;    /* Source IP mask (IPv6). */
   1758     bcm_ip6_t dip6_mask;    /* Destination IP mask (IPv6). */
   1759     uint32 udp_dst_port;    /* UDP dst port for UDP packets. */
   1760     uint32 udp_src_port;    /* UDP src port for UDP packets */
   1761     bcm_tunnel_type_t type;    /* Tunnel type */
   1762     bcm_pbmp_t pbmp;    /* Port bitmap for this tunnel */
   1763     bcm_vlan_t vlan;    /* The VLAN ID or L3 ingress interface ID for IPMC lookup or WLAN tunnel */
   1764     bcm_vlan_t fwd_vlan;    /* VLAN ID for forwarding terminated IP Tunnel */
   1765     bcm_gport_t remote_port;    /* Remote termination */
   1766     bcm_gport_t tunnel_id;    /* Tunnel id */
   1767     int if_class;    /* L3 interface class this tunnel. */
   1768     bcm_multicast_t failover_mc_group;    /* MC group used for bi-cast. */
   1769     bcm_failover_t ingress_failover_id;    /* 1+1 protection. */
   1770     bcm_failover_t failover_id;    /* Failover Object Identifier for protected tunnel. */
   1771     bcm_gport_t failover_tunnel_id;    /* Failover Tunnel ID. */
   1772     bcm_if_t tunnel_if;    /* hierarchical interface. */
   1773     int tunnel_class;    /* Tunnel class id for VFP match. */
   1774     int qos_map_id;    /* QoS DSCP map this tunnel. */
   1775     int inlif_counting_profile;    /* In LIF counting profile */
   1776     int tunnel_term_ecn_map_id;    /* Tunnel termination ecn map id. */
   1777     bcm_qos_ingress_model_t ingress_qos_model;    /* ingress qos and ttl model */
   1778     int priority;    /* Entry priority. */
   1779     int subport_pbmp_profile_id;    /* profile id for allowed subports on this tunnel. */
   1780     bcm_if_t egress_if;    /* Tunnel egress interface */
   1781 } bcm_compat6519_tunnel_terminator_t;
   1782 
   1783 /* Add a tunnel terminator for DIP-SIP key. */
   1784 extern int bcm_compat6519_tunnel_terminator_add(
   1785     int unit,
   1786     bcm_compat6519_tunnel_terminator_t *info);
   1787 
   1788 /* Add a tunnel terminator for DIP-SIP key. */
   1789 extern int bcm_compat6519_tunnel_terminator_create(
   1790     int unit,
   1791     bcm_compat6519_tunnel_terminator_t *info);
   1792 
   1793 /* Delete a tunnel terminator for DIP-SIP key. */
   1794 extern int bcm_compat6519_tunnel_terminator_delete(
   1795     int unit,
   1796     bcm_compat6519_tunnel_terminator_t *info);
   1797 
   1798 /* Update a tunnel terminator for DIP-SIP key. */
   1799 extern int bcm_compat6519_tunnel_terminator_update(
   1800     int unit,
   1801     bcm_compat6519_tunnel_terminator_t *info);
   1802 
   1803 /* Get a tunnel terminator for DIP-SIP key. */
   1804 extern int bcm_compat6519_tunnel_terminator_get(
   1805     int unit,
   1806     bcm_compat6519_tunnel_terminator_t *info);
   1807 
   1808 /* Attach counters entries to the given tunnel. */
   1809 extern int bcm_compat6519_tunnel_terminator_stat_attach(
   1810     int unit,
   1811     bcm_compat6519_tunnel_terminator_t *terminator,
   1812     uint32 stat_counter_id);
   1813 
   1814 /* Detach counters entries to the given tunnel. */
   1815 extern int bcm_compat6519_tunnel_terminator_stat_detach(
   1816     int unit,
   1817     bcm_compat6519_tunnel_terminator_t *terminator);
   1818 
   1819 /* Get stat counter id associated with given tunnel. */
   1820 extern int bcm_compat6519_tunnel_terminator_stat_id_get(
   1821     int unit,
   1822     bcm_compat6519_tunnel_terminator_t *terminator,
   1823     uint32 *stat_counter_id);
   1824 
   1825 /* Set flex counter object value for the given tunnel. */
   1826 extern int bcm_compat6519_tunnel_terminator_flexctr_object_set(
   1827     int unit,
   1828     bcm_compat6519_tunnel_terminator_t *terminator,
   1829     uint32 value);
   1830 
   1831 /* Get flex counter object value for the given tunnel. */
   1832 extern int bcm_compat6519_tunnel_terminator_flexctr_object_get(
   1833     int unit,
   1834     bcm_compat6519_tunnel_terminator_t *terminator,
   1835     uint32 *value);
   1836 
   1837 /* Create VXLAN Tunnel terminator. */
   1838 extern int bcm_compat6519_vxlan_tunnel_terminator_create(
   1839     int unit,
   1840     bcm_compat6519_tunnel_terminator_t *info);
   1841 
   1842 /* Update multicast/active state per VXLAN Tunnel terminator. */
   1843 extern int bcm_compat6519_vxlan_tunnel_terminator_update(
   1844     int unit,
   1845     bcm_compat6519_tunnel_terminator_t *info);
   1846 
   1847 /* Get VXLAN Tunnel terminator. */
   1848 extern int bcm_compat6519_vxlan_tunnel_terminator_get(
   1849     int unit,
   1850     bcm_compat6519_tunnel_terminator_t *info);
   1851 
   1852 /* Create L2GRE Tunnel terminator. */
   1853 extern int bcm_compat6519_l2gre_tunnel_terminator_create(
   1854     int unit,
   1855     bcm_compat6519_tunnel_terminator_t *info);
   1856 
   1857 /* Update L2GRE Tunnel terminator. */
   1858 extern int bcm_compat6519_l2gre_tunnel_terminator_update(
   1859     int unit,
   1860     bcm_compat6519_tunnel_terminator_t *info);
   1861 
   1862 /* Get L2GRE Tunnel terminator. */
   1863 extern int bcm_compat6519_l2gre_tunnel_terminator_get(
   1864     int unit,
   1865     bcm_compat6519_tunnel_terminator_t *info);
   1866 
   1867 #endif /* defined(INCLUDE_L3) */
   1868 
   1869 
   1870 /* PP statistic profile. */
   1871 typedef struct bcm_compat6519_stat_pp_profile_info_s {
   1872     int counter_command_id;    /* Command id (interface id). */
   1873     int stat_object_type;    /* Statistic object type in range 0-BCM_STAT_MAX_NUMBER_OF_OBJECT_TYPES-1 */
   1874     int meter_command_id;    /* Relevant only for egress */
   1875     int meter_qos_map_id;    /* Relevant only for egress */
   1876     uint8 is_meter_enable;    /* Allow metering */
   1877     uint8 is_fp_cs_var;    /* Enable PMF2 context selection */
   1878     int ingress_tunnel_metadata_size;    /* Ingress metadata size in buffer (in bits) for terminated headers */
   1879     int ingress_tunnel_metadata_start_bit;    /* Ingress metadata start bit in buffer for terminated headers */
   1880     int ingress_forward_metadata_size;    /* Ingress metadata size in buffer (in bits) for forwarding header */
   1881     int ingress_forward_metadata_start_bit;    /* Ingress metadata start bit in buffer for forwarding header */
   1882     int ingress_fwd_plus_one_metadata_size;    /* Ingress metadata size in buffer (in bits) for forwarding plus one header */
   1883     int ingress_fwd_plus_one_metadata_start_bit;    /* Ingress metadata start bit in buffer for forwarding plus one header */
   1884 } bcm_compat6519_stat_pp_profile_info_t;
   1885 
   1886 /* Map {statistic command, statistic profile} to the profile properties */
   1887 extern int bcm_compat6519_stat_pp_profile_create(
   1888     int unit,
   1889     int flags,
   1890     bcm_stat_counter_interface_type_t engine_source,
   1891     int *stat_pp_profile,
   1892     bcm_compat6519_stat_pp_profile_info_t *stat_pp_profile_info);
   1893 
   1894 /* Get profile properties according to stat_pp_profile */
   1895 extern int bcm_compat6519_stat_pp_profile_get(
   1896     int unit,
   1897     int stat_pp_profile,
   1898     bcm_compat6519_stat_pp_profile_info_t *stat_pp_profile_info);
   1899 
   1900 /* This structure contain the latency data that was measured in the ingress for a packet */
   1901 typedef struct bcm_compat6519_cosq_max_latency_pkts_s {
   1902     bcm_gport_t dest_gport;    /* will return modport gport */
   1903     bcm_cos_queue_t cosq;    /* cosq */
   1904     uint64 latency;    /* latency measured */
   1905     uint32 latency_flow;    /* latency flow */
   1906 } bcm_compat6519_cosq_max_latency_pkts_t;
   1907 
   1908 /* get cosq ingress congestion resource statistics */
   1909 extern int bcm_compat6519_cosq_max_latency_pkts_get(
   1910     int unit,
   1911     bcm_gport_t gport,
   1912     uint32 flags,
   1913     int max_count,
   1914     bcm_compat6519_cosq_max_latency_pkts_t *max_latency_pkts,
   1915     int *actual_count);
   1916 
   1917 /* Structure holds configuration per policer database. */
   1918 typedef struct bcm_compat6519_policer_database_config_s {
   1919     int expansion_enable;    /* Allowed to ingress database 0. if enabled, expansion size, filter and offsets will be  made according API bcm_policer_expansion_groups_set. */
   1920     int is_single_bucket;    /* Single or dual bucket mode. */
   1921 } bcm_compat6519_policer_database_config_t;
   1922 
   1923 /* API create a policer database (sw create). database represent the meter processor belong to one of the meter commands.It gets as input database handler which gather the key parameters: core, scope, database_id */
   1924 extern int bcm_compat6519_policer_database_create(
   1925     int unit,
   1926     int flags,
   1927     int policer_database_handle,
   1928     bcm_compat6519_policer_database_config_t *config);
   1929 
   1930 /* Structure holds the policer expansion groups, according the forwarding types. */
   1931 typedef struct bcm_compat6519_policer_expansion_group_s {
   1932     bcm_policer_expansion_group_types_config_t config[bcmPolicerFwdTypeMax];    /*  */
   1933 } bcm_compat6519_policer_expansion_group_t;
   1934 
   1935 /* API Defines groups of L2 Fwd-Types and decide if to count them and in which offset in the expansion to count them. */
   1936 extern int bcm_compat6519_policer_expansion_groups_set(
   1937     int unit,
   1938     int flags,
   1939     bcm_core_t core_id,
   1940     bcm_compat6519_policer_expansion_group_t *expansion_group);
   1941 
   1942 /* API gets the expansion groups of L2 Fwd-Types. */
   1943 extern int bcm_compat6519_policer_expansion_groups_get(
   1944     int unit,
   1945     int flags,
   1946     bcm_core_t core_id,
   1947     bcm_compat6519_policer_expansion_group_t *expansion_group);
   1948 
   1949 /* Flowtracker check information. */
   1950 typedef struct bcm_compat6519_flowtracker_check_info_s {
   1951     uint32 flags;                       /* Configuration flags for Check
   1952                                            Creation. */
   1953     bcm_flowtracker_tracking_param_type_t param; /* The attribute of flow on which the
   1954                                            check is performed. */
   1955     uint32 min_value;                   /* Element value to do greater than or
   1956                                            equal checks. Minimum value to do
   1957                                            range checks. */
   1958     uint32 max_value;                   /* Element value to do smaller than or
   1959                                            mask checks. Maximum value to do
   1960                                            range checks. */
   1961     uint32 mask_value;                  /* Mask value to be applied on flow
   1962                                            attribute. */
   1963     uint8 shift_value;                  /* Right shift value to be applied on
   1964                                            flow attribute. */
   1965     bcm_flowtracker_check_operation_t operation; /* Operation to be performed for this
   1966                                            check. */
   1967     bcm_flowtracker_check_t primary_check_id; /* primary check id to associate second
   1968                                            check for aggregated checks on same
   1969                                            flow. */
   1970     uint32 state_transition_flags;      /* State Transition flags */
   1971     uint16 num_drop_reason_group_id;    /* Number of drop reason group id. */
   1972     bcm_flowtracker_drop_reason_group_t drop_reason_group_id[BCM_FLOWTRACKER_DROP_REASON_GROUP_ID_MAX]; /* Flowtracker drop reason group ids.
   1973                                            Applicable only if tracking param is
   1974                                            IngDropReasonGroupIdVector or
   1975                                            EgrDropReasonGroupIdVector. */
   1976 } bcm_compat6519_flowtracker_check_info_t;
   1977 
   1978 /* Create a flowtracker flow group. */
   1979 extern int bcm_compat6519_flowtracker_check_create(
   1980     int unit,
   1981     uint32 options,
   1982     bcm_compat6519_flowtracker_check_info_t check_info,
   1983     bcm_flowtracker_check_t *check_id);
   1984 
   1985 /* Get a flowtracker flow check. */
   1986 extern int bcm_compat6519_flowtracker_check_get(
   1987     int unit,
   1988     bcm_flowtracker_check_t check_id,
   1989     bcm_compat6519_flowtracker_check_info_t *check_info);
   1990 
   1991 /*
   1992  * Group configuration structure. Used to create a field group with
   1993  * specific attributes.
   1994  */
   1995 typedef struct bcm_compat6519_field_group_config_s {
   1996     uint32 flags;                       /* Group create flags
   1997                                            BCM_FIELD_GROUP_CREATE_XXX. */
   1998     bcm_field_qset_t qset;              /* Group qualifier set. */
   1999     int priority;                       /* Group priority. */
   2000     bcm_field_group_mode_t mode;        /* Group mode. */
   2001     bcm_pbmp_t ports;                   /* Group member ports. */
   2002     bcm_field_group_t group;            /* Group. */
   2003     bcm_field_aset_t aset;              /* Group action set */
   2004     bcm_field_presel_set_t preselset;   /* Group preselector set */
   2005     bcm_field_presel_set_t group_ref;   /* Reference Field group for operation
   2006                                            set by the Flag. */
   2007     int max_entry_priorities;           /* Number of entries priorities in the
   2008                                            group. 0 means unlimited. */
   2009     bcm_field_hintid_t hintid;          /* Hints for Group Creation. */
   2010     int action_res_id;                  /* Action resolution id for Group. */
   2011     uint8 name[BCM_FIELD_MAX_NAME_LEN]; /* Name for Group. */
   2012     bcm_field_group_cycle_t cycle;      /* Create Field Group Cycle. */
   2013     uint32 pgm_bmp;                     /* Bitmap of program-ids which the
   2014                                            current field group will be pointing
   2015                                            to. */
   2016     uint32 share_id;                    /* Group share ID. Groups created with
   2017                                            same share ID may share TCAM banks. */
   2018     bcm_field_presel_group_t presel_group; /* Presel Group ID. */
   2019 } bcm_compat6519_field_group_config_t;
   2020 
   2021 /* Create a field group with specific attributes. */
   2022 extern int bcm_compat6519_field_group_config_create(
   2023     int unit,
   2024     bcm_compat6519_field_group_config_t *group_config);
   2025 
   2026 /* To verify whether a group can be created with a given qset and mode */
   2027 extern int bcm_compat6519_field_group_config_validate(
   2028     int unit,
   2029     bcm_compat6519_field_group_config_t *group_config,
   2030     bcm_field_group_mode_t *mode);
   2031 
   2032 /* Port Configuration structure. */
   2033 typedef struct bcm_compat6519_port_config_s {
   2034     bcm_pbmp_t fe;    /* Mask of FE ports. */
   2035     bcm_pbmp_t ge;    /* Mask of GE ports. */
   2036     bcm_pbmp_t xe;    /* Mask of 10gig ports. */
   2037     bcm_pbmp_t ce;    /* Mask of 100gig ports. */
   2038     bcm_pbmp_t le;    /* Mask of 50gig ports. */
   2039     bcm_pbmp_t cc;    /* Mask of 200gig ports. */
   2040     bcm_pbmp_t cd;    /* Mask of 400gig ports. */
   2041     bcm_pbmp_t e;    /* Mask of eth ports. */
   2042     bcm_pbmp_t hg;    /* Mask of HiGig ports. */
   2043     bcm_pbmp_t sci;    /* Mask of SCI ports. */
   2044     bcm_pbmp_t sfi;    /* Mask of SFI ports. */
   2045     bcm_pbmp_t spi;    /* Mask of SPI ports. */
   2046     bcm_pbmp_t spi_subport;    /* Mask of SPI subports. */
   2047     bcm_pbmp_t port;    /* Mask of all front panel ports. */
   2048     bcm_pbmp_t cpu;    /* Mask of CPU ports. */
   2049     bcm_pbmp_t all;    /* Mask of all ports. */
   2050     bcm_pbmp_t stack_int;    /* Deprecated - unused. */
   2051     bcm_pbmp_t stack_ext;    /* Mask of Stack ports. */
   2052     bcm_pbmp_t tdm;    /* Mask of TDM ports. */
   2053     bcm_pbmp_t pon;    /* Mask of PON ports. */
   2054     bcm_pbmp_t llid;    /* Mask of LLID ports. */
   2055     bcm_pbmp_t il;    /* Mask of ILKN ports. */
   2056     bcm_pbmp_t xl;    /* Mask of XLAUI ports. */
   2057     bcm_pbmp_t rcy;    /* Mask of RECYCLE ports. */
   2058     bcm_pbmp_t sat;    /* Mask of SAT ports. */
   2059     bcm_pbmp_t ipsec;    /* Mask of IPSEC ports. */
   2060     bcm_pbmp_t per_pipe[BCM_PIPES_MAX];    /* Mask of ports per pipe. The number of pipes per device can be obtained via num_pipes field of bcm_info_t. */
   2061     bcm_pbmp_t nif;    /* Mask of Network Interfaces ports. */
   2062     bcm_pbmp_t control;    /* Mask of hot swap controlling ports. */
   2063     bcm_pbmp_t eventor;    /* Mask of Eventor ports. */
   2064     bcm_pbmp_t olp;    /* Mask of OLP ports. */
   2065     bcm_pbmp_t oamp;    /* Mask of OAMP ports. */
   2066     bcm_pbmp_t erp;    /* Mask of ERP ports. */
   2067     bcm_pbmp_t roe;    /* Mask of ROE ports. */
   2068     bcm_pbmp_t rcy_mirror;    /* Mask of mirror recycle ports (sniff) */
   2069     bcm_pbmp_t per_pp_pipe[BCM_PP_PIPES_MAX];    /* Mask of ports per PP pipe. The number of PP pipes per device can be obtained via num_pp_pipes field of bcm_info_t. */
   2070     bcm_pbmp_t stat;    /* Mask of stat ports. */
   2071 } bcm_compat6519_port_config_t;
   2072 
   2073 /* Retrieved the port configuration for the specified device. */
   2074 extern int bcm_compat6519_port_config_get(
   2075     int unit,
   2076     bcm_compat6519_port_config_t *config);
   2077 
   2078 #endif /* BCM_RPC_SUPPORT */
   2079 #endif /* !_COMPAT_6519_H */