senf::CheckINet4Network< address, prefix_len > Class Template Reference

Check INet4Address against a fixed network prefix. More...

#include <senf/Socket/Protocols/INet/INet4Address.hh>

List of all members.


Detailed Description

template<boost::uint32_t address, unsigned prefix_len>
class senf::CheckINet4Network< address, prefix_len >

Check INet4Address against a fixed network prefix.

This helper allows to easily and efficiently check an INet4Address against an arbitrary but constant network prefix. The network prefix is represented by

senf::CheckINet4Network< addr , prefix-len >
Where addr is the v4 Internet address as a 32-bit unsigned integer number in host byte order and prefix_len is the length of the network prefix. The class exposes a single static member match( addr ) which matches the INet4Address addr against the prefix:
if (senf::CheckINet4Network<0x7F000000u,8u>::match(addr)) {
    // 'addr' is within the 127.0.0.0/8 loopback network
    ...
}
Implementation note:
This is implemented the way it is so the syntax is identical to the CheckINet6Network syntax.

Definition at line 208 of file INet4Address.hh.


Static Public Member Functions

static bool  match (INet4Address const &addr)

Member Function Documentation

template<boost::uint32_t address, unsigned prefix_len>
bool senf::CheckINet4Network< address, prefix_len >::
match ( INet4Address const &  addr )

Definition at line 38 of file INet4Address.cti.


The documentation for this class was generated from the following files: