summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-09-26 12:00:25 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-09-26 12:00:25 +0000
commit38168f1a04733ab04def2b6129b8bb3e4690c653 (patch)
treef53fe8d2f288e2c35849504714071c961f3fe125
parente84f36d1f23cb07c978d8072f28bf72d5b629f97 (diff)
downloadATCD-38168f1a04733ab04def2b6129b8bb3e4690c653.tar.gz
Tue Sep 26 11:59:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/utils/catior/catior.cpp86
1 files changed, 85 insertions, 1 deletions
diff --git a/TAO/utils/catior/catior.cpp b/TAO/utils/catior/catior.cpp
index 843d885fe3a..479fdec29bf 100644
--- a/TAO/utils/catior/catior.cpp
+++ b/TAO/utils/catior/catior.cpp
@@ -139,6 +139,9 @@ CORBA::Boolean
cat_shmiop_profile (TAO_InputCDR& cdr);
CORBA::Boolean
+cat_coiop_profile (TAO_InputCDR& cdr);
+
+CORBA::Boolean
cat_nskpw_profile (TAO_InputCDR& cdr);
static CORBA::Boolean
@@ -298,6 +301,12 @@ catior (char const * str
continue_decoding = cat_profile_helper(stream, "DIOP (GIOP over UDP)");
ACE_DEBUG ((LM_DEBUG, "%}"));
}
+ else if (tag == TAO_TAG_COIOP_PROFILE)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%{"));
+ continue_decoding = cat_coiop_profile(stream);
+ ACE_DEBUG ((LM_DEBUG, "%}"));
+ }
else if (tag == TAO_TAG_NSKPW_PROFILE)
{
ACE_DEBUG ((LM_DEBUG, "%{"));
@@ -1523,6 +1532,81 @@ cat_profile_helper (TAO_InputCDR& stream,
}
CORBA::Boolean
+cat_coiop_profile (TAO_InputCDR& stream)
+{
+ // OK, we've got an COIOP profile. It's going to be
+ // encapsulated ProfileData. Create a new decoding stream and
+ // context for it, and tell the "parent" stream that this data
+ // isn't part of it any more.
+
+ CORBA::ULong encap_len;
+ if (stream.read_ulong (encap_len) == 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "cannot read encap length\n"));
+ return false;
+ }
+
+ // Create the decoding stream from the encapsulation in the
+ // buffer, and skip the encapsulation.
+ TAO_InputCDR str (stream, encap_len);
+
+ if (str.good_bit () == 0 || stream.skip_bytes (encap_len) == 0)
+ return false;
+
+ // Read and verify major, minor versions, ignoring IIOP
+ // profiles whose versions we don't understand.
+ //
+ // XXX this doesn't actually go back and skip the whole
+ // encapsulation...
+ CORBA::Octet iiop_version_major;
+ CORBA::Octet iiop_version_minor = CORBA::Octet();
+ if (! (str.read_octet (iiop_version_major)
+ && iiop_version_major == 1
+ && str.read_octet (iiop_version_minor)
+ && iiop_version_minor <= 2))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%I detected new v%d.%d COIOP profile that catior cannot decode",
+ iiop_version_major,
+ iiop_version_minor));
+ return true;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "COIOP Version:\t%d.%d\n",
+ iiop_version_major,
+ iiop_version_minor));
+
+ // Get host and port.
+ CORBA::String_var uuid;
+ if (!(str >> uuid.inout ()))
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "%I problem decoding uuid\n"));
+ return true;
+ }
+
+ ACE_DEBUG ((LM_DEBUG,
+ "%I UUID:\t%s\n",
+ uuid.in ()));
+
+ if (cat_object_key (str) == 0)
+ return false;
+
+ //IIOP 1.0 does not have tagged_components.
+ if (!(iiop_version_major == 1 && iiop_version_minor == 0))
+ {
+ if (cat_tagged_components (str) == 0)
+ return false;
+
+ return true;
+ }
+ else
+ return false;
+}
+
+CORBA::Boolean
cat_iiop_profile (TAO_InputCDR& stream)
{
return cat_profile_helper (stream, "IIOP");
@@ -1663,7 +1747,7 @@ cat_sciop_profile (TAO_InputCDR& stream)
"%I problem decoding hostname\n"),
false);
}
-
+
ACE_DEBUG ((LM_DEBUG,
"%I Host Name:\t%s\n",
hostname.in ()));