00001 // -*- C++ -*- 00002 // 00003 //$Id: GIOP_Message_Generator_Parser_Impl.inl 74110 2006-08-18 09:09:57Z johnnyw $ 00004 00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 ACE_INLINE CORBA::Boolean 00008 TAO_GIOP_Message_Generator_Parser_Impl::check_revision ( 00009 CORBA::Octet incoming_major, 00010 CORBA::Octet incoming_minor) 00011 { 00012 CORBA::UShort const version_as_whole_num = 00013 incoming_major << 8 | incoming_minor; 00014 00015 CORBA::UShort const max_allowable_version = 00016 TAO_DEF_GIOP_MAJOR << 8 | TAO_DEF_GIOP_MINOR; 00017 00018 // If it's greater than the max, we know it's not allowed. 00019 if (version_as_whole_num > max_allowable_version) 00020 return false; 00021 00022 // If it's less than the max, though, we still have to check for 00023 // each explicit version and only allow the ones we know work. 00024 switch (version_as_whole_num) 00025 { 00026 case 0x0100: 00027 case 0x0101: 00028 case 0x0102: 00029 return true; 00030 } 00031 00032 return false; 00033 } 00034 00035 TAO_END_VERSIONED_NAMESPACE_DECL