00001
00002
00003 #include "orbsvcs/PortableGroup/UIPMC_Profile.h"
00004 #include "orbsvcs/PortableGroup/miopconf.h"
00005 #include "tao/CDR.h"
00006 #include "tao/ORB.h"
00007 #include "tao/ORB_Core.h"
00008 #include "tao/debug.h"
00009 #include "tao/target_specification.h"
00010 #include "ace/OS_NS_ctype.h"
00011
00012 #include "orbsvcs/miopC.h"
00013 #include "orbsvcs/PortableGroupC.h"
00014
00015 ACE_RCSID (PortableGroup,
00016 UIPMC_Profile,
00017 "$Id: UIPMC_Profile.cpp 81853 2008-06-06 12:35:50Z vzykov $")
00018
00019 static const char the_prefix[] = "miop";
00020
00021
00022
00023 static const CORBA::Short default_addressing_mode_ = TAO_Target_Specification::Profile_Addr;
00024
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026
00027 const char TAO_UIPMC_Profile::object_key_delimiter_ = '/';
00028
00029 char
00030 TAO_UIPMC_Profile::object_key_delimiter (void) const
00031 {
00032 return TAO_UIPMC_Profile::object_key_delimiter_;
00033 }
00034
00035 TAO_UIPMC_Profile::TAO_UIPMC_Profile (TAO_ORB_Core *orb_core)
00036 : TAO_Profile (IOP::TAG_UIPMC,
00037 orb_core,
00038 TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
00039 endpoint_ (),
00040 tagged_profile_ ()
00041 {
00042 addressing_mode_ = default_addressing_mode_;
00043 }
00044
00045 TAO_UIPMC_Profile::TAO_UIPMC_Profile (const ACE_INET_Addr &addr,
00046 TAO_ORB_Core *orb_core)
00047 : TAO_Profile (IOP::TAG_UIPMC,
00048 orb_core,
00049 TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
00050 endpoint_ (addr),
00051 tagged_profile_ ()
00052 {
00053 addressing_mode_ = default_addressing_mode_;
00054 }
00055
00056 TAO_UIPMC_Profile::TAO_UIPMC_Profile (const CORBA::Octet class_d_address[4],
00057 CORBA::UShort port,
00058 TAO_ORB_Core *orb_core)
00059 : TAO_Profile (IOP::TAG_UIPMC,
00060 orb_core,
00061 TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
00062 endpoint_ (class_d_address, port),
00063 tagged_profile_ ()
00064 {
00065 addressing_mode_ = default_addressing_mode_;
00066 }
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 TAO_UIPMC_Profile::~TAO_UIPMC_Profile (void)
00086 {
00087 }
00088
00089 int
00090 TAO_UIPMC_Profile::decode (TAO_InputCDR& cdr)
00091 {
00092
00093
00094 CORBA::ULong encap_len = cdr.length ();
00095
00096
00097
00098 if (!(cdr.read_octet (this->version_.major)
00099 && this->version_.major == TAO_DEF_GIOP_MAJOR
00100 && cdr.read_octet (this->version_.minor)
00101 && this->version_.minor <= TAO_DEF_GIOP_MINOR))
00102 {
00103 if (TAO_debug_level > 0)
00104 {
00105 ACE_DEBUG ((LM_DEBUG,
00106 ACE_TEXT ("TAO (%P|%t) - UIPMC_Profile::decode - v%d.%d\n"),
00107 this->version_.major,
00108 this->version_.minor));
00109 }
00110
00111 return -1;
00112 }
00113
00114
00115 if (this->decode_profile (cdr) < 0)
00116 {
00117 return -1;
00118 }
00119
00120
00121 if (this->tagged_components_.decode (cdr) == 0)
00122 {
00123 return -1;
00124 }
00125
00126 if (cdr.length () != 0 && TAO_debug_level)
00127 {
00128
00129
00130 ACE_DEBUG ((LM_DEBUG,
00131 ACE_TEXT ("%d bytes out of %d left after profile data\n"),
00132 cdr.length (),
00133 encap_len));
00134 }
00135
00136
00137
00138
00139 return 1;
00140 }
00141
00142 int
00143 TAO_UIPMC_Profile::decode_endpoints (void)
00144 {
00145 ACE_NOTSUP_RETURN (-1);
00146 }
00147
00148 int
00149 TAO_UIPMC_Profile::decode_profile (TAO_InputCDR& cdr)
00150 {
00151 CORBA::UShort port = 0;
00152 ACE_CString address;
00153 if (!(cdr.read_string (address)
00154 && cdr.read_ushort (port)))
00155 {
00156 if (TAO_debug_level > 0)
00157 ACE_DEBUG ((LM_DEBUG,
00158 ACE_TEXT ("TAO (%P|%t) - UIPMC_Profile::decode - ")
00159 ACE_TEXT ("Couldn't unmarshal address and port!\n")));
00160 return -1;
00161 }
00162
00163 if (cdr.good_bit ())
00164 {
00165
00166
00167 ACE_INET_Addr addr (port, address.c_str ());
00168 this->endpoint_.object_addr (addr);
00169 return 1;
00170 }
00171
00172 return -1;
00173 }
00174
00175 void
00176 TAO_UIPMC_Profile::parse_string (const char *string)
00177 {
00178 this->parse_string_i (string);
00179 }
00180
00181 void
00182 TAO_UIPMC_Profile::parse_string_i (const char *string)
00183 {
00184
00185
00186
00187
00188 if (ACE_OS::ace_isdigit (string [0]) &&
00189 string[1] == '.' &&
00190 ACE_OS::ace_isdigit (string [2]) &&
00191 string[3] == '@')
00192 {
00193 if (string[0] != '1' ||
00194 string[2] != '0')
00195 {
00196 throw CORBA::INV_OBJREF (
00197 CORBA::SystemException::_tao_minor_code (
00198 TAO::VMCID,
00199 EINVAL),
00200 CORBA::COMPLETED_NO);
00201 }
00202
00203 string += 4;
00204
00205 }
00206
00207
00208 this->version_.set_version (1, 2);
00209
00210
00211
00212
00213
00214
00215 if (ACE_OS::ace_isdigit (string [0]) &&
00216 string[1] == '.' &&
00217 ACE_OS::ace_isdigit (string [2]) &&
00218 string[3] == '-')
00219 {
00220 CORBA::Char major;
00221 CORBA::Char minor;
00222
00223 major = (char) (string [0] - '0');
00224 minor = (char) (string [2] - '0');
00225
00226
00227 if (major != TAO_DEF_MIOP_MAJOR ||
00228 minor > TAO_DEF_MIOP_MINOR)
00229 {
00230 throw CORBA::INV_OBJREF (
00231 CORBA::SystemException::_tao_minor_code (
00232 TAO::VMCID,
00233 EINVAL),
00234 CORBA::COMPLETED_NO);
00235 }
00236
00237
00238 string += 4;
00239 }
00240 else
00241 {
00242
00243 throw CORBA::INV_OBJREF (
00244 CORBA::SystemException::_tao_minor_code (
00245 TAO::VMCID,
00246 EINVAL),
00247 CORBA::COMPLETED_NO);
00248 }
00249
00250
00251
00252
00253
00254 const char *pos = ACE_OS::strchr (string, '-');
00255
00256 if (pos == 0)
00257 {
00258
00259
00260 throw CORBA::INV_OBJREF (
00261 CORBA::SystemException::_tao_minor_code (
00262 TAO::VMCID,
00263 EINVAL),
00264 CORBA::COMPLETED_NO);
00265 }
00266
00267
00268 ACE_CString group_domain_id (string, pos - string);
00269
00270
00271
00272
00273
00274 string = pos + 1;
00275 pos = ACE_OS::strchr (string, '-');
00276
00277 CORBA::Boolean parse_group_ref_version_flag = 0;
00278
00279 if (pos != 0)
00280 {
00281
00282
00283 parse_group_ref_version_flag = 1;
00284 }
00285 else
00286 {
00287
00288 pos = ACE_OS::strchr (string, '/');
00289
00290 if (pos == 0)
00291 {
00292
00293 throw CORBA::INV_OBJREF (
00294 CORBA::SystemException::_tao_minor_code (
00295 TAO::VMCID,
00296 EINVAL),
00297 CORBA::COMPLETED_NO);
00298 }
00299 }
00300
00301 if (ACE_OS::strspn (string, "0123456789") !=
00302 static_cast<size_t> (pos - string))
00303 {
00304
00305 throw CORBA::INV_OBJREF (
00306 CORBA::SystemException::_tao_minor_code (
00307 TAO::VMCID,
00308 EINVAL),
00309 CORBA::COMPLETED_NO);
00310 }
00311
00312
00313 ACE_CString str_group_id (string, pos - string);
00314
00315
00316 PortableGroup::ObjectGroupId group_id =
00317 ACE_OS::strtoull (str_group_id.c_str (), 0, 10);
00318
00319 this->has_ref_version_ = false;
00320 PortableGroup::ObjectGroupRefVersion ref_version = 0;
00321 if (parse_group_ref_version_flag)
00322 {
00323
00324 string = pos + 1;
00325 pos = ACE_OS::strchr (string, '/');
00326 if (pos == 0)
00327 {
00328
00329
00330 throw CORBA::INV_OBJREF (
00331 CORBA::SystemException::_tao_minor_code (
00332 TAO::VMCID,
00333 EINVAL),
00334 CORBA::COMPLETED_NO);
00335 }
00336
00337 if (ACE_OS::strspn (string, "0123456789") !=
00338 static_cast<size_t> (pos - string))
00339 {
00340
00341 throw CORBA::INV_OBJREF (
00342 CORBA::SystemException::_tao_minor_code (
00343 TAO::VMCID,
00344 EINVAL),
00345 CORBA::COMPLETED_NO);
00346 }
00347
00348 ACE_CString str_group_ref_ver (string, pos - string);
00349
00350 ref_version =
00351 ACE_OS::strtoul (str_group_ref_ver.c_str (), 0, 10);
00352 this->has_ref_version_ = true;
00353 }
00354
00355
00356
00357 string = pos + 1;
00358 pos = ACE_OS::strchr (string, ':');
00359
00360 if (pos == 0)
00361 {
00362
00363
00364 throw CORBA::INV_OBJREF (
00365 CORBA::SystemException::_tao_minor_code (
00366 TAO::VMCID,
00367 EINVAL),
00368 CORBA::COMPLETED_NO);
00369 }
00370
00371 ACE_CString mcast_addr;
00372
00373 #if defined (ACE_HAS_IPV6)
00374
00375
00376 if ((this->version ().major > TAO_MIN_IPV6_IIOP_MAJOR ||
00377 this->version ().minor >= TAO_MIN_IPV6_IIOP_MINOR) &&
00378 string[0] == '[')
00379 {
00380
00381
00382 pos = ACE_OS::strchr (string, ']');
00383 if (pos == 0)
00384 {
00385
00386 if (TAO_debug_level > 0)
00387 {
00388 ACE_ERROR ((LM_ERROR,
00389 ACE_TEXT ("\nTAO (%P|%t) - UIPMC_Profile: ")
00390 ACE_TEXT ("Invalid IPv6 decimal address specified.\n")));
00391 }
00392
00393 throw CORBA::INV_OBJREF (
00394 CORBA::SystemException::_tao_minor_code (
00395 0,
00396 EINVAL),
00397 CORBA::COMPLETED_NO);
00398 }
00399 else
00400 {
00401 ++string;
00402 mcast_addr = ACE_CString (string, pos - string);
00403 string = pos + 2;
00404 }
00405 }
00406 else
00407 {
00408 #endif
00409 mcast_addr = ACE_CString (string, pos - string);
00410 string = pos + 1;
00411 #if defined (ACE_HAS_IPV6)
00412 }
00413 #endif
00414
00415 size_t mcast_addr_len = mcast_addr.length ();
00416 if (ACE_OS::strspn (mcast_addr.c_str (),
00417 ".:0123456789ABCDEFabcdef") != mcast_addr_len)
00418 {
00419
00420 throw CORBA::INV_OBJREF (
00421 CORBA::SystemException::_tao_minor_code (
00422 TAO::VMCID,
00423 EINVAL),
00424 CORBA::COMPLETED_NO);
00425 }
00426
00427
00428
00429
00430 if (string[0] == '\0')
00431 {
00432
00433
00434 throw CORBA::INV_OBJREF (
00435 CORBA::SystemException::_tao_minor_code (
00436 TAO::VMCID,
00437 EINVAL),
00438 CORBA::COMPLETED_NO);
00439 }
00440
00441
00442 const char port_chars[] =
00443 "-0123456789ABCDEFGHIGKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
00444 size_t port_len = ACE_OS::strlen (string);
00445 if (ACE_OS::strspn (string, port_chars) != port_len)
00446 {
00447
00448 throw CORBA::INV_OBJREF (
00449 CORBA::SystemException::_tao_minor_code (
00450 TAO::VMCID,
00451 EINVAL),
00452 CORBA::COMPLETED_NO);
00453 }
00454
00455 ACE_INET_Addr ia;
00456 if (ia.string_to_addr (string) == -1)
00457 {
00458 throw CORBA::INV_OBJREF (
00459 CORBA::SystemException::_tao_minor_code (
00460 TAO::VMCID,
00461 EINVAL),
00462 CORBA::COMPLETED_NO);
00463 }
00464
00465 u_short mcast_port = ia.get_port_number ();
00466
00467
00468
00469
00470
00471 ACE_INET_Addr addr (mcast_port, mcast_addr.c_str ());
00472 this->endpoint_.object_addr (addr);
00473
00474 this->set_group_info (group_domain_id.c_str (),
00475 group_id,
00476 ref_version);
00477 }
00478
00479 CORBA::Boolean
00480 TAO_UIPMC_Profile::do_is_equivalent (const TAO_Profile *other_profile)
00481 {
00482 const TAO_UIPMC_Profile *op =
00483 dynamic_cast<const TAO_UIPMC_Profile *> (other_profile);
00484
00485 if (op == 0)
00486 return 0;
00487
00488 return this->endpoint_.is_equivalent (&op->endpoint_);
00489 }
00490
00491 CORBA::ULong
00492 TAO_UIPMC_Profile::hash (CORBA::ULong max)
00493 {
00494
00495 CORBA::ULong hashval = this->endpoint_.hash ();
00496
00497 hashval += this->version_.minor;
00498 hashval += this->tag ();
00499
00500 return hashval % max;
00501 }
00502
00503 TAO_Endpoint*
00504 TAO_UIPMC_Profile::endpoint (void)
00505 {
00506 return &this->endpoint_;
00507 }
00508
00509 int
00510 TAO_UIPMC_Profile::encode_endpoints (void)
00511 {
00512 return 1;
00513 }
00514
00515 CORBA::ULong
00516 TAO_UIPMC_Profile::endpoint_count (void) const
00517 {
00518 return 1;
00519 }
00520
00521 char *
00522 TAO_UIPMC_Profile::to_string (void)
00523 {
00524
00525
00526 size_t buflen = (8 +
00527 1 +
00528 ACE_OS::strlen (::the_prefix) +
00529 1 +
00530 1 +
00531 1 +
00532 1 +
00533 1 +
00534 1 +
00535 1 +
00536 1 +
00537 1 +
00538 this->group_domain_id_.length () +
00539 1 +
00540 20 +
00541 1 +
00542 10 +
00543 1 +
00544 39 +
00545 1 +
00546 5 );
00547 #if defined (ACE_HAS_IPV6)
00548 if (this->endpoint_.object_addr ().get_type () == AF_INET6)
00549 buflen += 2;
00550 #endif
00551
00552 static const char digits [] = "0123456789";
00553
00554 char * buf = CORBA::string_alloc (static_cast<CORBA::ULong> (buflen));
00555
00556 ACE_OS::sprintf (buf,
00557 "corbaloc:%s:%c.%c@%c.%c-%s-%llu",
00558 ::the_prefix,
00559 digits [this->version_.major],
00560 digits [this->version_.minor],
00561 digits [TAO_DEF_MIOP_MAJOR],
00562 digits [TAO_DEF_MIOP_MINOR],
00563 this->group_domain_id_.c_str (),
00564 this->group_id_);
00565
00566 if (this->has_ref_version_)
00567 {
00568 ACE_OS::sprintf (&buf[ACE_OS::strlen (buf)],
00569 "-%lu",
00570 this->ref_version_);
00571 }
00572
00573 #if defined (ACE_HAS_IPV6)
00574 if (this->endpoint_.object_addr ().get_type () == AF_INET6)
00575 {
00576 ACE_OS::sprintf (&buf[ACE_OS::strlen (buf)],
00577 "/[%s]:%d",
00578 this->endpoint_.host (),
00579 this->endpoint_.port ());
00580 }
00581 else
00582 #endif
00583 ACE_OS::sprintf (&buf[ACE_OS::strlen (buf)],
00584 "/%s:%d",
00585 this->endpoint_.host (),
00586 this->endpoint_.port ());
00587
00588 return buf;
00589 }
00590
00591 const char *
00592 TAO_UIPMC_Profile::prefix (void)
00593 {
00594 return ::the_prefix;
00595 }
00596
00597 IOP::TaggedProfile &
00598 TAO_UIPMC_Profile::create_tagged_profile (void)
00599 {
00600
00601 if (this->tagged_profile_.profile_data.length () == 0)
00602 {
00603
00604 this->tagged_profile_.tag = IOP::TAG_UIPMC;
00605
00606
00607 TAO_OutputCDR encap;
00608
00609
00610 this->create_profile_body (encap);
00611
00612 CORBA::ULong length =
00613 static_cast<CORBA::ULong> (encap.total_length ());
00614
00615 #if (TAO_NO_COPY_OCTET_SEQUENCES == 1)
00616
00617
00618 this->tagged_profile_.profile_data.replace (length,
00619 encap.begin ());
00620 #else
00621 this->tagged_profile_.profile_data.length (length);
00622 CORBA::Octet *buffer =
00623 this->tagged_profile_.profile_data.get_buffer ();
00624 for (const ACE_Message_Block *i = encap.begin ();
00625 i != encap.end ();
00626 i = i->next ())
00627 {
00628 ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ());
00629 buffer += i->length ();
00630 }
00631 #endif
00632 }
00633
00634 return this->tagged_profile_;
00635 }
00636
00637 void
00638 TAO_UIPMC_Profile::create_profile_body (TAO_OutputCDR &encap) const
00639 {
00640 encap.write_octet (TAO_ENCAP_BYTE_ORDER);
00641
00642
00643
00644 encap.write_octet (this->version_.major);
00645 encap.write_octet (this->version_.minor);
00646
00647
00648 encap.write_string (this->endpoint_.host ());
00649
00650
00651 encap.write_ushort (this->endpoint_.port ());
00652
00653
00654
00655 this->tagged_components ().encode (encap);
00656 }
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715 void
00716 TAO_UIPMC_Profile::set_group_info (const char *domain_id,
00717 PortableGroup::ObjectGroupId group_id,
00718 PortableGroup::ObjectGroupRefVersion ref_version)
00719 {
00720
00721 this->group_domain_id_.set (domain_id);
00722 this->group_id_ = group_id;
00723 this->ref_version_ = ref_version;
00724
00725
00726 this->update_cached_group_component ();
00727 }
00728
00729 void
00730 TAO_UIPMC_Profile::update_cached_group_component (void)
00731 {
00732 PortableGroup::TagGroupTaggedComponent group;
00733
00734
00735 group.component_version.major = TAO_DEF_MIOP_MAJOR;
00736 group.component_version.minor = TAO_DEF_MIOP_MINOR;
00737
00738 group.group_domain_id = CORBA::string_dup (this->group_domain_id_.c_str ());
00739 group.object_group_id = this->group_id_;
00740 group.object_group_ref_version = this->ref_version_;
00741
00742 TAO_OutputCDR out_cdr;
00743
00744
00745 out_cdr << ACE_OutputCDR::from_boolean (ACE_CDR_BYTE_ORDER);
00746
00747
00748 if ((out_cdr << group) == 0)
00749 {
00750 ACE_DEBUG ((LM_DEBUG,
00751 "Error marshaling group component!"));
00752 return;
00753 }
00754
00755 size_t length = out_cdr.total_length ();
00756
00757 IOP::TaggedComponent tagged_component;
00758 tagged_component.tag = IOP::TAG_GROUP;
00759 tagged_component.component_data.length (static_cast<CORBA::ULong> (length));
00760 CORBA::Octet *buf =
00761 tagged_component.component_data.get_buffer ();
00762
00763 for (const ACE_Message_Block *iterator = out_cdr.begin ();
00764 iterator != 0;
00765 iterator = iterator->cont ())
00766 {
00767 size_t i_length = iterator->length ();
00768 ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length);
00769
00770 buf += i_length;
00771 }
00772
00773
00774
00775 this->tagged_components_.set_component (tagged_component);
00776 }
00777
00778 void
00779 TAO_UIPMC_Profile::request_target_specifier (
00780 TAO_Target_Specification &target_spec,
00781 TAO_Target_Specification::TAO_Target_Address required_type)
00782 {
00783
00784 switch (required_type)
00785 {
00786 case TAO_Target_Specification::Profile_Addr:
00787
00788
00789
00790
00791 target_spec.target_specifier (
00792 this->create_tagged_profile ());
00793 break;
00794
00795 case TAO_Target_Specification::Key_Addr:
00796 case TAO_Target_Specification::Reference_Addr:
00797 default:
00798
00799 throw CORBA::MARSHAL ();
00800 }
00801 }
00802
00803 int
00804 TAO_UIPMC_Profile::supports_multicast (void) const
00805 {
00806
00807 return 1;
00808 }
00809
00810 void
00811 TAO_UIPMC_Profile::addressing_mode (CORBA::Short addr_mode)
00812 {
00813
00814 switch (addr_mode)
00815 {
00816 case TAO_Target_Specification::Profile_Addr:
00817 case TAO_Target_Specification::Reference_Addr:
00818 this->addressing_mode_ = addr_mode;
00819 break;
00820
00821 case TAO_Target_Specification::Key_Addr:
00822
00823
00824 default:
00825 throw CORBA::BAD_PARAM (
00826 CORBA::SystemException::_tao_minor_code (
00827 TAO::VMCID,
00828 EINVAL),
00829 CORBA::COMPLETED_NO);
00830 }
00831 }
00832
00833 int
00834 TAO_UIPMC_Profile::extract_group_component (const IOP::TaggedProfile &profile,
00835 PortableGroup::TagGroupTaggedComponent &group)
00836 {
00837
00838
00839
00840
00841 TAO_InputCDR cdr (reinterpret_cast<const char*> (profile.profile_data.get_buffer ()),
00842 profile.profile_data.length ());
00843
00844
00845
00846 CORBA::Boolean byte_order;
00847 if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
00848 return -1;
00849 cdr.reset_byte_order (static_cast<int> (byte_order));
00850
00851
00852
00853 CORBA::Octet major;
00854 CORBA::Octet minor = CORBA::Octet();
00855
00856
00857
00858 if (!(cdr.read_octet (major)
00859 && cdr.read_octet (minor)))
00860 {
00861 if (TAO_debug_level > 0)
00862 {
00863 ACE_DEBUG ((LM_DEBUG,
00864 ACE_TEXT ("TAO (%P|%t) - UIPMC_Profile::extract_group_component - v%d.%d\n"),
00865 major,
00866 minor));
00867 }
00868 return -1;
00869 }
00870
00871
00872 ACE_CString address;
00873 CORBA::UShort port;
00874
00875 if (!(cdr.read_string (address)
00876 && cdr.read_ushort (port)))
00877 {
00878 if (TAO_debug_level > 0)
00879 ACE_DEBUG ((LM_DEBUG,
00880 ACE_TEXT ("TAO (%P|%t) - UIPMC_Profile::extract_group_component - Couldn't unmarshal address and port!\n")));
00881 return -1;
00882 }
00883
00884 TAO_Tagged_Components tagged_components;
00885 if (tagged_components.decode (cdr) == 0)
00886 return -1;
00887
00888 IOP::TaggedComponent tagged_component;
00889 tagged_component.tag = IOP::TAG_GROUP;
00890
00891
00892 if (tagged_components.get_component (tagged_component) == 0)
00893 return -1;
00894
00895
00896 const CORBA::Octet *buf =
00897 tagged_component.component_data.get_buffer ();
00898
00899 TAO_InputCDR in_cdr (reinterpret_cast<const char*> (buf),
00900 tagged_component.component_data.length ());
00901
00902
00903 if ((in_cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0)
00904 return -1;
00905 in_cdr.reset_byte_order (static_cast<int> (byte_order));
00906
00907 if ((in_cdr >> group) == 0)
00908 return -1;
00909
00910 return 0;
00911 }
00912
00913 TAO_END_VERSIONED_NAMESPACE_DECL