transmit_segment_dyn_descr_example.cpp

Reference Documentation

product_line_custom
IntelĀ® PAC
Napatech SmartNIC
category
Reference Information
Napatech Software Suite: examples/net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp File Reference
transmit_segment_dyn_descr_example.cpp File Reference
#include <nt.h>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>

Go to the source code of this file.

Functions

static void handle_error_status (int status, const char *message)
 
static uint64_t create_padding_packet_dyn3 (struct NtNetBuf_s &buffer, uint64_t max_packet_size, uint64_t remaining_segment_space)
 
static uint64_t get_max_packet_size (uint8_t port)
 
int main (int, char **)
 

Data Structures

struct  Dyn3_checksum_overlay
 

Variables

static constexpr uint8_t Test_packet []
 

Function Documentation

static void handle_error_status ( int  status,
const char *  message 
)
static

Handles and prints NT error messages, and the terminates the program.

Definition at line 99 of file transmit_segment_dyn_descr_example.cpp.

Referenced by get_max_packet_size(), and main().

static uint64_t create_padding_packet_dyn3 ( struct NtNetBuf_s buffer,
uint64_t  max_packet_size,
uint64_t  remaining_segment_space 
)
static

Calculate the size of a segment padding packet, and add it to the net buffer. Returns the size of the padding packet added (incl. descriptor size).

Examples:
net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp.

Definition at line 113 of file transmit_segment_dyn_descr_example.cpp.

Referenced by main().

static uint64_t get_max_packet_size ( uint8_t  port)
static

Use the NT info stream to get the maximum size of a TX packet.

Examples:
net/transmit_segment_dyn_descr/transmit_segment_dyn_descr_example.cpp.

Definition at line 154 of file transmit_segment_dyn_descr_example.cpp.

Referenced by main().

int main ( int  ,
char **   
)

Definition at line 177 of file transmit_segment_dyn_descr_example.cpp.

Variable Documentation

constexpr uint8_t Test_packet[]
static
Initial value:
{
0xb7, 0x27, 0x53, 0x03, 0xe5, 0x8a, 0x6e, 0x97,
0xba, 0x83, 0xa4, 0xc4, 0x08, 0x00, 0x45, 0x00,
0x00, 0x52, 0x00, 0x01, 0x00, 0x00, 0x40, 0x11,
0x26, 0x57, 0xfb, 0x83, 0x89, 0xd7, 0xd9, 0x4c,
0xf5, 0x9b, 0x06, 0x09, 0xfa, 0xaa, 0x00, 0x3e,
0xce, 0xa5, 0x70, 0x69, 0x7a, 0x7a, 0x61, 0x70,
0x69, 0x7a, 0x7a, 0x61, 0x70, 0x69, 0x7a, 0x7a,
0x61, 0x70, 0x69, 0x7a, 0x7a, 0x61, 0x70, 0x69,
0x7a, 0x7a, 0x61, 0x70, 0x69, 0x7a, 0x7a, 0x61,
0x70, 0x69, 0x7a, 0x7a, 0x61, 0x70, 0x69, 0x7a,
0x7a, 0x61, 0x70, 0x69, 0x7a, 0x7a, 0x61, 0x70,
0x69, 0x7a, 0x7a, 0x61, 0x70, 0x69, 0x7a, 0x7a
}

IPv4 UDP packet. No FCS included. Size: 96 byte.

Definition at line 69 of file transmit_segment_dyn_descr_example.cpp.

Referenced by main().