Documentation
¶
Overview ¶
Package ndr provides the ability to unmarshal NDR encoded byte steams into Go data structures
Index ¶
Constants ¶
const ( TagConformant = "conformant" TagVarying = "varying" TagPointer = "pointer" TagPipe = "pipe" )
Struct tag values
const ( SizeBool = 1 SizeChar = 1 SizeUint8 = 1 SizeUint16 = 2 SizeUint32 = 4 SizeUint64 = 8 SizeEnum = 2 SizeSingle = 4 SizeDouble = 8 SizePtr = 4 )
Byte sizes of primitive types
const ( TagEncapsulated = "encapsulated" TagUnionTag = "unionTag" TagUnionField = "unionField" )
Union related constants such as struct tag values
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonHeader ¶
type CommonHeader struct { Version uint8 Endianness binary.ByteOrder CharacterEncoding uint8 FloatRepresentation uint8 HeaderLength uint16 Filler []byte }
CommonHeader implements the NDR common header: https://msdn.microsoft.com/en-us/library/cc243889.aspx
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder unmarshals NDR byte stream data into a Go struct representation
func NewDecoder ¶
NewDecoder creates a new instance of a NDR Decoder.
type Malformed ¶
type Malformed struct {
EText string
}
Malformed implements the error interface for malformed NDR encoding errors.
type PrivateHeader ¶
PrivateHeader implements the NDR private header: https://msdn.microsoft.com/en-us/library/cc243919.aspx
type RawBytes ¶
type RawBytes interface {
Size(interface{}) int
}
RawBytes interface should be implemented if reading just a number of bytes from the NDR stream
type Union ¶
type Union interface {
SwitchFunc(t interface{}) string
}
Union interface must be implemented by structs that will be unmarshaled into from the NDR byte stream union representation. The union's discriminating tag will be passed to the SwitchFunc method. The discriminating tag field must have the struct tag: `ndr:"unionTag"` If the union is encapsulated the discriminating tag field must have the struct tag: `ndr:"encapsulated"` The possible value fields that can be selected from must have the struct tag: `ndr:"unionField"`