suricata
source-nfq.h File Reference
#include "threads.h"
#include <linux/netfilter.h>
#include <libnetfilter_queue/libnetfilter_queue.h>
Include dependency graph for source-nfq.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  NFQPacketVars_
 
struct  NFQQueueVars_
 
struct  NFQGlobalVars_
 

Macros

#define NFQ_MAX_QUEUE   65535
 

Typedefs

typedef struct NFQPacketVars_ NFQPacketVars
 
typedef struct NFQQueueVars_ NFQQueueVars
 
typedef struct NFQGlobalVars_ NFQGlobalVars
 

Functions

void NFQInitConfig (char quiet)
 To initialize the NFQ global configuration data. More...
 
int NFQRegisterQueue (const uint16_t number)
 Add a single Netfilter queue. More...
 
int NFQParseAndRegisterQueues (const char *queues)
 Parses and adds Netfilter queue(s). More...
 
int NFQGetQueueCount (void)
 
void * NFQGetQueue (int number)
 Get a pointer to the NFQ queue at index. More...
 
int NFQGetQueueNum (int number)
 
void * NFQGetThread (int number)
 Get a pointer to the NFQ thread at index. More...
 
void NFQContextsClean (void)
 Clean global contexts. Must be called on exit. More...
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file source-nfq.h.

Macro Definition Documentation

◆ NFQ_MAX_QUEUE

#define NFQ_MAX_QUEUE   65535

Definition at line 35 of file source-nfq.h.

Typedef Documentation

◆ NFQGlobalVars

typedef struct NFQGlobalVars_ NFQGlobalVars

◆ NFQPacketVars

typedef struct NFQPacketVars_ NFQPacketVars

◆ NFQQueueVars

typedef struct NFQQueueVars_ NFQQueueVars

Function Documentation

◆ NFQContextsClean()

void NFQContextsClean ( void  )

Clean global contexts. Must be called on exit.

Definition at line 1284 of file source-nfq.c.

◆ NFQGetQueue()

void* NFQGetQueue ( int  number)

Get a pointer to the NFQ queue at index.

Parameters
numberidx of the queue in our array
Return values
ptrpointer to the NFQThreadVars at index
NULLon error

Definition at line 933 of file source-nfq.c.

References unlikely.

◆ NFQGetQueueCount()

int NFQGetQueueCount ( void  )

◆ NFQGetQueueNum()

int NFQGetQueueNum ( int  number)

◆ NFQGetThread()

void* NFQGetThread ( int  number)

Get a pointer to the NFQ thread at index.

This function is temporary used as configuration parser.

Parameters
numberidx of the queue in our array
Return values
ptrpointer to the NFQThreadVars at index
NULLon error

Definition at line 951 of file source-nfq.c.

References unlikely.

Referenced by RunModeIpsNFQAutoFp(), and RunModeIpsNFQWorker().

Here is the caller graph for this function:

◆ NFQInitConfig()

void NFQInitConfig ( char  quiet)

To initialize the NFQ global configuration data.

Parameters
quietIt tells the mode of operation, if it is TRUE nothing will be get printed.

Definition at line 209 of file source-nfq.c.

References NFQCnf_::batchcount, NFQCnf_::bypass_mark, NFQCnf_::bypass_mask, ConfGet(), ConfGetBool(), ConfGetInt(), NFQCnf_::flags, NFQCnf_::mark, NFQCnf_::mask, NFQCnf_::mode, NFQCnf_::next_queue, NFQ_ACCEPT_MODE, nfq_config, NFQ_FLAG_FAIL_OPEN, NFQ_REPEAT_MODE, NFQ_ROUTE_MODE, SC_ERR_INVALID_ARGUMENT, SC_ERR_NFQ_NOSUPPORT, SCLogDebug, SCLogError, SCLogInfo, and SCLogWarning.

Here is the call graph for this function:

◆ NFQParseAndRegisterQueues()

int NFQParseAndRegisterQueues ( const char *  queues)

Parses and adds Netfilter queue(s).

Parameters
stringwith the queue number or range
Return values
0on success.
-1on failure.

Definition at line 870 of file source-nfq.c.

References SC_ERR_INVALID_ARGUMENT, SCLogError, and SCRealloc.

◆ NFQRegisterQueue()

int NFQRegisterQueue ( const uint16_t  number)

Add a single Netfilter queue.

Parameters
stringwith the queue number
Return values
0on success.
-1on failure.

Definition at line 811 of file source-nfq.c.

References UtilCpuGetNumProcessorsOnline().

Here is the call graph for this function: