File: LOOKING_GLASS_FORMAT

package info (click to toggle)
pmacct 1.7.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 11,548 kB
  • sloc: ansic: 106,538; sh: 4,876; cpp: 4,340; python: 3,631; makefile: 502
file content (59 lines) | stat: -rw-r--r-- 1,463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Following are documented the up-to-date BGP Looking Glass server request/reply
formats. When upgrading from an earlier version, you may want to check out the
UPGRADE document to verify if any impacting changes to the message formats were
introduced. See CONFIG-KEYS and the 'Example: querying the BGP daemon via the
Looking Glass server' section in QUICKSTART for more info.

Query Type 1: IP address/prefix lookup

* Request format:
  {
    "query_type": 1
    "queries": <# of IP prefixes to lookup>
  }

  Followed by one JSON object per IP address/prefix to look up, ie.:
  {
    "ip_prefix": <IP prefix>,
    "rd": <Route Distingiusher>, [OPTIONAL]
    "peer_ip_src": <Peer IP address>,
    "peer_tcp_port": <BGP peer TCP port> [OPTIONAL]
  }

* Reply format:
  {
    "query_type": 1,
    "results": <# of matching IP Prefixes>
  }

  Followed by one JSON object per matching IP address/prefix, ie.: 
  {
    "peer_ip_src": <Peer IP address>,
    "event_type": "lglass",
    "afi": <afi>,
    "safi": <safi>,
    "ip_prefix": <IP prefix>,
    <BGP NLRI, attributes, ..>
  }

Query Type 2: Get Peers

* Request format:
  { 
    "query_type": 2
    "queries": 1
  } 

* Reply format:
  {
    "query_type": 2,
    "results": <# of BGP peers>
  }

  Followed by one JSON object per connected BGP peer:
  {
    "peer_ip_src": <Peer IP address>,
    "peer_id": <Peer BGP Router-ID>,
    "peer_tcp_port": <BGP session TCP port>,
    "peer_as": <Peer AS number>
  }