Documentation ¶
Index ¶
- Variables
- func ValidateVrtPacketSize(header Header, size uint32) (outputHeaderSize uint16, ouputMinimumWords uint32, err error)
- type ClassID
- type Header
- type PacketCount
- type TSF
- type TSI
- type Trailer
- type VRT
- func (v *VRT) CanDecode() gopacket.LayerClass
- func (v *VRT) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error
- func (v VRT) LayerContents() (data []byte)
- func (v *VRT) LayerPayload() []byte
- func (v VRT) LayerType() gopacket.LayerType
- func (v *VRT) NextLayerType() gopacket.LayerType
- func (v *VRT) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
- type VitaPacketType
Constants ¶
This section is empty.
Variables ¶
var LayerTypeVRT = gopacket.RegisterLayerType(4900, gopacket.LayerTypeMetadata{Name: "VRT", Decoder: gopacket.DecodeFunc(decodeVRT)})
LayerTypeVRT handles the VRT packet processing for gopacket
Functions ¶
func ValidateVrtPacketSize ¶
func ValidateVrtPacketSize(header Header, size uint32) (outputHeaderSize uint16, ouputMinimumWords uint32, err error)
ValidateVrtPacketSize calculates the minimum size of the VRT packet based on the VRT header and compares to the size of the VRT packet. VRT packets below the minimum size through an error. header.PacketSize is the number of 32 bit words per packet and should always equal size/4.
Types ¶
type ClassID ¶
type ClassID struct { OUI uint32 // 0xFC // PadBitCount // 0x03 PacketClassCode uint16 InformationClassCode uint16 }
ClassID makes it possible for a VRT Packet Stream receiver to determine the identity of both the Information Class used for the application and the Packet Class from which each received packet was made.
type Header ¶
type Header struct { Type VitaPacketType // F0 C bool // 08 T bool // 04 TSI TSI // C0 TSF TSF // 30 PacketCount PacketCount // 0F PacketSize uint16 }
Header is the representation of a VRT packet's header.
type PacketCount ¶
type PacketCount uint8
PacketCount contains a modulo-16 count of IF Data packets for an IF Data Packet Stream
type Trailer ¶
type Trailer struct { CalibratedTimeEnable bool ValidDataEnable bool ReferenceLockEnable bool AGCMGCEnable bool DetectedSignalEnable bool SpectralInversionEnable bool OverrangeEnable bool SampleLossEnable bool CalibratedTimeIndicator bool ValidDataIndicator bool ReferenceLockIndicator bool AGCMGCIndicator bool DetectedSignalIndicator bool SpectralInversionIndicator bool OverrangeIndicator bool SampleLossIndicator bool AssociatedContextPacketCountEnable bool AssociatedContextPacketCount byte // valid 0 - 127 }
Trailer is the representation of a VRT packet's trailer. This is optional and only appears when the Header.T is set to `true`. Will be fully implemented in a future version of this module.
type VRT ¶
type VRT struct { layers.BaseLayer Header Header StreamID uint32 ClassID ClassID TimestampInt uint32 TimestampFrac uint64 Payload []byte }
VRT (VITA Radio Transport) is a standard that defines a transport layer protocol designed to promote interoperability between RF (radio frequency) receivers and signal processing equipment across a wide range of applications.
func (*VRT) CanDecode ¶
func (v *VRT) CanDecode() gopacket.LayerClass
CanDecode returns a set of layers that VRT objects can decode. As VRT objects can only decide the VRT layer, we can return just that layer. Apparently a single layer type implements LayerClass.
func (*VRT) DecodeFromBytes ¶
func (v *VRT) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error
DecodeFromBytes analyses a byte slice and attempts to decode it as a VRT record of a UDP packet.
Upon succeeds, it loads the VRT object with information about the packet and returns nil. Upon failure, it returns an error (non nil).
func (VRT) LayerContents ¶
LayerContents returns the VRT layer's contents as a byte array
func (*VRT) LayerPayload ¶
LayerPayload returns the VRT object's Payload VRT packets carry a data payload so the Payload byte slice is retured.
func (*VRT) NextLayerType ¶
NextLayerType specifies the next layer that GoPacket should attempt to analyse after this (VRT) layer. As VRT packets contain payload bytes, there is an additional layer to analyse.
func (*VRT) SerializeTo ¶
func (v *VRT) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.
type VitaPacketType ¶
type VitaPacketType uint8
VitaPacketType specifies the VRT Packet Type
const ( IFData VitaPacketType = iota // 0 IFDataWithStream // 1 ExtData // 2 ExtDataWithStream // 3 IFContext // 4 ExtContext // 5 )
constants representing different VRT packet types