#include <errno.h>#include <sys/types.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <sys/stat.h>#include <grp.h>#include <pwd.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <timersub.h>#include "snort.h"#include "rules.h"#include "plugbase.h"#include "signal.h"#include "debug.h"#include "util.h"#include "parser.h"#include "tag.h"#include "log.h"#include "detect.h"#include "mstring.h"#include "fpcreate.h"#include "fpdetect.h"#include "sfthreshold.h"#include "packet_time.h"#include "src/preprocessors/flow/flow_print.h"#include "src/detection-plugins/sp_flowbits.h"#include "src/preprocessors/spp_perfmonitor.h"#include "src/preprocessors/spp_bait_and_switch.h"#include "event_queue.h"#include "asn1.h"#include "inline.h"#include "mpse.h"Go to the source code of this file.
Defines | |
| #define | DLT_OLDPFLOG 17 |
| #define | FPUTS_WIN32(msg) |
| #define | FPUTS_UNIX(msg) fputs(msg,stdout) |
| #define | FPUTS_BOTH(msg) fputs(msg,stdout) |
Functions | |
| static char * | ConfigFileSearch () |
| static int | ProcessAlertCommandLine () |
| static int | ProcessLogCommandLine () |
| static void | Restart () |
| static void | SigTermHandler (int signal) |
| static void | SigIntHandler (int signal) |
| static void | SigQuitHandler (int signal) |
| static void | SigHupHandler (int signal) |
| static void | SigUsrHandler (int signal) |
| int | main (int argc, char *argv[]) |
| int | SnortMain (int argc, char *argv[]) |
| void | PcapProcessPacket (char *user, struct pcap_pkthdr *pkthdr, u_char *pkt) |
| void | ProcessPacket (char *user, struct pcap_pkthdr *pkthdr, u_char *pkt, void *ft) |
| int | ShowUsage (char *progname) |
| int | ParseCmdLine (int argc, char *argv[]) |
| int | SetPktProcessor () |
| void * | InterfaceThread (void *arg) |
| int | OpenPcap () |
| void | SigCantHupHandler (int signal) |
| void | CleanExit (int exit_val) |
Variables | |
| OutputFuncNode * | AlertList |
| OutputFuncNode * | LogList |
| int | errno |
| u_int8_t | runMode = 0 |
| PV | pv |
| int | datalink |
| char * | progname |
| char ** | progargs |
| char * | username |
| char * | groupname |
| unsigned long | userid = 0 |
| unsigned long | groupid = 0 |
| passwd * | pw |
| group * | gr |
| char * | pcap_cmd |
| char * | pktidx |
| pcap_t * | pd |
| int | g_drop_pkt |
| 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 |
| char | _PATH_VARRUN [STD_BUF] |
| SFPERF | sfPerf |
| char * | optarg |
| int | optind |
| int | opterr |
| int | optopt |
| static struct timeval | starttime |
| static struct timeval | endtime |
| PluginSignalFuncNode * | PluginShutdownList |
| PluginSignalFuncNode * | PluginCleanExitList |
| PluginSignalFuncNode * | PluginRestartList |
|
|
Definition at line 108 of file snort.c. Referenced by SetPktProcessor(). |
|
|
Referenced by ShowUsage(). |
|
|
Referenced by ShowUsage(). |
|
|
Referenced by ShowUsage(). |
|
|
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 2212 of file snort.c. References FatalError(), home_dir, and NULL. Referenced by SnortMain(). |
|
|
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 198 of file snort.c. References FatalError(), and 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 2257 of file snort.c. References ActivateOutputPlugin(), _progvars::alert_cmd_override, ALERT_CMG, ALERT_FAST, ALERT_FULL, _progvars::alert_mode, ALERT_NONE, ALERT_STDOUT, ALERT_SYSLOG, ALERT_UNSOCK, FatalError(), NoAlert(), NT_OUTPUT_ALERT, NULL, and SetOutputList(). Referenced by SnortMain(). |
|
|
Definition at line 2306 of file snort.c. References ActivateOutputPlugin(), _progvars::binLogFile, FatalError(), LOG_ASCII, _progvars::log_cmd_override, _progvars::log_mode, LOG_NONE, LOG_PCAP, NoLog(), NT_OUTPUT_LOG, NULL, and SetOutputList(). Referenced by SnortMain(). |
|
||||||||||||||||||||
|
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 2544 of file snort.c. References _PluginSignalFuncNode::arg, DropStats(), errno, fpShowEventStats(), _PluginSignalFuncNode::func, InlineMode(), LogMessage(), _PluginSignalFuncNode::next, NULL, pcap_close(), _progvars::pid_filename, progargs, progname, SIGHUP, and _progvars::test_mode_flag. Referenced by SigHupHandler(). |
|
|
|
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 2356 of file snort.c. References Restart(). Referenced by SnortMain(). |
|
|
Definition at line 2346 of file snort.c. References CleanExit(). Referenced by SnortMain(). |
|
|
Definition at line 2351 of file snort.c. References CleanExit(). Referenced by SnortMain(). |
|
|
Definition at line 2341 of file snort.c. References CleanExit(). Referenced by SnortMain(). |
|
|
Definition at line 2361 of file snort.c. References DropStats(), NULL, _progvars::quiet_flag, _progvars::rotate_perf_file, SIG_SETMASK, SIGNAL_SNORT_ROTATE_STATS, and SIGUSR1. Referenced by SnortMain(). |
|
||||||||||||
|
|
Definition at line 167 of file snort.c. Referenced by CreatePidFile(). |
|
|
|
|
|
Definition at line 587 of file plugbase.c. |
|
|
|
|
|
Definition at line 130 of file snort.c. Referenced by DropStats(), OpenPcap(), Print2ndHeader(), SetPktProcessor(), and UnifiedInitLogFile(). |
|
|
Definition at line 2005 of file snort.c. Referenced by CleanExit(). |
|
|
|
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 143 of file snort.c. Referenced by ProcessPacket(). |
|
|
|
|
|
|
|
|
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 588 of file plugbase.c. |
|
|
Definition at line 151 of file snort.c. Referenced by GenHomenet(), GenObfuscationMask(), InitNetmasks(), and ParseIP(). |
|
|
Definition at line 27 of file getopt.c. Referenced by getopt(), and ParseCmdLine(). |
|
|
Definition at line 30 of file getopt.c. Referenced by getopt(). |
|
|
Definition at line 28 of file getopt.c. Referenced by getopt(), and ParseCmdLine(). |
|
|
Definition at line 32 of file getopt.c. Referenced by getopt(), and ParseCmdLine(). |
|
|
|
|
|
|
Definition at line 141 of file snort.c. Referenced by DropStats(), GetPktDropStats(), ParseConfig(), and TcpdumpInitLogFile(). |
|
|
|
|
|
Definition at line 135 of file plugbase.c. |
|
|
Definition at line 136 of file plugbase.c. |
|
|
Definition at line 134 of file plugbase.c. |
|
|
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 2004 of file snort.c. Referenced by CleanExit(), and InterfaceThread(). |
|
|
|
|
|
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(). |
1.4.2