suricata
source-af-packet.h File Reference
#include "queue.h"
Include dependency graph for source-af-packet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  AFPIfaceConfig_
 
struct  AFPPeer_
 
struct  AFPPacketVars_
 per packet AF_PACKET vars More...
 

Macros

#define HAVE_PACKET_FANOUT   1
 
#define PACKET_FANOUT   18
 
#define PACKET_FANOUT_HASH   0
 
#define PACKET_FANOUT_LB   1
 
#define PACKET_FANOUT_CPU   2
 
#define PACKET_FANOUT_ROLLOVER   3
 
#define PACKET_FANOUT_RND   4
 
#define PACKET_FANOUT_QM   5
 
#define PACKET_FANOUT_FLAG_ROLLOVER   0x1000
 
#define PACKET_FANOUT_FLAG_DEFRAG   0x8000
 
#define AFP_RING_MODE   (1<<0)
 
#define AFP_ZERO_COPY   (1<<1)
 
#define AFP_SOCK_PROTECT   (1<<2)
 
#define AFP_EMERGENCY_MODE   (1<<3)
 
#define AFP_TPACKET_V3   (1<<4)
 
#define AFP_VLAN_IN_HEADER   (1<<5)
 
#define AFP_MMAP_LOCKED   (1<<6)
 
#define AFP_BYPASS   (1<<7)
 
#define AFP_XDPBYPASS   (1<<8)
 
#define AFP_COPY_MODE_NONE   0
 
#define AFP_COPY_MODE_TAP   1
 
#define AFP_COPY_MODE_IPS   2
 
#define AFP_FILE_MAX_PKTS   256
 
#define AFP_IFACE_NAME_LENGTH   48
 
#define AFP_BLOCK_SIZE_DEFAULT_ORDER   3
 

Typedefs

typedef struct AFPIfaceConfig_ AFPIfaceConfig
 

Functions

void TmModuleReceiveAFPRegister (void)
 Registration Function for RecieveAFP. More...
 
void TmModuleDecodeAFPRegister (void)
 Registration Function for DecodeAFP. More...
 
TmEcode AFPPeersListInit (void)
 Init the global list of AFPPeer. More...
 
TmEcode AFPPeersListCheck (void)
 Check that all AFPPeer got a peer. More...
 
void AFPPeersListClean (void)
 Clean the global peers list. More...
 
int AFPGetLinkType (const char *ifname)
 
int AFPIsFanoutSupported (int cluster_id)
 test if we can use FANOUT. Older kernels like those in CentOS6 have HAVE_PACKET_FANOUT defined but fail to work More...
 
#define AFPV_CLEANUP(afpv)
 
typedef struct AFPPeer_ AFPPeer
 
typedef struct AFPPacketVars_ AFPPacketVars
 per packet AF_PACKET vars More...
 

Detailed Description

Author
Eric Leblond eric@.nosp@m.regi.nosp@m.t.org

Definition in file source-af-packet.h.

Macro Definition Documentation

#define AFP_BLOCK_SIZE_DEFAULT_ORDER   3

Definition at line 79 of file source-af-packet.h.

Referenced by AFPGetLinkType(), and RunModeIdsAFPRegister().

#define AFP_BYPASS   (1<<7)
#define AFP_COPY_MODE_IPS   2

Definition at line 70 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister(), and TmModuleDecodeAFPRegister().

#define AFP_COPY_MODE_NONE   0
#define AFP_COPY_MODE_TAP   1

Definition at line 69 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

#define AFP_EMERGENCY_MODE   (1<<3)

Definition at line 61 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister(), and TmModuleDecodeAFPRegister().

#define AFP_FILE_MAX_PKTS   256

Definition at line 72 of file source-af-packet.h.

#define AFP_IFACE_NAME_LENGTH   48

Definition at line 73 of file source-af-packet.h.

#define AFP_MMAP_LOCKED   (1<<6)

Definition at line 64 of file source-af-packet.h.

Referenced by AFPGetLinkType(), and RunModeIdsAFPRegister().

#define AFP_RING_MODE   (1<<0)
#define AFP_SOCK_PROTECT   (1<<2)
#define AFP_VLAN_IN_HEADER   (1<<5)

Definition at line 63 of file source-af-packet.h.

Referenced by ReceiveAFPThreadInit(), and TmModuleDecodeAFPRegister().

#define AFP_XDPBYPASS   (1<<8)
#define AFP_ZERO_COPY   (1<<1)

Definition at line 59 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister(), and TmModuleDecodeAFPRegister().

#define AFPV_CLEANUP (   afpv)
Value:
do { \
(afpv)->relptr = NULL; \
(afpv)->copy_mode = 0; \
(afpv)->peer = NULL; \
(afpv)->mpeer = NULL; \
} while(0)

Definition at line 169 of file source-af-packet.h.

Referenced by TmModuleDecodeAFPRegister().

#define HAVE_PACKET_FANOUT   1

Definition at line 28 of file source-af-packet.h.

#define PACKET_FANOUT   18

Definition at line 30 of file source-af-packet.h.

Referenced by AFPIsFanoutSupported().

#define PACKET_FANOUT_CPU   2

Definition at line 34 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

#define PACKET_FANOUT_FLAG_DEFRAG   0x8000

Definition at line 40 of file source-af-packet.h.

Referenced by AFPIsFanoutSupported(), and RunModeIdsAFPRegister().

#define PACKET_FANOUT_FLAG_ROLLOVER   0x1000

Definition at line 39 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

#define PACKET_FANOUT_HASH   0

Definition at line 32 of file source-af-packet.h.

Referenced by AFPIsFanoutSupported(), and RunModeIdsAFPRegister().

#define PACKET_FANOUT_LB   1

Definition at line 33 of file source-af-packet.h.

Referenced by ReceiveAFPThreadInit(), and RunModeIdsAFPRegister().

#define PACKET_FANOUT_QM   5

Definition at line 37 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

#define PACKET_FANOUT_RND   4

Definition at line 36 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

#define PACKET_FANOUT_ROLLOVER   3

Definition at line 35 of file source-af-packet.h.

Referenced by RunModeIdsAFPRegister().

Typedef Documentation

typedef struct AFPPacketVars_ AFPPacketVars

per packet AF_PACKET vars

This structure is used y the release data system and is cleaned up by the AFPV_CLEANUP macro below.