00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _C_PROTOCOLCONTROL_H
00021 #define _C_PROTOCOLCONTROL_H
00022
00023 #include "string_t.hpp"
00024 #include "map_t.hpp"
00025
00026 #include "C_IdGenerator.hpp"
00027 #include "C_XmlData.hpp"
00028 #include "C_ProtocolFrame.hpp"
00029
00030 #include "C_TransportControl.hpp"
00031
00032 #include "C_GeneratorConfig.hpp"
00033 #include "C_ProtocolStats.hpp"
00034
00035
00036 #define ERROR_PROTOCOL_UNKNOWN -1
00037 typedef map_t<string_t, int> T_ProtocolNameMap, *T_pProtocolNameMap ;
00038
00039 typedef struct _protocol_instance_info {
00040 C_ProtocolFrame *m_instance ;
00041 int m_id ;
00042 char *m_name ;
00043 } T_ProtocolInstanceInfo, *T_pProtocolInstanceInfo ;
00044 typedef list_t<T_pProtocolInstanceInfo> T_ProtocolInstList ;
00045
00046 class C_ProtocolControl {
00047
00048 public:
00049 C_ProtocolControl(C_TransportControl *P_transport_control) ;
00050 ~C_ProtocolControl() ;
00051
00052 bool fromXml (C_XmlData *P_data,
00053 T_pConfigValueList P_config_value_list,
00054 bool P_display_protocol_stats) ;
00055
00056
00057 C_ProtocolFrame* get_protocol (char *P_name);
00058 C_ProtocolFrame* get_protocol (int P_id);
00059 char* get_protocol_name (int P_id);
00060 int get_protocol_id (char *P_name);
00061
00062 int get_nb_protocol ();
00063
00064
00065
00066 protected:
00067 private:
00068
00069 T_pProtocolNameMap m_name_map ;
00070 T_pC_ProtocolFrame *m_protocol_table ;
00071 char **m_protocol_name_table ;
00072 int m_protocol_table_size ;
00073 T_pC_IdGenerator m_id_gen ;
00074
00075 C_TransportControl *m_transport_control ;
00076
00077
00078 char* get_protocol_name(C_XmlData *);
00079 char* get_protocol_type(C_XmlData *);
00080
00081
00082 } ;
00083
00084 #endif
00085
00086
00087
00088
00089
00090
00091