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

collector.h (4303B)


      1 /*! \file collector.h
      2  *
      3  * Collector module internal header file.
      4  * This file contains collector definitions internal
      5  * to the collector module itself.
      6  */
      7 /*
      8  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      9  * 
     10  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     11  */
     12 #ifndef BCMI_LTSW_COLLECTOR_H
     13 #define BCMI_LTSW_COLLECTOR_H
     14 
     15 #include <bcm/collector.h>
     16 
     17 /******************************************************************************
     18  * Defines
     19  */
     20 
     21 /*! Enum defines the transport types of collectors */
     22 typedef enum bcm_ltsw_collector_transport_type_e{
     23     LTSW_COLLECTOR_TYPE_IPV4_UDP = 0,
     24     LTSW_COLLECTOR_TYPE_IPV6_UDP = 1,
     25 } bcm_ltsw_collector_transport_type_t;
     26 
     27 /* Internal enumeration for the users of common collector
     28  * infrastructure.
     29  */
     30 typedef enum bcm_ltsw_collector_export_app_e {
     31     LTSW_COLLECTOR_EXPORT_APP_NONE = 0,
     32     LTSW_COLLECTOR_EXPORT_APP_FT_IPFIX = 1,
     33     LTSW_COLLECTOR_EXPORT_APP_FT_PROTOBUF = 2,
     34     LTSW_COLLECTOR_EXPORT_APP_ST_PROTOBUF = 3,
     35     LTSW_COLLECTOR_EXPORT_APP_IFA_IPFIX = 4,
     36 } bcm_ltsw_collector_export_app_t;
     37 
     38 /******************************************************************************
     39  * Function definitions
     40  */
     41 /*
     42  * Function:
     43  *     bcmi_ltsw_collector_export_profile_ref_count_update
     44  * Purpose:
     45  *     Increment/Decrement reference count for an export profile
     46  * Parameters:
     47  *     unit          - (IN) BCM device number
     48  *     id            - (IN) Export profile Id
     49  *     update        - (IN) Reference count update (+/-)
     50  * Returns:
     51  *     BCM_E_XXX
     52  */
     53 extern int 
     54 bcmi_ltsw_collector_export_profile_ref_count_update(
     55     int unit, 
     56     int id, 
     57     int update);
     58 
     59 /*
     60  * Function:
     61  *     bcmi_ltsw_collector_ref_count_update
     62  * Purpose:
     63  *     Increment/Decrement reference count for an export profile
     64  * Parameters:
     65  *     unit          - (IN) BCM device number
     66  *     id            - (IN) Collector Id
     67  *     update        - (IN) Reference count update (+/-)
     68  * Returns:
     69  *     BCM_E_XXX
     70  */
     71 extern int 
     72 bcmi_ltsw_collector_ref_count_update(
     73     int unit, 
     74     int id, 
     75     int update);
     76 
     77 
     78 /*
     79  * Function:
     80  *     bcmi_ltsw_collector_user_update
     81  * Purpose:
     82  *     Add user for a collector.
     83  *     Currently one user is expected per collector
     84  * Parameters:
     85  *     unit          - (IN) BCM device number
     86  *     id            - (IN) Collector Id
     87  *     user          - (IN) The user type of calling app
     88  * Returns:
     89  *     BCM_E_XXX
     90  */
     91 extern int
     92 bcmi_ltsw_collector_user_update(
     93     int unit,
     94     bcm_collector_t id,
     95     bcm_ltsw_collector_export_app_t user);
     96 
     97 /*
     98  * Function:
     99  *     bcmi_ltsw_collector_check_user_is_other
    100  * Purpose:
    101  *     Check if collector ID is used by other user.
    102  * Parameters:
    103  *     unit          - (IN) BCM device number
    104  *     id            - (IN) Collector Id
    105  *     my_user       - (IN) The user type of calling app
    106  * Returns:
    107  *     BCM_E_XXX
    108  */
    109 extern uint8
    110 bcmi_ltsw_collector_check_user_is_other(
    111     int unit,
    112     bcm_collector_t id,
    113     bcm_ltsw_collector_export_app_t my_user);
    114 
    115 /*
    116  * Function:
    117  *     bcmi_ltsw_collector_internal_id_get
    118  * Purpose:
    119  *     Get the internal ID (the ID that is programmed in LT) and the type of a
    120  *     collector.
    121  * Parameters:
    122  *     unit          - (IN)  BCM device number
    123  *     id            - (IN)  Collector Id
    124  *     internal_id   - (OUT) Internal ID of the collector.
    125  *     type          - (OUT) Type of the collector.
    126  * Returns:
    127  *     SHR_E_XXX
    128  */
    129 extern int
    130 bcmi_ltsw_collector_internal_id_get(int unit, bcm_collector_t id,
    131                                     uint32_t *internal_id,
    132                                     bcm_ltsw_collector_transport_type_t *type);
    133 
    134 /*
    135  * Function:
    136  *     bcmi_ltsw_collector_external_id_get
    137  * Purpose:
    138  *     Get the external ID of a collector.
    139  * Parameters:
    140  *     unit          - (IN)  BCM device number
    141  *     internal_id   - (IN)  Collector internal ID.
    142  *     type          - (IN)  Collector type.
    143  *     id            - (OUT) External ID of the collector.
    144  * Returns:
    145  *     SHR_E_XXX
    146  */
    147 extern int
    148 bcmi_ltsw_collector_external_id_get(int unit, uint32_t internal_id,
    149                                     bcm_ltsw_collector_transport_type_t type,
    150                                     bcm_collector_t *id);
    151 #endif
    152 
    153 
    154 
    155 
    156 
    157