![]() |
Kea 2.2.0
|
Structure that specifies a single RdataFields field.
More...
#include <rdatafields.h>
Public Member Functions | |
| FieldSpec (Type type_param, uint16_t len_param) | |
Public Attributes | |
| uint16_t | len |
| The length of the field in bytes. More... | |
| Type | type |
| The type of the field. More... | |
Structure that specifies a single RdataFields field.
This is a straightforward pair of the type and length of a single RdataFields field.
In some cases an application may want to do deeper inspection of some RdataFields field(s). For example, an application may want to construct a Name object for each domain name field of an RDATA and use it for some special purpose. The FieldSpec structure provides necessary parameters to get access to a specific RdataFields field.
The following code snippet implements the above example scenario:
Note that the offset is not included in FieldSpec. This is because such deeper inspection would be a relatively rare operation while it is desirable to keep this structure as small as possible for the purpose of space efficiency. Also, if and when an application wants to look into a specific field, it would be quite likely that the application iterates over all fields and does something special for selected fields like the above example. In that case the application can easily and efficiently identify the necessary offset, again, as shown in the above code example.
Definition at line 206 of file rdatafields.h.
|
inline |
Definition at line 207 of file rdatafields.h.
| uint16_t isc::dns::rdata::RdataFields::FieldSpec::len |
The length of the field in bytes.
Definition at line 211 of file rdatafields.h.
Referenced by isc::dns::rdata::RdataFields::RdataFields(), and isc::dns::rdata::RdataFields::toWire().
| Type isc::dns::rdata::RdataFields::FieldSpec::type |
The type of the field.
Definition at line 210 of file rdatafields.h.