telemetry.h (4875B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_TELEMETRY_H__ 14 #define __BCM_TELEMETRY_H__ 15 16 #include <bcm/types.h> 17 #include <bcm/collector.h> 18 19 #ifndef BCM_HIDE_DISPATCHABLE 20 21 /* Initializes the Telemetry module. */ 22 extern int bcm_telemetry_init( 23 int unit); 24 25 /* Detaches the Telemetry module. */ 26 extern int bcm_telemetry_detach( 27 int unit); 28 29 #endif /* BCM_HIDE_DISPATCHABLE */ 30 31 /* Type of telemetry object stats to be collected */ 32 typedef enum bcm_telemetry_object_type_e { 33 bcmTelemetryObjectTypeNone = 0, /* No stats. */ 34 bcmTelemetryObjectTypeIntfIngress = 1, /* Interface Ingress stats. */ 35 bcmTelemetryObjectTypeIntfEgress = 2, /* Interface Egress stats. */ 36 bcmTelemetryObjectTypeIntfEgressQueue = 3, /* Interface Egress Queue stats. */ 37 bcmTelemetryObjectTypeIntfIngressError = 4, /* Interface Ingress stats. */ 38 bcmTelemetryObjectTypeIntMetaData = 5, /* Interface Egress Queue stats. */ 39 bcmTelemetryObjectTypeCount = 6 /* Last Value. Not Usable. */ 40 } bcm_telemetry_object_type_t; 41 42 /* Telemetry module defines. */ 43 #define BCM_TELEMETRY_PORT_NAME_SIZE 10 /* Port/Interface name size 44 of ProtoBuf Streaming 45 telemetry. */ 46 47 /* Telemetry application instance configuration information. */ 48 typedef struct bcm_telemetry_config_s { 49 bcm_telemetry_object_type_t object_type[bcmTelemetryObjectTypeCount]; /* Type of stats need to be collected. */ 50 uint32 component_id; /* Component Identification to be used 51 in export data to collector. */ 52 bcm_gport_t gport; /* port to be used to collect 53 statistics. */ 54 uint8 port_name[BCM_TELEMETRY_PORT_NAME_SIZE]; /* Port/Interface name associated with 55 port provided. */ 56 } bcm_telemetry_config_t; 57 58 #ifndef BCM_HIDE_DISPATCHABLE 59 60 /* 61 * Configures a Telemetry application instance with specified number of 62 * telemetry objects information. 63 */ 64 extern int bcm_telemetry_config_set( 65 int unit, 66 int telemetry_instance, 67 int core, 68 int config_count, 69 bcm_telemetry_config_t *telemetry_config_list); 70 71 /* Fetches a Telemetry instance information. */ 72 extern int bcm_telemetry_config_get( 73 int unit, 74 int telemetry_instance, 75 int core, 76 int max_count, 77 bcm_telemetry_config_t *telemetry_config_list, 78 int *config_count); 79 80 /* Configures the Telemetry instance export information. */ 81 extern int bcm_telemetry_export_config_set( 82 int unit, 83 int telemetry_instance, 84 bcm_collector_t collector_id, 85 int export_profile_id); 86 87 /* Fetches the telemetry instance export information. */ 88 extern int bcm_telemetry_export_config_get( 89 int unit, 90 int telemetry_instance, 91 bcm_collector_t *collector_id, 92 int *export_profile_id); 93 94 /* Deletes the telemetry instance export information. */ 95 extern int bcm_telemetry_export_config_delete( 96 int unit, 97 int telemetry_instance, 98 bcm_collector_t collector_id, 99 int export_profile_id); 100 101 #endif /* BCM_HIDE_DISPATCHABLE */ 102 103 /* Initializes a telemetry config information structure. */ 104 extern void bcm_telemetry_config_t_init( 105 bcm_telemetry_config_t *telemetry_config); 106 107 #ifndef BCM_HIDE_DISPATCHABLE 108 109 /* Configures the Telemetry system ID. */ 110 extern int bcm_telemetry_system_id_set( 111 int unit, 112 int system_id_len, 113 uint8 *system_id); 114 115 /* Fetches the telemetry syetem ID information. */ 116 extern int bcm_telemetry_system_id_get( 117 int unit, 118 int max_system_id_len, 119 int *system_id_len, 120 uint8 *system_id); 121 122 #endif /* BCM_HIDE_DISPATCHABLE */ 123 124 /* Telemetry instance export statistics. */ 125 typedef struct bcm_telemetry_instance_export_stats_s { 126 uint64 tx_pkts; /* Number of pkts exported. */ 127 uint64 tx_pkt_fails; /* Number of pkts that failed to export. */ 128 } bcm_telemetry_instance_export_stats_t; 129 130 #ifndef BCM_HIDE_DISPATCHABLE 131 132 /* Get the telemetry instance export statistics. */ 133 extern int bcm_telemetry_instance_export_stats_get( 134 int unit, 135 int telemetry_instance, 136 bcm_collector_t collector_id, 137 bcm_telemetry_instance_export_stats_t *stats); 138 139 /* Set the telemetry instance export statistics. */ 140 extern int bcm_telemetry_instance_export_stats_set( 141 int unit, 142 int telemetry_instance, 143 bcm_collector_t collector_id, 144 bcm_telemetry_instance_export_stats_t *stats); 145 146 #endif /* BCM_HIDE_DISPATCHABLE */ 147 148 #endif /* __BCM_TELEMETRY_H__ */