+115
+-- remove share.h
+-- misc FIXITs
+
114
-- more FIXIT cleanup
-- fixed flush bucket dumping
* Function comment blocks are generally just noise that quickly becomes
obsolete. If you absolutely must comment on parameters, put each on a
separate line along with the comment. That way changing the signature
- will cause a change to the comments too.
+ may prompt a change to the comments too.
+
+* Use FIXIT (not FIXTHIS or TODO or whatever) to mark things left for a
+ day or even in just a minute. That way we can find them easily and won't
+ lose track of them.
+
+* Presently using FIXIT-X where X = P | H | M | L, indicating perf, high,
+ med, or low priority. For now, H, M, or L can indicate alpha 1, 2, or 3.
+ Perf changes fall between alpha 1 and 2.
==== Types
mpse.h
parameter.h
plug_data.h
- share.h
so_rule.h
value.h
)
mpse.h \
parameter.h \
plug_data.h \
-share.h \
so_rule.h \
value.h
+++ /dev/null
-/*
-** Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved.
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License Version 2 as
-** published by the Free Software Foundation. You may not use, modify or
-** distribute this program under any other version of the GNU General
-** Public License.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
-// share.h author Russ Combs <rucombs@cisco.com>
-
-#ifndef SHARE_H
-#define SHARE_H
-
-// FIXIT remove this dependency once stuff works
-// need to move below to share.cc or
-// move below data mgr calls to share.cc
-// need to build dynamic plugins and on linux to verify
-#include "managers/data_manager.h"
-
-class PlugData;
-
-class Share
-{
-public:
- static PlugData* acquire(const char* key)
- { return DataManager::acquire(key); };
-
- static void release(PlugData* p)
- { return DataManager::release(p); };
-};
-
-#endif
-
if (flags & TEST_FLAG_SESSION)
LogIpAddrs(test_file, p);
-#if 0
- if (flags & TEST_FLAG_REBUILT)
+ if ( (flags & TEST_FLAG_REBUILT) && (p->packet_flags && PKT_PSEUDO) )
{
- if (p->packet_flags & PKT_REBUILT_FRAG)
- //TextLog_Print(test_file, "F:" STDu64 "\t", pc.rebuilt_frags); FIXIT count in f3
- //
- else if (p->packet_flags & PKT_REBUILT_STREAM)
- //TextLog_Print(test_file, "S:" STDu64 "\t", pc.rebuilt_tcp); FIXIT count in s5
+ const char* s;
+ switch ( p->pseudo_type )
+ {
+ case PSEUDO_PKT_IP: s = "ip-defrag"; break;
+ case PSEUDO_PKT_TCP: s = "tcp-deseg"; break;
+ case PSEUDO_PKT_DCE_RPKT: s = "dce-pkt"; break;
+ case PSEUDO_PKT_DCE_SEG: s = "dce-deseg"; break;
+ case PSEUDO_PKT_DCE_FRAG: s = "dec-defrag"; break;
+ case PSEUDO_PKT_SMB_SEG: s = "smb-deseg"; break;
+ case PSEUDO_PKT_SMB_TRANS: s = "smb-trans"; break;
+ case PSEUDO_PKT_PS: s = "port_scan"; break;
+ case PSEUDO_PKT_SDF: s = "sdf"; break;
+ default: s = "pseudo pkt"; break;
+ }
+ TextLog_Print(test_file, "%s", s);
}
-#endif
TextLog_Print(test_file, "\n");
TextLog_Flush(test_file);
}
b->data = api->ctor(mod);
}
-PlugData* DataManager::acquire(const char* key)
+PlugData* DataManager::acquire(const char* key, SnortConfig* sc)
{
DataBlock* b = get_data(key);
assert(b);
{
// create default instance
Module* mod = ModuleManager::get_module(key);
- mod->begin(key, 0, nullptr); // FIXIT really need sc?
+ mod->begin(key, 0, sc);
mod->end(key, 0, nullptr);
b->data = b->api->ctor(mod);
}
static void instantiate(const DataApi*, Module*, SnortConfig*);
- static PlugData* acquire(const char* key);
+ static PlugData* acquire(const char* key, SnortConfig*);
static void release(PlugData*);
};
#include "main/analyzer.h"
#include "protocols/packet.h"
+#include "managers/data_manager.h"
#include "managers/packet_manager.h"
#include "event.h"
#include "event_wrapper.h"
#include "filters/sfthreshold.h"
#include "sfsnprintfappend.h"
#include "framework/inspector.h"
-#include "framework/share.h"
#include "framework/plug_data.h"
#include "profiler.h"
#include "detection/detect.h"
delete config;
if ( global )
- Share::release(global);
+ DataManager::release(global);
}
-bool PortScan::configure(SnortConfig*)
+bool PortScan::configure(SnortConfig* sc)
{
// FIXIT use fixed base file name
config->logfile = SnortStrdup("portscan.log");
- global = (PsData*)Share::acquire(PS_GLOBAL);
+ global = (PsData*)DataManager::acquire(PS_GLOBAL, sc);
config->common = global->data;
return true;
}
PSEUDO_PKT_IP,
PSEUDO_PKT_TCP,
PSEUDO_PKT_DCE_RPKT,
- PSEUDO_PKT_SMB_SEG,
PSEUDO_PKT_DCE_SEG,
PSEUDO_PKT_DCE_FRAG,
+ PSEUDO_PKT_SMB_SEG,
PSEUDO_PKT_SMB_TRANS,
PSEUDO_PKT_PS,
PSEUDO_PKT_SDF,
#include "parser.h"
#include "framework/inspector.h"
#include "framework/plug_data.h"
-#include "framework/share.h"
+#include "managers/data_manager.h"
#include "detection/detection_util.h"
int16_t ftp_data_app_id = SFTARGET_UNKNOWN_PROTOCOL;
if ( ftp_client )
// FIXIT make sure CleanupFTPClientConf() is called
- Share::release(ftp_client);
+ DataManager::release(ftp_client);
}
bool FtpServer::configure (SnortConfig* sc)
{
- ftp_client = (ClientData*)Share::acquire(client_key);
+ ftp_client = (ClientData*)DataManager::acquire(client_key, sc);
bind_server = ftp_server;
bind_client = ftp_client->data;
#include "parser.h"
#include "framework/inspector.h"
#include "framework/plug_data.h"
-#include "framework/share.h"
#include "detection/detection_util.h"
static const char* data_key = "ftp_data";
#include "file_api/file_api.h"
#include "sf_email_attach_decode.h"
#include "framework/inspector.h"
-#include "framework/share.h"
+#include "managers/data_manager.h"
#define ERRSTRLEN 1000
delete config;
if ( global )
- Share::release(global);
+ DataManager::release(global);
}
bool HttpInspect::get_buf(
bool HttpInspect::configure (SnortConfig* sc)
{
- global = (HttpData*)Share::acquire(GLOBAL_KEYWORD);
+ global = (HttpData*)DataManager::acquire(GLOBAL_KEYWORD, sc);
config->global = global->data;
HttpInspectInitializeGlobalConfig(config->global);
#include "snort_debug.h"
#include "framework/inspector.h"
#include "framework/plug_data.h"
-#include "framework/share.h"
#include "managers/inspector_manager.h"
#include "managers/module_manager.h"
#include "flow/flow_control.h"
#include "packet_io/active.h"
#include "packet_io/sfdaq.h"
#include "framework/inspector.h"
-#include "framework/share.h"
#include "flow/flow_control.h"
/* D E F I N E S **************************************************/