Versions in this module Expand all Collapse all v0 v0.9.1 May 20, 2022 Changes in this version + const AdminRecordTypeStatusReport + const ExtBlockTypeBinarySprayBlock + const ExtBlockTypeBundleAgeBlock + const ExtBlockTypeDTLSRBlock + const ExtBlockTypeHopCountBlock + const ExtBlockTypePayloadBlock + const ExtBlockTypePreviousNodeBlock + const ExtBlockTypeProphetBlock + const ExtBlockTypeSignatureBlock + func IsBundleReassemblable(bs []Bundle) bool + type AdministrativeRecord interface + RecordTypeCode func() uint64 + func NewAdministrativeRecordFromCbor(data []byte) (ar AdministrativeRecord, err error) + type AdministrativeRecordManager struct + func GetAdministrativeRecordManager() *AdministrativeRecordManager + func NewAdministrativeRecordManager() *AdministrativeRecordManager + func (arm *AdministrativeRecordManager) IsKnown(typeCode uint64) (known bool) + func (arm *AdministrativeRecordManager) ReadAdministrativeRecord(r io.Reader) (ar AdministrativeRecord, err error) + func (arm *AdministrativeRecordManager) Register(ar AdministrativeRecord) (err error) + func (arm *AdministrativeRecordManager) Unregister(ar AdministrativeRecord) + func (arm *AdministrativeRecordManager) WriteAdministrativeRecord(ar AdministrativeRecord, w io.Writer) (err error) + type BinarySprayBlock uint64 + func NewBinarySprayBlock(copies uint64) *BinarySprayBlock + func (bsb *BinarySprayBlock) BlockTypeCode() uint64 + func (bsb *BinarySprayBlock) BlockTypeName() string + func (bsb *BinarySprayBlock) CheckValid() error + func (bsb *BinarySprayBlock) MarshalCbor(w io.Writer) error + func (bsb *BinarySprayBlock) RemainingCopies() uint64 + func (bsb *BinarySprayBlock) SetCopies(newValue uint64) + func (bsb *BinarySprayBlock) UnmarshalCbor(r io.Reader) error + type BlockControlFlags uint64 + const DeleteBundle + const RemoveBlock + const ReplicateBlock + const StatusReportBlock + func (bcf BlockControlFlags) CheckValid() error + func (bcf BlockControlFlags) Has(flag BlockControlFlags) bool + func (bcf BlockControlFlags) MarshalJSON() ([]byte, error) + func (bcf BlockControlFlags) String() string + func (bcf BlockControlFlags) Strings() (fields []string) + type Bundle struct + CanonicalBlocks []CanonicalBlock + PrimaryBlock PrimaryBlock + func BuildFromMap(m map[string]interface{}) (bndl Bundle, err error) + func MustNewBundle(primary PrimaryBlock, canonicals []CanonicalBlock) (b Bundle) + func NewBundle(primary PrimaryBlock, canonicals []CanonicalBlock) (b Bundle, err error) + func ParseBundle(r io.Reader) (b Bundle, err error) + func ReassembleFragments(bs []Bundle) (b Bundle, err error) + func (b *Bundle) AddExtensionBlock(block CanonicalBlock) error + func (b *Bundle) ExtensionBlock(blockType uint64) (*CanonicalBlock, error) + func (b *Bundle) HasExtensionBlock(blockType uint64) bool + func (b *Bundle) MarshalCbor(w io.Writer) error + func (b *Bundle) PayloadBlock() (*CanonicalBlock, error) + func (b *Bundle) RemoveExtensionBlockByBlockNumber(blockNumber uint64) + func (b *Bundle) SetCRCType(crcType CRCType) + func (b *Bundle) UnmarshalCbor(r io.Reader) error + func (b *Bundle) WriteBundle(w io.Writer) error + func (b Bundle) AdministrativeRecord() (AdministrativeRecord, error) + func (b Bundle) CheckValid() (errs error) + func (b Bundle) Fragment(mtu int) (bs []Bundle, err error) + func (b Bundle) ID() BundleID + func (b Bundle) IsAdministrativeRecord() bool + func (b Bundle) IsLifetimeExceeded() bool + func (b Bundle) MarshalJSON() ([]byte, error) + func (b Bundle) String() string + type BundleAgeBlock uint64 + func NewBundleAgeBlock(ms uint64) *BundleAgeBlock + func (bab *BundleAgeBlock) Age() uint64 + func (bab *BundleAgeBlock) BlockTypeCode() uint64 + func (bab *BundleAgeBlock) BlockTypeName() string + func (bab *BundleAgeBlock) CheckValid() error + func (bab *BundleAgeBlock) Increment(offset uint64) uint64 + func (bab *BundleAgeBlock) MarshalCbor(w io.Writer) error + func (bab *BundleAgeBlock) MarshalJSON() ([]byte, error) + func (bab *BundleAgeBlock) UnmarshalCbor(r io.Reader) error + type BundleBuilder struct + func Builder() *BundleBuilder + func (bldr *BundleBuilder) AdministrativeRecord(ar AdministrativeRecord) *BundleBuilder + func (bldr *BundleBuilder) Build() (bndl Bundle, err error) + func (bldr *BundleBuilder) BundleAgeBlock(args ...interface{}) *BundleBuilder + func (bldr *BundleBuilder) BundleCtrlFlags(bcf BundleControlFlags) *BundleBuilder + func (bldr *BundleBuilder) CRC(crcType CRCType) *BundleBuilder + func (bldr *BundleBuilder) Canonical(args ...interface{}) *BundleBuilder + func (bldr *BundleBuilder) CreationTimestampEpoch() *BundleBuilder + func (bldr *BundleBuilder) CreationTimestampNow() *BundleBuilder + func (bldr *BundleBuilder) CreationTimestampTime(t time.Time) *BundleBuilder + func (bldr *BundleBuilder) Destination(eid interface{}) *BundleBuilder + func (bldr *BundleBuilder) Error() error + func (bldr *BundleBuilder) HopCountBlock(args ...interface{}) *BundleBuilder + func (bldr *BundleBuilder) Lifetime(duration interface{}) *BundleBuilder + func (bldr *BundleBuilder) PayloadBlock(args ...interface{}) *BundleBuilder + func (bldr *BundleBuilder) PreviousNodeBlock(args ...interface{}) *BundleBuilder + func (bldr *BundleBuilder) ReportTo(eid interface{}) *BundleBuilder + func (bldr *BundleBuilder) Source(eid interface{}) *BundleBuilder + func (bldr *BundleBuilder) StatusReport(args ...interface{}) *BundleBuilder + type BundleControlFlags uint64 + const AdministrativeRecordPayload + const IsFragment + const MustNotFragmented + const RequestStatusTime + const RequestUserApplicationAck + const StatusRequestDeletion + const StatusRequestDelivery + const StatusRequestForward + const StatusRequestReception + func (bcf BundleControlFlags) CheckValid() (errs error) + func (bcf BundleControlFlags) Has(flag BundleControlFlags) bool + func (bcf BundleControlFlags) MarshalJSON() ([]byte, error) + func (bcf BundleControlFlags) String() string + func (bcf BundleControlFlags) Strings() (fields []string) + type BundleID struct + FragmentOffset uint64 + IsFragment bool + SourceNode EndpointID + Timestamp CreationTimestamp + TotalDataLength uint64 + func (bid *BundleID) MarshalCbor(w io.Writer) error + func (bid *BundleID) UnmarshalCbor(r io.Reader) error + func (bid BundleID) Len() uint64 + func (bid BundleID) Scrub() BundleID + func (bid BundleID) String() string + type BundleStatusItem struct + Asserted bool + StatusRequested bool + Time DtnTime + func NewBundleStatusItem(asserted bool) BundleStatusItem + func NewTimeReportingBundleStatusItem(time DtnTime) BundleStatusItem + func (bsi *BundleStatusItem) MarshalCbor(w io.Writer) error + func (bsi *BundleStatusItem) UnmarshalCbor(r io.Reader) error + func (bsi BundleStatusItem) String() string + type CRCType uint64 + const CRC16 + const CRC32 + const CRCNo + func (c CRCType) String() string + type CanonicalBlock struct + BlockControlFlags BlockControlFlags + BlockNumber uint64 + CRC []byte + CRCType CRCType + Value ExtensionBlock + func AdministrativeRecordToCbor(ar AdministrativeRecord) (blk CanonicalBlock, err error) + func NewCanonicalBlock(no uint64, bcf BlockControlFlags, value ExtensionBlock) CanonicalBlock + func (cb *CanonicalBlock) MarshalCbor(w io.Writer) error + func (cb *CanonicalBlock) SetCRCType(crcType CRCType) + func (cb *CanonicalBlock) UnmarshalCbor(r io.Reader) error + func (cb CanonicalBlock) CheckValid() (errs error) + func (cb CanonicalBlock) GetCRCType() CRCType + func (cb CanonicalBlock) HasCRC() bool + func (cb CanonicalBlock) MarshalJSON() ([]byte, error) + func (cb CanonicalBlock) String() string + func (cb CanonicalBlock) TypeCode() uint64 + type CreationTimestamp [2]uint64 + func NewCreationTimestamp(time DtnTime, sequence uint64) CreationTimestamp + func (ct *CreationTimestamp) MarshalCbor(w io.Writer) error + func (ct *CreationTimestamp) UnmarshalCbor(r io.Reader) error + func (ct CreationTimestamp) DtnTime() DtnTime + func (ct CreationTimestamp) IsZeroTime() bool + func (ct CreationTimestamp) MarshalJSON() ([]byte, error) + func (ct CreationTimestamp) SequenceNumber() uint64 + func (ct CreationTimestamp) String() string + type DTLSRBlock DTLSRPeerData + func NewDTLSRBlock(data DTLSRPeerData) *DTLSRBlock + func (dtlsrb *DTLSRBlock) BlockTypeCode() uint64 + func (dtlsrb *DTLSRBlock) BlockTypeName() string + func (dtlsrb *DTLSRBlock) CheckValid() error + func (dtlsrb *DTLSRBlock) GetPeerData() DTLSRPeerData + func (dtlsrb *DTLSRBlock) MarshalCbor(w io.Writer) error + func (dtlsrb *DTLSRBlock) UnmarshalCbor(r io.Reader) error + type DTLSRPeerData struct + ID EndpointID + Peers map[EndpointID]DtnTime + Timestamp DtnTime + func (pd DTLSRPeerData) ShouldReplace(other DTLSRPeerData) bool + type DtnEndpoint struct + Demux string + IsDtnNone bool + NodeName string + func (_ DtnEndpoint) SchemeName() string + func (_ DtnEndpoint) SchemeNo() uint64 + func (e *DtnEndpoint) UnmarshalCbor(r io.Reader) error + func (e DtnEndpoint) Authority() string + func (e DtnEndpoint) CheckValid() (err error) + func (e DtnEndpoint) IsSingleton() bool + func (e DtnEndpoint) MarshalCbor(w io.Writer) error + func (e DtnEndpoint) Path() string + func (e DtnEndpoint) String() string + type DtnTime uint64 + const DtnTimeEpoch + func DtnTimeFromTime(t time.Time) DtnTime + func DtnTimeNow() DtnTime + func (t DtnTime) String() string + func (t DtnTime) Time() time.Time + type EndpointID struct + EndpointType EndpointType + func DtnNone() EndpointID + func MustNewEndpointID(uri string) EndpointID + func NewEndpointID(uri string) (e EndpointID, err error) + func (eid *EndpointID) MarshalCbor(w io.Writer) error + func (eid *EndpointID) UnmarshalCbor(r io.Reader) error + func (eid EndpointID) Authority() string + func (eid EndpointID) CheckValid() error + func (eid EndpointID) IsSingleton() bool + func (eid EndpointID) MarshalJSON() ([]byte, error) + func (eid EndpointID) Path() string + func (eid EndpointID) SameNode(other EndpointID) bool + func (eid EndpointID) String() string + type EndpointType interface + Authority func() string + IsSingleton func() bool + MarshalCbor func(io.Writer) error + Path func() string + SchemeName func() string + SchemeNo func() uint64 + func NewDtnEndpoint(uri string) (e EndpointType, err error) + func NewIpnEndpoint(uri string) (e EndpointType, err error) + type ExtensionBlock interface + BlockTypeCode func() uint64 + BlockTypeName func() string + type ExtensionBlockManager struct + func GetExtensionBlockManager() *ExtensionBlockManager + func NewExtensionBlockManager() *ExtensionBlockManager + func (ebm *ExtensionBlockManager) IsKnown(typeCode uint64) bool + func (ebm *ExtensionBlockManager) ReadBlock(typeCode uint64, r io.Reader) (b ExtensionBlock, err error) + func (ebm *ExtensionBlockManager) Register(eb ExtensionBlock) error + func (ebm *ExtensionBlockManager) Unregister(eb ExtensionBlock) + func (ebm *ExtensionBlockManager) WriteBlock(b ExtensionBlock, w io.Writer) error + type GenericExtensionBlock struct + func NewGenericExtensionBlock(data []byte, typeCode uint64) *GenericExtensionBlock + func (geb *GenericExtensionBlock) BlockTypeCode() uint64 + func (geb *GenericExtensionBlock) BlockTypeName() string + func (geb *GenericExtensionBlock) CheckValid() error + func (geb *GenericExtensionBlock) MarshalBinary() ([]byte, error) + func (geb *GenericExtensionBlock) UnmarshalBinary(data []byte) error + type HopCountBlock struct + Count uint8 + Limit uint8 + func NewHopCountBlock(limit uint8) *HopCountBlock + func (hcb *HopCountBlock) BlockTypeCode() uint64 + func (hcb *HopCountBlock) BlockTypeName() string + func (hcb *HopCountBlock) CheckValid() error + func (hcb *HopCountBlock) Decrement() + func (hcb *HopCountBlock) Increment() bool + func (hcb *HopCountBlock) MarshalCbor(w io.Writer) error + func (hcb *HopCountBlock) MarshalJSON() ([]byte, error) + func (hcb *HopCountBlock) UnmarshalCbor(r io.Reader) error + func (hcb HopCountBlock) IsExceeded() bool + type IpnEndpoint struct + Node uint64 + Service uint64 + func (_ IpnEndpoint) IsSingleton() bool + func (e *IpnEndpoint) UnmarshalCbor(r io.Reader) error + func (e IpnEndpoint) Authority() string + func (e IpnEndpoint) CheckValid() error + func (e IpnEndpoint) MarshalCbor(w io.Writer) error + func (e IpnEndpoint) Path() string + func (e IpnEndpoint) SchemeName() string + func (e IpnEndpoint) SchemeNo() uint64 + func (e IpnEndpoint) String() string + type PayloadBlock []byte + func NewPayloadBlock(data []byte) *PayloadBlock + func (pb *PayloadBlock) BlockTypeCode() uint64 + func (pb *PayloadBlock) BlockTypeName() string + func (pb *PayloadBlock) CheckValid() error + func (pb *PayloadBlock) Data() []byte + func (pb *PayloadBlock) MarshalBinary() ([]byte, error) + func (pb *PayloadBlock) MarshalJSON() ([]byte, error) + func (pb *PayloadBlock) UnmarshalBinary(data []byte) error + type PreviousNodeBlock EndpointID + func NewPreviousNodeBlock(prev EndpointID) *PreviousNodeBlock + func (pnb *PreviousNodeBlock) BlockTypeCode() uint64 + func (pnb *PreviousNodeBlock) BlockTypeName() string + func (pnb *PreviousNodeBlock) CheckValid() error + func (pnb *PreviousNodeBlock) Endpoint() EndpointID + func (pnb *PreviousNodeBlock) MarshalCbor(w io.Writer) error + func (pnb *PreviousNodeBlock) MarshalJSON() ([]byte, error) + func (pnb *PreviousNodeBlock) UnmarshalCbor(r io.Reader) error + type PrimaryBlock struct + BundleControlFlags BundleControlFlags + CRC []byte + CRCType CRCType + CreationTimestamp CreationTimestamp + Destination EndpointID + FragmentOffset uint64 + Lifetime uint64 + ReportTo EndpointID + SourceNode EndpointID + TotalDataLength uint64 + Version uint64 + func NewPrimaryBlock(bundleControlFlags BundleControlFlags, destination EndpointID, ...) PrimaryBlock + func (pb *PrimaryBlock) MarshalCbor(w io.Writer) error + func (pb *PrimaryBlock) SetCRCType(crcType CRCType) + func (pb *PrimaryBlock) UnmarshalCbor(r io.Reader) error + func (pb PrimaryBlock) CheckValid() (errs error) + func (pb PrimaryBlock) GetCRCType() CRCType + func (pb PrimaryBlock) HasCRC() bool + func (pb PrimaryBlock) HasFragmentation() bool + func (pb PrimaryBlock) MarshalJSON() ([]byte, error) + func (pb PrimaryBlock) String() string + type ProphetBlock map[EndpointID]float64 + func NewProphetBlock(data map[EndpointID]float64) *ProphetBlock + func (pBlock *ProphetBlock) BlockTypeCode() uint64 + func (pBlock *ProphetBlock) BlockTypeName() string + func (pBlock *ProphetBlock) GetPredictabilities() map[EndpointID]float64 + func (pBlock *ProphetBlock) MarshalCbor(w io.Writer) error + func (pBlock *ProphetBlock) UnmarshalCbor(r io.Reader) error + func (pBlock ProphetBlock) CheckValid() error + type SignatureBlock struct + PublicKey []byte + Signature []byte + func NewSignatureBlock(b Bundle, priv ed25519.PrivateKey) (s *SignatureBlock, err error) + func (s *SignatureBlock) BlockTypeCode() uint64 + func (s *SignatureBlock) BlockTypeName() string + func (s *SignatureBlock) CheckValid() (err error) + func (s *SignatureBlock) MarshalCbor(w io.Writer) error + func (s *SignatureBlock) UnmarshalCbor(r io.Reader) error + func (s *SignatureBlock) Verify(b Bundle) (valid bool) + type StatusInformationPos int + const DeletedBundle + const DeliveredBundle + const ForwardedBundle + const ReceivedBundle + func (sip StatusInformationPos) String() string + type StatusReport struct + RefBundle BundleID + ReportReason StatusReportReason + StatusInformation []BundleStatusItem + func NewStatusReport(bndl Bundle, statusItem StatusInformationPos, reason StatusReportReason, ...) (report *StatusReport) + func (sr *StatusReport) MarshalCbor(w io.Writer) error + func (sr *StatusReport) RecordTypeCode() uint64 + func (sr *StatusReport) UnmarshalCbor(r io.Reader) error + func (sr StatusReport) StatusInformations() (sips []StatusInformationPos) + func (sr StatusReport) String() string + type StatusReportReason uint64 + const BlockUnintelligible + const BlockUnsupported + const DepletedStorage + const DestEndpointUnintelligible + const ForwardUnidirectionalLink + const HopLimitExceeded + const LifetimeExpired + const NoInformation + const NoNextNodeContact + const NoRouteToDestination + const TrafficPared + const TransmissionCanceled + func (srr StatusReportReason) String() string + type Valid interface + CheckValid func() error