Documentation ¶
Index ¶
- type ASEntry
- type HopEntry
- type Meta
- type PathSegment
- func (ps *PathSegment) AddASEntry(ase *ASEntry, signType proto.SignType, signSrc common.RawBytes) error
- func (ps *PathSegment) ContainsInterface(ia addr.IA, ifid common.IFIDType) bool
- func (ps *PathSegment) FirstIA() addr.IA
- func (ps *PathSegment) ID() (common.RawBytes, error)
- func (ps *PathSegment) InfoF() (*spath.InfoField, error)
- func (ps *PathSegment) LastIA() addr.IA
- func (ps *PathSegment) MaxAEIdx() int
- func (ps *PathSegment) MaxExpiry() time.Time
- func (ps *PathSegment) MinExpiry() time.Time
- func (ps *PathSegment) Pack() (common.RawBytes, error)
- func (ps *PathSegment) ParseRaw() error
- func (ps *PathSegment) ProtoId() proto.ProtoIdType
- func (ps *PathSegment) RawWriteTo(w io.Writer) (int64, error)
- func (ps *PathSegment) SignLastASEntry(key common.RawBytes) error
- func (ps *PathSegment) String() string
- func (ps *PathSegment) Validate() error
- func (ps *PathSegment) VerifyASEntry(key common.RawBytes, idx int) error
- func (ps *PathSegment) WalkHopEntries() error
- func (ps *PathSegment) Write(b common.RawBytes) (int, error)
- type PathSegmentSignedData
- type Segments
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASEntry ¶
type ASEntry struct { RawIA addr.IAInt `capnp:"isdas"` TrcVer uint64 CertVer uint64 IfIDSize uint8 HopEntries []*HopEntry `capnp:"hops"` MTU uint16 `capnp:"mtu"` Exts struct { RoutingPolicy common.RawBytes `capnp:"-"` // Not supported yet Sibra common.RawBytes `capnp:"-"` // Not supported yet } }
func (*ASEntry) ProtoId ¶
func (ase *ASEntry) ProtoId() proto.ProtoIdType
type HopEntry ¶
type Meta ¶
type Meta struct { Type proto.PathSegType Segment *PathSegment `capnp:"pathSeg"` }
func NewMeta ¶ added in v0.3.0
func NewMeta(s *PathSegment, t proto.PathSegType) *Meta
type PathSegment ¶
type PathSegment struct { RawSData common.RawBytes `capnp:"sdata"` SData *PathSegmentSignedData `capnp:"-"` RawASEntries []*proto.SignedBlobS `capnp:"asEntries"` ASEntries []*ASEntry `capnp:"-"` // contains filtered or unexported fields }
func NewSegFromRaw ¶
func NewSegFromRaw(b common.RawBytes) (*PathSegment, error)
func (*PathSegment) AddASEntry ¶
func (*PathSegment) ContainsInterface ¶
func (*PathSegment) FirstIA ¶ added in v0.3.0
func (ps *PathSegment) FirstIA() addr.IA
FirstIA returns the IA of the first ASEntry. Note that if the seg contains no ASEntries this method will panic.
func (*PathSegment) LastIA ¶ added in v0.3.0
func (ps *PathSegment) LastIA() addr.IA
LastIA returns the IA of the last ASEntry. Note that if the seg contains no ASEntries this method will panic.
func (*PathSegment) MaxAEIdx ¶
func (ps *PathSegment) MaxAEIdx() int
func (*PathSegment) MaxExpiry ¶ added in v0.3.0
func (ps *PathSegment) MaxExpiry() time.Time
MaxExpiry returns the maximum expiry of all hop fields. Assumes segment is validated.
func (*PathSegment) MinExpiry ¶ added in v0.3.0
func (ps *PathSegment) MinExpiry() time.Time
MinExpiry returns the minimum expiry of all hop fields. Assumes segment is validated.
func (*PathSegment) ParseRaw ¶
func (ps *PathSegment) ParseRaw() error
func (*PathSegment) ProtoId ¶
func (ps *PathSegment) ProtoId() proto.ProtoIdType
func (*PathSegment) RawWriteTo ¶ added in v0.3.0
func (ps *PathSegment) RawWriteTo(w io.Writer) (int64, error)
RawWriteTo writes the PathSegment to the writer in a form that is understood by spath/Path.
func (*PathSegment) SignLastASEntry ¶
func (ps *PathSegment) SignLastASEntry(key common.RawBytes) error
func (*PathSegment) String ¶
func (ps *PathSegment) String() string
func (*PathSegment) Validate ¶
func (ps *PathSegment) Validate() error
func (*PathSegment) VerifyASEntry ¶
func (ps *PathSegment) VerifyASEntry(key common.RawBytes, idx int) error
func (*PathSegment) WalkHopEntries ¶
func (ps *PathSegment) WalkHopEntries() error
WalkHopEntries iterates through the hop entries of asEntries, checking that the hop fields within can be parsed. If an parse error is found, the function immediately returns with an error.
type PathSegmentSignedData ¶
func NewPathSegmentSignedDataFromRaw ¶
func NewPathSegmentSignedDataFromRaw(b common.RawBytes) (*PathSegmentSignedData, error)
func (*PathSegmentSignedData) InfoF ¶
func (pss *PathSegmentSignedData) InfoF() (*spath.InfoField, error)
func (*PathSegmentSignedData) ProtoId ¶
func (pss *PathSegmentSignedData) ProtoId() proto.ProtoIdType
func (*PathSegmentSignedData) String ¶
func (pss *PathSegmentSignedData) String() string
func (*PathSegmentSignedData) Validate ¶ added in v0.3.0
func (pss *PathSegmentSignedData) Validate() error
type Segments ¶ added in v0.3.0
type Segments []*PathSegment
Segments is just a helper type to have additional methods on top of a slice of PathSegments.
func (*Segments) FilterSegs ¶ added in v0.3.0
func (segs *Segments) FilterSegs(keep func(*PathSegment) bool)
FilterSegs filters the given segs and only keeps the segments for which keep returns true. Modifies segs in-place.