1 2 /**************************************************************************** 3 * 4 * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved. 5 * Copyright (C) 2003-2013 Sourcefire, Inc. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License Version 2 as 9 * published by the Free Software Foundation. You may not use, modify or 10 * distribute this program under any other version of the GNU General 11 * Public License. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 ****************************************************************************/ 23 24 /** 25 * @file log_text.h 26 * @author Russ Combs <rcombs@sourcefire.com> 27 * @date Fri Jun 27 10:34:37 2003 28 * 29 * @brief logging to text file 30 * 31 * Use these methods to write to a TextLog. 32 */ 33 34 #ifndef _LOG_TEXT_H 35 #define _LOG_TEXT_H 36 37 #include "sfutil/sf_textlog.h" 38 39 void LogPriorityData(TextLog*, bool doNewLine); 40 #if defined(FEAT_OPEN_APPID) 41 void LogAppID(TextLog*, const char* appName, bool doNewLine); 42 #endif 43 void LogXrefs(TextLog*, bool doNewLine); 44 45 void LogIPPkt(TextLog*, int type, Packet*); 46 47 void LogTimeStamp(TextLog*, Packet*); 48 void LogTrHeader(TextLog*, Packet*); 49 void Log2ndHeader(TextLog*, Packet*); 50 void LogIpAddrs(TextLog*, Packet*); 51 void LogIPHeader(TextLog*, Packet*); 52 void LogTCPHeader(TextLog*, Packet*); 53 void LogUDPHeader(TextLog*, Packet*); 54 void LogICMPHeader(TextLog*, Packet*); 55 void LogArpHeader(TextLog*, Packet*); 56 57 #ifdef DUMP_BUFFER 58 void LogBuffer(TextLog *, char *, char *, const int); 59 #endif 60 61 #if 0 62 /* these are implemented in log_text.c but not public */ 63 static void LogEthHeader(TextLog*, Packet*); 64 static void LogSLLHeader(TextLog*, Packet*); 65 static void LogWifiHeader(TextLog*, Packet*); 66 static void LogIpOptions(TextLog* , Packet*); 67 static void LogTcpOptions(TextLog*, Packet*); 68 static void LogEmbeddedICMPHeader(TextLog*, const ICMPHdr*); 69 static void LogICMPEmbeddedIP(TextLog*, Packet*); 70 static void LogReference(TextLog*, ReferenceNode*); 71 static void ScOutputCharData(TextLog*, char* data, int len); 72 static void LogNetData (TextLog*, const u_char* data, const int len, Packet *); 73 #endif 74 75 #if 0 76 /* these are only in log.c: */ 77 /* called from snort.c: */ 78 void PrintEapolPkt(FILE*, Packet*); 79 /* *Key() and *Header() should be static/private */ 80 void PrintEapolKey(FILE*, Packet*); 81 void PrintEapolHeader(FILE*, Packet*); 82 void PrintEAPHeader(FILE*, Packet*); 83 84 /* commented out all over the place! */ 85 /* still called in snort.c and spp_stream4.c */ 86 void ClearDumpBuf(void); 87 88 /* called from snort.c */ 89 void PrintWifiPkt(FILE*, Packet*); 90 91 /* called in a few places including log_text.c */ 92 void CreateTCPFlagString(Packet*, char*); 93 #endif 94 95 #endif /* _LOG_TEXT_H */ 96 97