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_NEED_PEER   (1 << 0)
 
#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_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 (uint16_t 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

◆ AFP_BLOCK_SIZE_DEFAULT_ORDER

#define AFP_BLOCK_SIZE_DEFAULT_ORDER   3

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

◆ AFP_BYPASS

#define AFP_BYPASS   (1<<7)

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

◆ AFP_COPY_MODE_IPS

#define AFP_COPY_MODE_IPS   2

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

◆ AFP_COPY_MODE_NONE

#define AFP_COPY_MODE_NONE   0

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

◆ AFP_COPY_MODE_TAP

#define AFP_COPY_MODE_TAP   1

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

◆ AFP_EMERGENCY_MODE

#define AFP_EMERGENCY_MODE   (1<<3)

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

◆ AFP_IFACE_NAME_LENGTH

#define AFP_IFACE_NAME_LENGTH   48

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

◆ AFP_MMAP_LOCKED

#define AFP_MMAP_LOCKED   (1<<6)

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

◆ AFP_NEED_PEER

#define AFP_NEED_PEER   (1 << 0)

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

◆ AFP_SOCK_PROTECT

#define AFP_SOCK_PROTECT   (1<<2)

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

◆ AFP_TPACKET_V3

#define AFP_TPACKET_V3   (1<<4)

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

◆ AFP_VLAN_IN_HEADER

#define AFP_VLAN_IN_HEADER   (1<<5)

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

◆ AFP_XDPBYPASS

#define AFP_XDPBYPASS   (1<<8)

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

◆ AFPV_CLEANUP

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

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

◆ HAVE_PACKET_FANOUT

#define HAVE_PACKET_FANOUT   1

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

◆ PACKET_FANOUT

#define PACKET_FANOUT   18

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

◆ PACKET_FANOUT_CPU

#define PACKET_FANOUT_CPU   2

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

◆ PACKET_FANOUT_FLAG_DEFRAG

#define PACKET_FANOUT_FLAG_DEFRAG   0x8000

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

◆ PACKET_FANOUT_FLAG_ROLLOVER

#define PACKET_FANOUT_FLAG_ROLLOVER   0x1000

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

◆ PACKET_FANOUT_HASH

#define PACKET_FANOUT_HASH   0

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

◆ PACKET_FANOUT_LB

#define PACKET_FANOUT_LB   1

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

◆ PACKET_FANOUT_QM

#define PACKET_FANOUT_QM   5

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

◆ PACKET_FANOUT_RND

#define PACKET_FANOUT_RND   4

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

◆ PACKET_FANOUT_ROLLOVER

#define PACKET_FANOUT_ROLLOVER   3

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

Typedef Documentation

◆ AFPIfaceConfig

◆ AFPPacketVars

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.