suricata

AF_PACKET has an IPS mode were interface are peered: packet from on interface are sent the peered interface and the other way. The AFPPeer list is maintaining the list of peers. Each AFPPeer is storing the needed information to be able to send packet on the interface. A element of the list must not be destroyed during the run of Suricata as it is used by Packet and other threads. More...

Collaboration diagram for AFP peers list:

Data Structures

struct  AFPPeersList_
 
struct  AFPPeer_
 

Typedefs

typedef struct AFPPeersList_ AFPPeersList
 

Functions

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

Variables

AFPPeersList peerslist
 
typedef struct AFPPeer_ AFPPeer
 

Detailed Description

AF_PACKET has an IPS mode were interface are peered: packet from on interface are sent the peered interface and the other way. The AFPPeer list is maintaining the list of peers. Each AFPPeer is storing the needed information to be able to send packet on the interface. A element of the list must not be destroyed during the run of Suricata as it is used by Packet and other threads.

Typedef Documentation

◆ AFPPeer

typedef struct AFPPeer_ AFPPeer

◆ AFPPeersList

typedef struct AFPPeersList_ AFPPeersList

Function Documentation

◆ AFPPeersListCheck()

TmEcode AFPPeersListCheck ( void  )

Check that all AFPPeer got a peer.

Return values
TM_ECODE_FAILEDif some threads are not peered or TM_ECODE_OK else.

Definition at line 469 of file source-af-packet.c.

References AFP_PEERS_MAX_TRY, AFP_PEERS_WAIT, peerslist, SCEnter, SCLogError, SCReturnInt, TM_ECODE_FAILED, and TM_ECODE_OK.

◆ AFPPeersListClean()

void AFPPeersListClean ( void  )

Clean the global peers list.

Definition at line 584 of file source-af-packet.c.

References next, peerslist, TAILQ_FIRST, and TAILQ_REMOVE.

Referenced by GlobalsDestroy().

Here is the caller graph for this function:

◆ AFPPeersListInit()

TmEcode AFPPeersListInit ( void  )

Init the global list of AFPPeer.

Definition at line 452 of file source-af-packet.c.

References peerslist, SC_ATOMIC_INIT, SC_ATOMIC_SET, SCEnter, SCReturnInt, TAILQ_INIT, and TM_ECODE_OK.

Referenced by RunModeIdsAFPAutoFp(), RunModeIdsAFPSingle(), and RunModeIdsAFPWorkers().

Here is the caller graph for this function:

Variable Documentation

◆ peerslist

AFPPeersList peerslist

Definition at line 446 of file source-af-packet.c.

Referenced by AFPPeersListCheck(), AFPPeersListClean(), and AFPPeersListInit().