Expand description
Primitive types and core traits needed to generate and use ingot
packets.
Re-exports§
Modules§
- field
Header
equivalents for header fields accessed by reference.- header
- An abstraction layer over in-buffer and owned packets and headers.
- ip
- Minimal types for IPv4 and IPv6 addresses
- primitives
- Primitive types – integers of known endianness, and base buffer types.
- util
- Utilities for parsing more complex packet types or specific inputs.
Macros§
- zerocopy_
impls - Macro which defines
HeaderLen
andEmit
for a zerocopy-type - zerocopy_
type - Macro which declares a zerocopy-flavored type, which can be used in a field
Structs§
- Accessor
- A tool for converting zerocopy’s
Ref<_, T>
s into&T
/&mut T
based on need and input B mutability. - CRStr
- A static string which is jointly usable as a
CStr
andstr
. - CRStr
Error - Error encountered while constructing a
CRStr
(the string was not null-terminated, or was invalid UTF-8). - Packet
Parse Error - An error encountered while parsing a complete packet.
- Parsed
- Successful return value from parsing a full packet header stack
over a base packet buffer which is
Read
. - Vec
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Enums§
- Parse
Control - Action to be taken as part of an
#[ingot(control)]
block during packet parsing. - Parse
Error - An error encountered while parsing an individual header.
Traits§
- Byte
Slice - A mutable or immutable reference to a byte slice.
- Byte
Slice Mut - A mutable reference to a byte slice.
- Emit
- Serialise a network packet/header into a byte buffer.
- Emit
Does NotRely OnBuf Contents - A promise from the programmer to the compiler that an implementation
of
Emit
does not perform any reads from uninitialised memory. - HasRepr
- A type which has a corresponding static/owned representation type.
- HasView
- A type which has a corresponding view-type over any buffer
B
. - Header
Len - Base trait for header/packet types.
- Header
Parse - A header/packet type which can be unconditionally parsed from any
buffer
B
. - Into
BufPointer - Convert a byte slice into a pointer to its base.
- Into
Byte Slice - A
ByteSlice
that conveys no ownership, and so can be converted into a byte slice. - Network
Repr - Types which can be converted to and from bitstrings and byte arrays for serialisation as fields of network packets.
- Next
Layer - Headers which can be queried for a hint, used to select the next layer in a packet.
- Read
- An iterator over contiguous byte slices which can be parsed as a packet.
- Split
Byte Slice - A
ByteSlice
that can be split in two. - Split
Byte Slice Mut - A shorthand for
SplitByteSlice
andByteSliceMut
. - ToOwned
Packet - Converts a borrowed view of a header into an owned version, possibly reparsing to do so.
Type Aliases§
- Packet
Parse Result - Convenience type for fallible operations done while parsing full packets.
- Parse
Result - Convenience type for fallible operations done while parsing headers.
- Success
- Helper alias for methods which return tuples of
(header, next_layer_hint, buf_remainder)
.