Documentation ¶
Index ¶
- Constants
- type HopField
- func (h *HopField) CalcMac(mac hash.Hash, tsInt uint32, prev common.RawBytes) (common.RawBytes, error)
- func (h *HopField) Len() int
- func (h *HopField) String() string
- func (h *HopField) Verify(mac hash.Hash, tsInt uint32, prev common.RawBytes) error
- func (h *HopField) Write()
- func (h *HopField) WriteTo(w io.Writer) (int64, error)
- type InfoField
- type Path
Constants ¶
View Source
const ( HopFieldLength = common.LineLen DefaultHopFExpiry = 63 MacLen = 3 ErrorHopFTooShort = "HopF too short" ErrorHopFBadMac = "Bad HopF MAC" XoverMask = 0x01 VerifyOnlyMask = 0x02 RecurseMask = 0x04 )
View Source
const ( InfoFieldLength = common.LineLen ErrorInfoFTooShort = "InfoF too short" )
View Source
const ( MaxTTL = 24 * 60 * 60 // One day in seconds ExpTimeUnit = MaxTTL / (1 << 8) MaxTimestamp = ^uint32(0) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HopField ¶
type HopField struct { Xover bool VerifyOnly bool Recurse bool ExpTime uint8 ConsIngress common.IFIDType ConsEgress common.IFIDType Mac common.RawBytes // contains filtered or unexported fields }
func HopFFromRaw ¶
HopFFromRaw returns a HopField object from the raw content in b.
The new HopField object takes ownership of the first HopFieldLength bytes in b. Changing fields in the new object and calling Write will mutate the initial bytes in b.
func NewHopField ¶
func (*HopField) CalcMac ¶
func (h *HopField) CalcMac(mac hash.Hash, tsInt uint32, prev common.RawBytes) (common.RawBytes, error)
CalcMac calculates the MAC of a Hop Field and its preceeding Hop Field, if any.
type InfoField ¶
type InfoField struct { // Previously Up, ConsDir = !Up ConsDir bool Shortcut bool Peer bool TsInt uint32 ISD uint16 Hops uint8 }
func InfoFFromRaw ¶
type Path ¶
type Path struct { Raw common.RawBytes InfOff int // Offset of current Info Field HopOff int // Offset of current Hop Field }
func (*Path) IncOffsets ¶
IncOffsets updates the info and hop indices to the next routing field, while skipping verify only fields.
func (*Path) InitOffsets ¶
InitOffsets computes the initial Hop Field offset (in bytes) for a newly created packet.
Click to show internal directories.
Click to hide internal directories.