Documentation ¶
Overview ¶
Package ndr is a partial implementation of NDR encoding: http://pubs.opengroup.org/onlinepubs/9629399/chap14.htm
Index ¶
- func ReadBool(b *[]byte, p *int) bool
- func ReadBytes(b *[]byte, p *int, s int, e *binary.ByteOrder) (r []byte)
- func ReadConformantVaryingString(b *[]byte, p *int, e *binary.ByteOrder) (string, error)
- func ReadHeaders(b *[]byte) (CommonHeader, PrivateHeader, int, error)
- func ReadIEEEfloat32(b *[]byte, p *int, e *binary.ByteOrder) float32
- func ReadIEEEfloat64(b *[]byte, p *int, e *binary.ByteOrder) float64
- func ReadUint16(b *[]byte, p *int, e *binary.ByteOrder) (i uint16)
- func ReadUint32(b *[]byte, p *int, e *binary.ByteOrder) (i uint32)
- func ReadUint64(b *[]byte, p *int, e *binary.ByteOrder) (i uint64)
- func ReadUint8(b *[]byte, p *int) (i uint8)
- func ReadUniDimensionalConformantArrayHeader(b *[]byte, p *int, e *binary.ByteOrder) int
- type CommonHeader
- type Malformed
- type PrivateHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConformantVaryingString ¶
ReadConformantVaryingString reads a Conformant and Varying String from the bytes slice. A conformant and varying string is a string in which the maximum number of elements is not known beforehand and therefore is included in the representation of the string. NDR represents a conformant and varying string as an ordered sequence of representations of the string elements, preceded by three unsigned long integers. The first integer gives the maximum number of elements in the string, including the terminator. The second integer gives the offset from the first index of the string to the first index of the actual subset being passed. The third integer gives the actual number of elements being passed, including the terminator.
func ReadHeaders ¶
func ReadHeaders(b *[]byte) (CommonHeader, PrivateHeader, int, error)
ReadHeaders processes the bytes to return the NDR Common and Private headers.
func ReadIEEEfloat32 ¶
ReadIEEEfloat32 reads bytes representing a IEEE formatted 32 bit float.
func ReadIEEEfloat64 ¶
ReadIEEEfloat64 reads bytes representing a IEEE formatted 64 bit float.
func ReadUint16 ¶
ReadUint16 reads bytes representing a thirty two bit integer.
func ReadUint32 ¶
ReadUint32 reads bytes representing a thirty two bit integer.
func ReadUint64 ¶
ReadUint64 reads bytes representing a thirty two bit integer.
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
func GetCommonHeader ¶
func GetCommonHeader(b *[]byte) (CommonHeader, int, error)
GetCommonHeader processes the bytes to return the NDR Common header.
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
func GetPrivateHeader ¶
GetPrivateHeader processes the bytes to return the NDR Private header.