diff --git a/policy/nfs.bro b/policy/nfs.bro index d8db0b4ef8..0d572b52c7 100644 --- a/policy/nfs.bro +++ b/policy/nfs.bro @@ -1,4 +1,3 @@ -# $Id$ @load udp diff --git a/policy/portmapper.bro b/policy/portmapper.bro index 2a038674e0..4829812154 100644 --- a/policy/portmapper.bro +++ b/policy/portmapper.bro @@ -120,8 +120,6 @@ export { # the request was answered, F it was attempted but not answered. # If there's an entry in the set, then the access won't lead to a # NOTICE (unless the connection is hot for some other reason). - # If there's an entry in the set, then the access won't lead to a - # NOTICE (unless the connection is hot for some other reason). const RPC_do_not_complain: set[string, bool] = { ["pm_null", [T, F]], } &redef; diff --git a/src/Analyzer.cc b/src/Analyzer.cc index a9c17dde36..da81e54478 100644 --- a/src/Analyzer.cc +++ b/src/Analyzer.cc @@ -40,8 +40,6 @@ #include "Syslog-binpac.h" #include "ConnSizeAnalyzer.h" -#include - // Keep same order here as in AnalyzerTag definition! const Analyzer::Config Analyzer::analyzer_configs[] = { { AnalyzerTag::Error, "", 0, 0, 0, false }, diff --git a/src/BroString.cc b/src/BroString.cc index 0ad923c848..1bbe0099f2 100644 --- a/src/BroString.cc +++ b/src/BroString.cc @@ -12,8 +12,6 @@ #include "BroString.h" #include "Var.h" -#include - #ifdef DEBUG #define DEBUG_STR(msg) DBG_LOG(DBG_STRING, msg) #else diff --git a/src/ContentLine.cc b/src/ContentLine.cc index bd5c48f6f1..5f58fa1f0c 100644 --- a/src/ContentLine.cc +++ b/src/ContentLine.cc @@ -5,8 +5,6 @@ #include "ContentLine.h" #include "TCP.h" -#include - ContentLine_Analyzer::ContentLine_Analyzer(Connection* conn, bool orig) : TCP_SupportAnalyzer(AnalyzerTag::ContentLine, conn, orig) { diff --git a/src/DNS_Mgr.cc b/src/DNS_Mgr.cc index 6101688181..d179ccec49 100644 --- a/src/DNS_Mgr.cc +++ b/src/DNS_Mgr.cc @@ -36,8 +36,6 @@ #include "Net.h" #include "Var.h" -#include - extern "C" { extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); diff --git a/src/Discard.cc b/src/Discard.cc index 7d3b53f49a..fcee23e5e0 100644 --- a/src/Discard.cc +++ b/src/Discard.cc @@ -10,8 +10,6 @@ #include "Var.h" #include "Discard.h" -#include - Discarder::Discarder() { ip_hdr = internal_type("ip_hdr")->AsRecordType(); diff --git a/src/File.cc b/src/File.cc index 03a7ddafde..2e6929fc89 100644 --- a/src/File.cc +++ b/src/File.cc @@ -31,8 +31,6 @@ #include "Serializer.h" #include "Event.h" -#include - // Timer which on dispatching rotates the file. class RotateTimer : public Timer { public: diff --git a/src/FileAnalyzer.cc b/src/FileAnalyzer.cc index 4e7401f99f..17d3ad1dbc 100644 --- a/src/FileAnalyzer.cc +++ b/src/FileAnalyzer.cc @@ -4,8 +4,6 @@ #include "FileAnalyzer.h" -#include - #ifdef HAVE_LIBMAGIC magic_t File_Analyzer::magic = 0; magic_t File_Analyzer::magic_mime = 0; diff --git a/src/ICMP.cc b/src/ICMP.cc index 66982ed767..4e11583651 100644 --- a/src/ICMP.cc +++ b/src/ICMP.cc @@ -11,8 +11,6 @@ #include "Event.h" #include "ICMP.h" -#include - ICMP_Analyzer::ICMP_Analyzer(Connection* c) : TransportLayerAnalyzer(AnalyzerTag::ICMP, c) { diff --git a/src/IOSource.cc b/src/IOSource.cc index 05a5b8a05b..83f4ef15f2 100644 --- a/src/IOSource.cc +++ b/src/IOSource.cc @@ -10,8 +10,6 @@ #include "util.h" #include "IOSource.h" -#include - IOSourceRegistry io_sources; IOSourceRegistry::~IOSourceRegistry() diff --git a/src/NFS.cc b/src/NFS.cc index 9f21f4368f..2951361baf 100644 --- a/src/NFS.cc +++ b/src/NFS.cc @@ -204,8 +204,6 @@ int NFS_Interp::RPC_BuildReply(RPC_CallInfo* c, BifEnum::rpc_status rpc_status, event = nfs_proc_readdir; break; - - default: if ( c->Proc() < BifEnum::NFS3::PROC_END_OF_PROCS ) { @@ -614,8 +612,6 @@ RecordVal* NFS_Interp::nfs3_readdir_reply(bool isplus, const u_char*& buf, { rep->Assign(1, nfs3_post_op_attr(buf,n)); } - return rep; - } return rep; } diff --git a/src/NFS.h b/src/NFS.h index 1d642674aa..28a1d5c4ac 100644 --- a/src/NFS.h +++ b/src/NFS.h @@ -92,6 +92,4 @@ public: }; -#endif - #endif diff --git a/src/Portmap.cc b/src/Portmap.cc index 9751f0c560..e806acdc7a 100644 --- a/src/Portmap.cc +++ b/src/Portmap.cc @@ -80,7 +80,6 @@ int PortmapperInterp::RPC_BuildReply(RPC_CallInfo* c, BifEnum::rpc_status status Val *reply = 0; int success = (status == BifEnum::RPC_SUCCESS); - switch ( c->Proc() ) { case PMAPPROC_NULL: event = success ? pm_request_null : pm_attempt_null; diff --git a/src/RPC.cc b/src/RPC.cc index c877e53490..915f2efe9e 100644 --- a/src/RPC.cc +++ b/src/RPC.cc @@ -13,8 +13,6 @@ #include "RPC.h" #include "Sessions.h" -#include - namespace { // local namespace const bool DEBUG_rpc_resync = false; } @@ -48,17 +46,12 @@ RPC_CallInfo::RPC_CallInfo(uint32 arg_xid, const u_char*& buf, int& n, double ar valid_call = false; v = 0; - /*GM cookie = 0; */ } RPC_CallInfo::~RPC_CallInfo() { delete [] call_buf; Unref(v); - /*GM - if (cookie) - delete cookie; - */ } int RPC_CallInfo::CompareRexmit(const u_char* buf, int n) const @@ -94,6 +87,7 @@ int RPC_Interpreter::DeliverRPC(const u_char* buf, int n, int rpclen, if ( ! buf ) return 0; + HashKey h(&xid, 1); RPC_CallInfo* call = calls.Lookup(&h); @@ -106,9 +100,6 @@ int RPC_Interpreter::DeliverRPC(const u_char* buf, int n, int rpclen, { if ( ! call->CompareRexmit(buf, n) ) Weird("RPC_rexmit_inconsistency"); - // XXX: Should we update start_time and last_time or not?? - call->SetStartTime(start_time); - call->SetLastTime(last_time); // TODO: Should we update start_time and last_time or // not?? @@ -140,10 +131,6 @@ int RPC_Interpreter::DeliverRPC(const u_char* buf, int n, int rpclen, calls.Insert(&h, call); } - // We now have a valid RPC_CallInfo (either the previous one in case - // of a rexmit or the current one). - // TODO: What to do in case of a rexmit_inconistency?? - Event_RPC_Call(call); // We now have a valid RPC_CallInfo (either the previous one // in case of a rexmit or the current one). diff --git a/src/Reassem.cc b/src/Reassem.cc index 12cb59d7f4..0153bde178 100644 --- a/src/Reassem.cc +++ b/src/Reassem.cc @@ -9,8 +9,6 @@ #include "Reassem.h" #include "Serializer.h" -#include - const bool DEBUG_reassem = false; #ifdef DEBUG diff --git a/src/RuleMatcher.cc b/src/RuleMatcher.cc index 7238da3b9a..4bc28b4c32 100644 --- a/src/RuleMatcher.cc +++ b/src/RuleMatcher.cc @@ -11,8 +11,6 @@ #include "Scope.h" #include "File.h" -#include - // FIXME: Things that are not fully implemented/working yet: // // - "ip-options" always evaluates to false diff --git a/src/SmithWaterman.cc b/src/SmithWaterman.cc index 2f7c6e450a..34ca4bc87b 100644 --- a/src/SmithWaterman.cc +++ b/src/SmithWaterman.cc @@ -11,8 +11,6 @@ #include "Var.h" #include "util.h" -#include - BroSubstring::BroSubstring(const BroSubstring& bst) : BroString((const BroString&) bst), _new(bst._new) { diff --git a/src/TCP.cc b/src/TCP.cc index b4ea4f8037..62039b7fa7 100644 --- a/src/TCP.cc +++ b/src/TCP.cc @@ -12,8 +12,6 @@ #include "OSFinger.h" #include "Event.h" -#include - namespace { // local namespace const bool DEBUG_tcp_data_sent = false; const bool DEBUG_tcp_connection_close = false; diff --git a/src/TCP_Reassembler.cc b/src/TCP_Reassembler.cc index 1ebd58331e..e221ab4118 100644 --- a/src/TCP_Reassembler.cc +++ b/src/TCP_Reassembler.cc @@ -7,8 +7,6 @@ #include "TCP.h" #include "TCP_Endpoint.h" -#include - // Only needed for gap_report events. #include "Event.h" diff --git a/src/UDP.cc b/src/UDP.cc index e6ed7db853..b141a1e9a2 100644 --- a/src/UDP.cc +++ b/src/UDP.cc @@ -10,8 +10,6 @@ #include "NetVar.h" #include "UDP.h" -#include - UDP_Analyzer::UDP_Analyzer(Connection* conn) : TransportLayerAnalyzer(AnalyzerTag::UDP, conn) { diff --git a/src/XDR.cc b/src/XDR.cc index dcb2e24faf..53e9a4b2dd 100644 --- a/src/XDR.cc +++ b/src/XDR.cc @@ -8,8 +8,6 @@ #include "XDR.h" -#include - uint32 extract_XDR_uint32(const u_char*& buf, int& len) { if ( ! buf ) @@ -63,8 +61,6 @@ const u_char* extract_XDR_opaque(const u_char*& buf, int& len, int& n, int max_l n = int(extract_XDR_uint32(buf, len)); if ( ! buf ) return 0; - if (short_buf_ok) - n = std::min(n, len); if ( short_buf_ok ) n = std::min(n, len); diff --git a/src/event.bif b/src/event.bif index fed999356f..e9e5990e28 100644 --- a/src/event.bif +++ b/src/event.bif @@ -165,14 +165,6 @@ event rpc_call%(c: connection, xid: count, prog: count, ver: count, proc: count, # Generated for each (correctly formed) RPC_REPLY message received. event rpc_reply%(c: connection, xid: count, status: rpc_status, reply_len: count%); -# Generated for each RPC request / reply *pair* (if there is no reply, the event -# will be generated on timeout). -event rpc_dialogue%(c: connection, prog: count, ver: count, proc: count, status: rpc_status, start_time: time, call_len: count, reply_len: count%); -# Generated for each (correctly formed) RPC_CALL message received -event rpc_call%(c: connection, xid: count, prog: count, ver: count, proc: count, call_len: count%); -# Generated for each (correctly formed) RPC_REPLY message received -event rpc_reply%(c: connection, xid: count, status: rpc_status, reply_len: count%); - event pm_request_null%(r: connection%); event pm_request_set%(r: connection, m: pm_mapping, success: bool%); event pm_request_unset%(r: connection, m: pm_mapping, success: bool%); diff --git a/src/util.h b/src/util.h index 24edfbdbc0..6aad1271af 100644 --- a/src/util.h +++ b/src/util.h @@ -13,11 +13,6 @@ // Expose C99 functionality from inttypes.h, which would otherwise not be // available in C++. -#ifndef _ISOC99_SOURCE -# define _ISOC99_SOURCE -#endif -#define __STDC_LIMIT_MACROS -#define __STDC_CONSTANT_MACROS #define __STDC_FORMAT_MACROS #include