Classes

struct  senf::Int8Parser
 Parse 8bit signed byte aligned integer. More...
 
struct  senf::UInt8Parser
 Parse 8bit unsigned byte aligned integer. More...
 
struct  senf::Int16Parser
 Parse 16bit signed byte aligned integer. More...
 
struct  senf::Int16LSBParser
 Parse 16bit signed byte aligned integer LSB. More...
 
struct  senf::UInt16Parser
 Parse 16bit unsigned byte aligned integer. More...
 
struct  senf::UInt16LSBParser
 Parse 16bit unsigned byte aligned integer LSB. More...
 
struct  senf::Int24Parser
 Parse 24bit signed byte aligned integer. More...
 
struct  senf::UInt24Parser
 Parse 24bit unsigned byte aligned integer. More...
 
struct  senf::Int32Parser
 Parse 32bit signed byte aligned integer. More...
 
struct  senf::UInt32Parser
 Parse 32bit unsigned byte aligned integer. More...
 
struct  senf::Int64Parser
 Parse 64bit signed byte aligned integer. More...
 
struct  senf::UInt64Parser
 Parse 64bit unsigned byte aligned integer. More...
 
struct  senf::UInt64LSBParser
 Parse 64bit unsigned byte aligned integer LSB. More...
 
struct  senf::IntFieldParser< Start, End >
 Parse signed bitfield with up to 32bit's. More...
 
struct  senf::UIntFieldParser< Start, End >
 Parse unsigned bitfield with up to 32bit's. More...
 
struct  senf::FlagParser< Bit >
 Parse single-bit flag. More...
 

Detailed Description

Most packet fields will ultimately contain some type of integral number. The integer parsers allow to parse arbitrary integers in network byte order from 1-32 bit, both signed and unsigned. There are two types of integer parsers:

  • The normal integer parsers with interpret 1-4 byte integers (9, 16, 24, 32 bits) aligned at byte boundaries.
  • The bitfield parsers which parse integers with 1-32 bits aligned at any bit. A special case is the single bit flag parser.

All fields are parsed in network byte order, the return value of all these parsers is the value in host byte order.

The interface of all these parsers is the same (p is an arbitrary integer parser instance, v is an integer constant):

  • p = v: Assigns the value to the packet field.
  • p.value(v): same as above.
  • p.value(): Returns the fields value as an integer number.
  • Use of p like an integer in most contexts: p += v, p *= v, v = p 1 and so on. You will only need to use the explicit value() member in rare circumstances when the automatic conversion is ambiguous or in some template contexts.