Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeInteger(data []byte) (ret uint64)
- func DecodeString(data []byte) (ret string)
- func EncodeInteger(val uint64) []byte
- func PrintBytes(buf []byte, indent string)
- func PrintPacket(p *Packet)
- type Packet
- func DecodePacket(data []byte) *Packet
- func Encode(ClassType, TagType, Tag uint8, Value interface{}, Description string) *Packet
- func NewBoolean(ClassType, TagType, Tag uint8, Value bool, Description string) *Packet
- func NewInteger(ClassType, TagType, Tag uint8, Value uint64, Description string) *Packet
- func NewSequence(Description string) *Packet
- func NewString(ClassType, TagType, Tag uint8, Value, Description string) *Packet
- func ReadPacket(reader io.Reader) (*Packet, error)
Constants ¶
View Source
const ( TagEOC = 0x00 TagBoolean = 0x01 TagInteger = 0x02 TagBitString = 0x03 TagOctetString = 0x04 TagNULL = 0x05 TagObjectIdentifier = 0x06 TagObjectDescriptor = 0x07 TagExternal = 0x08 TagRealFloat = 0x09 TagEnumerated = 0x0a TagEmbeddedPDV = 0x0b TagUTF8String = 0x0c TagRelativeOID = 0x0d TagSequence = 0x10 TagSet = 0x11 TagNumericString = 0x12 TagPrintableString = 0x13 TagT61String = 0x14 TagVideotexString = 0x15 TagIA5String = 0x16 TagUTCTime = 0x17 TagGeneralizedTime = 0x18 TagGraphicString = 0x19 TagVisibleString = 0x1a TagGeneralString = 0x1b TagUniversalString = 0x1c TagCharacterString = 0x1d TagBMPString = 0x1e TagBitmask = 0x1f // xxx11111b )
View Source
const ( ClassUniversal = 0 // 00xxxxxxb ClassApplication = 64 // 01xxxxxxb ClassContext = 128 // 10xxxxxxb ClassPrivate = 192 // 11xxxxxxb ClassBitmask = 192 // 11xxxxxxb )
View Source
const ( TypePrimitive = 0 // xx0xxxxxb TypeConstructed = 32 // xx1xxxxxb TypeBitmask = 32 // xx1xxxxxb )
Variables ¶
View Source
var ClassMap = map[uint8]string{ ClassUniversal: "Universal", ClassApplication: "Application", ClassContext: "Context", ClassPrivate: "Private", }
View Source
var Debug bool = false
View Source
var TagMap = map[uint8]string{ TagEOC: "EOC (End-of-Content)", TagBoolean: "Boolean", TagInteger: "Integer", TagBitString: "Bit String", TagOctetString: "Octet String", TagNULL: "NULL", TagObjectIdentifier: "Object Identifier", TagObjectDescriptor: "Object Descriptor", TagExternal: "External", TagRealFloat: "Real (float)", TagEnumerated: "Enumerated", TagEmbeddedPDV: "Embedded PDV", TagUTF8String: "UTF8 String", TagRelativeOID: "Relative-OID", TagSequence: "Sequence and Sequence of", TagSet: "Set and Set OF", TagNumericString: "Numeric String", TagPrintableString: "Printable String", TagT61String: "T61 String", TagVideotexString: "Videotex String", TagIA5String: "IA5 String", TagUTCTime: "UTC Time", TagGeneralizedTime: "Generalized Time", TagGraphicString: "Graphic String", TagVisibleString: "Visible String", TagGeneralString: "General String", TagUniversalString: "Universal String", TagCharacterString: "Character String", TagBMPString: "BMP String", }
View Source
var TypeMap = map[uint8]string{ TypePrimitive: "Primative", TypeConstructed: "Constructed", }
Functions ¶
func DecodeInteger ¶
func DecodeString ¶
func EncodeInteger ¶
func PrintBytes ¶
func PrintPacket ¶
func PrintPacket(p *Packet)
Types ¶
type Packet ¶
type Packet struct { ClassType uint8 TagType uint8 Tag uint8 Value interface{} ByteValue []byte Data *bytes.Buffer Children []*Packet Description string }
func DecodePacket ¶
func NewBoolean ¶
func NewInteger ¶
func NewSequence ¶
func (*Packet) AppendChild ¶
func (*Packet) DataLength ¶
Click to show internal directories.
Click to hide internal directories.