asn1cmp

package module
v0.0.0-...-e6f18bc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 5 Imported by: 0

README

asn1cmp

Ensure you have libsnmp installed and run the tests to compare ASN1 marshaling

Documentation

Index

Constants

View Source
const (
	/*
	 * defined types (from the SMI, RFC 1157)
	 */
	ASN_APPLICATION NetSnmpAsnType = 0x40
	ASN_IPADDRESS                  = ASN_APPLICATION + 0
	ASN_COUNTER                    = ASN_APPLICATION + 1
	ASN_GAUGE                      = ASN_APPLICATION + 2
	ASN_UNSIGNED                   = ASN_APPLICATION + 2 /* RFC 1902 - same as GAUGE */
	ASN_TIMETICKS                  = ASN_APPLICATION + 3
	ASN_OPAQUE                     = ASN_APPLICATION + 4 /* changed so no conflict with other includes */

	/*
	 * defined types (from the SMI, RFC 1442)
	 */
	//ASN_NSAP      = ASN_APPLICATION + 5 /* historic - don't use */
	ASN_COUNTER64 = ASN_APPLICATION + 6
	ASN_UINTEGER  = ASN_APPLICATION + 7 /* historic - don't use */

	/*
	 * defined types from draft-perkins-opaque-01.txt
	 */
	ASN_FLOAT      = ASN_APPLICATION + 8
	ASN_DOUBLE     = ASN_APPLICATION + 9
	ASN_INTEGER64  = ASN_APPLICATION + 10
	ASN_UNSIGNED64 = ASN_APPLICATION + 11

	ASN_OPAQUE_TAG2      = 0x30
	ASN_OPAQUE_COUNTER64 = ASN_OPAQUE_TAG2 + ASN_FLOAT
	ASN_OPAQUE_FLOAT     = ASN_OPAQUE_TAG2 + ASN_COUNTER64
	ASN_OPAQUE_DOUBLE    = ASN_OPAQUE_TAG2 + ASN_DOUBLE
	ASN_OPAQUE_I64       = ASN_OPAQUE_TAG2 + ASN_INTEGER64
	ASN_OPAQUE_U64       = ASN_OPAQUE_TAG2 + ASN_UNSIGNED64
)

from include/net-snmp/library/snmp_impl.h#L90

Variables

This section is empty.

Functions

func GoAsn1Marshal

func GoAsn1Marshal(typ NetSnmpAsnType, data any) ([]byte, error)

func NetSnmpAsn1Double

func NetSnmpAsn1Double(typ NetSnmpAsnType, data float64) ([]byte, error)

NetSnmpAsn1Double uses `asn_build_double` to build a double type

func NetSnmpAsn1Float

func NetSnmpAsn1Float(typ NetSnmpAsnType, data float32) ([]byte, error)

NetSnmpAsn1Float uses `asn_build_float` to build a float type

func NetSnmpAsn1Int64

func NetSnmpAsn1Int64(typ NetSnmpAsnType, data int64) ([]byte, error)

NetSnmpAsn1Int64 uses `asn_build_signed_int64` to build a int64 type

func NetSnmpAsn1Marshal

func NetSnmpAsn1Marshal(typ NetSnmpAsnType, data any) ([]byte, error)

func NetSnmpAsn1Uint

func NetSnmpAsn1Uint(typ NetSnmpAsnType, data int) ([]byte, error)

NetSnmpAsn1Int uses `asn_build_unsigned_int` to build a uint type

func NetSnmpAsn1Uint64

func NetSnmpAsn1Uint64(typ NetSnmpAsnType, data uint64) ([]byte, error)

NetSnmpAsn1Uint64 uses `asn_build_unsigned_int64` to build a uint64 type

Types

type NetSnmpAsnType

type NetSnmpAsnType int

func (NetSnmpAsnType) String

func (t NetSnmpAsnType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL