Documentation ¶
Overview ¶
Package nlenc implements encoding and decoding functions for netlink messages and attributes.
Index ¶
- func Bytes(s string) []byte
- func Int32(b []byte) int32
- func Int32Bytes(v int32) []byte
- func NativeEndian() binary.ByteOrder
- func PutInt32(b []byte, v int32)
- func PutUint16(b []byte, v uint16)
- func PutUint32(b []byte, v uint32)
- func PutUint64(b []byte, v uint64)
- func PutUint8(b []byte, v uint8)
- func String(b []byte) string
- func Uint16(b []byte) uint16
- func Uint16Bytes(v uint16) []byte
- func Uint32(b []byte) uint32
- func Uint32Bytes(v uint32) []byte
- func Uint64(b []byte) uint64
- func Uint64Bytes(v uint64) []byte
- func Uint8(b []byte) uint8
- func Uint8Bytes(v uint8) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int32 ¶
Int32 decodes an int32 from b using the host machine's native endianness. If b is not exactly 4 bytes in length, Int32 will panic.
func Int32Bytes ¶
Int32Bytes encodes a int32 into a newly-allocated byte slice using the host machine's native endianness. It is a shortcut for allocating a new byte slice and filling it using PutInt32.
func NativeEndian ¶
NativeEndian returns the native byte order of this system.
func PutInt32 ¶
PutInt32 encodes a int32 into b using the host machine's native endianness. If b is not exactly 4 bytes in length, PutInt32 will panic.
func PutUint16 ¶
PutUint16 encodes a uint16 into b using the host machine's native endianness. If b is not exactly 2 bytes in length, PutUint16 will panic.
func PutUint32 ¶
PutUint32 encodes a uint32 into b using the host machine's native endianness. If b is not exactly 4 bytes in length, PutUint32 will panic.
func PutUint64 ¶
PutUint64 encodes a uint64 into b using the host machine's native endianness. If b is not exactly 8 bytes in length, PutUint64 will panic.
func PutUint8 ¶
PutUint8 encodes a uint8 into b. If b is not exactly 1 byte in length, PutUint8 will panic.
func Uint16 ¶
Uint16 decodes a uint16 from b using the host machine's native endianness. If b is not exactly 2 bytes in length, Uint16 will panic.
func Uint16Bytes ¶
Uint16Bytes encodes a uint16 into a newly-allocated byte slice using the host machine's native endianness. It is a shortcut for allocating a new byte slice and filling it using PutUint16.
func Uint32 ¶
Uint32 decodes a uint32 from b using the host machine's native endianness. If b is not exactly 4 bytes in length, Uint32 will panic.
func Uint32Bytes ¶
Uint32Bytes encodes a uint32 into a newly-allocated byte slice using the host machine's native endianness. It is a shortcut for allocating a new byte slice and filling it using PutUint32.
func Uint64 ¶
Uint64 decodes a uint64 from b using the host machine's native endianness. If b is not exactly 8 bytes in length, Uint64 will panic.
func Uint64Bytes ¶
Uint64Bytes encodes a uint64 into a newly-allocated byte slice using the host machine's native endianness. It is a shortcut for allocating a new byte slice and filling it using PutUint64.
func Uint8Bytes ¶
Uint8Bytes encodes a uint8 into a newly-allocated byte slice. It is a shortcut for allocating a new byte slice and filling it using PutUint8.
Types ¶
This section is empty.