| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |

Macros | |
| #define | DOCA_NETFLOW_APP_ID |
| NetFlow Application ID. More... | |
| #define | DOCA_NETFLOW_DEFAULT_PORT 2055 |
| NetFlow collector default port. More... | |
DOCA lib for exporting a netflow packet to a netflow collector through the telemetry service.
This lib simplifies and centralizes the formatting and exporting of netflow packets. Netflow is a protocol for exporting information about the device network flows to a netflow collector that will aggregate and analyze the data. After creating conf file and invoke init function, the lib send function can be called with netflow struct to send a netflow packet with the format to the collector of choice specified in the conf file. The lib uses the netflow protocol specified by cisco.
Limitations:
The lib supports the netflow V9 format. The lib is not thread safe.
| #define DOCA_NETFLOW_APP_ID |
NetFlow Application ID.
Definition at line 58 of file doca_telemetry_exporter_netflow.h.
| #define DOCA_NETFLOW_DEFAULT_PORT 2055 |
NetFlow collector default port.
Definition at line 64 of file doca_telemetry_exporter_netflow.h.
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_destroy | ( | void | ) |
Free the exporter memory and close the connection.
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_field_create | ( | struct doca_telemetry_exporter_netflow_flowset_field ** | field | ) |
Create new telemetry netflow field.
| [out] | field | Pointer to the newly allocated telemetry field. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_field_destroy | ( | struct doca_telemetry_exporter_netflow_flowset_field * | field | ) |
Destructor for DOCA netflow field.
| [in] | field | field to destroy. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_field_set_len | ( | struct doca_telemetry_exporter_netflow_flowset_field * | field, |
| uint16_t | length | ||
| ) |
Set doca telemetry netflow field length.
| [in] | field | Pointer to doca telemetry netflow field. |
| [in] | length | Field type. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_field_set_type | ( | struct doca_telemetry_exporter_netflow_flowset_field * | field, |
| uint16_t | type | ||
| ) |
Set doca telemetry netflow field type.
| [in] | field | Pointer to doca telemetry netflow field. |
| [in] | type | Field type. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_flush | ( | void | ) |
Immediately flush the data of the DOCA internal Netflow source.
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_get_buf_data_root | ( | const char ** | path | ) |
Get data root path.
| [out] | path | The buffer data root |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_get_buf_size | ( | uint64_t * | size | ) |
Get buffer size.
| [out] | size | The buffer size |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_get_file_write_max_age | ( | doca_telemetry_exporter_timestamp_t * | max_age | ) |
Get file maximum age.
| [out] | max_age | Maximum file age. Once current file is older than this threshold a new file will be created. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_get_file_write_max_size | ( | size_t * | size | ) |
Get file maximum size.
| [out] | size | Maximum size of binary data file. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_get_ipc_sockets_dir | ( | const char ** | path | ) |
Get IPC socket directory.
| [out] | path | Path to a folder containing DOCA Telemetry Service (DTS) sockets. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_init | ( | uint16_t | source_id | ) |
Init exporter memory, set configs and open connection.
The Source ID field is a 32-bit value that is used to guarantee uniqueness for all flows exported from a particular device (see link).
This function can be called again only after doca_telemetry_exporter_netflow_destroy was called.
| [in] | source_id | Unique source ID. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_send | ( | const struct doca_telemetry_exporter_netflow_template * | netflow_template, |
| const void ** | records, | ||
| size_t | nof_records, | ||
| size_t * | nof_records_sent | ||
| ) |
Sending netflow records. Need to init first.
| [in] | netflow_template | Template pointer of how the records are structured. For more info refer to doca_telemetry_exporter_netflow_template. |
| [in] | records | Array of pointers to the flows structs to send, must be packed. Strings must be an array in the struct, not a pointer. |
| [in] | nof_records | Records array size. |
| [out] | nof_records_sent | If not NULL, it will be filled with amount of records sent. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_buf_data_root | ( | const char * | path | ) |
Set buffer data root Default path is "/opt/mellanox/doca/services/telemetry/data/".
| [in] | path | Path to a folder where the data and schema will be stored. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_buf_size | ( | uint64_t | size | ) |
Set buffer size Default value is 60000 bytes.
| [in] | size | Buffer size |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_collector_addr | ( | const char * | collector_addr | ) |
Set collector address.
| [in] | collector_addr | User defined netflow collector's IP address. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_collector_port | ( | uint16_t | collector_port | ) |
Set collector port. See DOCA_NETFLOW_DEFAULT_PORT for default value.
| [in] | collector_port | User defined netflow collector's port. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_file_write_enabled | ( | void | ) |
Enable file write file write is disabled by default.
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_file_write_max_age | ( | doca_telemetry_exporter_timestamp_t | max_age | ) |
Set file maximum age Default value is 1 hour.
| [in] | max_age | Maximum file age. Once current file is older than this threshold a new file will be created. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_file_write_max_size | ( | size_t | size | ) |
Set file maximum size Default value is 1MB.
| [in] | size | Maximum size of binary data file. Once this size is reached, a new binary file will be created. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_ipc_enabled | ( | void | ) |
Enable IPC IPC is disabled by default.
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_ipc_sockets_dir | ( | const char * | path | ) |
Set IPC socket directory. Default path is "/opt/mellanox/doca/services/telemetry/ipc_sockets".
| [in] | path | Path to a folder containing DOCA Telemetry Service (DTS) sockets. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_set_max_packet_size | ( | uint16_t | max_packet_size | ) |
Set max packet size.
| [in] | max_packet_size | User defined netflow packet's max size. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_source_set_id | ( | const char * | source_id | ) |
Set source id.
| [in] | source_id | Hostname or guid. |
| DOCA_EXPERIMENTAL void doca_telemetry_exporter_netflow_source_set_tag | ( | const char * | source_tag | ) |
Set source tag.
| [in] | source_tag | User defined data-file name prefix. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_start | ( | void | ) |
Finalizes netflow setup.
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_template_add_field | ( | struct doca_telemetry_exporter_netflow_template * | netflow_template, |
| struct doca_telemetry_exporter_netflow_flowset_field * | field | ||
| ) |
Add DOCA telemetry netflow field to netflow_template. The user loses the ownership of the field after a successful invocation of the function.
| [in] | netflow_template | Pointer to netflow_template. |
| [in] | field | DOCA Telemetry netflow field to add. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_template_create | ( | struct doca_telemetry_exporter_netflow_template ** | netflow_template | ) |
Create new telemetry netflow template.
| [out] | netflow_template | Pointer to the newly allocated telemetry netflow template. |
| DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_netflow_template_destroy | ( | struct doca_telemetry_exporter_netflow_template * | netflow_template | ) |
Destructor for DOCA netflow template.
| [in] | netflow_template | netflow template to destroy. |