SnortProtocolId snort_protocol_id;
};
-template <typename T>
-class InspectorData : public Inspector
-{
-public:
- InspectorData(T* t)
- { data = t; }
-
- ~InspectorData() override
- { delete data; }
-
- void show(SnortConfig*) override { }
- void eval(Packet*) override { }
-
- T* data;
-};
-
// at present there is no sequencing among like types except that appid
// is always first among controls.
// class stuff
//-------------------------------------------------------------------------
-typedef InspectorData<FTP_CLIENT_PROTO_CONF> FtpClient;
+class FtpClient : public Inspector
+{
+public:
+ FtpClient(FTP_CLIENT_PROTO_CONF* client) : ftp_client(client) { }
+
+ ~FtpClient() override
+ { delete ftp_client; }
+
+ void show(SnortConfig*) override;
+ void eval(Packet*) override { }
+
+ FTP_CLIENT_PROTO_CONF* ftp_client;
+};
-template<>
void FtpClient::show(SnortConfig*)
{
- if ( data )
- print_conf_client(data);
+ if ( ftp_client )
+ print_conf_client(ftp_client);
}
class FtpServer : public Inspector
assert(client);
p->flow->set_data(client);
}
- return client->data;
+ return client->ftp_client;
}
FTP_SERVER_PROTO_CONF* get_ftp_server(Packet* p)