Psyllid  v1.12.4
Project 8 Data Acquisisition Software
Classes | Macros | Functions | Variables
test_tpacket_v3.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <poll.h>
#include <unistd.h>
#include <signal.h>
#include <inttypes.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
Include dependency graph for test_tpacket_v3.cc:

Go to the source code of this file.

Classes

struct  block_desc
 
struct  ring
 

Macros

#define likely(x)   __builtin_expect(!!(x), 1)
 
#define unlikely(x)   __builtin_expect(!!(x), 0)
 

Functions

static void sighandler (int)
 
static int setup_socket (ring *ring, char *netdev)
 
static void display (tpacket3_hdr *ppd)
 
static void walk_block (block_desc *pbd, const int)
 
static void flush_block (block_desc *pbd)
 
static void teardown_socket (ring *ring, int fd)
 
int main (int argc, char **argp)
 

Variables

static unsigned long packets_total = 0
 
static unsigned long bytes_total = 0
 
static sig_atomic_t sigint = 0
 

Macro Definition Documentation

◆ likely

#define likely (   x)    __builtin_expect(!!(x), 1)

Definition at line 33 of file test_tpacket_v3.cc.

◆ unlikely

#define unlikely (   x)    __builtin_expect(!!(x), 0)

Definition at line 36 of file test_tpacket_v3.cc.

Function Documentation

◆ display()

static void display ( tpacket3_hdr *  ppd)
static

Definition at line 125 of file test_tpacket_v3.cc.

◆ flush_block()

static void flush_block ( block_desc pbd)
static

Definition at line 179 of file test_tpacket_v3.cc.

◆ main()

int main ( int  argc,
char **  argp 
)

Definition at line 191 of file test_tpacket_v3.cc.

◆ setup_socket()

static int setup_socket ( ring ring,
char *  netdev 
)
static

Definition at line 59 of file test_tpacket_v3.cc.

◆ sighandler()

static void sighandler ( int  )
static

Definition at line 54 of file test_tpacket_v3.cc.

◆ teardown_socket()

static void teardown_socket ( ring ring,
int  fd 
)
static

Definition at line 184 of file test_tpacket_v3.cc.

◆ walk_block()

static void walk_block ( block_desc pbd,
const int   
)
static

Definition at line 159 of file test_tpacket_v3.cc.

Variable Documentation

◆ bytes_total

unsigned long bytes_total = 0
static

Definition at line 51 of file test_tpacket_v3.cc.

◆ packets_total

unsigned long packets_total = 0
static

Definition at line 51 of file test_tpacket_v3.cc.

◆ sigint

sig_atomic_t sigint = 0
static

Definition at line 52 of file test_tpacket_v3.cc.