bgp

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 13 Imported by: 0

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
	},
	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