Inhaltsverzeichnis

std.net.bgp

BGP-4 (Border Gateway Protocol, RFC 4271) ist das Routing-Protokoll des Internets und verbindet autonome Systeme (AS) miteinander. Es tauscht Erreichbarkeitsinformationen (IP-Prefixe) zwischen AS-Grenz-Routern aus und wählt Pfade anhand von Attributen (AS-PATH, LOCAL-PREF, MED, COMMUNITY). Die Unit implementiert den vollständigen BGP-Handshake (OPEN/KEEPALIVE), UPDATE-Nachrichten mit Routenankündigung und -rücknahme sowie die BGP-Zustandsmaschine (FSM: IDLE → ESTABLISHED).

Einsatzbereiche sind BGP-Monitoring-Systeme, Route-Collector-Implementierungen, Netzwerkanalyse-Tools und Anwendungen, die Routing-Informationen aus dem globalen Internet-Routing-System auslesen oder injizieren.


Imports


Konstanten

Name Typ Wert Sichtbarkeit
BGP_PORT int64 179 pub
BGP_MARKER_SIZE int64 16 pub
BGP_MSG_OPEN int64 1 pub
BGP_MSG_UPDATE int64 2 pub
BGP_MSG_NOTIFICATION int64 3 pub
BGP_MSG_KEEPALIVE int64 4 pub
BGP_MSG_ROUTE_REFRESH int64 5 pub
BGP_STATE_IDLE int64 0 pub
BGP_STATE_CONNECT int64 1 pub
BGP_STATE_ACTIVE int64 2 pub
BGP_STATE_OPENSENT int64 3 pub
BGP_STATE_OPENCONFIRM int64 4 pub
BGP_STATE_ESTABLISHED int64 5 pub
BGP_ERR_MSG_HDR int64 1 pub
BGP_ERR_OPEN int64 2 pub
BGP_ERR_UPDATE int64 3 pub
BGP_ERR_HOLD_TIMER int64 4 pub
BGP_ERR_FSM int64 5 pub
BGP_ERR_CEASE int64 6 pub
BGP_ATTR_ORIGIN int64 1 pub
BGP_ATTR_AS_PATH int64 2 pub
BGP_ATTR_NEXT_HOP int64 3 pub
BGP_ATTR_MULTI_EXIT_DISC int64 4 pub
BGP_ATTR_LOCAL_PREF int64 5 pub
BGP_ATTR_ATOMIC_AGGREGATE int64 6 pub
BGP_ATTR_AGGREGATOR int64 7 pub
BGP_ATTR_COMMUNITY int64 8 pub
BGP_ATTR_MP_REACH_NLRI int64 14 pub
BGP_ATTR_MP_UNREACH_NLRI int64 15 pub
BGP_ATTR_EXTENDED_COMMUNITY int64 16 pub
BGP_ORIGIN_IGP int64 0 pub
BGP_ORIGIN_EGP int64 1 pub
BGP_ORIGIN_INCOMPLETE int64 2 pub

Typen

BGPPeer (struct)

Feld Typ

BGPRoute (struct)

Feld Typ

BGPUpdate (struct)

Feld Typ

Funktionen

Signatur Sichtbarkeit Beschreibung
BGPBuildHeader(msgType: int64, length: int64): int64 pub Erstellt BGP-Nachrichtenheader mit Marker
BGPBuildOpen(version: int64, asNum: int64, holdTime: int64, bgpId: int64): int64 pub Erstellt BGP-OPEN-Nachricht
BGPBuildKeepalive(): int64 pub Erstellt BGP-KEEPALIVE-Nachricht
BGPBuildNotification(errCode: int64, errSubcode: int64): int64 pub Erstellt BGP-Fehlernachricht
BGPBuildUpdate(prefix: int64, prefixLen: int64, nextHop: int64, origin: int64): int64 pub Erstellt BGP-UPDATE mit Route
BGPGetMessageType(msg: int64): int64 pub Liest Nachrichtentyp aus BGP-Header
BGPGetMessageLength(msg: int64): int64 pub Liest Gesamtlänge aus BGP-Header
BGPParseOpen(msg: int64, len: int64): int64 pub Parst BGP-OPEN-Nachricht einfach
BGPParseOpenFull(msg: int64, len: int64, remoteAS: int64, holdTime: int64, bgpId: int64): int64 pub Parst BGP-OPEN vollständig mit Ausgabeparametern
BGPConnect(peerIp: int64, localAS: int64, remoteAS: int64): BGPPeer pub Verbindet TCP zum BGP-Peer
BGPSendOpen(peer: BGPPeer): int64 pub Sendet OPEN-Nachricht an Peer
BGPSendKeepalive(peer: BGPPeer): int64 pub Sendet KEEPALIVE an Peer
BGPSendNotification(peer: BGPPeer, errCode: int64, errSubcode: int64): int64 pub Sendet Fehlermeldung an Peer
BGPAdvertiseRoute(peer: BGPPeer, prefix: int64, prefixLen: int64, nextHop: int64): int64 pub Kündigt Netzwerkpräfix an Peer an
BGPWithdrawRoute(peer: BGPPeer, prefix: int64, prefixLen: int64): int64 pub Zieht angekündigten Präfix zurück
BGPRecvMessage(peer: BGPPeer): int64 pub Empfängt BGP-Nachricht vom Peer
BGPPerformOpenExchange(peer: BGPPeer): int64 pub Führt OPEN/KEEPALIVE-Handshake durch
BGPWaitEstablished(peer: BGPPeer): int64 pub Wartet bis Session ESTABLISHED erreicht
BGPIPv4(a: int64, b: int64, c: int64, d: int64): int64 pub Erzeugt IPv4-Adresse aus vier Oktetten
BGPFormatIPv4(ip: int64): int64 pub Formatiert IPv4-Adresse als String
BGPDisconnect(peer: BGPPeer) pub Trennt BGP-Verbindung zum Peer