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

ft_export.h (22146B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      6  *
      7  * File:        ft_export.h
      8  * Purpose:     Function declarations for flowtracker Export routines.
      9  */
     10 
     11 #ifndef _BCM_INT_FT_EXPORT_H_
     12 #define _BCM_INT_FT_EXPORT_H_
     13 
     14 #include <soc/defs.h>
     15 #include <shared/bsl.h>
     16 
     17 #if defined(BCM_FLOWTRACKER_SUPPORT)
     18 
     19 #include <shared/bitop.h>
     20 
     21 #include <soc/helix5.h>
     22 #include <soc/drv.h>
     23 #include <soc/debug.h>
     24 #include <soc/shared/shr_pkt.h>
     25 
     26 #include <soc/mem.h>
     27 #include <soc/format.h>
     28 
     29 #include <bcm/module.h>
     30 #include <soc/scache.h>
     31 
     32 #include <bcm/error.h>
     33 #include <bcm/flowtracker.h>
     34 #include <bcm/collector.h>
     35 
     36 #include <bcm_int/esw/collector.h>
     37 #include <bcm_int/esw/flowtracker/ft_group.h>
     38 
     39 
     40 /*
     41  * Global defines.
     42  */
     43 #define BCMI_FT_MAX_COLLECTORS        8
     44 #define BCMI_FT_COLLECTOR_ID_INVALID  -1
     45 
     46 #define BCMI_FT_IPFIX_PACKET_BUILD_MAX_SIZE  128
     47 #define BCMI_FT_IPFIX_MAX_RECORDS_PER_PACKET 128
     48 #define BCMI_FT_IPFIX_RECORD_SIZE            (1024 / 8)
     49 
     50 #define BCMI_FT_MAX_TEMPLATES    1024
     51 #define BCMI_FT_TEMPLATE_ID_INVALID  -1
     52 #define BCMI_FT_TEMPLATE_MAX_ELEMS 128
     53 
     54 #define BCMI_FT_FIFO_ENTRIES_MAX                  128
     55 
     56 /* Default number of fifo entries per collector */
     57 #define BCMI_FT_COLLECTOR_FIFO_ENTRIES_DEF       16
     58 
     59 /* Export records callback sources */
     60 #define BCMI_FT_CB_MAX 3
     61 
     62 /* Maximum name length of export elements. */
     63 #define BCMI_FT_EXPORT_ELEMENT_NAME_LEN_MAX       40
     64 
     65 /* Group FT Type */
     66 #define BCMI_FT_COLLECTOR_FT_TYPE_MICRO           (0)
     67 #define BCMI_FT_COLLECTOR_FT_TYPE_AGGREGATE       (1)
     68 
     69 /* Structures */
     70 
     71 typedef struct bcmi_ft_collector_info_s {
     72 
     73     bcm_collector_t cmn_coll_id;
     74     int             cmn_export_prof_id;
     75     int             num_records;
     76 
     77     /* Software handle for collector. */
     78     bcm_flowtracker_collector_t coll_hw_id;
     79 
     80     /* Number of groups associated with collector. */
     81     int in_use;
     82 
     83     /* Collector information structure. */
     84     bcm_flowtracker_collector_info_t collector_info;
     85 
     86     /* IPFIX header */
     87     int ipfix_hdr_use_custom;
     88     bcm_collector_ipfix_header_t ipfix_hdr;
     89 
     90     /* Export Interval for Records in case
     91        threshold is not hit */
     92     uint32 export_interval;
     93 
     94     /* Flowtracker type for associated group */
     95     uint8 ft_type;
     96 
     97     /* Maximum number of fifo entries to reserve */
     98     int max_records_reserve;
     99 
    100     /* Minimum pointer in hw FIFO */
    101     int min_pointer;
    102 
    103 } bcmi_ft_collector_info_t;
    104 
    105 typedef struct bcmi_ft_template_info_s {
    106     /* Template ID.  */
    107     bcm_flowtracker_export_template_t template_id;
    108 
    109     /* Number of groups associated with template. */
    110     int in_use;
    111 
    112     /* IPFIX Template Set Id. */
    113     uint16 set_id;
    114 
    115     /* Num elements.  */
    116     int num_elements;
    117 
    118     /* List of export elements.  */
    119     bcm_flowtracker_export_element_info_t export_elements[BCMI_FT_TEMPLATE_MAX_ELEMS];
    120 
    121 } bcmi_ft_template_info_t;
    122 
    123 /* Index into array of profile structures */
    124 typedef enum bcmi_ft_export_cb_state_e {
    125     BCMI_FT_CALLBACK_STATE_INVALID = 0,
    126     BCMI_FT_CALLBACK_STATE_ACTIVE,
    127     BCMI_FT_CALLBACK_STATE_REGISTERED,
    128     BCMI_FT_CALLBACK_STATE_UNREGISTERED
    129 } bcmi_ft_export_cb_state_t;
    130 
    131 typedef struct bcmi_ft_cb_entry_s {
    132     VOL bcmi_ft_export_cb_state_t state;
    133 
    134     bcm_flowtracker_export_record_cb_f callback;
    135     bcm_flowtracker_collector_callback_options_t callback_options;
    136 
    137     void *userdata;
    138 } bcmi_ft_cb_entry_t;
    139 
    140 typedef struct bcmi_ft_export_cb_ctrl_s {
    141     /* per unit profiles array is indexed by _bcm_ipfix_profile_id_t */
    142     bcmi_ft_cb_entry_t callback_entry[BCMI_FT_CB_MAX];
    143     sal_thread_t pid;          /* export fifo processing thread process id */
    144     VOL sal_usecs_t interval;  /* export fifo processing polling interval */
    145     int dma_chan;           /* export fifo DMA channel number */
    146 
    147     int bad_handled;  /* Records not properly handled.  */
    148     int owned;        /* Records owned succesfully.  */
    149     int callback_sources; /* Callback sources registered */
    150 } bcmi_ft_export_cb_ctrl_t;
    151 
    152 /*
    153  * FT Export (IPFIX) Packet build
    154  */
    155 typedef struct bcmi_ft_pkt_build_s {
    156     /* Flags */
    157     uint32 flags;
    158 
    159     /* Checksum of IP header excluding length */
    160     uint32 ip_base_checksum;
    161 
    162     /* UDP psuedo header checksum */
    163     uint32 udp_base_checksum;
    164 
    165     /* Software handle for collector */
    166     uint16 id;
    167 
    168     /* Length of the IPFIX encapsulation */
    169     uint16 encap_length;
    170 
    171     /* Max size of the packet that can be sent to collector */
    172     uint16 mtu;
    173 
    174     /* Offset to start of IP header in the encap */
    175     uint16 ip_offset;
    176 
    177     /* Offset to start of UDP header in the encap */
    178     uint16 udp_offset;
    179 
    180     /* Offset to start of IPFIX header in the encap */
    181     uint16 ipfix_offset;
    182 
    183     /* IPFIX encapsulation */
    184     uint8 encap[BCMI_FT_IPFIX_PACKET_BUILD_MAX_SIZE];
    185 } bcmi_ft_pkt_build_t;
    186 
    187 
    188 typedef struct bcmi_ft_export_state_s {
    189     /* IPFIX export Record length (bytes). */
    190     int record_length;
    191 
    192     /* Max collectors supported by device. */
    193     int max_collectors;
    194 
    195     /* Max templates. */
    196     int max_templates;
    197 
    198     /* Max information elements in a template. */
    199     int max_elements;
    200 
    201     /* Template valid bitmap.  */
    202     SHR_BITDCL template_bitmap[SHR_BITALLOCSIZE(BCMI_FT_MAX_TEMPLATES)];
    203 
    204     /* Per collector info. */
    205     bcmi_ft_collector_info_t collector_info[BCMI_FT_MAX_COLLECTORS];
    206 
    207     /* Templates info. */
    208     bcmi_ft_template_info_t *template_info[BCMI_FT_MAX_TEMPLATES];
    209 
    210     /* DMA Collector Id. */
    211     bcm_flowtracker_collector_t dma_collector_id;
    212 
    213     /* Export Callback functions' state */
    214     bcmi_ft_export_cb_ctrl_t *export_cb_ctrl;
    215 
    216     /* IPFIX observation domain id. */
    217     int ipfix_observation_domain_id;
    218 
    219     /* Number of entries in export FIFO */
    220     int num_fifo_entries;
    221 
    222     /* Mapping of export FIFO entries to collectors */
    223     int fifo_collector_map[BCMI_FT_FIFO_ENTRIES_MAX];
    224 
    225 } bcmi_ft_export_state_t;
    226 
    227 /* Periodic export interval ganularity (in milliseconds) */
    228 #define BCMI_FT_PERIODIC_EXPORT_INTERVAL_GRAN           100
    229 
    230 #if defined(BCM_FLOWTRACKER_V3_SUPPORT)
    231 
    232 /* Group user entries installed information */
    233 typedef struct bcmi_ft_group_hw_user_entry_info_s {
    234 
    235     /* Number of user entries installed in the hw */
    236     int hw_user_entries;
    237 
    238 } bcmi_ft_group_hw_user_entry_info_t;
    239 
    240 /* Collector mapped to aggregate group info */
    241 typedef struct bcmi_ft_collector_agg_group_info_s {
    242 
    243     /* Fifo entries allocated */
    244     int num_fifo_entries;
    245 
    246     /* Number of AFT Groups associated */
    247     int num_groups;
    248 
    249     /* Associated AFT Group list */
    250     bcm_flowtracker_group_t *group_id_list;
    251 
    252     /* Next index Group to enable */
    253     int next_scan_idx;
    254 
    255 } bcmi_ft_collector_agg_group_info_t;
    256 
    257 /* Struct to maintain aggregate periodic export sw information  */
    258 typedef struct bcmi_aft_export_sw_ctrl_s {
    259 
    260     /* Group-User entries information */
    261     bcmi_ft_group_hw_user_entry_info_t *grp_entry_info[BCMI_FT_GROUP_TYPE_COUNT];
    262 
    263     /* Collector-Group information */
    264     bcmi_ft_collector_agg_group_info_t *col_grp_info[BCMI_FT_MAX_COLLECTORS];
    265 
    266     /* Mutex for collector scan */
    267     sal_mutex_t col_lock[BCMI_FT_MAX_COLLECTORS];
    268 
    269     /* Thread for periodic export scan */
    270     sal_thread_t pid;
    271 
    272     /* Semaphore to start/stop of thread */
    273     sal_sem_t sema;
    274 
    275     /* Interval of the periodic export */
    276     uint32 scan_interval;
    277 
    278     /* User configured periodic interval */
    279     sal_usecs_t user_interval;
    280 
    281     int last_col_idx;
    282 
    283 } bcmi_aft_export_sw_ctrl_t;
    284 
    285 extern bcmi_aft_export_sw_ctrl_t *bcmi_aft_export_sw_ctrl[BCM_MAX_NUM_UNITS];
    286 
    287 #define BCMI_AFT_GRP_USER_ENTRY_TYPE_INFO(_u_, _gt_) \
    288     bcmi_aft_export_sw_ctrl[(_u_)]->grp_entry_info[(_gt_)]
    289 
    290 #define BCMI_AFT_COL_GROUP_INFO(_u_, _i_) \
    291     bcmi_aft_export_sw_ctrl[(_u_)]->col_grp_info[(_i_)]
    292 
    293 #define BCMI_AFT_GRP_USER_ENTRY_INFO(_u_,_id_) \
    294    (&bcmi_aft_export_sw_ctrl[(_u_)]->grp_entry_info\
    295         [BCMI_FT_GROUP_TYPE_GET(_id_)][BCMI_FT_GROUP_INDEX_GET(_id_)])
    296 
    297 #define BCMI_AFT_GRP_USER_ENTRY_INSTALLED(_u_, _id_) \
    298    (BCMI_AFT_GRP_USER_ENTRY_INFO(_u_, _id_))->hw_user_entries
    299 
    300 #endif /* BCM_FLOWTRACKER_V3_SUPPORT */
    301 
    302 /* Export software state. */
    303 extern
    304   bcmi_ft_export_state_t *bcmi_ft_export_state[BCM_MAX_NUM_UNITS];
    305 
    306 /*
    307  * Function Macros
    308  */
    309 #define BCMI_FT_EXPORT_INFO(unit) \
    310             (bcmi_ft_export_state[unit])
    311 
    312 #define BCMI_FT_COLLECTOR_INFO(unit, id) \
    313             &(BCMI_FT_EXPORT_INFO(unit)->collector_info[id])
    314 
    315 #define BCMI_FT_TEMPLATE_BITMAP(unit) \
    316             (BCMI_FT_EXPORT_INFO(unit)->template_bitmap)
    317 
    318 #define BCMI_FT_TEMPLATE_INFO(unit, id) \
    319             (BCMI_FT_EXPORT_INFO(unit)->template_info[id])
    320 
    321 #define BCMI_FT_CB_CTRL(unit) \
    322             (BCMI_FT_EXPORT_INFO(unit) == NULL ? NULL : (BCMI_FT_EXPORT_INFO(unit)->export_cb_ctrl))
    323 
    324 
    325 
    326 /* Function Declarations */
    327 extern void
    328 bcma_ft_dump_export_entry(int unit,
    329                           bcm_flowtracker_export_record_t *data);
    330 
    331 extern int
    332 bcma_ft_export_fifo_control(int unit, int callback_source, int enable);
    333 
    334 extern int
    335 bcma_ft_export_dma_collector_get(int unit,
    336                                  bcm_collector_t *id);
    337 
    338 extern int
    339 bcma_ft_setid_template_id_get(int unit, uint16 setid,
    340                               bcm_flowtracker_export_template_t *template_id);
    341 extern int
    342 bcmi_ft_export_init(int unit);
    343 
    344 extern int
    345 bcmi_ft_export_cleanup(int unit);
    346 
    347 /*
    348  * Function:
    349  *   bcmi_ft_collector_create
    350  * Purpose:
    351  *   Create flowtracker collector id.
    352  * Description :
    353  *   Routine to create a flowtracker collector
    354  * Parameters:
    355  *   unit - (IN) BCM device id
    356  *   options - (IN) options for group creation
    357  *   collector_id   - (OUT) FT collector id.
    358  *   collector_info - (IN) Collector info.
    359  * Returns:
    360  *   BCM_E_XXX
    361  */
    362 extern int
    363 bcmi_ft_collector_create(
    364     int unit,
    365     uint32 options,
    366     bcm_flowtracker_collector_t *collector_id,
    367     bcm_flowtracker_collector_info_t *collector_info);
    368 
    369 
    370 /*
    371  * Function:
    372  *   bcmi_ft_collector_get
    373  * Purpose:
    374  *   Fetch flowtracker collector info.
    375  * Description :
    376  *   Routine to create a flowtracker collector
    377  * Parameters:
    378  *   unit - (IN) BCM device id
    379  *   collector_id   - (OUT) FT collector id.
    380  *   collector_info - (IN) Collector info.
    381  * Returns:
    382  *   BCM_E_XXX
    383  */
    384 extern int
    385 bcmi_ft_collector_get(
    386     int unit,
    387     bcm_flowtracker_collector_t collector_d,
    388     bcm_flowtracker_collector_info_t *collector_info);
    389 
    390 /*
    391  * Function:
    392  *   bcmi_ft_collector_get_all
    393  * Purpose:
    394  *   Fetch all flowtracker collectors info.
    395  * Description :
    396  *   Routine to create a flowtracker collector
    397  * Parameters:
    398  *   unit - (IN) BCM device id
    399  *   max_size   - (OUT) Max collectors to read.
    400  *   collector_list - (OUT) Collector id list.
    401  *   list_size (OUT) - Num of collectors read.
    402  * Returns:
    403  *   BCM_E_XXX
    404  */
    405 extern int
    406 bcmi_ft_collector_get_all(
    407     int unit,
    408     int max_size,
    409     bcm_flowtracker_collector_t *collector_list,
    410     int *list_size);
    411 
    412 /*
    413  * Function:
    414  *   bcmi_ft_collector_destroy
    415  * Purpose:
    416  *   Destroy flowtracker collector.
    417  * Description :
    418  *   Routine to destroy a flowtracker collector
    419  * Parameters:
    420  *   unit - (IN) BCM device id
    421  *   collector_d   - (OUT) FT collector id.
    422  * Returns:
    423  *   BCM_E_XXX
    424  */
    425 extern int
    426 bcmi_ft_collector_destroy(
    427     int unit,
    428     bcm_flowtracker_collector_t collector_d);
    429 
    430 /*
    431  * Function:
    432  *   bcm_flowtracker_export_template_validate
    433  * Purpose:
    434  *   Validate the template and return the list supported by the
    435  *   device.
    436  * Parameters:
    437  *   unit - (IN) Unit number.
    438  *   flow_group_id - (IN) Flowtracker flow group software ID.
    439  *   max_in_export_elements - (IN) Max number of export elements intended in the tempate.
    440  *   in_export_elements - (IN) List of export elements intended to be in the template.
    441  *   max_out_export_elements - (IN) Max number of export elements in the supportable tempate.
    442  *   out_export_elements - (OUT) List of export elements in the template supportable by hardware.
    443  *   actual_out_export_elements - (OUT) Actual number of export elements in the supportable tempate.
    444  * Returns:
    445  *   BCM_E_xxx
    446  * Notes:
    447  */
    448 extern int
    449 bcmi_ft_export_template_validate(
    450     int unit,
    451     bcm_flowtracker_group_t flow_group_id,
    452     int max_in_export_elements,
    453     bcm_flowtracker_export_element_info_t *in_export_elements,
    454     int max_out_export_elements,
    455     bcm_flowtracker_export_element_info_t *out_export_elements,
    456     int *actual_out_export_elements);
    457 /*
    458  * Function:
    459  *   bcmi_ft_template_create
    460  * Purpose:
    461  *   Create flowtracker export template.
    462  * Description :
    463  *   Routine to create a flowtracker template
    464  * Parameters:
    465  *   unit - (IN) BCM device id
    466  *   options - (IN) options for template creation
    467  *   template_id   - (OUT) FT template id.
    468  *   set_id - (IN) IPFIX template set id
    469  *   num_export_elements - (IN) Number of information elements.
    470  *   list_of_export_elements - (IN) List of IPFIX information elems.
    471  * Returns:
    472  *   BCM_E_XXX
    473  */
    474 extern int
    475 bcmi_ft_template_create(
    476     int unit,
    477     uint32 options,
    478     bcm_flowtracker_export_template_t *template_id,
    479     uint16 set_id,
    480     int num_export_elements,
    481     bcm_flowtracker_export_element_info_t *list_of_export_elements);
    482 
    483 
    484 /*
    485  * Function:
    486  *   bcmi_ft_template_get
    487  * Purpose:
    488  *   Ftech flowtracker export template.
    489  * Description :
    490  *   Routine to get flowtracker template info.
    491  * Parameters:
    492  *   unit - (IN) BCM device id
    493  *   template_id   - (IN) FT template id.
    494  *   *set_id - (OUT) IPFIX template set id
    495  *   max_size - (IN) Max num of elements
    496  *   list_of_export_elements - (OUT) List of IPFIX information elems.
    497  *   num_export_elements - (OUT) Actual Number of information elements.
    498  * Returns:
    499  *   BCM_E_XXX
    500  */
    501 extern int
    502 bcmi_ft_template_get(
    503     int unit,
    504     bcm_flowtracker_export_template_t template_id,
    505     uint16 *set_id,
    506     int max_elems,
    507     bcm_flowtracker_export_element_info_t *list_of_elems,
    508     int *num_elems);
    509 
    510 /*
    511  * Function:
    512  *   bcmi_ft_template_destroy
    513  * Purpose:
    514  *   Destroy flowtracker export template.
    515  * Description :
    516  *   Routine to destroy a flowtracker template
    517  * Parameters:
    518  *   unit - (IN) BCM device id
    519  *   template_id   - (OUT) FT template id.
    520  * Returns:
    521  *   BCM_E_XXX
    522  */
    523 extern int
    524 bcmi_ft_template_destroy(
    525     int unit,
    526     bcm_flowtracker_export_template_t template_id);
    527 
    528 /*
    529  * Function:
    530  *   bcmi_ft_flow_group_collector_add
    531  * Purpose:
    532  *   Attach a collector a flow group.
    533  * Description :
    534  *   Routine to associate a collector to an flowtracker group.
    535  * Parameters:
    536  *   unit - (IN) BCM device id
    537  *   group_id- (IN) FT group Id.
    538  *   collector_id   - (OUT) FT Collector Id.
    539  *   template_id - (IN) IPFIX template Id.
    540  * Returns:
    541  *   BCM_E_XXX
    542  */
    543 extern int
    544 bcmi_ft_flow_group_collector_add(
    545     int unit,
    546     bcm_flowtracker_group_t flow_group_id,
    547     bcm_flowtracker_collector_t collector_id,
    548     bcm_flowtracker_export_template_t template_id);
    549 
    550 
    551 /*
    552  * Function:
    553  *   bcmi_ft_flow_group_collector_delete
    554  * Purpose:
    555  *   Detach a collector a flow group.
    556  * Description :
    557  *   Routine to dissociate a collector to an flowtracker group.
    558  * Parameters:
    559  *   unit - (IN) BCM device id
    560  *   group_id- (IN) FT group Id.
    561  *   collector_id   - (OUT) FT Collector Id.
    562  *   template_id - (IN) IPFIX template Id.
    563  * Returns:
    564  *   BCM_E_XXX
    565  */
    566 extern int
    567 bcmi_ft_flow_group_collector_delete(
    568     int unit,
    569     bcm_flowtracker_group_t flow_group_id,
    570     bcm_flowtracker_collector_t collector_id,
    571     bcm_flowtracker_export_template_t template_id);
    572 
    573 
    574 /*
    575  * Function:
    576  *   bcmi_ft_flow_group_collector_get_all
    577  * Purpose:
    578  *   Get collector attached to a flow group.
    579  * Description :
    580  *   Routine to fetch collector and template id
    581  *   associated a flowtracker group.
    582  * Parameters:
    583  *   unit                 - (IN)  BCM device id
    584  *   group_id             - (IN)  FT group Id.
    585  *   max_list_size        - (IN)  max list of collectors
    586  *   list_of_collectors   - (OUT) FT Collector Id list.
    587  *   list_of_templates    - (OUT) FT Template Id list.
    588  *   list_size            - (IN)  Actual list size.
    589  * Returns:
    590  *   BCM_E_XXX
    591  */
    592 extern int
    593 bcmi_ft_flow_group_collector_get_all(
    594     int unit,
    595     bcm_flowtracker_group_t flow_group_id,
    596     int max_list_size,
    597     bcm_flowtracker_collector_t *list_of_collectors,
    598     bcm_flowtracker_export_template_t *list_of_templates,
    599     int *list_size);
    600 
    601 /*
    602  * Function:
    603  *   bcmi_ft_group_collector_attach
    604  * Purpose:
    605  *   Associate flow group to a collector with an export template.
    606  * Parameters:
    607  *   unit            - (IN)  BCM device number
    608  *   flow_group_id   - (IN)  Flow group Id
    609  *   collector_id    - (IN)  Collector Id
    610  *   template_id     - (IN)  Template Id
    611  * Returns:
    612  *   BCM_E_XXX   - BCM error code.
    613  */
    614 extern int
    615 bcmi_ft_group_collector_attach(
    616         int unit,
    617         bcm_flowtracker_group_t flow_group_id,
    618         bcm_flowtracker_collector_t collector_id,
    619         int export_profile_id,
    620         bcm_flowtracker_export_template_t template_id);
    621 
    622 /*
    623  * Function:
    624  *   bcmi_ft_group_collector_detach
    625  * Purpose:
    626  *   Dis-associate flow group from a collector with an export template.
    627  * Parameters:
    628  *   unit            - (IN)  BCM device number
    629  *   flow_group_id   - (IN)  Flow group Id
    630  *   collector_id    - (IN)  Collector Id
    631  *   template_id     - (IN)  Template Id
    632  * Returns:
    633  *   BCM_E_XXX   - BCM error code.
    634  */
    635 extern int
    636 bcmi_ft_group_collector_detach(
    637         int unit,
    638         bcm_flowtracker_group_t flow_group_id,
    639         bcm_flowtracker_collector_t collector_id,
    640         int export_profile_id,
    641         bcm_flowtracker_export_template_t template_id);
    642 
    643 /*
    644  * Function:
    645  *   bcmi_ft_group_collector_attach_get_all
    646  * Purpose:
    647  *   Get list of all collectors, templates  attached to a flow group
    648  * Parameters:
    649  *   unit                - (IN)  BCM device number
    650  *   flow_group_id       - (IN)  Flow group Id
    651  *   max_list_size       - (IN)  Size of the list arrays
    652  *   list_of_collectors  - (OUT) Collector list
    653  *   list_of_templates   - (OUT) Template list
    654  *   list_size           - (OUT) Number of elements in the lists
    655  * Returns:
    656  *   BCM_E_XXX   - BCM error code.
    657  */
    658 extern int
    659 bcmi_ft_group_collector_attach_get_all(
    660     int unit,
    661     bcm_flowtracker_group_t flow_group_id,
    662     int max_list_size,
    663     bcm_flowtracker_collector_t *list_of_collectors,
    664     int *list_of_export_profile_ids,
    665     bcm_flowtracker_export_template_t *list_of_templates,
    666     int *list_size);
    667 
    668 
    669 extern int
    670 bcmi_ft_export_record_register(
    671     int unit,
    672     bcm_flowtracker_collector_t collector_id,
    673     bcm_flowtracker_collector_callback_options_t callback_options,
    674     bcm_flowtracker_export_record_cb_f callback,
    675     void *userdata);
    676 
    677 extern int
    678 bcmi_ft_export_record_unregister(
    679     int unit,
    680     bcm_flowtracker_collector_t collector_id,
    681     bcm_flowtracker_collector_callback_options_t callback_options,
    682     bcm_flowtracker_export_record_cb_f callback_fn);
    683 
    684 extern int
    685 bcmi_ft_export_record_cb_install(
    686     int unit,
    687     bcm_collector_t collector_id,
    688     int callback_source,
    689     bcmi_ft_cb_entry_t *entry);
    690 
    691 extern int
    692 bcmi_ft_export_record_cb_remove(int unit,
    693     bcm_collector_t collector_id,
    694     int callback_source,
    695     bcmi_ft_cb_entry_t *entry);
    696 
    697 extern int
    698 bcmi_ft_export_fifo_alloc_show(int unit);
    699 
    700 extern int
    701 bcmi_ft_periodic_export_config_set(
    702     int unit,
    703     uint32 ft_type_flags,
    704     bcm_flowtracker_periodic_export_config_t *config);
    705 
    706 extern int
    707 bcmi_ft_periodic_export_config_get(
    708     int unit,
    709     uint32 ft_type_flags,
    710     bcm_flowtracker_periodic_export_config_t *config);
    711 
    712 #ifdef BCM_WARM_BOOT_SUPPORT
    713 
    714 /* Flowtracker export template elements information. */
    715 typedef struct bcmi_compat6519_flowtracker_export_element_info_s {
    716     uint32 flags;                       /* See
    717                                            BCM_FLOWTRACKER_EXPORT_ELEMENT_FLAGS_XXX. */
    718     bcm_flowtracker_export_element_type_t element; /* Type of export element. */
    719     uint32 data_size;                   /* Size of information element in the
    720                                            export record in bytes. If the
    721                                            data_size is given as 0, then the
    722                                            default RFC size is used. */
    723     uint16 info_elem_id;                /* Information element to be used, when
    724                                            the template set is exported. */
    725     bcm_flowtracker_check_t check_id;   /* Flowtracker Check Id for exporting
    726                                            check data. */
    727 } bcmi_compat6519_flowtracker_export_element_info_t;
    728 
    729 extern int
    730 bcmi_ft_export_warmboot_alloc(int unit, soc_scache_handle_t scache_handle);
    731 
    732 extern int
    733 bcmi_ft_export_warmboot_sync(int unit, soc_scache_handle_t scache_handle);
    734 
    735 extern int
    736 bcmi_ft_export_warmboot_recover(int unit, soc_scache_handle_t scache_handle);
    737 
    738 #endif /* BCM_WARM_BOOT_SUPPORT */
    739 
    740 #if defined(BCM_FLOWTRACKER_V2_SUPPORT)
    741 extern int
    742 bcmi_ftv2_export_tod_set(int unit,
    743                          bcm_flowtracker_collector_t coll_hw_id,
    744                          bcm_flowtracker_collector_info_t *collector_info,
    745                          int coll_enable);
    746 
    747 #endif /*  BCM_FLOWTRACKER_V2_SUPPORT */
    748 
    749 #if defined(BCM_FLOWTRACKER_V3_SUPPORT)
    750 
    751 extern int
    752 bcmi_ftv3_aft_export_sw_ctrl_init(int unit);
    753 
    754 extern int
    755 bcmi_ftv3_aft_export_sw_ctrl_cleanup(int unit);
    756 
    757 extern int
    758 bcmi_ftv3_aft_export_sw_scan_update(
    759         int unit,
    760         uint32 interval);
    761 
    762 extern int
    763 bcmi_ftv3_aft_export_sw_grp_timer_set(
    764         int unit,
    765         bcm_flowtracker_group_t group_id,
    766         uint32 enable);
    767 
    768 extern int
    769 bcmi_ftv3_aft_export_sw_grp_hw_entry_update(
    770         int unit,
    771         bcm_flowtracker_group_t group_id,
    772         int count);
    773 
    774 extern int bcmi_ftv3_aft_export_sw_ctrl_show(int unit);
    775 
    776 #if defined(BCM_WARM_BOOT_SUPPORT)
    777 extern int
    778 bcmi_ftv3_aft_export_sw_ctrl_recover(int unit);
    779 #endif /* BCM_WARM_BOOT_SUPPORT */
    780 #endif /* BCM_FLOWTACKER_V3_SUPPORT */
    781 
    782 extern int
    783 bcmi_ft_export_record_data_info_get(
    784         int unit,
    785         bcm_flowtracker_export_record_t *record,
    786         int max_elements,
    787         bcm_flowtracker_export_element_info_t *export_element_info,
    788         bcm_flowtracker_export_record_data_info_t *data_info,
    789         int *count);
    790 
    791 #endif /*  BCM_FLOWTRACKER_SUPPORT */
    792 #endif /*  _BCM_INT_FT_EXPORT_H_ */