Skip to content
Snippets Groups Projects
Commit 54ae0117 authored by tho's avatar tho
Browse files

Packets/80221Bundle: added handy SENF_MIH_PACKET_REGISTRY_REGISTER define

parent 49a0cb08
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,18 @@ ...@@ -40,7 +40,18 @@
///////////////////////////////hh.p//////////////////////////////////////// ///////////////////////////////hh.p////////////////////////////////////////
namespace senf { namespace senf {
struct MIHMessageRegistry {
// MIH messages registry
typedef boost::uint16_t key_t;
};
# define SENF_MIH_PACKET_REGISTRY_REGISTER( sid, opcode, aid, type ) \
SENF_PACKET_REGISTRY_REGISTER( \
senf::MIHMessageRegistry, \
boost::uint16_t((boost::uint16_t(sid) << 12) | (boost::uint16_t(opcode) << 10) | aid), \
type )
/** \brief Parse a MIHF_ID /** \brief Parse a MIHF_ID
the maximum length of a MIHF_ID is 253 octets (see F.3.11 in 802.21) the maximum length of a MIHF_ID is 253 octets (see F.3.11 in 802.21)
...@@ -97,12 +108,7 @@ namespace senf { ...@@ -97,12 +108,7 @@ namespace senf {
return boost::make_filter_iterator<binaryNAIDecoder>(begin, end); return boost::make_filter_iterator<binaryNAIDecoder>(begin, end);
} }
}; };
struct MIHMessageRegistry {
// MIH messages registry
typedef boost::uint16_t key_t;
};
/** \brief Parse a MIH packet /** \brief Parse a MIH packet
Parser implementing the MIH header. The fields implemented are: Parser implementing the MIH header. The fields implemented are:
...@@ -178,6 +184,8 @@ namespace senf { ...@@ -178,6 +184,8 @@ namespace senf {
static void dump(packet p, std::ostream &os); static void dump(packet p, std::ostream &os);
static void finalize(packet p); static void finalize(packet p);
static factory_t nextPacketType(packet p); static factory_t nextPacketType(packet p);
enum ResponseStatus { Success, UnspecifiedFailure, Rejected, AuthorizationFailure, NetworkError };
}; };
/** \brief MIH packet typedef */ /** \brief MIH packet typedef */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment