Branch data Line data Source code
1 : : // $Id: Portmap.h 6219 2008-10-01 05:39:07Z vern $
2 : : //
3 : : // See the file "COPYING" in the main distribution directory for copyright.
4 : :
5 : : #ifndef portmap_h
6 : : #define portmap_h
7 : :
8 : : #include "RPC.h"
9 : :
10 [ # # ][ # # ]: 0 : class PortmapperInterp : public RPC_Interpreter {
11 : : public:
12 : 0 : PortmapperInterp(Analyzer* arg_analyzer) : RPC_Interpreter(arg_analyzer) { }
13 : :
14 : : protected:
15 : : int RPC_BuildCall(RPC_CallInfo* c, const u_char*& buf, int& n);
16 : : int RPC_BuildReply(const RPC_CallInfo* c, int success,
17 : : const u_char*& buf, int& n,
18 : : EventHandlerPtr& event, Val*& reply);
19 : : uint32 CheckPort(uint32 port);
20 : :
21 : : void Event(EventHandlerPtr f, Val* request, int status, Val* reply);
22 : :
23 : : Val* ExtractMapping(const u_char*& buf, int& len);
24 : : Val* ExtractPortRequest(const u_char*& buf, int& len);
25 : : Val* ExtractCallItRequest(const u_char*& buf, int& len);
26 : : };
27 : :
28 : : class Portmapper_Analyzer : public RPC_Analyzer {
29 : : public:
30 : : Portmapper_Analyzer(Connection* conn);
31 : : virtual ~Portmapper_Analyzer();
32 : : virtual void Init();
33 : :
34 : 0 : static Analyzer* InstantiateAnalyzer(Connection* conn)
35 : 0 : { return new Portmapper_Analyzer(conn); }
36 : :
37 : 1 : static bool Available()
38 [ + - ][ - + ]: 1 : { return pm_request || rpc_call; }
39 : : };
40 : :
41 : : #endif
|