Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeString(data []byte) string
- func PrintBytes(out io.Writer, buf []byte, indent string)
- func PrintPacket(p *Packet)
- type Class
- type Identifier
- type Packet
- func DecodePacket(data []byte) *Packet
- func DecodePacketErr(data []byte) (*Packet, error)
- func Encode(ClassType Class, TagType Type, Tag Tag, Value interface{}, Description string) *Packet
- func NewBoolean(ClassType Class, TagType Type, Tag Tag, Value bool, Description string) *Packet
- func NewInteger(ClassType Class, TagType Type, Tag Tag, Value interface{}, Description string) *Packet
- func NewSequence(Description string) *Packet
- func NewString(ClassType Class, TagType Type, Tag Tag, Value, Description string) *Packet
- func ReadPacket(reader io.Reader) (*Packet, error)
- type Tag
- type Type
Constants ¶
View Source
const ( // LengthLongFormBitmask is the mask to apply to the length byte to see if a long-form byte sequence is used LengthLongFormBitmask = 0x80 // LengthValueBitmask is the mask to apply to the length byte to get the number of bytes in the long-form byte sequence LengthValueBitmask = 0x7f // LengthIndefinite is returned from readLength to indicate an indefinite length LengthIndefinite = -1 )
Variables ¶
View Source
var ClassMap = map[Class]string{ ClassUniversal: "Universal", ClassApplication: "Application", ClassContext: "Context", ClassPrivate: "Private", }
View Source
var Debug bool = false
View Source
var TypeMap = map[Type]string{ TypePrimitive: "Primitive", TypeConstructed: "Constructed", }
Functions ¶
func DecodeString ¶
func PrintPacket ¶
func PrintPacket(p *Packet)
Types ¶
type Identifier ¶ added in v1.1.1
type Packet ¶
type Packet struct { Identifier Value interface{} ByteValue []byte Data *bytes.Buffer Children []*Packet Description string }
func DecodePacket ¶
DecodePacket decodes the given bytes into a single Packet If a decode error is encountered, nil is returned.
func DecodePacketErr ¶ added in v1.1.1
DecodePacketErr decodes the given bytes into a single Packet If a decode error is encountered, nil is returned
func NewBoolean ¶
func NewInteger ¶
func NewSequence ¶
func ReadPacket ¶
ReadPacket reads a single Packet from the reader
func (*Packet) AppendChild ¶
type Tag ¶
type Tag uint64
const ( TagEOC Tag = 0x00 TagBoolean Tag = 0x01 TagInteger Tag = 0x02 TagBitString Tag = 0x03 TagOctetString Tag = 0x04 TagNULL Tag = 0x05 TagObjectIdentifier Tag = 0x06 TagObjectDescriptor Tag = 0x07 TagExternal Tag = 0x08 TagRealFloat Tag = 0x09 TagEnumerated Tag = 0x0a TagEmbeddedPDV Tag = 0x0b TagUTF8String Tag = 0x0c TagRelativeOID Tag = 0x0d TagSequence Tag = 0x10 TagSet Tag = 0x11 TagNumericString Tag = 0x12 TagPrintableString Tag = 0x13 TagT61String Tag = 0x14 TagVideotexString Tag = 0x15 TagIA5String Tag = 0x16 TagUTCTime Tag = 0x17 TagGeneralizedTime Tag = 0x18 TagGraphicString Tag = 0x19 TagVisibleString Tag = 0x1a TagGeneralString Tag = 0x1b TagUniversalString Tag = 0x1c TagCharacterString Tag = 0x1d TagBMPString Tag = 0x1e TagBitmask Tag = 0x1f // xxx11111b // HighTag indicates the start of a high-tag byte sequence HighTag Tag = 0x1f // xxx11111b // HighTagContinueBitmask indicates the high-tag byte sequence should continue HighTagContinueBitmask Tag = 0x80 // 10000000b // HighTagValueBitmask obtains the tag value from a high-tag byte sequence byte HighTagValueBitmask Tag = 0x7f // 01111111b )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.