meta

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package meta represents BGP message metadata.

Exported to a separate package in order to avoid dependency loops: message parsers take Meta, which is part of msg.Msg.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValue = errors.New("invalid value")
)

Functions

This section is empty.

Types

type Dir

type Dir byte

BGP message direction

const (
	DIR_L  Dir = 0b01 // L direction: "left" or "local"
	DIR_R  Dir = 0b10 // R direction: "right" or "remote"
	DIR_LR Dir = 0b11 // LR direction: both "left" and "right"
)

func DirString

func DirString(s string) (Dir, error)

DirString converts string to Dir

func (Dir) Flip

func (d Dir) Flip() Dir

Flip returns the opposite direction

func (Dir) String

func (d Dir) String() string

String converts Dir to string

type Meta

type Meta struct {
	Dir  Dir       // message direction
	Seq  int64     // sequence number
	Time time.Time // message timestamp

	// per-message parser options, overriding session capabilities:
	// 0 = no data, -1 = disabled, 1 = enabled
	ParseAS4     int8 // 4-byte ASN encoding (CAP_AS4)
	ParseAddPath int8 // ADD-PATH encoding (CAP_ADDPATH)
}

Meta holds optional BGP message metadata: the direction, sequence number and timestamp, plus per-message parser options.

NB: passed by value to parsers; the zero value means "no metadata".

func (*Meta) Reset added in v0.22.0

func (mt *Meta) Reset()

Reset resets the metadata to its zero value.

Jump to

Keyboard shortcuts

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