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() { selector_data = NULL; }
00050 ~BiopTap();
00051
00052 int Process(const unsigned char*);
00053
00054 unsigned short id;
00055 unsigned short use;
00056
00057 unsigned short assoc_tag;
00058 unsigned short selector_len;
00059 char *selector_data;
00060 };
00061
00062 class BiopConnbinder
00063 {
00064 public:
00065 int Process(const unsigned char*);
00066
00067 unsigned long component_tag;
00068 unsigned char component_data_len;
00069 unsigned char taps_count;
00070 BiopTap tap;
00071 };
00072
00073 class BiopObjLocation
00074 {
00075 public:
00076 BiopObjLocation() { }
00077 ~BiopObjLocation() { }
00078
00079 int Process(const unsigned char*);
00080
00081 unsigned long component_tag;
00082 char component_data_len;
00083 char version_major;
00084 char version_minor;
00085 DSMCCCacheReference m_Reference;
00086 };
00087
00088 class ProfileBody
00089 {
00090 public:
00091 virtual ~ProfileBody() {}
00092 virtual DSMCCCacheReference *GetReference() = 0;
00093 virtual int Process(const unsigned char *) = 0;
00094 };
00095
00096 class ProfileBodyFull: public ProfileBody
00097 {
00098 public:
00099 ProfileBodyFull() { }
00100 virtual ~ProfileBodyFull() { }
00101 virtual int Process(const unsigned char *);
00102 virtual DSMCCCacheReference *GetReference()
00103 { return &obj_loc.m_Reference; }
00104
00105 protected:
00106 unsigned long data_len;
00107 char byte_order;
00108 char lite_components_count;
00109 BiopObjLocation obj_loc;
00110
00111
00112 public:
00113 BiopConnbinder dsm_conn;
00114
00115 };
00116
00117 class ProfileBodyLite: public ProfileBody
00118 {
00119 public:
00120
00121 virtual int Process(const unsigned char *);
00122
00123
00124 virtual DSMCCCacheReference *GetReference() { return NULL; }
00125 };
00126
00127
00128 class BiopIor
00129 {
00130 public:
00131 BiopIor() :
00132 type_id_len(0), type_id(NULL),
00133 tagged_profiles_count(0), profile_id_tag(0),
00134 m_profile_body(NULL) { }
00135
00136 ~BiopIor()
00137 {
00138 free(type_id);
00139 delete m_profile_body;
00140 }
00141
00142 int Process(const unsigned char *);
00143 void AddTap(Dsmcc *pStatus);
00144
00145 unsigned long type_id_len;
00146 char *type_id;
00147 unsigned long tagged_profiles_count;
00148 unsigned long profile_id_tag;
00149 ProfileBody *m_profile_body;
00150
00151
00152 };
00153
00154 class BiopBinding
00155 {
00156 public:
00157 BiopBinding() : m_objinfo_len(0), m_objinfo(0) {}
00158 ~BiopBinding();
00159
00160 int Process(const unsigned char *data);
00161
00162 BiopName m_name;
00163 char m_binding_type;
00164 BiopIor m_ior;
00165 unsigned int m_objinfo_len;
00166 char *m_objinfo;
00167 };
00168
00169 class ObjCarousel;
00170
00171 class BiopMessage
00172 {
00173 public:
00174 BiopMessage() : m_objinfo(NULL), m_objkind(NULL) {}
00175 ~BiopMessage();
00176 bool Process(DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00177 unsigned char *data, unsigned long *curp);
00178
00179 protected:
00180
00181 bool ProcessDir(bool isSrg,
00182 DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00183 unsigned char *data, unsigned long *curp);
00184
00185 bool ProcessFile(DSMCCCacheModuleData *cachep, DSMCCCache *cache,
00186 unsigned char *data, unsigned long *curp);
00187
00188 bool ProcessMsgHdr(unsigned char *data, unsigned long *curp);
00189
00190 protected:
00191 unsigned char m_version_major;
00192 unsigned char m_version_minor;
00193 unsigned int m_message_size;
00194 DSMCCCacheKey m_objkey;
00195 unsigned long m_objkind_len;
00196 unsigned int m_objinfo_len;
00197 char *m_objinfo;
00198
00199 public:
00200 char *m_objkind;
00201 };
00202
00203
00204 class ModuleDescriptorData
00205 {
00206 public:
00207 ModuleDescriptorData(): isCompressed(false), originalSize(0) { }
00208
00209 void Process(const unsigned char *data, int length);
00210
00211 bool isCompressed;
00212 unsigned long originalSize;
00213 };
00214
00215 class BiopModuleInfo
00216 {
00217 public:
00218 int Process(const unsigned char *Data);
00219
00220 unsigned long mod_timeout;
00221 unsigned long block_timeout;
00222 unsigned long min_blocktime;
00223 unsigned char taps_count;
00224 BiopTap tap;
00225
00226 ModuleDescriptorData descriptorData;
00227 };
00228
00229 class DsmccModuleInfo
00230 {
00231 public:
00232 unsigned short module_id;
00233 unsigned long module_size;
00234 unsigned char module_version;
00235 unsigned char module_info_len;
00236 unsigned char *data;
00237 unsigned int curp;
00238 BiopModuleInfo modinfo;
00239 };
00240
00241 #endif