suricata
source-pcap.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PcapPacketVars_
 
struct  PcapIfaceConfig_
 

Macros

#define LIBPCAP_SNAPLEN   1518
 
#define LIBPCAP_COPYWAIT   500
 
#define LIBPCAP_PROMISC   1
 
#define PCAP_IFACE_NAME_LENGTH   128
 

Typedefs

typedef struct PcapPacketVars_ PcapPacketVars
 
typedef struct PcapIfaceConfig_ PcapIfaceConfig
 

Functions

void TmModuleReceivePcapRegister (void)
 Registration Function for RecievePcap. More...
 
void TmModuleDecodePcapRegister (void)
 Registration Function for DecodePcap. More...
 
void PcapTranslateIPToDevice (char *pcap_dev, size_t len)
 
int PcapLiveRegisterDevice (char *)
 
int PcapLiveGetDeviceCount (void)
 
char * PcapLiveGetDevice (int)
 

Detailed Description

Macro Definition Documentation

#define LIBPCAP_COPYWAIT   500

Definition at line 36 of file source-pcap.h.

Referenced by ReceivePcapThreadInit().

#define LIBPCAP_PROMISC   1

Definition at line 37 of file source-pcap.h.

Referenced by RunModeIdsPcapRegister().

#define LIBPCAP_SNAPLEN   1518

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

#define PCAP_IFACE_NAME_LENGTH   128

needs to be able to contain Windows adapter id's, so must be quite long.

Definition at line 47 of file source-pcap.h.

Typedef Documentation

Function Documentation

char* PcapLiveGetDevice ( int  )
int PcapLiveGetDeviceCount ( void  )
int PcapLiveRegisterDevice ( char *  )
void PcapTranslateIPToDevice ( char *  pcap_dev,
size_t  len 
)

Definition at line 620 of file source-pcap.c.

References strlcpy().

Referenced by RegisterAllModules().

Here is the call graph for this function:

Here is the caller graph for this function:

void TmModuleDecodePcapRegister ( void  )

Registration Function for DecodePcap.

Todo:
Unit tests are needed for this module.

Definition at line 129 of file source-pcap.c.

References PcapThreadVars_::bpf_filter, PcapThreadVars_::bytes, TmModule_::cap_flags, PcapThreadVars_::capture_kernel_drops, PcapThreadVars_::capture_kernel_ifdrops, PcapThreadVars_::capture_kernel_packets, PcapThreadVars_::cb_result, PcapThreadVars_::checksum_mode, CHECKSUM_VALIDATION_AUTO, CHECKSUM_VALIDATION_DISABLE, ChecksumAutoModeCheck(), PcapThreadVars_::datalink, Packet_::datalink, DecodePcap(), DecodePcapThreadDeinit(), DecodePcapThreadInit(), PcapThreadVars_::filter, TmModule_::flags, Packet_::flags, TmModule_::Func, LiveDevice_::ignore_checksum, PcapThreadVars_::last_stats_dump, likely, PcapThreadVars_::livedev, Packet_::livedev, TmModule_::name, PacketCopyData(), PacketGetFromQueueOrAlloc(), PcapThreadVars_::pcap_handle, PcapThreadVars_::pcap_state, PCAP_STATE_DOWN, PCAP_STATE_UP, PKT_IGNORE_CHECKSUM, PKT_SET_SRC, PKT_SRC_WIRE, PcapThreadVars_::pkts, TmModule_::RegisterTests, SC_ATOMIC_ADD, SC_ATOMIC_GET, SC_ATOMIC_SET, SC_ERR_BPF, SCEnter, SCLogDebug, SCLogError, SCLogInfo, SCReturn, PcapThreadVars_::slot, StatsSetUI64(), TmModule_::ThreadDeinit, TmModule_::ThreadExitPrintStats, TmModule_::ThreadInit, TimeGet(), TM_ECODE_FAILED, TM_ECODE_OK, TM_FLAG_DECODE_TM, TMM_DECODEPCAP, tmm_modules, TmqhOutputPacketpool(), Packet_::ts, PcapThreadVars_::tv, and unlikely.

Referenced by RegisterAllModules().

Here is the call graph for this function:

Here is the caller graph for this function:

void TmModuleReceivePcapRegister ( void  )