summaryrefslogtreecommitdiff
path: root/TAO/tao/GIOP_Message_Generator_Parser_Impl.inl
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
commit3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (patch)
tree197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tao/GIOP_Message_Generator_Parser_Impl.inl
parent6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (diff)
downloadATCD-3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/tao/GIOP_Message_Generator_Parser_Impl.inl')
-rw-r--r--TAO/tao/GIOP_Message_Generator_Parser_Impl.inl35
1 files changed, 35 insertions, 0 deletions
diff --git a/TAO/tao/GIOP_Message_Generator_Parser_Impl.inl b/TAO/tao/GIOP_Message_Generator_Parser_Impl.inl
new file mode 100644
index 00000000000..5415e22f081
--- /dev/null
+++ b/TAO/tao/GIOP_Message_Generator_Parser_Impl.inl
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+//
+//$Id$
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+ACE_INLINE CORBA::Boolean
+TAO_GIOP_Message_Generator_Parser_Impl::check_revision (
+ CORBA::Octet incoming_major,
+ CORBA::Octet incoming_minor)
+{
+ CORBA::UShort const version_as_whole_num =
+ incoming_major << 8 | incoming_minor;
+
+ CORBA::UShort const max_allowable_version =
+ TAO_DEF_GIOP_MAJOR << 8 | TAO_DEF_GIOP_MINOR;
+
+ // If it's greater than the max, we know it's not allowed.
+ if (version_as_whole_num > max_allowable_version)
+ return 0;
+
+ // If it's less than the max, though, we still have to check for
+ // each explicit version and only allow the ones we know work.
+ switch (version_as_whole_num)
+ {
+ case 0x0100:
+ case 0x0101:
+ case 0x0102:
+ return 1;
+ }
+
+ return 0;
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL