friendev EtherDune TCP/IP library
Public Member Functions | Public Attributes | List of all members
nint16_t Union Reference

Represents a network byte order 16 bit integer. More...

#include <inet.h>

Public Member Functions

 operator uint16_t ()
 Converts the underlying network-order integer to little endian. More...
 
void operator= (uint16_t v)
 Assigns a little endian value to this network-order integer More...
 
void zero ()
 sets the variable to 0. More...
 

Public Attributes

uint16_t rawValue
 provides low level access to the memory containing the network-order integer More...
 
struct {
   uint8_t   h
 most significant byte More...
 
   uint8_t   l
 least significant byte More...
 
}; 
 

Detailed Description

Represents a network byte order 16 bit integer.

Includes overloaded operators so as to make conversion to/from network byte order transparent

Definition at line 59 of file inet.h.

Member Function Documentation

nint16_t::operator uint16_t ( )
inline

Converts the underlying network-order integer to little endian.

Returns
uint16_t equivalent of the network-order integer

Definition at line 74 of file inet.h.

void nint16_t::operator= ( uint16_t  v)
inline

Assigns a little endian value to this network-order integer

Parameters
vvalue to assign

Definition at line 87 of file inet.h.

void nint16_t::zero ( )
inline

sets the variable to 0.

Definition at line 97 of file inet.h.

Member Data Documentation

struct { ... }
uint8_t nint16_t::h

most significant byte

Definition at line 64 of file inet.h.

uint8_t nint16_t::l

least significant byte

Definition at line 65 of file inet.h.

uint16_t nint16_t::rawValue

provides low level access to the memory containing the network-order integer

Definition at line 61 of file inet.h.


The documentation for this union was generated from the following file: