Kea 2.7.6
|
This class defines DNS serial numbers and serial arithmetic. More...
#include <serial.h>
Public Member Functions | |
Serial (const Serial &other) | |
Copy constructor. | |
Serial (uint32_t value) | |
Constructor with value. | |
uint32_t | getValue () const |
Returns the uint32_t representation of this serial value. | |
bool | operator!= (const Serial &other) const |
Returns true if the serial values are not equal. | |
Serial | operator+ (const Serial &other) const |
Adds the given value to the serial number. | |
Serial | operator+ (uint32_t other_val) const |
Adds the given value to the serial number. | |
bool | operator< (const Serial &other) const |
Returns true if the serial value of this serial is smaller than the other, according to serial arithmetic as described in RFC 1982. | |
bool | operator<= (const Serial &other) const |
Returns true if the serial value of this serial is equal to or smaller than the other, according to serial arithmetic as described in RFC 1982. | |
Serial & | operator= (const Serial &other) |
Direct assignment from other Serial. | |
void | operator= (uint32_t value) |
Direct assignment from value. | |
bool | operator== (const Serial &other) const |
Returns true if the serial values are equal. | |
bool | operator> (const Serial &other) const |
Returns true if the serial value of this serial is greater than the other, according to serial arithmetic as described in RFC 1982. | |
bool | operator>= (const Serial &other) const |
Returns true if the serial value of this serial is equal to or greater than the other, according to serial arithmetic as described in RFC 1982. | |
This class defines DNS serial numbers and serial arithmetic.
DNS Serial number are in essence unsigned 32-bits numbers, with one catch; they should be compared using sequence space arithmetic. So given that they are 32-bits; as soon as the difference between two serial numbers is greater than 2147483647 (2^31 - 1), the lower number (in plain comparison) is considered the higher one.
In order to do this as transparently as possible, these numbers are stored in the Serial class, which overrides the basic comparison operators.
In this specific context, these operations are called 'serial number arithmetic', and they are defined in RFC 1982.
|
inlineexplicit |
Constructor with value.
value | The uint32_t value of the serial |
Definition at line 46 of file serial.h.
Referenced by operator+().
|
inline |
|
inline |
Returns the uint32_t representation of this serial value.
Definition at line 67 of file serial.h.
Referenced by operator!=(), operator+(), operator<(), isc::dns::operator<<(), operator=(), and operator==().
bool isc::dns::Serial::operator!= | ( | const Serial & | other | ) | const |
Returns true if the serial values are not equal.
Definition at line 20 of file serial.cc.
References getValue().
Adds the given value to the serial number.
If this would make the number greater than 2^32-1, it is 'wrapped'.
other | The Serial to add |
Definition at line 59 of file serial.cc.
References getValue().
Serial isc::dns::Serial::operator+ | ( | uint32_t | other_val | ) | const |
Adds the given value to the serial number.
If this would make the number greater than 2^32-1, it is 'wrapped'.
other_val | The uint32_t value to add |
Definition at line 52 of file serial.cc.
References Serial(), and isc::dns::MAX_SERIAL_VALUE.
bool isc::dns::Serial::operator< | ( | const Serial & | other | ) | const |
Returns true if the serial value of this serial is smaller than the other, according to serial arithmetic as described in RFC 1982.
other | The Serial to compare to |
Definition at line 24 of file serial.cc.
References getValue(), and isc::dns::MAX_SERIAL_INCREMENT.
bool isc::dns::Serial::operator<= | ( | const Serial & | other | ) | const |
Direct assignment from other Serial.
other | The Serial to assign the value from |
Definition at line 54 of file serial.h.
References getValue().
|
inline |
bool isc::dns::Serial::operator== | ( | const Serial & | other | ) | const |
Returns true if the serial values are equal.
Definition at line 15 of file serial.cc.
References getValue().
bool isc::dns::Serial::operator> | ( | const Serial & | other | ) | const |
bool isc::dns::Serial::operator>= | ( | const Serial & | other | ) | const |