00001
00002
00003
00004
00005 #ifndef DSMCC_BIOP_H
00006 #define DSMCC_BIOP_H
00007
00008 #include <stdlib.h>
00009
00010 #include "dsmcccache.h"
00011
00012 #define BIOP_OBJ_OFFSET 11
00013 #define BIOP_TAG_OFFSET 17
00014
00015 class DSMCCCacheModuleData;
00016 class Dsmcc;
00017
00018 class BiopNameComp
00019 {
00020 public:
00021 BiopNameComp() :
00022 m_id_len(0), m_kind_len(0), m_id(NULL), m_kind(NULL) {}
00023
00024 ~BiopNameComp();
00025
00026 int Process(const unsigned char *);
00027
00028 unsigned char m_id_len;
00029 unsigned char m_kind_len;
00030 char *m_id;
00031 char *m_kind;
00032 };
00033
00034 class BiopName
00035 {
00036 public:
00037 BiopName();
00038 ~BiopName();
00039
00040 int Process(const unsigned char*);
00041
00042 unsigned char m_comp_count;
00043 BiopNameComp *m_comps;
00044 };
00045
00046 class BiopTap
00047 {
00048 public:
00049 BiopTap() :
00050 id(0), use(0),
00051 assoc_tag(0), selector_len(0),
00052 selector_data(NULL) { }
00053 ~BiopTap();
00054
00055 int Process(const unsigned char*);
00056
00057 unsigned short id;
00058 unsigned short use;
00059
00060 unsigned short assoc_tag;
00061 unsigned short selector_len;
00062 char *selector_data;
00063 };
00064
00065 class BiopConnbinder
00066 {
00067 public:
00068 BiopConnbinder() :
00069 component_tag(0), component_data_len(0), taps_count(0) { }
00070 int Process(const unsigned char*);
00071
00072 unsigned long component_tag;
00073 unsigned char component_data_len;
00074 unsigned char taps_count;
00075 BiopTap tap;
00076 };
00077
00078 class BiopObjLocation
00079 {
00080 public:
00081 BiopObjLocation() :
00082 component_tag(0), component_data_len(0),
00083 version_major(0), version_minor(0) { }
00084 ~BiopObjLocation() { }
00085
00086 int Process(const unsigned char*);
00087
00088 unsigned long component_tag;
00089 char component_data_len;
00090 char version_major;
00091 char version_minor;
00092 DSMCCCacheReference m_Reference;
00093 };
00094
00095 class ProfileBody
00096 {
00097 public:
00098 virtual ~ProfileBody() {}
00099 virtual DSMCCCacheReference *GetReference() = 0;
00100 virtual int Process(const unsigned char *) = 0;
00101 };
00102
00103 class ProfileBodyFull: public ProfileBody
00104 {
00105 public:
00106 ProfileBodyFull() :
00107 data_len(0), byte_order(0),
00108 lite_components_count(0) { }
00109 virtual ~ProfileBodyFull() { }
00110 virtual int Process(const unsigned char *);
00111 virtual DSMCCCacheReference *GetReference()
00112 { return &obj_loc.m_Reference; }
00113
00114 protected:
00115 unsigned long data_len;
00116 char byte_order;
00117 char lite_components_count;
00118 BiopObjLocation obj_loc;
00119
00120
00121 public:
00122 BiopConnbinder dsm_conn;
00123
00124 };
00125
00126 class ProfileBodyLite: public ProfileBody
00127 {
00128 public:
00129
00130 virtual int Process(const unsigned char *);
00131
00132
00133 virtual DSMCCCacheReference *GetReference() { return NULL; }
00134 };
00135
00136
00137 class BiopIor
00138 {
00139 public:
00140 BiopIor() :
00141 type_id_len(0), type_id(NULL),
00142 tagged_profiles_count(0), profile_id_tag(0),
00143 m_profile_body(NULL) { }
00144
00145 ~BiopIor()
00146 {
00147 free(type_id);
00148 delete m_profile_body;
00149 }
00150
00151 int Process(const unsigned char *);
00152 void AddTap(Dsmcc *pStatus);
00153
00154 unsigned long type_id_len;
00155 char *type_id;
00156 unsigned long tagged_profiles_count;
00157 unsigned long profile_id_tag;
00158 ProfileBody *m_profile_body;
00159
00160
00161 };
00162
00163 class BiopBinding
00164 {
00165 public:
00166 BiopBinding() : m_binding_type(0), m_objinfo_len(0), m_objinfo(0) {}
00167 ~BiopBinding();
00168
00169 int Process(const unsigned char *data);
00170
00171 BiopName m_name;
00172 char m_binding_type;
00173 BiopIor m_ior;
00174 unsigned int m_objinfo_len;
00175 char *m_objinfo;
00176 };
00177
00178 class ObjCarousel;
00179
00180 class BiopMessage
00181 {
00182 public:
00183 BiopMessage() :
00184 m_version_major(0), m_version_minor(0),
00185 m_message_size(0), m_objkind_len(0),
00186 m_objinfo_len(0), m_objinfo(NULL),
00187 m_objkind(NULL) {}
00188 ~BiopMessage();
00189
00190 bool Process(DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00191 unsigned char *data, unsigned long *curp);
00192
00193 protected:
00194
00195 bool ProcessDir(bool isSrg,
00196 DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00197 unsigned char *data, unsigned long *curp);
00198
00199 bool ProcessFile(DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00200 unsigned char *data, unsigned long *curp);
00201
00202 bool ProcessMsgHdr(unsigned char *data, unsigned long *curp);
00203
00204 protected:
00205 unsigned char m_version_major;
00206 unsigned char m_version_minor;
00207 unsigned int m_message_size;
00208 DSMCCCacheKey m_objkey;
00209 unsigned long m_objkind_len;
00210 unsigned int m_objinfo_len;
00211 char *m_objinfo;
00212
00213 public:
00214 char *m_objkind;
00215 };
00216
00217
00218 class ModuleDescriptorData
00219 {
00220 public:
00221 ModuleDescriptorData(): isCompressed(false), originalSize(0) { }
00222
00223 void Process(const unsigned char *data, int length);
00224
00225 bool isCompressed;
00226 unsigned long originalSize;
00227 };
00228
00229 class BiopModuleInfo
00230 {
00231 public:
00232 int Process(const unsigned char *Data);
00233
00234 unsigned long mod_timeout;
00235 unsigned long block_timeout;
00236 unsigned long min_blocktime;
00237 unsigned char taps_count;
00238 BiopTap tap;
00239
00240 ModuleDescriptorData descriptorData;
00241 };
00242
00243 class DsmccModuleInfo
00244 {
00245 public:
00246 unsigned short module_id;
00247 unsigned long module_size;
00248 unsigned char module_version;
00249 unsigned char module_info_len;
00250 unsigned char *data;
00251 unsigned int curp;
00252 BiopModuleInfo modinfo;
00253 };
00254
00255 #endif