sdelements

package
v0.0.0-...-c3b650e Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: LGPL-3.0 Imports: 7 Imported by: 3

Documentation

Overview

The sdelements package holds the implementations of the different RFC 5424 structured data elements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Origin

type Origin struct {
	// IPs lists extra IP addresses (in addition to the hostname).
	IPs []net.IP // RFC 1035/4291

	// EnterpriseID is the IANA-registered PEN (or sub-code) associated
	// with the identified software.
	EnterpriseID OriginEnterpriseID // RFC 2578

	// SoftwareName identifies the software that originated the record.
	SoftwareName string

	// SoftwareVersion is the software's version.
	SoftwareVersion version.Number
}

Origin is an IANA-registered structured data element that provides extra information about where a log message came from.

See https://tools.ietf.org/html/rfc5424#section-7.2.

func (Origin) ID

func (origin Origin) ID() rfc5424.StructuredDataName

ID returns the SD-ID for this element.

func (Origin) Params

func (origin Origin) Params() []rfc5424.StructuredDataParam

Params returns the []SD-PARAM for this element.

func (Origin) Validate

func (origin Origin) Validate() error

Validate ensures that the element is correct.

type OriginEnterpriseID

type OriginEnterpriseID struct {
	// Number is the PEN.
	Number PrivateEnterpriseNumber

	// SubTree is the path on the subtree from the PEN. The sub-tree
	// should be registered with the IANA.
	SubTree []int
}

OriginEnterpriseID is the PEN (or subtree) for the origin software.

func (OriginEnterpriseID) String

func (eid OriginEnterpriseID) String() string

String returns the string representation of the ID.

func (OriginEnterpriseID) Validate

func (eid OriginEnterpriseID) Validate() error

Validate ensures that the ID is correct.

type Private

type Private struct {
	// Name is the custom name for this SD element, relative to PEN.
	Name rfc5424.StructuredDataName

	// PEN is the IANA-registered Private Enterprise Number, with an
	// implicit SMI Network Management code prefixed by
	// "iso.org.dod.internet.private.enterprise".
	PEN PrivateEnterpriseNumber

	// Data is the multi-set of data items associated with this SD
	// element. The PEN's org should ensure that the format is
	// sufficiently well-communicated.
	Data []rfc5424.StructuredDataParam
}

Private is a custom structured data element associated with an IANA-registered Private Enterprise Number.

See https://tools.ietf.org/html/rfc5424#section-6.3.1 and http://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml.

func (Private) ID

ID returns the SD-ID for this element.

func (Private) Params

func (sde Private) Params() []rfc5424.StructuredDataParam

Params returns the []SD-PARAM for this element.

func (Private) Validate

func (sde Private) Validate() error

Validate ensures that the element is correct.

type PrivateEnterpriseNumber

type PrivateEnterpriseNumber int

PrivateEnterpriseNumber is an IANA-registered positive integer that publicly identifies a specific organization.

See http://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml.

func (PrivateEnterpriseNumber) String

func (pen PrivateEnterpriseNumber) String() string

String returns the string representation of the PEN.

func (PrivateEnterpriseNumber) Validate

func (pen PrivateEnterpriseNumber) Validate() error

Validate ensures that the number is correct.

Jump to

Keyboard shortcuts

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