4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Thorsten Horstmann <tho@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief MIH protocol inline non-template implementation */
26 //#include "MIHPacket.ih"
30 #define prefix_ inline
31 ///////////////////////////////cci.p////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
35 prefix_ senf::MIHFId::MIHFId()
36 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
37 senf::INet6Address, std::string, senf::EUI64 > ( boost::blank())
40 prefix_ senf::MIHFId::MIHFId(senf::MACAddress const & addr)
41 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
42 senf::INet6Address, std::string, senf::EUI64 > ( addr)
45 prefix_ senf::MIHFId::MIHFId(senf::INet4Address const & addr)
46 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
47 senf::INet6Address, std::string, senf::EUI64 > ( addr)
50 prefix_ senf::MIHFId::MIHFId(senf::INet6Address const & addr)
51 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
52 senf::INet6Address, std::string, senf::EUI64 > ( addr)
55 prefix_ senf::MIHFId::MIHFId(std::string const & addr)
56 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
57 senf::INet6Address, std::string, senf::EUI64 > ( addr)
60 prefix_ senf::MIHFId::MIHFId(senf::EUI64 const & addr)
61 : boost::variant< boost::blank, senf::MACAddress, senf::INet4Address,
62 senf::INet6Address, std::string, senf::EUI64 > ( addr)
65 prefix_ senf::MIHFId::Type senf::MIHFId::type()
68 return boost::apply_visitor( GetTypeVisitor(), *this );
71 prefix_ bool senf::MIHFId::operator==(senf::MIHFId const & other)
74 return boost::apply_visitor( EqualsVisitor(), *this, other);
77 prefix_ bool senf::MIHFId::operator<(senf::MIHFId const & other)
80 if (type() != other.type()) return type() < other.type();
81 return boost::apply_visitor( LessThanVisitor(), *this, other);
84 ///////////////////////////////////////////////////////////////////////////
87 prefix_ std::string senf::MIHFId_TLVParser::asString()
90 return std::string( i(1+length_bytes()), i(1+length_bytes()+length()) );
93 prefix_ senf::MACAddress senf::MIHFId_TLVParser::asMACAddress()
96 return MACAddress::from_data(
97 getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+12) ));
100 prefix_ senf::INet4Address senf::MIHFId_TLVParser::asINet4Address()
103 return INet4Address::from_data(
104 getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+8) ));
107 prefix_ senf::INet6Address senf::MIHFId_TLVParser::asINet6Address()
110 return INet6Address::from_data(
111 getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+32) ));
114 prefix_ senf::EUI64 senf::MIHFId_TLVParser::asEUI64()
117 return EUI64::from_data(
118 getNAIDecodedIterator( i(1+length_bytes()), i(1+length_bytes()+16) ));
121 ///////////////////////////////cci.e////////////////////////////////////////
128 // c-file-style: "senf"
129 // indent-tabs-mode: nil
130 // ispell-local-dictionary: "american"
131 // compile-command: "scons -u test"
132 // comment-column: 40