diff --git a/src/analyzer/protocol/arp/Plugin.cc b/src/analyzer/protocol/arp/Plugin.cc index 9045ef412f..d0297d5f78 100644 --- a/src/analyzer/protocol/arp/Plugin.cc +++ b/src/analyzer/protocol/arp/Plugin.cc @@ -1,7 +1,21 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(Bro, ARP) - BRO_PLUGIN_DESCRIPTION("ARP Parsing Code"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_ARP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + plugin::Configuration config; + config.name = "Bro::ARP"; + config.description = "ARP Parsing"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ayiya/AYIYA.h b/src/analyzer/protocol/ayiya/AYIYA.h index f5bb379cf4..8a8ab26851 100644 --- a/src/analyzer/protocol/ayiya/AYIYA.h +++ b/src/analyzer/protocol/ayiya/AYIYA.h @@ -14,7 +14,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new AYIYA_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/ayiya/Plugin.cc b/src/analyzer/protocol/ayiya/Plugin.cc index 0fc96eff3c..7b660722e4 100644 --- a/src/analyzer/protocol/ayiya/Plugin.cc +++ b/src/analyzer/protocol/ayiya/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "AYIYA.h" -BRO_PLUGIN_BEGIN(Bro, AYIYA) - BRO_PLUGIN_DESCRIPTION("AYIYA Analyzer"); - BRO_PLUGIN_ANALYZER("AYIYA", ayiya::AYIYA_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_AYIYA { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("AYIYA", ::analyzer::ayiya::AYIYA_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::AYIYA"; + config.description = "AYIYA Analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/backdoor/BackDoor.h b/src/analyzer/protocol/backdoor/BackDoor.h index 5bc8a67381..b85f09244a 100644 --- a/src/analyzer/protocol/backdoor/BackDoor.h +++ b/src/analyzer/protocol/backdoor/BackDoor.h @@ -73,7 +73,7 @@ public: virtual void Done(); void StatTimer(double t, int is_expire); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new BackDoor_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/backdoor/Plugin.cc b/src/analyzer/protocol/backdoor/Plugin.cc index 0983aaf5d3..111ba70709 100644 --- a/src/analyzer/protocol/backdoor/Plugin.cc +++ b/src/analyzer/protocol/backdoor/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "BackDoor.h" -BRO_PLUGIN_BEGIN(Bro, BackDoor) - BRO_PLUGIN_DESCRIPTION("Backdoor Analyzer (deprecated)"); - BRO_PLUGIN_ANALYZER("BackDoor", backdoor::BackDoor_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_BackDoor { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("BackDoor", ::analyzer::backdoor::BackDoor_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::BackDoor"; + config.description = "Backdoor Analyzer deprecated"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/bittorrent/BitTorrent.h b/src/analyzer/protocol/bittorrent/BitTorrent.h index 7739463052..7aafb7e262 100644 --- a/src/analyzer/protocol/bittorrent/BitTorrent.h +++ b/src/analyzer/protocol/bittorrent/BitTorrent.h @@ -19,7 +19,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); virtual void EndpointEOF(bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new BitTorrent_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/bittorrent/BitTorrentTracker.h b/src/analyzer/protocol/bittorrent/BitTorrentTracker.h index b041e556b7..37cf0b25bf 100644 --- a/src/analyzer/protocol/bittorrent/BitTorrentTracker.h +++ b/src/analyzer/protocol/bittorrent/BitTorrentTracker.h @@ -52,7 +52,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); virtual void EndpointEOF(bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new BitTorrentTracker_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/bittorrent/Plugin.cc b/src/analyzer/protocol/bittorrent/Plugin.cc index 7fea68bf07..b663dde25d 100644 --- a/src/analyzer/protocol/bittorrent/Plugin.cc +++ b/src/analyzer/protocol/bittorrent/Plugin.cc @@ -1,12 +1,27 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "BitTorrent.h" #include "BitTorrentTracker.h" -BRO_PLUGIN_BEGIN(Bro, BitTorrent) - BRO_PLUGIN_DESCRIPTION("BitTorrent Analyzer"); - BRO_PLUGIN_ANALYZER("BitTorrent", bittorrent::BitTorrent_Analyzer); - BRO_PLUGIN_ANALYZER("BitTorrentTracker", bittorrent::BitTorrentTracker_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_BitTorrent { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("BitTorrent", ::analyzer::bittorrent::BitTorrent_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("BitTorrentTracker", ::analyzer::bittorrent::BitTorrentTracker_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::BitTorrent"; + config.description = "BitTorrent Analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/conn-size/ConnSize.h b/src/analyzer/protocol/conn-size/ConnSize.h index 25f096dd32..36298b29b5 100644 --- a/src/analyzer/protocol/conn-size/ConnSize.h +++ b/src/analyzer/protocol/conn-size/ConnSize.h @@ -21,7 +21,7 @@ public: virtual void UpdateConnVal(RecordVal *conn_val); virtual void FlipRoles(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new ConnSize_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/conn-size/Plugin.cc b/src/analyzer/protocol/conn-size/Plugin.cc index 6993e15ff8..d373ce5d4a 100644 --- a/src/analyzer/protocol/conn-size/Plugin.cc +++ b/src/analyzer/protocol/conn-size/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "ConnSize.h" -BRO_PLUGIN_BEGIN(Bro, ConnSize) - BRO_PLUGIN_DESCRIPTION("Connection size analyzer"); - BRO_PLUGIN_ANALYZER("ConnSize", conn_size::ConnSize_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_ConnSize { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("ConnSize", ::analyzer::conn_size::ConnSize_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::ConnSize"; + config.description = "Connection size analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/dce-rpc/DCE_RPC.h b/src/analyzer/protocol/dce-rpc/DCE_RPC.h index 2abfb584b5..cd3910bf42 100644 --- a/src/analyzer/protocol/dce-rpc/DCE_RPC.h +++ b/src/analyzer/protocol/dce-rpc/DCE_RPC.h @@ -178,7 +178,7 @@ public: DCE_RPC_Analyzer(Connection* conn, bool speculative = false); ~DCE_RPC_Analyzer(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new DCE_RPC_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/dce-rpc/Plugin.cc b/src/analyzer/protocol/dce-rpc/Plugin.cc index d9f3ce16c8..d855d20cc0 100644 --- a/src/analyzer/protocol/dce-rpc/Plugin.cc +++ b/src/analyzer/protocol/dce-rpc/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "DCE_RPC.h" -BRO_PLUGIN_BEGIN(Bro, DCE_RPC) - BRO_PLUGIN_DESCRIPTION("DCE-RPC analyzer"); - BRO_PLUGIN_ANALYZER("DCE_RPC", dce_rpc::DCE_RPC_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_DCE_RPC"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_DCE_RPC { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("DCE_RPC", ::analyzer::dce_rpc::DCE_RPC_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_DCE_RPC", 0)); + + plugin::Configuration config; + config.name = "Bro::DCE_RPC"; + config.description = "DCE-RPC analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/dhcp/DHCP.h b/src/analyzer/protocol/dhcp/DHCP.h index a1c06e8b85..f96b75ee05 100644 --- a/src/analyzer/protocol/dhcp/DHCP.h +++ b/src/analyzer/protocol/dhcp/DHCP.h @@ -16,7 +16,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new DHCP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/dhcp/Plugin.cc b/src/analyzer/protocol/dhcp/Plugin.cc index 73603f8cb1..eecf6f9170 100644 --- a/src/analyzer/protocol/dhcp/Plugin.cc +++ b/src/analyzer/protocol/dhcp/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "DHCP.h" -BRO_PLUGIN_BEGIN(Bro, DHCP) - BRO_PLUGIN_DESCRIPTION("DHCP analyzer"); - BRO_PLUGIN_ANALYZER("DHCP", dhcp::DHCP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_DHCP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("DHCP", ::analyzer::dhcp::DHCP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::DHCP"; + config.description = "DHCP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/dnp3/DNP3.h b/src/analyzer/protocol/dnp3/DNP3.h index b84d3874b4..a58c0d486a 100644 --- a/src/analyzer/protocol/dnp3/DNP3.h +++ b/src/analyzer/protocol/dnp3/DNP3.h @@ -17,7 +17,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); virtual void EndpointEOF(bool is_orig); - static Analyzer* InstantiateAnalyzer(Connection* conn) + static Analyzer* Instantiate(Connection* conn) { return new DNP3_Analyzer(conn); } private: diff --git a/src/analyzer/protocol/dnp3/Plugin.cc b/src/analyzer/protocol/dnp3/Plugin.cc index d86413b388..614ff38773 100644 --- a/src/analyzer/protocol/dnp3/Plugin.cc +++ b/src/analyzer/protocol/dnp3/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "DNP3.h" -BRO_PLUGIN_BEGIN(Bro, DNP3) - BRO_PLUGIN_DESCRIPTION("DNP3 analyzer"); - BRO_PLUGIN_ANALYZER("DNP3", dnp3::DNP3_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_DNP3 { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("DNP3", ::analyzer::dnp3::DNP3_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::DNP3"; + config.description = "DNP3 analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/dns/DNS.h b/src/analyzer/protocol/dns/DNS.h index af4b8de22f..c7ea1e75fd 100644 --- a/src/analyzer/protocol/dns/DNS.h +++ b/src/analyzer/protocol/dns/DNS.h @@ -267,7 +267,7 @@ public: void ExpireTimer(double t); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new DNS_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/dns/Plugin.cc b/src/analyzer/protocol/dns/Plugin.cc index bb96692cd0..1cba094c54 100644 --- a/src/analyzer/protocol/dns/Plugin.cc +++ b/src/analyzer/protocol/dns/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "DNS.h" -BRO_PLUGIN_BEGIN(Bro, DNS) - BRO_PLUGIN_DESCRIPTION("DNS analyzer"); - BRO_PLUGIN_ANALYZER("DNS", dns::DNS_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_DNS"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_DNS { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("DNS", ::analyzer::dns::DNS_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_DNS", 0)); + + plugin::Configuration config; + config.name = "Bro::DNS"; + config.description = "DNS analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/file/File.h b/src/analyzer/protocol/file/File.h index 7afbd569c4..83185e2182 100644 --- a/src/analyzer/protocol/file/File.h +++ b/src/analyzer/protocol/file/File.h @@ -19,7 +19,7 @@ public: void Undelivered(int seq, int len, bool orig); -// static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) +// static analyzer::Analyzer* Instantiate(Connection* conn) // { return new File_Analyzer(conn); } protected: @@ -40,7 +40,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); - static Analyzer* InstantiateAnalyzer(Connection* conn) + static Analyzer* Instantiate(Connection* conn) { return new IRC_Data(conn); } }; @@ -54,7 +54,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); - static Analyzer* InstantiateAnalyzer(Connection* conn) + static Analyzer* Instantiate(Connection* conn) { return new FTP_Data(conn); } }; diff --git a/src/analyzer/protocol/file/Plugin.cc b/src/analyzer/protocol/file/Plugin.cc index 6e6adae90c..499736ebd8 100644 --- a/src/analyzer/protocol/file/Plugin.cc +++ b/src/analyzer/protocol/file/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "./File.h" -BRO_PLUGIN_BEGIN(Bro, File) - BRO_PLUGIN_DESCRIPTION("Generic file analyzer"); - BRO_PLUGIN_ANALYZER("FTP_Data", file::FTP_Data); - BRO_PLUGIN_ANALYZER("IRC_Data", file::IRC_Data); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_File { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("FTP_Data", ::analyzer::file::FTP_Data::Instantiate)); + AddComponent(new ::analyzer::Component("IRC_Data", ::analyzer::file::IRC_Data::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::File"; + config.description = "Generic file analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/finger/Finger.h b/src/analyzer/protocol/finger/Finger.h index efea0fae6b..c677f4c599 100644 --- a/src/analyzer/protocol/finger/Finger.h +++ b/src/analyzer/protocol/finger/Finger.h @@ -17,7 +17,7 @@ public: // Line-based input. virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Finger_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/finger/Plugin.cc b/src/analyzer/protocol/finger/Plugin.cc index 6cf909ca54..4fbfed8e12 100644 --- a/src/analyzer/protocol/finger/Plugin.cc +++ b/src/analyzer/protocol/finger/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Finger.h" -BRO_PLUGIN_BEGIN(Bro, Finger) - BRO_PLUGIN_DESCRIPTION("Finger analyzer"); - BRO_PLUGIN_ANALYZER("Finger", finger::Finger_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Finger { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Finger", ::analyzer::finger::Finger_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Finger"; + config.description = "Finger analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ftp/FTP.h b/src/analyzer/protocol/ftp/FTP.h index 1cffa19b1d..f829547f36 100644 --- a/src/analyzer/protocol/ftp/FTP.h +++ b/src/analyzer/protocol/ftp/FTP.h @@ -15,7 +15,7 @@ public: virtual void Done(); virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new FTP_Analyzer(conn); } diff --git a/src/analyzer/protocol/ftp/Plugin.cc b/src/analyzer/protocol/ftp/Plugin.cc index db8e20e7ed..80e5bf4381 100644 --- a/src/analyzer/protocol/ftp/Plugin.cc +++ b/src/analyzer/protocol/ftp/Plugin.cc @@ -1,12 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "FTP.h" -BRO_PLUGIN_BEGIN(Bro, FTP) - BRO_PLUGIN_DESCRIPTION("FTP analyzer"); - BRO_PLUGIN_ANALYZER("FTP", ftp::FTP_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("FTP_ADAT"); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_FTP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("FTP", ::analyzer::ftp::FTP_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("FTP_ADAT", 0)); + + plugin::Configuration config; + config.name = "Bro::FTP"; + config.description = "FTP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/gnutella/Gnutella.h b/src/analyzer/protocol/gnutella/Gnutella.h index 11d51cf276..c2b161ec04 100644 --- a/src/analyzer/protocol/gnutella/Gnutella.h +++ b/src/analyzer/protocol/gnutella/Gnutella.h @@ -42,7 +42,7 @@ public: virtual void Done (); virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Gnutella_Analyzer(conn); } private: diff --git a/src/analyzer/protocol/gnutella/Plugin.cc b/src/analyzer/protocol/gnutella/Plugin.cc index 73b91af002..afd0ff491e 100644 --- a/src/analyzer/protocol/gnutella/Plugin.cc +++ b/src/analyzer/protocol/gnutella/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Gnutella.h" -BRO_PLUGIN_BEGIN(Bro, Gnutella) - BRO_PLUGIN_DESCRIPTION("Gnutella analyzer"); - BRO_PLUGIN_ANALYZER("Gnutella", gnutella::Gnutella_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Gnutella { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Gnutella", ::analyzer::gnutella::Gnutella_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Gnutella"; + config.description = "Gnutella analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/gtpv1/GTPv1.h b/src/analyzer/protocol/gtpv1/GTPv1.h index b58405ea7f..a92e6fd2fb 100644 --- a/src/analyzer/protocol/gtpv1/GTPv1.h +++ b/src/analyzer/protocol/gtpv1/GTPv1.h @@ -14,7 +14,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new GTPv1_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/gtpv1/Plugin.cc b/src/analyzer/protocol/gtpv1/Plugin.cc index 83d1557e4d..846c78d18f 100644 --- a/src/analyzer/protocol/gtpv1/Plugin.cc +++ b/src/analyzer/protocol/gtpv1/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "GTPv1.h" -BRO_PLUGIN_BEGIN(Bro, GTPv1) - BRO_PLUGIN_DESCRIPTION("GTPv1 analyzer"); - BRO_PLUGIN_ANALYZER("GTPv1", gtpv1::GTPv1_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_GTPv1 { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("GTPv1", ::analyzer::gtpv1::GTPv1_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::GTPv1"; + config.description = "GTPv1 analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/http/HTTP.h b/src/analyzer/protocol/http/HTTP.h index 7757b99f7f..0ceebb50a7 100644 --- a/src/analyzer/protocol/http/HTTP.h +++ b/src/analyzer/protocol/http/HTTP.h @@ -183,7 +183,7 @@ public: virtual void ConnectionReset(); virtual void PacketWithRST(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new HTTP_Analyzer(conn); } static bool Available() diff --git a/src/analyzer/protocol/http/Plugin.cc b/src/analyzer/protocol/http/Plugin.cc index 1a2a05cbed..f88866f66f 100644 --- a/src/analyzer/protocol/http/Plugin.cc +++ b/src/analyzer/protocol/http/Plugin.cc @@ -1,11 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "HTTP.h" -BRO_PLUGIN_BEGIN(Bro, HTTP) - BRO_PLUGIN_DESCRIPTION("HTTP analyzer"); - BRO_PLUGIN_ANALYZER("HTTP", http::HTTP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_HTTP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("HTTP", ::analyzer::http::HTTP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::HTTP"; + config.description = "HTTP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/icmp/ICMP.h b/src/analyzer/protocol/icmp/ICMP.h index e371f53889..1a656efd3b 100644 --- a/src/analyzer/protocol/icmp/ICMP.h +++ b/src/analyzer/protocol/icmp/ICMP.h @@ -21,7 +21,7 @@ public: virtual void UpdateConnVal(RecordVal *conn_val); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new ICMP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/icmp/Plugin.cc b/src/analyzer/protocol/icmp/Plugin.cc index f313842c2a..f216bcbbe9 100644 --- a/src/analyzer/protocol/icmp/Plugin.cc +++ b/src/analyzer/protocol/icmp/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "ICMP.h" -BRO_PLUGIN_BEGIN(Bro, ICMP) - BRO_PLUGIN_DESCRIPTION("ICMP analyzer"); - BRO_PLUGIN_ANALYZER("ICMP", icmp::ICMP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_ICMP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("ICMP", ::analyzer::icmp::ICMP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::ICMP"; + config.description = "ICMP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ident/Ident.h b/src/analyzer/protocol/ident/Ident.h index 31df1dcdc6..07fe8c116f 100644 --- a/src/analyzer/protocol/ident/Ident.h +++ b/src/analyzer/protocol/ident/Ident.h @@ -15,7 +15,7 @@ public: virtual void DeliverStream(int length, const u_char* data, bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Ident_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/ident/Plugin.cc b/src/analyzer/protocol/ident/Plugin.cc index c053689b8f..e495210f08 100644 --- a/src/analyzer/protocol/ident/Plugin.cc +++ b/src/analyzer/protocol/ident/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Ident.h" -BRO_PLUGIN_BEGIN(Bro, Ident) - BRO_PLUGIN_DESCRIPTION("Ident analyzer"); - BRO_PLUGIN_ANALYZER("Ident", ident::Ident_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Ident { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Ident", ::analyzer::ident::Ident_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Ident"; + config.description = "Ident analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/interconn/InterConn.h b/src/analyzer/protocol/interconn/InterConn.h index b13abecab1..372e215cd9 100644 --- a/src/analyzer/protocol/interconn/InterConn.h +++ b/src/analyzer/protocol/interconn/InterConn.h @@ -49,7 +49,7 @@ public: virtual void Done(); void StatTimer(double t, int is_expire); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new InterConn_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/interconn/Plugin.cc b/src/analyzer/protocol/interconn/Plugin.cc index c135d0fb07..a4ee39ca07 100644 --- a/src/analyzer/protocol/interconn/Plugin.cc +++ b/src/analyzer/protocol/interconn/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "InterConn.h" -BRO_PLUGIN_BEGIN(Bro, InterConn) - BRO_PLUGIN_DESCRIPTION("InterConn analyzer (deprecated)"); - BRO_PLUGIN_ANALYZER("InterConn", interconn::InterConn_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_InterConn { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("InterConn", ::analyzer::interconn::InterConn_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::InterConn"; + config.description = "InterConn analyzer deprecated"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/irc/IRC.h b/src/analyzer/protocol/irc/IRC.h index a4112ccb12..bce9cdf054 100644 --- a/src/analyzer/protocol/irc/IRC.h +++ b/src/analyzer/protocol/irc/IRC.h @@ -32,7 +32,7 @@ public: */ virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new IRC_Analyzer(conn); } diff --git a/src/analyzer/protocol/irc/Plugin.cc b/src/analyzer/protocol/irc/Plugin.cc index fc7de1bd6d..54769ba0b0 100644 --- a/src/analyzer/protocol/irc/Plugin.cc +++ b/src/analyzer/protocol/irc/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "IRC.h" -BRO_PLUGIN_BEGIN(Bro, IRC) - BRO_PLUGIN_DESCRIPTION("IRC analyzer"); - BRO_PLUGIN_ANALYZER("IRC", irc::IRC_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_IRC { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("IRC", ::analyzer::irc::IRC_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::IRC"; + config.description = "IRC analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/login/Plugin.cc b/src/analyzer/protocol/login/Plugin.cc index 6b8d1a8fed..3e4a83ceae 100644 --- a/src/analyzer/protocol/login/Plugin.cc +++ b/src/analyzer/protocol/login/Plugin.cc @@ -1,3 +1,5 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" @@ -6,15 +8,27 @@ #include "RSH.h" #include "Rlogin.h" -BRO_PLUGIN_BEGIN(Bro, Login) - BRO_PLUGIN_DESCRIPTION("Telnet/Rsh/Rlogin analyzers"); - BRO_PLUGIN_ANALYZER("Telnet", login::Telnet_Analyzer); - BRO_PLUGIN_ANALYZER("Rsh", login::Rsh_Analyzer); - BRO_PLUGIN_ANALYZER("Rlogin", login::Rlogin_Analyzer); - BRO_PLUGIN_ANALYZER_BARE("NVT"); - BRO_PLUGIN_ANALYZER_BARE("Login"); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_Rsh"); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_Rlogin"); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Login { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Telnet", ::analyzer::login::Telnet_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Rsh", ::analyzer::login::Rsh_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Rlogin", ::analyzer::login::Rlogin_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("NVT", 0)); + AddComponent(new ::analyzer::Component("Login", 0)); + AddComponent(new ::analyzer::Component("Contents_Rsh", 0)); + AddComponent(new ::analyzer::Component("Contents_Rlogin", 0)); + + plugin::Configuration config; + config.name = "Bro::Login"; + config.description = "Telnet/Rsh/Rlogin analyzers"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/login/RSH.h b/src/analyzer/protocol/login/RSH.h index 2036ea966a..3f6e9851f1 100644 --- a/src/analyzer/protocol/login/RSH.h +++ b/src/analyzer/protocol/login/RSH.h @@ -49,7 +49,7 @@ public: void ClientUserName(const char* s); void ServerUserName(const char* s); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Rsh_Analyzer(conn); } Contents_Rsh_Analyzer* contents_orig; diff --git a/src/analyzer/protocol/login/Rlogin.h b/src/analyzer/protocol/login/Rlogin.h index 79de3b8952..0e8a7eb93b 100644 --- a/src/analyzer/protocol/login/Rlogin.h +++ b/src/analyzer/protocol/login/Rlogin.h @@ -62,7 +62,7 @@ public: void ServerUserName(const char* s); void TerminalType(const char* s); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Rlogin_Analyzer(conn); } }; diff --git a/src/analyzer/protocol/login/Telnet.h b/src/analyzer/protocol/login/Telnet.h index 332281013c..936d7a8427 100644 --- a/src/analyzer/protocol/login/Telnet.h +++ b/src/analyzer/protocol/login/Telnet.h @@ -12,7 +12,7 @@ public: Telnet_Analyzer(Connection* conn); virtual ~Telnet_Analyzer() {} - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Telnet_Analyzer(conn); } }; diff --git a/src/analyzer/protocol/mime/Plugin.cc b/src/analyzer/protocol/mime/Plugin.cc index d519a8f84e..f7a1c22f3e 100644 --- a/src/analyzer/protocol/mime/Plugin.cc +++ b/src/analyzer/protocol/mime/Plugin.cc @@ -1,7 +1,21 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(Bro, MIME) - BRO_PLUGIN_DESCRIPTION("MIME parsing code"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_MIME { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + plugin::Configuration config; + config.name = "Bro::MIME"; + config.description = "MIME parsing"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/modbus/Modbus.h b/src/analyzer/protocol/modbus/Modbus.h index 6f566be828..f4c148b407 100644 --- a/src/analyzer/protocol/modbus/Modbus.h +++ b/src/analyzer/protocol/modbus/Modbus.h @@ -17,7 +17,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); virtual void EndpointEOF(bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new ModbusTCP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/modbus/Plugin.cc b/src/analyzer/protocol/modbus/Plugin.cc index c84992cbae..8a01878113 100644 --- a/src/analyzer/protocol/modbus/Plugin.cc +++ b/src/analyzer/protocol/modbus/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Modbus.h" -BRO_PLUGIN_BEGIN(Bro, Modbus) - BRO_PLUGIN_DESCRIPTION("Modbus analyzer"); - BRO_PLUGIN_ANALYZER("MODBUS", modbus::ModbusTCP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Modbus { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("MODBUS", ::analyzer::modbus::ModbusTCP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Modbus"; + config.description = "Modbus analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ncp/NCP.h b/src/analyzer/protocol/ncp/NCP.h index 34174df74e..52ff233683 100644 --- a/src/analyzer/protocol/ncp/NCP.h +++ b/src/analyzer/protocol/ncp/NCP.h @@ -104,7 +104,7 @@ public: NCP_Analyzer(Connection* conn); virtual ~NCP_Analyzer(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new NCP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/ncp/Plugin.cc b/src/analyzer/protocol/ncp/Plugin.cc index 85cd318fe0..fe1de9a250 100644 --- a/src/analyzer/protocol/ncp/Plugin.cc +++ b/src/analyzer/protocol/ncp/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "NCP.h" -BRO_PLUGIN_BEGIN(Bro, NCP) - BRO_PLUGIN_DESCRIPTION("NCP analyzer"); - BRO_PLUGIN_ANALYZER("NCP", ncp::NCP_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_NCP"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_NCP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("NCP", ::analyzer::ncp::NCP_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_NCP", 0)); + + plugin::Configuration config; + config.name = "Bro::NCP"; + config.description = "NCP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/netbios/NetbiosSSN.h b/src/analyzer/protocol/netbios/NetbiosSSN.h index 7c2728ef9a..27f805f79b 100644 --- a/src/analyzer/protocol/netbios/NetbiosSSN.h +++ b/src/analyzer/protocol/netbios/NetbiosSSN.h @@ -148,7 +148,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new NetbiosSSN_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/netbios/Plugin.cc b/src/analyzer/protocol/netbios/Plugin.cc index 15daeb1ab5..0ec730889d 100644 --- a/src/analyzer/protocol/netbios/Plugin.cc +++ b/src/analyzer/protocol/netbios/Plugin.cc @@ -1,12 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "NetbiosSSN.h" -BRO_PLUGIN_BEGIN(Bro, NetBIOS) - BRO_PLUGIN_DESCRIPTION("NetBIOS analyzer (support only SSN currently)"); - BRO_PLUGIN_ANALYZER("NetbiosSSN", netbios_ssn::NetbiosSSN_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_NetbiosSSN"); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_NetBIOS { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("NetbiosSSN", ::analyzer::netbios_ssn::NetbiosSSN_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_NetbiosSSN", 0)); + + plugin::Configuration config; + config.name = "Bro::NetBIOS"; + config.description = "NetBIOS analyzer support"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/netflow/Plugin.cc b/src/analyzer/protocol/netflow/Plugin.cc index b994caa5d8..26107d0003 100644 --- a/src/analyzer/protocol/netflow/Plugin.cc +++ b/src/analyzer/protocol/netflow/Plugin.cc @@ -1,7 +1,21 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" -BRO_PLUGIN_BEGIN(Bro, NetFlow) - BRO_PLUGIN_DESCRIPTION("NetFlow parsing code"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_NetFlow { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + plugin::Configuration config; + config.name = "Bro::NetFlow"; + config.description = "NetFlow parsing"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ntp/NTP.h b/src/analyzer/protocol/ntp/NTP.h index 201c5a8774..2d1078669a 100644 --- a/src/analyzer/protocol/ntp/NTP.h +++ b/src/analyzer/protocol/ntp/NTP.h @@ -40,7 +40,7 @@ class NTP_Analyzer : public analyzer::Analyzer { public: NTP_Analyzer(Connection* conn); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new NTP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/ntp/Plugin.cc b/src/analyzer/protocol/ntp/Plugin.cc index ce4ce5680f..3399fbb867 100644 --- a/src/analyzer/protocol/ntp/Plugin.cc +++ b/src/analyzer/protocol/ntp/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "NTP.h" -BRO_PLUGIN_BEGIN(Bro, NTP) - BRO_PLUGIN_DESCRIPTION("NTP analyzer"); - BRO_PLUGIN_ANALYZER("NTP", ntp::NTP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_NTP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("NTP", ::analyzer::ntp::NTP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::NTP"; + config.description = "NTP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/pia/PIA.h b/src/analyzer/protocol/pia/PIA.h index d8c272d219..50b1a71d88 100644 --- a/src/analyzer/protocol/pia/PIA.h +++ b/src/analyzer/protocol/pia/PIA.h @@ -94,7 +94,7 @@ public: { SetConn(conn); } virtual ~PIA_UDP() { } - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new PIA_UDP(conn); } protected: @@ -139,7 +139,7 @@ public: void ReplayStreamBuffer(analyzer::Analyzer* analyzer); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new PIA_TCP(conn); } protected: diff --git a/src/analyzer/protocol/pia/Plugin.cc b/src/analyzer/protocol/pia/Plugin.cc index 7d52801475..983617be66 100644 --- a/src/analyzer/protocol/pia/Plugin.cc +++ b/src/analyzer/protocol/pia/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "PIA.h" -BRO_PLUGIN_BEGIN(Bro, PIA) - BRO_PLUGIN_DESCRIPTION("Analyzers implementing Dynamic Protocol Detection"); - BRO_PLUGIN_ANALYZER("PIA_TCP", pia::PIA_TCP); - BRO_PLUGIN_ANALYZER("PIA_UDP", pia::PIA_UDP); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_PIA { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("PIA_TCP", ::analyzer::pia::PIA_TCP::Instantiate)); + AddComponent(new ::analyzer::Component("PIA_UDP", ::analyzer::pia::PIA_UDP::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::PIA"; + config.description = "Analyzers implementing Dynamic Protocol"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/pop3/POP3.h b/src/analyzer/protocol/pop3/POP3.h index ab535420e5..dd9217bc81 100644 --- a/src/analyzer/protocol/pop3/POP3.h +++ b/src/analyzer/protocol/pop3/POP3.h @@ -69,7 +69,7 @@ public: virtual void Done(); virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new POP3_Analyzer(conn); } diff --git a/src/analyzer/protocol/pop3/Plugin.cc b/src/analyzer/protocol/pop3/Plugin.cc index edd99e2617..f6a97b824e 100644 --- a/src/analyzer/protocol/pop3/Plugin.cc +++ b/src/analyzer/protocol/pop3/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "POP3.h" -BRO_PLUGIN_BEGIN(Bro, POP3) - BRO_PLUGIN_DESCRIPTION("POP3 analyzer"); - BRO_PLUGIN_ANALYZER("POP3", pop3::POP3_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_POP3 { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("POP3", ::analyzer::pop3::POP3_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::POP3"; + config.description = "POP3 analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/rpc/NFS.h b/src/analyzer/protocol/rpc/NFS.h index 7656450d94..ba6cab38e2 100644 --- a/src/analyzer/protocol/rpc/NFS.h +++ b/src/analyzer/protocol/rpc/NFS.h @@ -77,7 +77,7 @@ public: NFS_Analyzer(Connection* conn); virtual void Init(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new NFS_Analyzer(conn); } }; diff --git a/src/analyzer/protocol/rpc/Plugin.cc b/src/analyzer/protocol/rpc/Plugin.cc index 9760df0623..15337f2d6e 100644 --- a/src/analyzer/protocol/rpc/Plugin.cc +++ b/src/analyzer/protocol/rpc/Plugin.cc @@ -1,3 +1,5 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" @@ -5,11 +7,24 @@ #include "NFS.h" #include "Portmap.h" -BRO_PLUGIN_BEGIN(Bro, RPC) - BRO_PLUGIN_DESCRIPTION("Analyzers for RPC-based protocols"); - BRO_PLUGIN_ANALYZER("NFS", rpc::NFS_Analyzer); - BRO_PLUGIN_ANALYZER("Portmapper", rpc::Portmapper_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_RPC"); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_NFS"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_RPC { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("NFS", ::analyzer::rpc::NFS_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Portmapper", ::analyzer::rpc::Portmapper_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_RPC", 0)); + AddComponent(new ::analyzer::Component("Contents_NFS", 0)); + + plugin::Configuration config; + config.name = "Bro::RPC"; + config.description = "Analyzers for RPC-based protocols"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/rpc/Portmap.h b/src/analyzer/protocol/rpc/Portmap.h index 52d0c21a04..3704bd8383 100644 --- a/src/analyzer/protocol/rpc/Portmap.h +++ b/src/analyzer/protocol/rpc/Portmap.h @@ -31,7 +31,7 @@ public: virtual ~Portmapper_Analyzer(); virtual void Init(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Portmapper_Analyzer(conn); } }; diff --git a/src/analyzer/protocol/smb/Plugin.cc b/src/analyzer/protocol/smb/Plugin.cc index af564c067c..c963c7ff69 100644 --- a/src/analyzer/protocol/smb/Plugin.cc +++ b/src/analyzer/protocol/smb/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SMB.h" -BRO_PLUGIN_BEGIN(Bro, SMB) - BRO_PLUGIN_DESCRIPTION("SMB analyzer"); - BRO_PLUGIN_ANALYZER("SMB", smb::SMB_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents_SMB"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SMB { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SMB", ::analyzer::smb::SMB_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("Contents_SMB", 0)); + + plugin::Configuration config; + config.name = "Bro::SMB"; + config.description = "SMB analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/smb/SMB.h b/src/analyzer/protocol/smb/SMB.h index b54852e5b7..6518315400 100644 --- a/src/analyzer/protocol/smb/SMB.h +++ b/src/analyzer/protocol/smb/SMB.h @@ -188,7 +188,7 @@ public: SMB_Analyzer(Connection* conn); ~SMB_Analyzer(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SMB_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/smtp/Plugin.cc b/src/analyzer/protocol/smtp/Plugin.cc index e089d7ffb1..ae0ef0e71a 100644 --- a/src/analyzer/protocol/smtp/Plugin.cc +++ b/src/analyzer/protocol/smtp/Plugin.cc @@ -1,11 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SMTP.h" -BRO_PLUGIN_BEGIN(Bro, SMTP) - BRO_PLUGIN_DESCRIPTION("SMTP analyzer"); - BRO_PLUGIN_ANALYZER("SMTP", smtp::SMTP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SMTP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SMTP", ::analyzer::smtp::SMTP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::SMTP"; + config.description = "SMTP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/smtp/SMTP.h b/src/analyzer/protocol/smtp/SMTP.h index cc12167d30..e02f5f2d45 100644 --- a/src/analyzer/protocol/smtp/SMTP.h +++ b/src/analyzer/protocol/smtp/SMTP.h @@ -48,7 +48,7 @@ public: void SkipData() { skip_data = 1; } // skip delivery of data lines - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SMTP_Analyzer(conn); } diff --git a/src/analyzer/protocol/socks/Plugin.cc b/src/analyzer/protocol/socks/Plugin.cc index d01f4520b7..661e39efbc 100644 --- a/src/analyzer/protocol/socks/Plugin.cc +++ b/src/analyzer/protocol/socks/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SOCKS.h" -BRO_PLUGIN_BEGIN(Bro, SOCKS) - BRO_PLUGIN_DESCRIPTION("SOCKS analyzer"); - BRO_PLUGIN_ANALYZER("SOCKS", socks::SOCKS_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SOCKS { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SOCKS", ::analyzer::socks::SOCKS_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::SOCKS"; + config.description = "SOCKS analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/socks/SOCKS.h b/src/analyzer/protocol/socks/SOCKS.h index f005967fd8..404dd84666 100644 --- a/src/analyzer/protocol/socks/SOCKS.h +++ b/src/analyzer/protocol/socks/SOCKS.h @@ -26,7 +26,7 @@ public: virtual void Undelivered(int seq, int len, bool orig); virtual void EndpointEOF(bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SOCKS_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/ssh/Plugin.cc b/src/analyzer/protocol/ssh/Plugin.cc index 53a0294a88..98b4e25522 100644 --- a/src/analyzer/protocol/ssh/Plugin.cc +++ b/src/analyzer/protocol/ssh/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SSH.h" -BRO_PLUGIN_BEGIN(Bro, SSH) - BRO_PLUGIN_DESCRIPTION("SSH analyzer"); - BRO_PLUGIN_ANALYZER("SSH", ssh::SSH_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SSH { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SSH", ::analyzer::ssh::SSH_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::SSH"; + config.description = "SSH analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ssh/SSH.h b/src/analyzer/protocol/ssh/SSH.h index 3878881693..d1f8c36150 100644 --- a/src/analyzer/protocol/ssh/SSH.h +++ b/src/analyzer/protocol/ssh/SSH.h @@ -14,7 +14,7 @@ public: virtual void DeliverStream(int len, const u_char* data, bool orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SSH_Analyzer(conn); } private: diff --git a/src/analyzer/protocol/ssl/Plugin.cc b/src/analyzer/protocol/ssl/Plugin.cc index c63be864f8..34557baf26 100644 --- a/src/analyzer/protocol/ssl/Plugin.cc +++ b/src/analyzer/protocol/ssl/Plugin.cc @@ -1,11 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SSL.h" -BRO_PLUGIN_BEGIN(Bro, SSL) - BRO_PLUGIN_DESCRIPTION("SSL analyzer"); - BRO_PLUGIN_ANALYZER("SSL", ssl::SSL_Analyzer); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SSL { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SSL", ::analyzer::ssl::SSL_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::SSL"; + config.description = "SSL analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/ssl/SSL.h b/src/analyzer/protocol/ssl/SSL.h index 6423d1b155..9feaa349ce 100644 --- a/src/analyzer/protocol/ssl/SSL.h +++ b/src/analyzer/protocol/ssl/SSL.h @@ -21,7 +21,7 @@ public: // Overriden from tcp::TCP_ApplicationAnalyzer. virtual void EndpointEOF(bool is_orig); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SSL_Analyzer(conn); } static bool Available() diff --git a/src/analyzer/protocol/stepping-stone/Plugin.cc b/src/analyzer/protocol/stepping-stone/Plugin.cc index 129b95fb25..f3566eb551 100644 --- a/src/analyzer/protocol/stepping-stone/Plugin.cc +++ b/src/analyzer/protocol/stepping-stone/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "SteppingStone.h" -BRO_PLUGIN_BEGIN(Bro, SteppingStone) - BRO_PLUGIN_DESCRIPTION("Stepping stone analyzer (deprecated)"); - BRO_PLUGIN_ANALYZER("SteppingStone", stepping_stone::SteppingStone_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_SteppingStone { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("SteppingStone", ::analyzer::stepping_stone::SteppingStone_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::SteppingStone"; + config.description = "Stepping stone analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/stepping-stone/SteppingStone.h b/src/analyzer/protocol/stepping-stone/SteppingStone.h index 1471c08a3b..d55feafba3 100644 --- a/src/analyzer/protocol/stepping-stone/SteppingStone.h +++ b/src/analyzer/protocol/stepping-stone/SteppingStone.h @@ -53,7 +53,7 @@ public: virtual void Init(); virtual void Done(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new SteppingStone_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/syslog/Plugin.cc b/src/analyzer/protocol/syslog/Plugin.cc index 67abaaf970..c2478bdeb0 100644 --- a/src/analyzer/protocol/syslog/Plugin.cc +++ b/src/analyzer/protocol/syslog/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Syslog.h" -BRO_PLUGIN_BEGIN(Bro, Syslog) - BRO_PLUGIN_DESCRIPTION("Syslog analyzer (UDP-only currently)"); - BRO_PLUGIN_ANALYZER("Syslog", syslog::Syslog_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Syslog { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Syslog", ::analyzer::syslog::Syslog_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Syslog"; + config.description = "Syslog analyzer UDP-only"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/syslog/Syslog.h b/src/analyzer/protocol/syslog/Syslog.h index 355863e36e..d8daafc83b 100644 --- a/src/analyzer/protocol/syslog/Syslog.h +++ b/src/analyzer/protocol/syslog/Syslog.h @@ -18,7 +18,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Syslog_Analyzer(conn); } protected: @@ -41,7 +41,7 @@ protected: // virtual void Undelivered(int seq, int len, bool orig); // virtual void EndpointEOF(tcp::TCP_Reassembler* endp); // -// static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) +// static analyzer::Analyzer* Instantiate(Connection* conn) // { return new Syslog_tcp::TCP_Analyzer(conn); } // //protected: diff --git a/src/analyzer/protocol/tcp/Plugin.cc b/src/analyzer/protocol/tcp/Plugin.cc index 6132b6f386..4c53422cf6 100644 --- a/src/analyzer/protocol/tcp/Plugin.cc +++ b/src/analyzer/protocol/tcp/Plugin.cc @@ -1,14 +1,28 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "TCP.h" -BRO_PLUGIN_BEGIN(Bro, TCP) - BRO_PLUGIN_DESCRIPTION("TCP analyzer"); - BRO_PLUGIN_ANALYZER("TCP", tcp::TCP_Analyzer); - BRO_PLUGIN_ANALYZER("TCPStats", tcp::TCPStats_Analyzer); - BRO_PLUGIN_SUPPORT_ANALYZER("ContentLine"); - BRO_PLUGIN_SUPPORT_ANALYZER("Contents"); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_TCP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("TCP", ::analyzer::tcp::TCP_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("TCPStats", ::analyzer::tcp::TCPStats_Analyzer::Instantiate)); + AddComponent(new ::analyzer::Component("ContentsLine", 0)); + AddComponent(new ::analyzer::Component("Contents", 0)); + + plugin::Configuration config; + config.name = "Bro::TCP"; + config.description = "TCP analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/tcp/TCP.h b/src/analyzer/protocol/tcp/TCP.h index e01ed3a255..410d14c724 100644 --- a/src/analyzer/protocol/tcp/TCP.h +++ b/src/analyzer/protocol/tcp/TCP.h @@ -91,7 +91,7 @@ public: proc_tcp_option_t proc, TCP_Analyzer* analyzer, bool is_orig, void* cookie); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new TCP_Analyzer(conn); } protected: @@ -367,7 +367,7 @@ public: virtual void Init(); virtual void Done(); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new TCPStats_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/teredo/Plugin.cc b/src/analyzer/protocol/teredo/Plugin.cc index 91de23b318..226d84a4a2 100644 --- a/src/analyzer/protocol/teredo/Plugin.cc +++ b/src/analyzer/protocol/teredo/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Teredo.h" -BRO_PLUGIN_BEGIN(Bro, Teredo) - BRO_PLUGIN_DESCRIPTION("Teredo analyzer"); - BRO_PLUGIN_ANALYZER("Teredo", teredo::Teredo_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Teredo { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("Teredo", ::analyzer::teredo::Teredo_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Teredo"; + config.description = "Teredo analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/teredo/Teredo.h b/src/analyzer/protocol/teredo/Teredo.h index 0da007187d..7984de5342 100644 --- a/src/analyzer/protocol/teredo/Teredo.h +++ b/src/analyzer/protocol/teredo/Teredo.h @@ -21,7 +21,7 @@ public: virtual void DeliverPacket(int len, const u_char* data, bool orig, int seq, const IP_Hdr* ip, int caplen); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new Teredo_Analyzer(conn); } /** diff --git a/src/analyzer/protocol/udp/Plugin.cc b/src/analyzer/protocol/udp/Plugin.cc index 0dbf0f80ca..2569d95a86 100644 --- a/src/analyzer/protocol/udp/Plugin.cc +++ b/src/analyzer/protocol/udp/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "analyzer/protocol/udp/UDP.h" -BRO_PLUGIN_BEGIN(Bro, UDP) - BRO_PLUGIN_DESCRIPTION("UDP Analyzer"); - BRO_PLUGIN_ANALYZER("UDP", udp::UDP_Analyzer); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_UDP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("UDP", ::analyzer::udp::UDP_Analyzer::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::UDP"; + config.description = "UDP Analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/analyzer/protocol/udp/UDP.h b/src/analyzer/protocol/udp/UDP.h index bcfee401b0..7c1ac56587 100644 --- a/src/analyzer/protocol/udp/UDP.h +++ b/src/analyzer/protocol/udp/UDP.h @@ -22,7 +22,7 @@ public: virtual void UpdateConnVal(RecordVal *conn_val); - static analyzer::Analyzer* InstantiateAnalyzer(Connection* conn) + static analyzer::Analyzer* Instantiate(Connection* conn) { return new UDP_Analyzer(conn); } protected: diff --git a/src/analyzer/protocol/zip/Plugin.cc b/src/analyzer/protocol/zip/Plugin.cc index b55accccb3..7a0bff39ad 100644 --- a/src/analyzer/protocol/zip/Plugin.cc +++ b/src/analyzer/protocol/zip/Plugin.cc @@ -1,10 +1,25 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "ZIP.h" -BRO_PLUGIN_BEGIN(Bro, ZIP) - BRO_PLUGIN_DESCRIPTION("Generic ZIP support analyzer"); - BRO_PLUGIN_ANALYZER_BARE("ZIP"); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_ZIP { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::analyzer::Component("ZIP", 0)); + + plugin::Configuration config; + config.name = "Bro::ZIP"; + config.description = "Generic ZIP support analyzer"; + return config; + } +} plugin; + +} +} diff --git a/src/file_analysis/analyzer/data_event/Plugin.cc b/src/file_analysis/analyzer/data_event/Plugin.cc index c2812a9af9..f0036f420b 100644 --- a/src/file_analysis/analyzer/data_event/Plugin.cc +++ b/src/file_analysis/analyzer/data_event/Plugin.cc @@ -1,8 +1,24 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "DataEvent.h" -BRO_PLUGIN_BEGIN(Bro, FileDataEvent) - BRO_PLUGIN_DESCRIPTION("Delivers file content via events"); - BRO_PLUGIN_FILE_ANALYZER("DATA_EVENT", DataEvent); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_FileDataEvent { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::file_analysis::Component("DATA_EVENT", ::file_analysis::DataEvent::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::FileDataEvent"; + config.description = "Delivers file content"; + return config; + } +} plugin; + +} +} diff --git a/src/file_analysis/analyzer/extract/Plugin.cc b/src/file_analysis/analyzer/extract/Plugin.cc index 599301188e..f4e234ef11 100644 --- a/src/file_analysis/analyzer/extract/Plugin.cc +++ b/src/file_analysis/analyzer/extract/Plugin.cc @@ -1,10 +1,24 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Extract.h" -BRO_PLUGIN_BEGIN(Bro, FileExtract) - BRO_PLUGIN_DESCRIPTION("Extract file content to local file system"); - BRO_PLUGIN_FILE_ANALYZER("EXTRACT", Extract); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(functions); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_FileExtract { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::file_analysis::Component("EXTRACT", ::file_analysis::Extract::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::FileExtract"; + config.description = "Extract file content"; + return config; + } +} plugin; + +} +} diff --git a/src/file_analysis/analyzer/hash/Plugin.cc b/src/file_analysis/analyzer/hash/Plugin.cc index 29453c0bfb..8bb0f0fab3 100644 --- a/src/file_analysis/analyzer/hash/Plugin.cc +++ b/src/file_analysis/analyzer/hash/Plugin.cc @@ -1,11 +1,26 @@ +// See the file in the main distribution directory for copyright. + #include "plugin/Plugin.h" #include "Hash.h" -BRO_PLUGIN_BEGIN(Bro, FileHash) - BRO_PLUGIN_DESCRIPTION("Hash file content"); - BRO_PLUGIN_FILE_ANALYZER("MD5", MD5); - BRO_PLUGIN_FILE_ANALYZER("SHA1", SHA1); - BRO_PLUGIN_FILE_ANALYZER("SHA256", SHA256); - BRO_PLUGIN_BIF_FILE(events); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_FileHash { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::file_analysis::Component("MD5", ::file_analysis::MD5::Instantiate)); + AddComponent(new ::file_analysis::Component("SHA1", ::file_analysis::SHA1::Instantiate)); + AddComponent(new ::file_analysis::Component("SHA256", ::file_analysis::SHA256::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::FileHash"; + config.description = "Hash file content"; + return config; + } +} plugin; + +} +} diff --git a/src/file_analysis/analyzer/unified2/Plugin.cc b/src/file_analysis/analyzer/unified2/Plugin.cc index e94168eae1..a0f885b7cb 100644 --- a/src/file_analysis/analyzer/unified2/Plugin.cc +++ b/src/file_analysis/analyzer/unified2/Plugin.cc @@ -1,12 +1,26 @@ +// See the file in the main distribution directory for copyright. + // See the file "COPYING" in the main distribution directory for copyright. #include "plugin/Plugin.h" #include "Unified2.h" -BRO_PLUGIN_BEGIN(Bro, Unified2) - BRO_PLUGIN_DESCRIPTION("Analyze Unified2 alert files."); - BRO_PLUGIN_FILE_ANALYZER("UNIFIED2", Unified2); - BRO_PLUGIN_BIF_FILE(events); - BRO_PLUGIN_BIF_FILE(types); -BRO_PLUGIN_END +namespace plugin { +namespace Bro_Unified2 { + +class Plugin : public plugin::Plugin { +public: + plugin::Configuration Configure() + { + AddComponent(new ::file_analysis::Component("UNIFIED2", ::file_analysis::Unified2::Instantiate)); + + plugin::Configuration config; + config.name = "Bro::Unified2"; + config.description = "Analyze Unified2 alert files."; + return config; + } +} plugin; + +} +} diff --git a/src/plugin/Plugin.cc b/src/plugin/Plugin.cc index 6bbcd57740..90418f9498 100644 --- a/src/plugin/Plugin.cc +++ b/src/plugin/Plugin.cc @@ -1,3 +1,5 @@ +// See the file in the main distribution directory for copyright. + // See the file "COPYING" in the main distribution directory for copyright. #include