#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <signal.h>
#include "log.h"
#include "rules.h"
#include "util.h"
#include "debug.h"
#include "signature.h"
#include "snort.h"
Go to the source code of this file.
Functions | |
void | PrintNetData (FILE *fp, u_char *start, const int len) |
void | PrintCharData (FILE *fp, char *data, int data_len) |
void | PrintIPPkt (FILE *fp, int type, Packet *p) |
FILE * | OpenAlertFile (char *filearg) |
void | ClearDumpBuf () |
void | NoAlert (Packet *p, char *msg, void *arg, Event *event) |
void | NoLog (Packet *p, char *msg, void *arg, Event *event) |
void | Print2ndHeader (FILE *fp, Packet *p) |
void | PrintTrHeader (FILE *fp, Packet *p) |
void | PrintEthHeader (FILE *fp, Packet *p) |
void | PrintSLLHeader (FILE *fp, Packet *p) |
void | PrintArpHeader (FILE *fp, Packet *p) |
void | PrintIPHeader (FILE *fp, Packet *p) |
void | PrintTCPHeader (FILE *fp, Packet *p) |
void | PrintEmbeddedTCPHeader (FILE *fp, Packet *p, int size) |
void | CreateTCPFlagString (Packet *p, char *flagBuffer) |
void | PrintUDPHeader (FILE *fp, Packet *p) |
void | PrintICMPHeader (FILE *fp, Packet *p) |
void | PrintIpOptions (FILE *fp, Packet *p) |
void | PrintTcpOptions (FILE *fp, Packet *p) |
void | PrintPriorityData (FILE *fp, int do_newline) |
void | PrintXrefs (FILE *fp, int do_newline) |
void | SetEvent (Event *event, u_int32_t generator, u_int32_t id, u_int32_t rev, u_int32_t classification, u_int32_t priority, u_int32_t event_ref) |
void | PrintEapolPkt (FILE *fp, Packet *p) |
void | PrintWifiHeader (FILE *fp, Packet *p) |
void | PrintWifiPkt (FILE *fp, Packet *p) |
void | PrintEapolHeader (FILE *fp, Packet *p) |
void | PrintEAPHeader (FILE *fp, Packet *p) |
void | PrintEapolKey (FILE *fp, Packet *p) |
Variables | |
OptTreeNode * | otn_tmp |
char * | data_dump_buffer |
int | dump_size |
u_int16_t | event_id |
static unsigned char | ezero [6] |
|
Definition at line 477 of file log.c. References data_dump_buffer, dump_size, and NULL. Referenced by BuildPacket(), DecodeIEEE80211Pkt(), DecodeIP(), Frag3Rebuild(), PcapProcessPacket(), ProcessPacket(), and RebuildFrag(). |
|
Definition at line 1019 of file log.c. References char(), _Packet::tcph, TH_ACK, TH_FIN, _TCPHdr::th_flags, TH_PUSH, TH_RES1, TH_RES2, TH_RST, TH_SYN, and TH_URG. Referenced by GetSessionFromSplayTree(), NewConnection(), PrintEmbeddedTCPHeader(), PrintTCPHeader(), RealAlertCSV(), ReassembleStream4(), and SLog(). |
|
Definition at line 501 of file log.c. Referenced by ProcessAlertCommandLine(). |
|
Definition at line 518 of file log.c. Referenced by ProcessLogCommandLine(). |
|
Definition at line 423 of file log.c. References _progvars::daemon_flag, DEBUG_INIT, DEBUG_WRAP, DEFAULT_DAEMON_ALERT_FILE, errno, FatalError(), _progvars::log_dir, NULL, pv, snprintf, and STD_BUF. Referenced by AlertCSVParseArgs(), ParseAlertFastArgs(), and ParseAlertFullArgs(). |
|
Definition at line 536 of file log.c. References datalink, DLT_EN10MB, DLT_IEEE802, DLT_IEEE802_11, DLT_LINUX_SLL, _Packet::eh, ErrorMessage(), PrintEthHeader(), PrintSLLHeader(), PrintTrHeader(), PrintWifiHeader(), pv, _Packet::sllh, _Packet::trh, _progvars::verbose_flag, and _Packet::wifih. Referenced by AlertFull(), PrintEapolPkt(), PrintIPPkt(), and PrintWifiPkt(). |
|
Definition at line 692 of file log.c. References _WifiHdr::addr1, _WifiHdr::addr2, _WifiHdr::addr3, _Packet::ah, _ARPHdr::ar_hln, _ARPHdr::ar_hrd, _ARPHdr::ar_op, _ARPHdr::ar_pln, _ARPHdr::ar_pro, _EtherARP::arp_sha, _EtherARP::arp_spa, _EtherARP::arp_tha, _EtherARP::arp_tpa, ARPOP_REPLY, ARPOP_REQUEST, ARPOP_RREPLY, ARPOP_RREQUEST, bcopy, bzero, _EtherARP::ea_hdr, _Packet::eh, _EtherHdr::ether_dst, _EtherHdr::ether_src, ETHERNET_TYPE_IP, ezero, _WifiHdr::frame_control, memcmp(), NULL, _Packet::pkth, TIMEBUF_SIZE, pcap_pkthdr::ts, ts_print(), _Packet::wifih, WLAN_FLAG_FROMDS, and WLAN_FLAG_TODS. Referenced by AlertFast(), LogAscii(), and ProcessPacket(). |
|
Definition at line 246 of file log.c. References data_dump_buffer, dump_size, index, int(), and NULL. Referenced by PrintEapolPkt(), PrintIPPkt(), and PrintWifiPkt(). |
|
Definition at line 1997 of file log.c. References _EAPHdr::code, EAP_CODE_FAILURE, EAP_CODE_REQUEST, EAP_CODE_RESPONSE, EAP_CODE_SUCCESS, EAP_TYPE_GTC, EAP_TYPE_IDENTITY, EAP_TYPE_MD5, EAP_TYPE_NAK, EAP_TYPE_NOTIFY, EAP_TYPE_OTP, EAP_TYPE_TLS, _Packet::eaph, _Packet::eaptype, _EAPHdr::id, _EAPHdr::len, and NULL. Referenced by PrintEapolPkt(). |
|
Definition at line 1961 of file log.c. References EAPOL_TYPE_ASF, EAPOL_TYPE_EAP, EAPOL_TYPE_KEY, EAPOL_TYPE_LOGOFF, EAPOL_TYPE_START, _EtherEapol::eaptype, _Packet::eplh, and _EtherEapol::len. Referenced by PrintEapolPkt(). |
|
Definition at line 2065 of file log.c. References _Packet::eapolk, _EapolKey::index, _EapolKey::length, memcpy, NULL, and _EapolKey::type. Referenced by PrintEapolPkt(). |
|
Definition at line 1745 of file log.c. References bzero, pcap_pkthdr::caplen, _progvars::char_data_flag, _Packet::data, _progvars::data_flag, _Packet::dsize, EAPOL_TYPE_EAP, EAPOL_TYPE_KEY, _EtherEapol::eaptype, _Packet::eplh, _Packet::pkt, _Packet::pkth, Print2ndHeader(), PrintCharData(), PrintEAPHeader(), PrintEapolHeader(), PrintEapolKey(), PrintNetData(), pv, _progvars::show2hdr_flag, TIMEBUF_SIZE, pcap_pkthdr::ts, ts_print(), and _progvars::verbose_bytedump_flag. Referenced by ProcessPacket(). |
|
Definition at line 970 of file log.c. References CreateTCPFlagString(), DEBUG_FLOW, DEBUG_WRAP, TCP_OFFSET, _Packet::tcph, _TCPHdr::th_ack, _TCPHdr::th_seq, and _TCPHdr::th_win. Referenced by PrintICMPHeader(). |
|
Definition at line 625 of file log.c. References _Packet::eh, _EtherHdr::ether_dst, _EtherHdr::ether_src, _EtherHdr::ether_type, pcap_pkthdr::len, and _Packet::pkth. Referenced by Print2ndHeader(). |
|
|
Definition at line 836 of file log.c. References _Packet::dp, _Packet::frag_flag, _Packet::frag_offset, _IPHdr::ip_dst, IP_HLEN, _IPHdr::ip_id, _IPHdr::ip_len, _IPHdr::ip_off, _Packet::ip_option_count, _IPHdr::ip_proto, _IPHdr::ip_src, _IPHdr::ip_tos, _IPHdr::ip_ttl, _Packet::iph, NULL, _progvars::obfuscation_flag, PrintIpOptions(), protocol_names, pv, _progvars::show2hdr_flag, and _Packet::sp. Referenced by AlertFull(), PrintICMPHeader(), and PrintIPPkt(). |
|
Definition at line 1411 of file log.c. References _Options::code, _Options::data, int(), _Packet::ip_option_count, _Packet::ip_options, IPOPT_EOL, IPOPT_LSRR, IPOPT_LSRR_E, IPOPT_NOP, IPOPT_RR, IPOPT_RTRALT, IPOPT_SATID, IPOPT_SECURITY, IPOPT_SSRR, IPOPT_TS, and _Options::len. Referenced by PrintIPHeader(). |
|
Definition at line 315 of file log.c. References _Packet::actual_ip_len, bzero, pcap_pkthdr::caplen, _progvars::char_data_flag, _Packet::data, _progvars::data_flag, DEBUG_LOG, DEBUG_WRAP, _Packet::dsize, _Packet::frag_flag, _Packet::icmph, IP_HLEN, _IPHdr::ip_len, _IPHdr::ip_proto, _Packet::iph, NULL, _Packet::pkt, _Packet::pkth, Print2ndHeader(), PrintCharData(), PrintICMPHeader(), PrintIPHeader(), PrintNetData(), PrintTCPHeader(), PrintUDPHeader(), pv, _progvars::show2hdr_flag, _Packet::tcph, TIMEBUF_SIZE, pcap_pkthdr::ts, ts_print(), _Packet::udph, and _progvars::verbose_bytedump_flag. Referenced by AlertFast(), BuildPacket(), Frag3Rebuild(), LogAscii(), and ProcessPacket(). |
|
Definition at line 71 of file log.c. References C_OFFSET, char(), data_dump_buffer, dump_size, FatalError(), FRAME_SIZE, int(), memset, NULL, pv, _progvars::verbose_bytedump_flag, and _progvars::verbose_flag. Referenced by DecodeIEEE80211Pkt(), PrintEapolPkt(), PrintIPPkt(), and PrintWifiPkt(). |
|
Definition at line 1648 of file log.c. References _SigInfo::classType, _ClassType::name, _SigInfo::priority, and _OptTreeNode::sigInfo. Referenced by AlertFast(), and AlertFull(). |
|
Definition at line 654 of file log.c. References pcap_pkthdr::len, LINUX_SLL_BROADCAST, LINUX_SLL_HOST, LINUX_SLL_MULTICAST, LINUX_SLL_OTHERHOST, LINUX_SLL_OUTGOING, _Packet::pkth, _SLLHdr::sll_addr, _SLLHdr::sll_halen, _SLLHdr::sll_hatype, _SLLHdr::sll_pkttype, _SLLHdr::sll_protocol, and _Packet::sllh. Referenced by Print2ndHeader(). |
|
Definition at line 934 of file log.c. References CreateTCPFlagString(), NULL, PrintTcpOptions(), TCP_OFFSET, _Packet::tcp_option_count, _Packet::tcph, _TCPHdr::th_ack, _TCPHdr::th_flags, _TCPHdr::th_seq, TH_URG, _TCPHdr::th_urp, and _TCPHdr::th_win. Referenced by AlertFull(), and PrintIPPkt(). |
|
Definition at line 1498 of file log.c. References bzero, _Options::code, _Options::data, EXTRACT_16BITS, EXTRACT_32BITS, int(), _Options::len, memcpy, _Packet::tcp_option_count, _Packet::tcp_options, TCPOPT_CC, TCPOPT_CCECHO, TCPOPT_CCNEW, TCPOPT_ECHO, TCPOPT_ECHOREPLY, TCPOPT_EOL, TCPOPT_MAXSEG, TCPOPT_NOP, TCPOPT_SACK, TCPOPT_SACKOK, TCPOPT_TIMESTAMP, and TCPOPT_WSCALE. Referenced by PrintTCPHeader(). |
|
Definition at line 581 of file log.c. References _Trh_hdr::ac, _Trh_hdr::daddr, _Trh_llc::dsap, _Trh_llc::ethertype, _Trh_hdr::fc, _Trh_llc::protid, _Trh_mr::rseg, _Trh_hdr::saddr, _Trh_llc::ssap, _Packet::trh, TRH_MR_BCAST, TRH_MR_DIR, TRH_MR_LEN, TRH_MR_LF, TRH_MR_RES, _Packet::trhllc, and _Packet::trhmr. Referenced by Print2ndHeader(), and RealAlertCSV(). |
|
Definition at line 1046 of file log.c. References NULL, UDP_HEADER_LEN, _Packet::udph, and _UDPHdr::uh_len. Referenced by AlertFull(), PrintICMPHeader(), and PrintIPPkt(). |
|
|
Definition at line 1919 of file log.c. References bzero, pcap_pkthdr::caplen, _progvars::char_data_flag, _Packet::data, _progvars::data_flag, _Packet::dsize, _Packet::pkt, _Packet::pkth, Print2ndHeader(), PrintCharData(), PrintNetData(), pv, TIMEBUF_SIZE, pcap_pkthdr::ts, ts_print(), and _progvars::verbose_bytedump_flag. Referenced by ProcessPacket(). |
|
Definition at line 1681 of file log.c. References FPrintReference(), _ReferenceNode::next, NULL, _SigInfo::refs, and _OptTreeNode::sigInfo. Referenced by AlertFull(). |
|
Definition at line 1714 of file log.c. References event_id, _progvars::event_log_id, and pv. Referenced by AlertIntermediateInfo(), CheckTagList(), GenerateOpenPortEvent(), GenerateSnortEvent(), LogTagData(), PortscanPreprocFunction(), and SAlert(). |
|
Definition at line 50 of file log.c. Referenced by ClearDumpBuf(), PrintCharData(), and PrintNetData(). |
|
Definition at line 51 of file log.c. Referenced by ClearDumpBuf(), PrintCharData(), and PrintNetData(). |
|
|
|
Definition at line 57 of file log.c. Referenced by PrintArpHeader(). |
|
|