pub struct FieldSpecifier {
pub information_element_identifier: u16,
pub field_length: u16,
pub enterprise_number: Option<u32>,
}Expand description
Field Specifier - RFC 7011 Section 3.2
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| Information Element ident. | Field Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Enterprise Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+The Enterprise bit (E) is not stored separately: it is set if and only if
enterprise_number is Some.
Fields§
§information_element_identifier: u16Information Element identifier (15 bits, Enterprise bit removed)
field_length: u16Length of the encoded Information Element, in octets.
VARIABLE_LENGTH (65535) means variable-length.
enterprise_number: Option<u32>IANA Private Enterprise Number, present if the Enterprise bit is set
Implementations§
Source§impl FieldSpecifier
impl FieldSpecifier
Sourcepub const VARIABLE_LENGTH: u16 = 65535
pub const VARIABLE_LENGTH: u16 = 65535
Field Length value reserved for variable-length Information Elements (RFC 7011 Section 7)
Sourcepub fn is_variable_length(&self) -> bool
pub fn is_variable_length(&self) -> bool
Whether the Information Element is variable-length
Sourcepub fn is_reverse(&self) -> bool
pub fn is_reverse(&self) -> bool
Whether the Field Specifier refers to a reverse Information Element (RFC 5103, Private Enterprise Number 29305)
Sourcepub fn information_element(&self) -> Option<&'static InformationElement>
pub fn information_element(&self) -> Option<&'static InformationElement>
The IANA Information Element this Field Specifier refers to.
For reverse Information Elements (RFC 5103), the forward Information
Element is returned. RFC 5103 Section 6.1 lets a Collecting Process
discard the reverse counterpart of a non-reversible element; this
parser keeps and decodes it instead. Returns None for
enterprise-specific or unknown Information Elements.