suricata
util-napatech.h File Reference
#include <nt.h>
Include dependency graph for util-napatech.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  NapatechPacketVars_
 
struct  NapatechStreamConfig_
 
struct  NapatechCurrentStats_
 

Macros

#define MAX_HOSTBUFFER   4
 
#define MAX_STREAMS   256
 
#define MAX_PORTS   80
 
#define MAX_ADAPTERS   8
 
#define HB_HIGHWATER   2048
 
#define NAPATECH_ERROR(status)
 
#define NAPATECH_NTPL_ERROR(ntpl_cmd, ntpl_info, status)
 
#define NAPATECH_DEBUG(...)
 
#define NAPATECH_PRINTIP(a)
 

Typedefs

typedef struct NapatechPacketVars_ NapatechPacketVars
 
typedef struct NapatechStreamConfig_ NapatechStreamConfig
 
typedef struct NapatechCurrentStats_ NapatechCurrentStats
 

Functions

void NapatechStartStats (void)
 
NapatechCurrentStats NapatechGetCurrentStats (uint16_t id)
 
int NapatechGetStreamConfig (NapatechStreamConfig stream_config[])
 Reads and parses the stream configuration defined in the config file. More...
 
bool NapatechSetupNuma (uint32_t stream, uint32_t numa)
 
uint32_t NapatechSetupTraffic (uint32_t first_stream, uint32_t last_stream)
 
uint32_t NapatechDeleteFilters (void)
 

Detailed Description

Author
Phil Young py@na.nosp@m.pate.nosp@m.ch.co.nosp@m.m

Definition in file util-napatech.h.

Macro Definition Documentation

◆ HB_HIGHWATER

#define HB_HIGHWATER   2048

Definition at line 62 of file util-napatech.h.

◆ MAX_ADAPTERS

#define MAX_ADAPTERS   8

Definition at line 61 of file util-napatech.h.

◆ MAX_HOSTBUFFER

#define MAX_HOSTBUFFER   4

Definition at line 58 of file util-napatech.h.

◆ MAX_PORTS

#define MAX_PORTS   80

Definition at line 60 of file util-napatech.h.

◆ MAX_STREAMS

#define MAX_STREAMS   256

Definition at line 59 of file util-napatech.h.

◆ NAPATECH_DEBUG

#define NAPATECH_DEBUG (   ...)

Definition at line 94 of file util-napatech.h.

◆ NAPATECH_ERROR

#define NAPATECH_ERROR (   status)
Value:
{ \
char errorBuffer[1024]; \
NT_ExplainError((status), errorBuffer, sizeof(errorBuffer) - 1); \
SCLogError("Napatech Error: %s", errorBuffer); \
}

Definition at line 66 of file util-napatech.h.

◆ NAPATECH_NTPL_ERROR

#define NAPATECH_NTPL_ERROR (   ntpl_cmd,
  ntpl_info,
  status 
)
Value:
{ \
char errorBuffer[1024]; \
NT_ExplainError(status, errorBuffer, sizeof(errorBuffer) - 1); \
SCLogError(" NTPL failed: %s", errorBuffer); \
SCLogError(" cmd: %s", ntpl_cmd); \
if (strncmp(ntpl_info.u.errorData.errBuffer[0], "", 256) != 0) \
SCLogError(" %s", ntpl_info.u.errorData.errBuffer[0]); \
if (strncmp(ntpl_info.u.errorData.errBuffer[1], "", 256) != 0) \
SCLogError(" %s", ntpl_info.u.errorData.errBuffer[1]); \
if (strncmp(ntpl_info.u.errorData.errBuffer[2], "", 256) != 0) \
SCLogError(" %s", ntpl_info.u.errorData.errBuffer[2]); \
}

Definition at line 73 of file util-napatech.h.

◆ NAPATECH_PRINTIP

#define NAPATECH_PRINTIP (   a)

Definition at line 95 of file util-napatech.h.

Typedef Documentation

◆ NapatechCurrentStats

◆ NapatechPacketVars

◆ NapatechStreamConfig

Function Documentation

◆ NapatechDeleteFilters()

uint32_t NapatechDeleteFilters ( void  )

Definition at line 1334 of file util-napatech.c.

References NAPATECH_ERROR, and NAPATECH_NTPL_ERROR.

◆ NapatechGetCurrentStats()

NapatechCurrentStats NapatechGetCurrentStats ( uint16_t  id)

Definition at line 196 of file util-napatech.c.

References current_stats.

Referenced by NapatechStreamThreadExitStats().

Here is the caller graph for this function:

◆ NapatechGetStreamConfig()

int NapatechGetStreamConfig ( NapatechStreamConfig  stream_config[])

Reads and parses the stream configuration defined in the config file.

Parameters
stream_config- array to be filled in with active stream info.
Returns
the number of streams configured or -1 if an error occurred

Definition at line 804 of file util-napatech.c.

References ConfGetBool(), MAX_STREAMS, NAPATECH_ERROR, NapatechIsAutoConfigEnabled(), SCLogError, and stream_config.

Here is the call graph for this function:

◆ NapatechSetupNuma()

bool NapatechSetupNuma ( uint32_t  stream,
uint32_t  numa 
)

Definition at line 1223 of file util-napatech.c.

References NAPATECH_ERROR, and NAPATECH_NTPL_ERROR.

◆ NapatechSetupTraffic()

uint32_t NapatechSetupTraffic ( uint32_t  first_stream,
uint32_t  last_stream 
)

Definition at line 1361 of file util-napatech.c.

◆ NapatechStartStats()

void NapatechStartStats ( void  )

Definition at line 1185 of file util-napatech.c.

References TmThreadCreate().

Here is the call graph for this function: