#include <sys/types.h>
#include <pcap.h>
#include <stdio.h>
#include "decode.h"
#include "perf.h"
Go to the source code of this file.
Defines | |
#define | SNORT_20 |
#define | PRINT_INTERFACE(i) i |
#define | BUILD "28" |
#define | STD_BUF 1024 |
#define | RF_ANY_SIP 0x01 |
#define | RF_ANY_DIP 0x02 |
#define | RF_ANY_SP 0x04 |
#define | RF_ANY_DP 0x10 |
#define | RF_ANY_FLAGS 0x20 |
#define | MAX_PIDFILE_SUFFIX 11 |
#define | DEFAULT_LOG_DIR "/var/log/snort" |
#define | DEFAULT_DAEMON_ALERT_FILE "alert" |
#define | SNIFFUSER 0 |
#define | FILEACCESSBITS 0x1FF |
#define | TIMEBUF_SIZE 26 |
#define | ASSURE_ALL 0 |
#define | ASSURE_EST 1 |
#define | DO_IP_CHECKSUMS 0x00000001 |
#define | DO_TCP_CHECKSUMS 0x00000002 |
#define | DO_UDP_CHECKSUMS 0x00000004 |
#define | DO_ICMP_CHECKSUMS 0x00000008 |
#define | LOG_UNIFIED 0x00000001 |
#define | LOG_TCPDUMP 0x00000002 |
#define | SIGNAL_SNORT_ROTATE_STATS 28 |
#define | MODE_PACKET_DUMP 1 |
#define | MODE_PACKET_LOG 2 |
#define | MODE_IDS 3 |
#define | MODE_TEST 4 |
#define | LOG_ASCII 1 |
#define | LOG_PCAP 2 |
#define | LOG_NONE 3 |
#define | ALERT_FULL 1 |
#define | ALERT_FAST 2 |
#define | ALERT_NONE 3 |
#define | ALERT_UNSOCK 4 |
#define | ALERT_STDOUT 5 |
#define | ALERT_CMG 6 |
#define | ALERT_SYSLOG 8 |
#define | MAX_IFS 1 |
Typedefs | |
typedef _Configuration | Configuration |
typedef _Capabilities | Capabilities |
typedef _runtime_config | runtime_config |
typedef _progvars | PV |
typedef _PacketCount | PacketCount |
typedef void(* | grinder_t )(Packet *, struct pcap_pkthdr *, u_char *) |
Functions | |
int | SnortMain (int argc, char *argv[]) |
int | ParseCmdLine (int, char **) |
void * | InterfaceThread (void *) |
int | OpenPcap () |
void | DefineIfaceVar (char *, u_char *, u_char *) |
int | SetPktProcessor () |
void | CleanExit (int) |
void | PcapProcessPacket (char *, struct pcap_pkthdr *, u_char *) |
void | ProcessPacket (char *, struct pcap_pkthdr *, u_char *, void *) |
int | ShowUsage (char *) |
void | SigCantHupHandler (int signal) |
Variables | |
SFPERF | sfPerf |
char | _PATH_VARRUN [STD_BUF] |
u_int8_t | runMode |
PV | pv |
int | datalink |
char * | progname |
char ** | progargs |
char * | username |
char * | groupname |
unsigned long | userid |
unsigned long | groupid |
passwd * | pw |
group * | gr |
char * | pcap_cmd |
char * | pktidx |
pcap_t * | pd |
FILE * | alert |
FILE * | binlog_ptr |
int | flow |
int | thiszone |
PacketCount | pc |
u_long | netmasks [33] |
pcap_pkthdr * | g_pkthdr |
u_char * | g_pkt |
u_long | g_caplen |
char * | protocol_names [256] |
u_int | snaplen |
grinder_t | grinder |
runtime_config | snort_runtime |
|
Definition at line 149 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 145 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 144 of file snort.h. Referenced by ParseCmdLine(), ProcessAlertCommandLine(), and SnortMain(). |
|
Definition at line 146 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 148 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 150 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 147 of file snort.h. Referenced by ParseCmdLine(), and ProcessAlertCommandLine(). |
|
Definition at line 100 of file snort.h. Referenced by ReassembleStream4(), and SnortMain(). |
|
Definition at line 101 of file snort.h. Referenced by fpLogEvent(), ParseCmdLine(), and ParseConfig(). |
|
Definition at line 55 of file snort.h. Referenced by DisplayBanner(). |
|
Definition at line 73 of file snort.h. Referenced by OpenAlertFile(). |
|
Definition at line 72 of file snort.h. Referenced by SnortMain(). |
|
Definition at line 106 of file snort.h. Referenced by DecodeICMP(), ParseCmdLine(), ParseConfig(), and SnortMain(). |
|
Definition at line 103 of file snort.h. Referenced by DecodeIP(), ParseCmdLine(), ParseConfig(), and SnortMain(). |
|
Definition at line 104 of file snort.h. Referenced by DecodeTCP(), ParseCmdLine(), ParseConfig(), and SnortMain(). |
|
Definition at line 105 of file snort.h. Referenced by DecodeUDP(), ParseCmdLine(), ParseConfig(), and SnortMain(). |
|
Definition at line 93 of file snort.h. Referenced by ParseCmdLine(), and ParseConfig(). |
|
Definition at line 140 of file snort.h. Referenced by ParseCmdLine(), and ProcessLogCommandLine(). |
|
Definition at line 142 of file snort.h. Referenced by ParseCmdLine(), ParseConfig(), and ProcessLogCommandLine(). |
|
Definition at line 141 of file snort.h. Referenced by ParseCmdLine(), ProcessLogCommandLine(), and SnortMain(). |
|
Definition at line 109 of file snort.h. Referenced by LogStream(), and LogTcpdumpInit(). |
|
Definition at line 108 of file snort.h. Referenced by UnifiedLogInit(). |
|
|
|
Definition at line 65 of file snort.h. Referenced by ParseCmdLine(). |
|
Definition at line 117 of file snort.h. Referenced by DecodeARP(), DecodeEAP(), DecodeEapol(), DecodeEapolKey(), DecodeICMP(), DecodeIEEE80211Pkt(), DecodeIP(), DecodeIPOptions(), DecodePPPoEPkt(), DecodeTCP(), DecodeTCPOptions(), DecodeTRPkt(), DecodeUDP(), DecodeVlan(), IPHdrTests(), ProcessPacket(), and SnortMain(). |
|
Definition at line 115 of file snort.h. Referenced by SnortMain(). |
|
Definition at line 116 of file snort.h. Referenced by ProcessPacket(), and SnortMain(). |
|
|
|
Definition at line 49 of file snort.h. Referenced by AlertFast(), AlertFull(), AlertSyslog(), DatabaseInit(), OpenPcap(), ParseCmdLine(), ParseConfig(), PortscanPreprocFunction(), SetPktProcessor(), and SnortMain(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 111 of file snort.h. Referenced by SigUsrHandler(), and SnortMain(). |
|
|
|
|
|
|
Definition at line 97 of file snort.h. Referenced by AlertFast(), AlertFull(), LogPortscanAlert(), PrintArpHeader(), PrintEapolPkt(), PrintIPPkt(), PrintWifiPkt(), RealAlertCSV(), SLog(), and ts_print(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 2417 of file snort.c. References _PluginSignalFuncNode::arg, bzero, _progvars::done_processing, DropStats(), endtime, fpShowEventStats(), _PluginSignalFuncNode::func, gettimeofday(), InlineMode(), LogMessage(), _PluginSignalFuncNode::next, NULL, pcap_close(), _progvars::pid_filename, SIGQUIT, starttime, _progvars::test_mode_flag, and TIMERSUB. Referenced by InterfaceThread(), SetPktProcessor(), SigIntHandler(), SigQuitHandler(), SigTermHandler(), and SnortMain(). |
|
Definition at line 214 of file util.c. References snprintf, and VarDefine(). Referenced by OpenPcap(). |
|
Definition at line 2006 of file snort.c. References bzero, CleanExit(), _progvars::daemon_flag, _progvars::done_processing, ErrorMessage(), gettimeofday(), LOG_CONS, LOG_DAEMON, LOG_PID, NULL, pcap_geterr(), pcap_loop(), PcapProcessPacket(), _progvars::pkt_cnt, starttime, and syslog(). Referenced by SnortMain(). |
|
Definition at line 2046 of file snort.c. References datalink, DEBUG_INIT, DEBUG_WRAP, DefineIfaceVar(), ErrorMessage(), FatalError(), _progvars::interface, LogMessage(), MIN_SNAPLEN, NULL, _progvars::pcap_cmd, pcap_compile(), pcap_datalink(), PCAP_ERRBUF_SIZE, pcap_geterr(), pcap_lookupdev(), pcap_lookupnet(), pcap_open_live(), pcap_open_offline(), pcap_setfilter(), pcap_snapshot(), _progvars::pkt_snaplen, PRINT_INTERFACE, PROMISC, _progvars::promisc_flag, _progvars::quiet_flag, READ_TIMEOUT, _progvars::readfile, _progvars::readmode_flag, SNAPLEN, snaplen, and strstr(). Referenced by ParseConfig(), and SnortMain(). |
|
|
|
Definition at line 749 of file snort.c. References pcap_pkthdr::caplen, ClearDumpBuf(), NULL, packet_time_update(), ProcessPacket(), _SFPERF::sfBase, sfthreshold_reset(), SnortEventqReset(), _PacketCount::total, pcap_pkthdr::ts, and UpdateWireStats(). Referenced by InterfaceThread(). |
|
Definition at line 779 of file snort.c. References CallLogPlugins(), ClearDumpBuf(), DEBUG_DECODE, DEBUG_WRAP, g_drop_pkt, _progvars::min_ttl, MODE_IDS, MODE_PACKET_LOG, NULL, _Packet::packet_flags, PKT_IGNORE_PORT, PKT_REBUILT_FRAG, Preprocess(), PrintArpHeader(), PrintEapolPkt(), PrintIPPkt(), PrintWifiPkt(), runMode, _progvars::showwifimgmt_flag, and _progvars::verbose_flag. Referenced by Frag3Rebuild(), PcapProcessPacket(), and RebuildFrag(). |
|
|
Definition at line 855 of file snort.c. References FPUTS_BOTH, FPUTS_UNIX, FPUTS_WIN32, and SNAPLEN. Referenced by ParseCmdLine(), and SnortMain(). |
|
dummy signal handler for nonroot users or chroot.
Definition at line 2397 of file snort.c. References LogMessage(). Referenced by SetChroot(), and SnortMain(). |
|
|
Definition at line 167 of file snort.c. Referenced by CreatePidFile(). |
|
|
|
|
|
Definition at line 130 of file snort.c. Referenced by DropStats(), OpenPcap(), Print2ndHeader(), SetPktProcessor(), and UnifiedInitLogFile(). |
|
Definition at line 148 of file snort.c. Referenced by ps_filter_ignore(), ps_tracker_update_ip(), ps_tracker_update_tcp(), and ps_tracker_update_udp(). |
|
|
|
|
|
|
|
Definition at line 138 of file snort.c. Referenced by ParseCmdLine(), and ParseConfig(). |
|
Definition at line 159 of file snort.c. Referenced by SetPktProcessor(). |
|
Definition at line 136 of file snort.c. Referenced by ParseCmdLine(), ParseConfig(), and SetUidGid(). |
|
Definition at line 134 of file snort.c. Referenced by ParseCmdLine(), ParseConfig(), and SetUidGid(). |
|
|
|
|
|
|
Definition at line 141 of file snort.c. Referenced by DropStats(), GetPktDropStats(), ParseConfig(), and TcpdumpInitLogFile(). |
|
|
|
Definition at line 132 of file snort.c. Referenced by Restart(), and SnortMain(). |
|
Definition at line 131 of file snort.c. Referenced by ParseCmdLine(), Restart(), SetPktProcessor(), and SnortMain(). |
|
Definition at line 155 of file snort.c. Referenced by AlertFast(), AlertSyslog(), CleanupProtoNames(), InitProtoNames(), OpenLogFile(), and PrintIPHeader(). |
|
|
|
Definition at line 137 of file snort.c. Referenced by ParseCmdLine(), and ParseConfig(). |
|
Definition at line 128 of file snort.c. Referenced by DecodeARP(), DecodeEAP(), DecodeEapol(), DecodeEapolKey(), DecodeICMP(), DecodeIEEE80211Pkt(), DecodeIP(), DecodeIPOptions(), DecodePPPoEPkt(), DecodeTCP(), DecodeTCPOptions(), DecodeTRPkt(), DecodeUDP(), DecodeVlan(), IPHdrTests(), ProcessPacket(), and SnortMain(). |
|
|
|
|
|
Definition at line 160 of file snort.c. Referenced by fpEvalOTN(), PreprocRpcDecode(), and Stream4Init(). |
|
|
|
Definition at line 135 of file snort.c. Referenced by ParseCmdLine(), ParseConfig(), SetUidGid(), and SnortMain(). |
|
Definition at line 133 of file snort.c. Referenced by ParseCmdLine(), ParseConfig(), and SetUidGid(). |