NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
telemetry_export_netflow_sample.c File Reference
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
#include <linux/types.h>
#include <doca_log.h>
#include <doca_telemetry_exporter_netflow.h>
Include dependency graph for telemetry_export_netflow_sample.c:

Go to the source code of this file.

Data Structures

struct  doca_telemetry_exporter_netflow_example_record
 

Macros

#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_SOURCE_ID   111 /* Source ID for DOCA Telemetry Netflow example */
 
#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_BATCH_SIZE   100 /* Number of records in a single batch */
 
#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_NOF_BATCHES   10 /* Number of batches to send */
 

Functions

 DOCA_LOG_REGISTER (TELEMETRY_EXPORTER::NETFLOW)
 
struct doca_telemetry_exporter_netflow_example_record __attribute__ ((packed))
 
static doca_error_t add_netflow_field (uint16_t type, uint16_t length)
 
static doca_error_t init_template_fields (void)
 
static void prepare_netflow_example_record (struct doca_telemetry_exporter_netflow_example_record *record)
 
doca_error_t telemetry_netflow_export (void)
 

Variables

__be32 src_addr_v4
 
__be32 dst_addr_v4
 
struct in6_addr src_addr_v6
 
struct in6_addr dst_addr_v6
 
__be32 next_hop_v4
 
struct in6_addr next_hop_v6
 
__be16 input
 
__be16 output
 
__be16 src_port
 
__be16 dst_port
 
uint8_t tcp_flags
 
uint8_t protocol
 
uint8_t tos
 
__be16 src_as
 
__be16 dst_as
 
uint8_t src_mask
 
uint8_t dst_mask
 
__be32 d_pkts
 
__be32 d_octets
 
__be32 first
 
__be32 last
 
__be64 flow_id
 
char application_name [DOCA_TELEMETRY_EXPORTER_NETFLOW_APPLICATION_NAME_DEFAULT_LENGTH]
 
static struct doca_telemetry_exporter_netflow_template * example_template
 

Macro Definition Documentation

◆ DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_BATCH_SIZE

#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_BATCH_SIZE   100 /* Number of records in a single batch */

Definition at line 38 of file telemetry_export_netflow_sample.c.

◆ DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_NOF_BATCHES

#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_EVENTS_NOF_BATCHES   10 /* Number of batches to send */

Definition at line 39 of file telemetry_export_netflow_sample.c.

◆ DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_SOURCE_ID

#define DOCA_TELEMETRY_EXPORTER_NETFLOW_EXAMPLE_SOURCE_ID   111 /* Source ID for DOCA Telemetry Netflow example */

Definition at line 37 of file telemetry_export_netflow_sample.c.

Function Documentation

◆ __attribute__()

struct doca_telemetry_exporter_netflow_example_record __attribute__ ( (packed)  )

Definition at line 1 of file telemetry_exporter.h.

◆ add_netflow_field()

static doca_error_t add_netflow_field ( uint16_t  type,
uint16_t  length 
)
static

Definition at line 79 of file telemetry_export_netflow_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( TELEMETRY_EXPORTER::NETFLOW  )

◆ init_template_fields()

static doca_error_t init_template_fields ( void  )
static

Definition at line 102 of file telemetry_export_netflow_sample.c.

◆ prepare_netflow_example_record()

static void prepare_netflow_example_record ( struct doca_telemetry_exporter_netflow_example_record record)
static

Definition at line 163 of file telemetry_export_netflow_sample.c.

◆ telemetry_netflow_export()

doca_error_t telemetry_netflow_export ( void  )

Definition at line 196 of file telemetry_export_netflow_sample.c.

Variable Documentation

◆ application_name

◆ d_octets

__be32 d_octets

Definition at line 18 of file telemetry_export_netflow_sample.c.

◆ d_pkts

__be32 d_pkts

Definition at line 17 of file telemetry_export_netflow_sample.c.

◆ dst_addr_v4

__be32 dst_addr_v4

Definition at line 1 of file telemetry_export_netflow_sample.c.

◆ dst_addr_v6

struct in6_addr dst_addr_v6

Definition at line 1 of file telemetry_export_netflow_sample.c.

◆ dst_as

__be16 dst_as

Definition at line 14 of file telemetry_export_netflow_sample.c.

◆ dst_mask

uint8_t dst_mask

Definition at line 16 of file telemetry_export_netflow_sample.c.

◆ dst_port

__be16 dst_port

Definition at line 9 of file telemetry_export_netflow_sample.c.

◆ example_template

struct doca_telemetry_exporter_netflow_template* example_template
static

Definition at line 70 of file telemetry_export_netflow_sample.c.

◆ first

__be32 first

Definition at line 19 of file telemetry_export_netflow_sample.c.

◆ flow_id

__be64 flow_id

Definition at line 21 of file telemetry_export_netflow_sample.c.

◆ input

__be16 input

Definition at line 6 of file telemetry_export_netflow_sample.c.

◆ last

__be32 last

Definition at line 20 of file telemetry_export_netflow_sample.c.

◆ next_hop_v4

__be32 next_hop_v4

Definition at line 4 of file telemetry_export_netflow_sample.c.

◆ next_hop_v6

struct in6_addr next_hop_v6

Definition at line 4 of file telemetry_export_netflow_sample.c.

◆ output

__be16 output

Definition at line 7 of file telemetry_export_netflow_sample.c.

◆ protocol

uint8_t protocol

Definition at line 11 of file telemetry_export_netflow_sample.c.

◆ src_addr_v4

__be32 src_addr_v4

Definition at line 0 of file telemetry_export_netflow_sample.c.

◆ src_addr_v6

struct in6_addr src_addr_v6

Definition at line 1 of file telemetry_export_netflow_sample.c.

◆ src_as

__be16 src_as

Definition at line 13 of file telemetry_export_netflow_sample.c.

◆ src_mask

uint8_t src_mask

Definition at line 15 of file telemetry_export_netflow_sample.c.

◆ src_port

__be16 src_port

Definition at line 8 of file telemetry_export_netflow_sample.c.

◆ tcp_flags

uint8_t tcp_flags

Definition at line 10 of file telemetry_export_netflow_sample.c.

◆ tos

uint8_t tos

Definition at line 12 of file telemetry_export_netflow_sample.c.