bgp

package
v0.16.10 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BGPMsgOpen         = 1
	BGPMsgUpdate       = 2
	BGPMsgNotification = 3
	BGPMsgKeepalive    = 4
	BGPMsgRouteRefresh = 5
)

BGP Message Types

View Source
const (
	BGPAttrOrigin          = 1
	BGPAttrASPath          = 2
	BGPAttrNextHop         = 3
	BGPAttrMultiExitDisc   = 4
	BGPAttrLocalPref       = 5
	BGPAttrAtomicAggregate = 6
	BGPAttrAggregator      = 7
	BGPAttrCommunities     = 8
)

BGP Path Attribute Type Codes

View Source
const (
	BGPAttrMPReachNLRI    = 14 // MP_REACH_NLRI (RFC 4760)
	BGPAttrMPUnreachNLRI  = 15 // MP_UNREACH_NLRI (RFC 4760)
	BGPAttrExtCommunities = 16 // Extended Communities (RFC 4360)
	BGPAttrAS4Path        = 17 // AS4_PATH (RFC 6793)
	BGPAttrAS4Aggregator  = 18 // AS4_AGGREGATOR (RFC 6793)
	BGPAttrLargeCommunity = 32 // Large Communities (RFC 8092)
)

Additional BGP Path Attribute Type Codes for security analysis

View Source
const (
	ASSegTypeSet       = 1 // AS_SET (unordered set of ASes)
	ASSegTypeSequence  = 2 // AS_SEQUENCE (ordered list)
	ASSegTypeConfedSeq = 3 // AS_CONFED_SEQUENCE
	ASSegTypeConfedSet = 4 // AS_CONFED_SET
)

AS Path Segment Types

View Source
const (
	CommNoExport          = 0xFFFFFF01 // NO_EXPORT (RFC 1997)
	CommNoAdvertise       = 0xFFFFFF02 // NO_ADVERTISE (RFC 1997)
	CommNoExportSubConfed = 0xFFFFFF03 // NO_EXPORT_SUBCONFED (RFC 1997)
	CommNoPeer            = 0xFFFFFF04 // NOPEER (RFC 3765)
	CommBlackhole         = 0xFFFF029A // BLACKHOLE (RFC 7999) - 65535:666
)

Well-known community values

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_BGP,
	Name:        serviceBGP,
	Description: "Border Gateway Protocol (BGP) is the protocol for routing between autonomous systems",
	PostInit: func(d *decoder.StreamDecoder) error {
		var err error
		bgpLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"bgp",
			decoderconfig.Instance.Debug,
		)
		return err
	},

	Specificity: core.SpecificityMagic,

	CanDecode: func(client, server []byte) bool {

		return (len(server) >= 19 && bytes.HasPrefix(server, bgpMarker)) ||
			(len(client) >= 19 && bytes.HasPrefix(client, bgpMarker))
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return bgpLog.Sync()
	},
	Factory: &bgpReader{},
	Typ:     core.TCP,
}

Decoder for protocol analysis and writing audit records to disk.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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