00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TAO_AV_FLOWSPEC_ENTRY_H
00015 #define TAO_AV_FLOWSPEC_ENTRY_H
00016 #include "ace/pre.h"
00017
00018 #include "orbsvcs/AV/AV_export.h"
00019 #include "orbsvcs/AV/AV_Core.h"
00020 #include "ace/Addr.h"
00021 #include "ace/Containers.h"
00022 #include "ace/SString.h"
00023
00024
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026
00027
00028
00029
00030
00031 class TAO_AV_Export TAO_Tokenizer
00032 {
00033 public:
00034
00035 TAO_Tokenizer (const char *string,char delimiter);
00036
00037
00038 ~TAO_Tokenizer (void);
00039
00040
00041 int parse (const char *string,char delimiter);
00042
00043
00044 char *token (void);
00045
00046
00047 int num_tokens (void);
00048
00049 const char *operator [] (size_t index) const;
00050
00051 protected:
00052 ACE_Array<char*> token_array_;
00053 size_t count_;
00054 size_t num_tokens_;
00055 char string_ [BUFSIZ];
00056 };
00057
00058
00059 class TAO_AV_Transport;
00060 class TAO_AV_Flow_Handler;
00061 class TAO_AV_Protocol_Object;
00062
00063
00064
00065
00066
00067
00068 class TAO_AV_Export TAO_FlowSpec_Entry
00069 {
00070 public:
00071
00072 enum Direction
00073 {
00074 TAO_AV_INVALID = -1,
00075 TAO_AV_DIR_IN = 0,
00076 TAO_AV_DIR_OUT = 1
00077 };
00078
00079 enum Role
00080 {
00081 TAO_AV_INVALID_ROLE = -1,
00082 TAO_AV_PRODUCER = 0,
00083 TAO_AV_CONSUMER = 1
00084 };
00085
00086
00087 TAO_FlowSpec_Entry (void);
00088
00089
00090 TAO_FlowSpec_Entry (const char *flowname,
00091 const char *direction,
00092 const char *format_name,
00093 const char *flow_protocol,
00094 const char *carrier_protocol,
00095 ACE_Addr *fwd_address,
00096
00097 ACE_Addr *control_address = 0);
00098
00099 TAO_FlowSpec_Entry (const char *flowname,
00100 const char *direction,
00101 const char *format_name,
00102 const char *flow_protocol,
00103 const char *fwd_address);
00104
00105
00106
00107 virtual int parse (const char* flowSpec_entry) = 0;
00108
00109
00110 virtual ~TAO_FlowSpec_Entry (void);
00111
00112
00113 int direction (void);
00114
00115 virtual Role role (void) = 0;
00116 void role (Role role);
00117
00118 const char * direction_str (void) const;
00119
00120
00121 const char *flow_protocol_str (void) const;
00122
00123
00124 void flow_protocol_str (const char *flow_protocol_str);
00125
00126
00127
00128 ACE_Addr *address (void);
00129 ACE_Addr *control_address (void);
00130 void address (ACE_Addr *address, bool cleanup = false);
00131 void control_address (ACE_Addr *address);
00132
00133
00134 const char *address_str (void) const;
00135
00136
00137
00138 TAO_AV_Core::Protocol carrier_protocol (void);
00139
00140
00141 const char * carrier_protocol_str (void) const;
00142
00143
00144 const char *format (void) const;
00145
00146
00147 const char *flowname (void) const;
00148
00149
00150 virtual const char *entry_to_string (void) = 0;
00151
00152 int set_peer_addr (ACE_Addr *peer_addr);
00153 ACE_Addr *get_peer_addr (void);
00154 int set_peer_control_addr (ACE_Addr *peer_control_addr);
00155 ACE_Addr *get_peer_control_addr (void);
00156
00157 int set_local_sec_addr (char** local_sec_addr, int size);
00158 char** get_local_sec_addr (void);
00159 int num_local_sec_addrs (void);
00160
00161 int set_peer_sec_addr (char** peer_sec_addr, int size);
00162 char** get_peer_sec_addr (void);
00163 int num_peer_sec_addrs (void);
00164
00165 int set_local_addr (ACE_Addr *local_addr);
00166 ACE_Addr *get_local_addr (void);
00167 char *get_local_addr_str (void);
00168 int set_local_control_addr (ACE_Addr *local_control_addr);
00169 ACE_Addr *get_local_control_addr (void);
00170 char *get_local_control_addr_str (void);
00171
00172 TAO_AV_Transport *transport (void);
00173 void transport (TAO_AV_Transport *transport);
00174 TAO_AV_Transport *control_transport (void);
00175 void control_transport (TAO_AV_Transport *control_transport);
00176
00177 TAO_AV_Flow_Handler* handler (void);
00178 void handler (TAO_AV_Flow_Handler *handler);
00179 TAO_AV_Flow_Handler* control_handler (void);
00180 void control_handler (TAO_AV_Flow_Handler *control_handler);
00181
00182 TAO_AV_Protocol_Object* protocol_object (void);
00183 void protocol_object (TAO_AV_Protocol_Object *object);
00184 TAO_AV_Protocol_Object* control_protocol_object (void);
00185 void control_protocol_object (TAO_AV_Protocol_Object *object);
00186
00187
00188 int parse_address (const char *format_string,
00189 TAO_AV_Core::Flow_Component flow_component);
00190
00191
00192 int is_multicast (void);
00193
00194 protected:
00195
00196
00197 int parse_flow_protocol_string (const char *flow_options_string);
00198
00199
00200 int set_direction (const char *direction_string);
00201
00202
00203 int set_protocol (void);
00204
00205
00206 ACE_Addr *address_;
00207 int clean_up_address_;
00208 ACE_Addr *control_address_;
00209 int clean_up_control_address_;
00210
00211
00212 ACE_CString address_str_;
00213
00214
00215 ACE_CString peer_address_str_;
00216
00217
00218 ACE_CString format_;
00219
00220
00221 Direction direction_;
00222
00223
00224 ACE_CString direction_str_;
00225
00226
00227 ACE_CString flowname_;
00228
00229
00230 TAO_AV_Core::Protocol protocol_;
00231
00232
00233 ACE_CString carrier_protocol_;
00234
00235
00236 ACE_CString flow_protocol_;
00237
00238 int use_flow_protocol_;
00239
00240
00241 ACE_CString entry_;
00242
00243 int is_multicast_;
00244 bool delete_peer_addr_;
00245 ACE_Addr *peer_addr_;
00246 char** local_sec_addr_;
00247 int num_local_sec_addrs_;
00248 char** peer_sec_addr_;
00249 int num_peer_sec_addrs_;
00250 ACE_Addr *peer_control_addr_;
00251 ACE_Addr *local_addr_;
00252 ACE_Addr *local_control_addr_;
00253 TAO_AV_Transport *transport_;
00254 TAO_AV_Transport *control_transport_;
00255 TAO_AV_Flow_Handler *handler_;
00256 TAO_AV_Flow_Handler *control_handler_;
00257 TAO_AV_Protocol_Object *protocol_object_;
00258 TAO_AV_Protocol_Object *control_protocol_object_;
00259 Role role_;
00260 };
00261
00262
00263
00264
00265
00266 class TAO_AV_Export TAO_Forward_FlowSpec_Entry
00267 : public TAO_FlowSpec_Entry
00268 {
00269 public:
00270 enum Position {TAO_AV_FLOWNAME = 0,
00271 TAO_AV_DIRECTION = 1,
00272 TAO_AV_FORMAT = 2,
00273 TAO_AV_FLOW_PROTOCOL = 3,
00274 TAO_AV_ADDRESS = 4,
00275 TAO_AV_PEER_ADDR = 5};
00276
00277
00278 TAO_Forward_FlowSpec_Entry (void);
00279
00280
00281 TAO_Forward_FlowSpec_Entry (const char *flowname,
00282 const char *direction,
00283 const char *format_name,
00284 const char *flow_protocol,
00285 const char *carrier_protocol,
00286 ACE_Addr *address,
00287 ACE_Addr *control_address = 0);
00288
00289 TAO_Forward_FlowSpec_Entry (const char *flowname,
00290 const char *direction,
00291 const char *format_name,
00292 const char *flow_protocol,
00293 const char *address);
00294
00295 virtual ~TAO_Forward_FlowSpec_Entry (void);
00296
00297
00298 virtual const char *entry_to_string (void);
00299
00300 virtual Role role (void);
00301
00302
00303 virtual int parse (const char* flowSpec_entry);
00304 };
00305
00306
00307
00308
00309
00310 class TAO_AV_Export TAO_Reverse_FlowSpec_Entry
00311 :public TAO_FlowSpec_Entry
00312 {
00313 public:
00314 enum Position {TAO_AV_FLOWNAME = 0,
00315 TAO_AV_ADDRESS = 1,
00316 TAO_AV_FLOW_PROTOCOL = 2,
00317 TAO_AV_DIRECTION = 3,
00318 TAO_AV_FORMAT = 4};
00319
00320
00321 TAO_Reverse_FlowSpec_Entry (void);
00322
00323
00324 TAO_Reverse_FlowSpec_Entry (const char *flowname,
00325 const char *direction,
00326 const char *format_name,
00327 const char *flow_protocol,
00328 const char *carrier_protocol,
00329 ACE_Addr *address,
00330 ACE_Addr *control_address = 0);
00331
00332
00333 TAO_Reverse_FlowSpec_Entry (const char *flowname,
00334 const char *direction,
00335 const char *format_name,
00336 const char *flow_protocol,
00337 const char *address);
00338
00339 virtual ~TAO_Reverse_FlowSpec_Entry (void);
00340
00341
00342 virtual const char *entry_to_string (void);
00343
00344 virtual Role role (void);
00345
00346
00347 virtual int parse (const char* flowSpec_entry);
00348 };
00349
00350 TAO_END_VERSIONED_NAMESPACE_DECL
00351
00352 #include "orbsvcs/AV/Transport.h"
00353
00354 #if defined (__ACE_INLINE__)
00355 #include "orbsvcs/AV/FlowSpec_Entry.inl"
00356 #endif
00357
00358 #include "ace/post.h"
00359 #endif