ifa_uc.h (7040B)
1 /*! \file ifa_uc.h 2 * 3 * IFA module internal header file. 4 * This file contains definitions internal to IFA module to interface with the 5 * IFA embedded app. 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 13 #ifndef BCMINT_LTSW_IFA_UC_H 14 #define BCMINT_LTSW_IFA_UC_H 15 16 #include <bcm/types.h> 17 18 #define BSL_LOG_MODULE BSL_LS_BCM_IFA 19 20 /*! 21 * \brief Set the IFA EApp config info. 22 * 23 * Set the IFA EApp config info. 24 * 25 * \param [in] unit Unit number. 26 * \param [in] cfg_info Configuration info. 27 * 28 * \retval SHR_E_NONE Success. 29 * \retval !SHR_E_NONE Failure. 30 */ 31 extern int 32 bcmi_ltsw_ifa_uc_config_info_set(int unit, bcm_ifa_config_info_t *cfg_info); 33 34 /*! 35 * \brief Get the IFA EApp config info. 36 * 37 * Get the IFA EApp config info. 38 * 39 * \param [in] unit Unit number. 40 * \param [out] cfg_info Configuration info. 41 * 42 * \retval SHR_E_NONE Success. 43 * \retval !SHR_E_NONE Failure. 44 */ 45 extern int 46 bcmi_ltsw_ifa_uc_config_info_get(int unit, bcm_ifa_config_info_t *cfg_info); 47 48 /*! 49 * \brief Set the IFA EApp stats. 50 * 51 * Set the IFA EApp stats. 52 * 53 * \param [in] unit Unit number. 54 * \param [in] stats Statistics. 55 * 56 * \retval SHR_E_NONE Success. 57 * \retval !SHR_E_NONE Failure. 58 */ 59 extern int 60 bcmi_ltsw_ifa_uc_stats_set(int unit, bcm_ifa_stat_info_t *stats); 61 62 /*! 63 * \brief Get the IFA EApp stats. 64 * 65 * Get the IFA EApp stats. 66 * 67 * \param [in] unit Unit number. 68 * \param [out] stats Statistics. 69 * 70 * \retval SHR_E_NONE Success. 71 * \retval !SHR_E_NONE Failure. 72 */ 73 extern int 74 bcmi_ltsw_ifa_uc_stats_get(int unit, bcm_ifa_stat_info_t *stats); 75 76 /*! 77 * \brief Create the IFA IPFIX template. 78 * 79 * Create the IFA IPFIX template. 80 * 81 * \param [in] unit Unit number. 82 * \param [in] options Options. 83 * \param [inout] Id Template Id. 84 * \param [in] set_id IPFIX Set ID. 85 * \param [in] num_export_elements Number of export elements. 86 * \param [in] export_elements List of export elements. 87 * 88 * \retval SHR_E_NONE Success. 89 * \retval !SHR_E_NONE Failure. 90 */ 91 extern int 92 bcmi_ltsw_ifa_uc_template_create(int unit, uint32 options, 93 bcm_ifa_export_template_t *id, uint16_t set_id, 94 int num_export_elements, 95 bcm_ifa_export_element_info_t *export_elements); 96 97 /*! 98 * \brief Get the IFA IPFIX template. 99 * 100 * Get the IFA IPFIX template. 101 * 102 * \param [in] unit Unit number. 103 * \param [in] Id Template Id. 104 * \param [out] set_id IPFIX Set ID. 105 * \param [in] max_size Size of the export_elements array. 106 * \param [out] export_elements List of export elements. 107 * \param [out] num_export_elements Number of export elements. 108 * 109 * \retval SHR_E_NONE Success. 110 * \retval !SHR_E_NONE Failure. 111 */ 112 extern int 113 bcmi_ltsw_ifa_uc_template_get(int unit, bcm_ifa_export_template_t id, 114 uint16_t *set_id, int max_export_elements, 115 bcm_ifa_export_element_info_t *export_elements, 116 int *num_export_elements); 117 118 /*! 119 * \brief Destroy the IFA IPFIX template. 120 * 121 * Destroy the IFA IPFIX template. 122 * 123 * \param [in] unit Unit number. 124 * \param [in] Id Template Id. 125 * 126 * \retval SHR_E_NONE Success. 127 * \retval !SHR_E_NONE Failure. 128 */ 129 extern int 130 bcmi_ltsw_ifa_uc_template_destroy(int unit, bcm_ifa_export_template_t id); 131 132 /*! 133 * \brief Attach the IFA collector. 134 * 135 * Attach the IFA IPFIX collector. 136 * 137 * \param [in] unit Unit number. 138 * \param [in] collector_id Collector ID 139 * \param [in] export_profile_id Export profile ID 140 * \param [in] template_id Template Id. 141 * 142 * \retval SHR_E_NONE Success. 143 * \retval !SHR_E_NONE Failure. 144 */ 145 extern int 146 bcmi_ltsw_ifa_uc_collector_attach(int unit, 147 bcm_collector_t collector_id, 148 int export_profile_id, 149 bcm_ifa_export_template_t template_id); 150 151 /*! 152 * \brief Get the IFA collector details. 153 * 154 * Get the attached IFA collector, export profile and IPFIX template. 155 * 156 * \param [in] unit Unit number. 157 * \param [out] collector_id Collector ID 158 * \param [out] export_profile_id Export profile ID 159 * \param [out] template_id Template Id. 160 * 161 * \retval SHR_E_NONE Success. 162 * \retval !SHR_E_NONE Failure. 163 */ 164 extern int 165 bcmi_ltsw_ifa_uc_collector_attach_get(int unit, 166 bcm_collector_t *collector_id, 167 int *export_profile_id, 168 bcm_ifa_export_template_t *template_id); 169 170 /*! 171 * \brief Detach the IFA collector. 172 * 173 * Detach the IFA collector. 174 * 175 * \param [in] unit Unit number. 176 * \param [out] collector_id Collector ID 177 * \param [out] export_profile_id Export profile ID 178 * \param [out] template_id Template Id. 179 * 180 * \retval SHR_E_NONE Success. 181 * \retval !SHR_E_NONE Failure. 182 */ 183 extern int 184 bcmi_ltsw_ifa_uc_collector_detach(int unit, 185 bcm_collector_t collector_id, 186 int export_profile_id, 187 bcm_ifa_export_template_t template_id); 188 189 /*! 190 * \brief Set the template transmit configuration. 191 * 192 * Set the template transmit configuration. 193 * 194 * \param [in] unit Unit number. 195 * \param [in] template_id Template ID 196 * \param [in] collector_id Collector ID 197 * \param [in] config Template transmit config. 198 * 199 * \retval SHR_E_NONE Success. 200 * \retval !SHR_E_NONE Failure. 201 */ 202 extern int 203 bcmi_ltsw_ifa_uc_template_transmit_config_set(int unit, 204 bcm_ifa_export_template_t template_id, 205 bcm_collector_t collector_id, 206 bcm_ifa_template_transmit_config_t *config); 207 208 /*! 209 * \brief Get the template transmit configuration. 210 * 211 * Get the template transmit configuration. 212 * 213 * \param [in] unit Unit number. 214 * \param [in] template_id Template ID 215 * \param [in] collector_id Collector ID 216 * \param [out] config Template transmit config. 217 * 218 * \retval SHR_E_NONE Success. 219 * \retval !SHR_E_NONE Failure. 220 */ 221 extern int 222 bcmi_ltsw_ifa_uc_template_transmit_config_get(int unit, 223 bcm_ifa_export_template_t template_id, 224 bcm_collector_t collector_id, 225 bcm_ifa_template_transmit_config_t *config); 226 227 /*! 228 * \brief Detach the IFA EApp. 229 * 230 * Detach the IFA EApp related logical tables if it is already initalized. 231 * 232 * \param [in] unit Unit number. 233 * 234 * \retval SHR_E_NONE Success. 235 * \retval !SHR_E_NONE Failure. 236 */ 237 extern int 238 bcmi_ltsw_ifa_uc_detach(int unit); 239 240 /*! 241 * \brief Initialize the IFA EApp. 242 * 243 * Initialize IFA EApp related logical tables. 244 * 245 * \param [in] unit Unit number. 246 * 247 * \retval SHR_E_NONE Success. 248 * \retval !SHR_E_NONE Failure. 249 */ 250 extern int 251 bcmi_ltsw_ifa_uc_init(int unit); 252 253 #endif /* BCMINT_LTSW_IFA_UC_H */