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...
 

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

#define NFQ_MAX_QUEUE   65535

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

Referenced by NFQRegisterQueue().

Typedef Documentation

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

Function Documentation

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 948 of file source-nfq.c.

Referenced by ReceiveNFQLoop(), ReceiveNFQThreadDeinit(), ReceiveNFQThreadExitStats(), and VerdictNFQThreadDeinit().

Here is the caller graph for this function:

int NFQGetQueueCount ( void  )
int NFQGetQueueNum ( int  number)
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 966 of file source-nfq.c.

References NFQThreadVars_::data, NFQThreadVars_::datalen, NFQQueueVars_::errs, NFQQueueVars_::fd, NFQQueueVars_::h, NFQMutexLock, NFQMutexUnlock, NFQQueueVars_::qh, SC_ERR_NFQ_HANDLE_PKT, SC_ERR_NFQ_RECV, SCLogWarning, NFQThreadVars_::slot, and NFQThreadVars_::tv.

Referenced by RunModeIpsNFQAutoFp(), and RunModeIpsNFQWorker().

Here is the caller graph for this function:

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 889 of file source-nfq.c.

References NFQRegisterQueue(), SC_ERR_INVALID_ARGUMENT, SC_ERR_MEM_ALLOC, SCCalloc, SCFree, and SCLogError.

Referenced by RegisterAllModules().

Here is the call graph for this function:

Here is the caller graph for this function:

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 838 of file source-nfq.c.

References LiveRegisterDeviceName(), NFQThreadVars_::nfq_index, NFQ_MAX_QUEUE, NFQQueueVars_::queue_num, SC_ERR_INVALID_ARGUMENT, SC_WARN_UNCOMMON, SCLogDebug, SCLogError, SCLogWarning, SCMutexLock, SCMutexUnlock, and UtilCpuGetNumProcessorsOnline().

Referenced by NFQParseAndRegisterQueues().

Here is the call graph for this function:

Here is the caller graph for this function: