types.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. package dynamicrouting
  2. // BGPInstance represents global BGP settings (/routing bgp instance)
  3. type BGPInstance struct {
  4. Enabled bool `json:"enabled"`
  5. AS uint32 `json:"as"`
  6. RouterID string `json:"router_id"`
  7. HoldTime int `json:"hold_time"` // Default 180
  8. KeepaliveTime int `json:"keepalive_time"` // Default 60
  9. RedistributeConnected bool `json:"redistribute_connected"`
  10. RedistributeStatic bool `json:"redistribute_static"`
  11. RedistributeOSPF bool `json:"redistribute_ospf"`
  12. Running bool `json:"running"`
  13. }
  14. // BGPPeer represents a BGP peer connection (/routing bgp connection / peer)
  15. type BGPPeer struct {
  16. ID string `json:"id"`
  17. Name string `json:"name"`
  18. Enabled bool `json:"enabled"`
  19. Comment string `json:"comment,omitempty"`
  20. Instance string `json:"instance,omitempty"`
  21. Template string `json:"template,omitempty"`
  22. LocalAS uint32 `json:"local_as,omitempty"` // Multi-Instance Local AS (if 0, uses global AS)
  23. RouterID string `json:"router_id,omitempty"`
  24. AFI string `json:"afi,omitempty"` // "ip", "ipv6"
  25. RemoteAddress string `json:"remote_address"`
  26. RemotePort int `json:"remote_port,omitempty"`
  27. RemoteAS uint32 `json:"remote_as"`
  28. RemoteAllowAS string `json:"remote_allow_as,omitempty"`
  29. LocalAddress string `json:"local_address,omitempty"`
  30. LocalPort int `json:"local_port,omitempty"`
  31. LocalRole string `json:"local_role,omitempty"` // ebgp, ibgp
  32. Password string `json:"password,omitempty"` // TCP MD5 Key
  33. Multihop bool `json:"multihop"`
  34. TxTTL int `json:"tx_ttl,omitempty"`
  35. RxMinTTL int `json:"rx_min_ttl,omitempty"`
  36. Connect bool `json:"connect"`
  37. Listen bool `json:"listen"`
  38. HoldTime int `json:"hold_time,omitempty"`
  39. KeepaliveTime int `json:"keepalive_time,omitempty"`
  40. UseBFD bool `json:"use_bfd,omitempty"`
  41. RoutingTable string `json:"routing_table,omitempty"`
  42. VRF string `json:"vrf,omitempty"`
  43. NoClientReflect bool `json:"no_client_reflect,omitempty"`
  44. RedistConnected bool `json:"redist_connected"`
  45. RedistStatic bool `json:"redist_static"`
  46. RedistOSPF bool `json:"redist_ospf"`
  47. RedistBGP bool `json:"redist_bgp"`
  48. RedistRIP bool `json:"redist_rip,omitempty"`
  49. RedistVPN bool `json:"redist_vpn,omitempty"`
  50. RedistDHCP bool `json:"redist_dhcp,omitempty"`
  51. RedistFantasy bool `json:"redist_fantasy,omitempty"`
  52. RedistModem bool `json:"redist_modem,omitempty"`
  53. RedistBgpMplsVpn bool `json:"redist_bgp_mpls_vpn,omitempty"`
  54. RedistSlaac bool `json:"redist_slaac,omitempty"`
  55. DefaultOriginate bool `json:"default_originate"`
  56. NetworkBlackhole bool `json:"network_blackhole,omitempty"`
  57. NoEarlyCut bool `json:"no_early_cut,omitempty"`
  58. KeepSentAttrs bool `json:"keep_sent_attrs,omitempty"`
  59. InputAffinity string `json:"input_affinity,omitempty"`
  60. OutputAffinity string `json:"output_affinity,omitempty"`
  61. NexthopChoice string `json:"nexthop_choice,omitempty"` // default, force-self
  62. NexthopSelf bool `json:"nexthop_self"`
  63. DefaultPrepend int `json:"default_prepend,omitempty"`
  64. AllowASIn int `json:"allow_as_in,omitempty"`
  65. RemovePrivateAS bool `json:"remove_private_as"`
  66. ASOverride bool `json:"as_override,omitempty"`
  67. IgnoreASPathLen bool `json:"ignore_as_path_len,omitempty"`
  68. InFilter string `json:"in_filter,omitempty"` // Routing Filter chain for incoming routes
  69. InAcceptNLRI string `json:"in_accept_nlri,omitempty"`
  70. InAcceptCommunities string `json:"in_accept_communities,omitempty"`
  71. InAcceptExtCommunities string `json:"in_accept_ext_communities,omitempty"`
  72. InAcceptLargeCommunities string `json:"in_accept_large_communities,omitempty"`
  73. InFilterCommunities string `json:"in_filter_communities,omitempty"`
  74. InFilterExtCommunities string `json:"in_filter_ext_communities,omitempty"`
  75. InFilterLargeCommunities string `json:"in_filter_large_communities,omitempty"`
  76. InFilterUnknown bool `json:"in_filter_unknown,omitempty"`
  77. OutFilter string `json:"out_filter,omitempty"` // Routing Filter chain for outgoing routes
  78. OutSelectionPolicy string `json:"out_selection_policy,omitempty"`
  79. OutputNetwork string `json:"output_network,omitempty"`
  80. OutputNetworks []string `json:"output_networks,omitempty"` // Dynamic [+] / [-] output networks
  81. Disabled bool `json:"disabled"`
  82. Passive bool `json:"passive"`
  83. // Runtime telemetry
  84. State string `json:"state,omitempty"` // Established, Active, Connect, Idle
  85. Uptime string `json:"uptime,omitempty"`
  86. PrefixReceived int `json:"prefix_received"`
  87. PrefixSent int `json:"prefix_sent"`
  88. }
  89. // BGPNetwork represents an advertised network (/routing bgp network)
  90. type BGPNetwork struct {
  91. ID string `json:"id"`
  92. Network string `json:"network"` // CIDR, e.g. 10.200.0.0/24
  93. Disabled bool `json:"disabled"`
  94. Comment string `json:"comment,omitempty"`
  95. }
  96. // BGPRoute represents an active BGP route
  97. type BGPRoute struct {
  98. Prefix string `json:"prefix"`
  99. NextHop string `json:"next_hop"`
  100. Metric int `json:"metric"`
  101. Weight int `json:"weight"`
  102. Path string `json:"path"`
  103. Origin string `json:"origin"`
  104. Best bool `json:"best"`
  105. }
  106. // OSPFInstance represents an OSPF instance (/routing ospf instance)
  107. type OSPFInstance struct {
  108. ID string `json:"id"`
  109. Name string `json:"name"` // Default "Default"
  110. Version int `json:"version"` // 2 or 3 (default 2)
  111. VRF string `json:"vrf"` // Default "main"
  112. RouterID string `json:"router_id"` // e.g. "10.42.62.254"
  113. RoutingTable string `json:"routing_table,omitempty"`// Default "main"
  114. Enabled bool `json:"enabled"`
  115. Disabled bool `json:"disabled"`
  116. Comment string `json:"comment,omitempty"`
  117. RedistributeConnected bool `json:"redistribute_connected"`
  118. RedistributeStatic bool `json:"redistribute_static"`
  119. RedistributeBGP bool `json:"redistribute_bgp"`
  120. RedistributeDefault bool `json:"redistribute_default"` // MikroTik redistribute-default
  121. OriginateDefault string `json:"originate_default,omitempty"` // "never", "if-installed", "always"
  122. DefaultMetric int `json:"default_metric"`
  123. Running bool `json:"running"`
  124. }
  125. // OSPFArea represents an OSPF area (/routing ospf area)
  126. type OSPFArea struct {
  127. ID string `json:"id"`
  128. Name string `json:"name"` // Default "Default"
  129. Instance string `json:"instance,omitempty"` // Default "Default"
  130. AreaID string `json:"area_id"` // e.g. "0.0.0.0"
  131. AreaType string `json:"area_type"` // default, stub, nssa
  132. DefaultCost int `json:"default_cost,omitempty"`
  133. NoSummaries bool `json:"no_summaries,omitempty"`
  134. Disabled bool `json:"disabled"`
  135. Comment string `json:"comment,omitempty"`
  136. }
  137. // OSPFAreaRange represents an area range (/routing ospf area range)
  138. type OSPFAreaRange struct {
  139. ID string `json:"id"`
  140. Area string `json:"area"` // Area name or ID
  141. Prefix string `json:"prefix"` // CIDR e.g. "10.42.0.0/16"
  142. Cost int `json:"cost"`
  143. Advertise bool `json:"advertise"` // default true
  144. Disabled bool `json:"disabled"`
  145. Comment string `json:"comment,omitempty"`
  146. }
  147. // OSPFInterface represents an OSPF interface template (/routing ospf interface-template)
  148. type OSPFInterface struct {
  149. ID string `json:"id"`
  150. Interfaces string `json:"interfaces,omitempty"` // ether1, wlan1, all...
  151. Area string `json:"area"` // Area ID or name e.g. "Default" / "0.0.0.0"
  152. Networks string `json:"networks,omitempty"` // CIDR e.g. "10.42.36.244/30"
  153. NetworkType string `json:"network_type"` // broadcast, ptp, nbma, point-to-multipoint
  154. Cost int `json:"cost"` // Metric, default 1
  155. Priority int `json:"priority"` // Default 128
  156. HelloInterval int `json:"hello_interval"` // Default 10
  157. DeadInterval int `json:"dead_interval"` // Default 40
  158. Passive bool `json:"passive"`
  159. Auth string `json:"auth,omitempty"` // none, simple, md5
  160. AuthKey string `json:"auth_key,omitempty"`
  161. UseBFD bool `json:"use_bfd,omitempty"`
  162. Disabled bool `json:"disabled"`
  163. Comment string `json:"comment,omitempty"`
  164. // Backward compatibility aliases
  165. Network string `json:"network,omitempty"`
  166. Interface string `json:"interface,omitempty"`
  167. AuthType string `json:"auth_type,omitempty"`
  168. }
  169. // OSPFInterfaceLive represents dynamic live OSPF interface state (/routing ospf interface)
  170. type OSPFInterfaceLive struct {
  171. Flags string `json:"flags"` // "D" (dynamic)
  172. Interface string `json:"interface"` // e.g. "eth0"
  173. Address string `json:"address"` // e.g. "192.168.131.0/24"
  174. Area string `json:"area"` // e.g. "Default" or "0.0.0.0"
  175. InstanceID int `json:"instance_id"` // 0
  176. State string `json:"state"` // dr, backup, waiting, passive, ptp
  177. Cost int `json:"cost"`
  178. Priority int `json:"priority"`
  179. }
  180. // OSPFStaticNeighbor represents a static OSPF neighbor (/routing ospf static-neighbor)
  181. type OSPFStaticNeighbor struct {
  182. ID string `json:"id"`
  183. Address string `json:"address"`
  184. Area string `json:"area"`
  185. PollInterval int `json:"poll_interval"`
  186. Cost int `json:"cost"`
  187. Disabled bool `json:"disabled"`
  188. Comment string `json:"comment,omitempty"`
  189. }
  190. // OSPFNeighbor represents a live OSPF neighbor (/routing ospf neighbor)
  191. type OSPFNeighbor struct {
  192. Flags string `json:"flags"` // "D" (dynamic)
  193. Comment string `json:"comment,omitempty"`
  194. Instance string `json:"instance"` // "Default"
  195. Area string `json:"area"` // "Default"
  196. Address string `json:"address"` // "10.42.62.249"
  197. State string `json:"state"` // "Full"
  198. StateChanges int `json:"state_changes"` // e.g. 6
  199. NeighborID string `json:"neighbor_id,omitempty"`
  200. Interface string `json:"interface,omitempty"`
  201. DeadTimer string `json:"dead_timer,omitempty"`
  202. Priority int `json:"priority,omitempty"`
  203. }
  204. // OSPFLSA represents an LSA record in the Link-State Database (/routing ospf lsa)
  205. type OSPFLSA struct {
  206. Flags string `json:"flags"` // "D", "SD"
  207. Instance string `json:"instance"` // "Default"
  208. Area string `json:"area"` // "Default"
  209. Type string `json:"type"` // "router", "network", "as-external", "summary-net", "summary-asbr"
  210. Originator string `json:"originator"` // Router ID
  211. ID string `json:"id"` // LS ID
  212. Link string `json:"link"`
  213. LinkIndex int `json:"link_index"`
  214. Sequence string `json:"sequence"` // e.g. "8000006e"
  215. Age int `json:"age"` // seconds
  216. }
  217. // OSPFRoute represents an active OSPF route
  218. type OSPFRoute struct {
  219. Prefix string `json:"prefix"`
  220. RouteType string `json:"route_type"` // Intra-Area, Inter-Area, External
  221. Cost int `json:"cost"`
  222. Area string `json:"area"`
  223. NextHop string `json:"next_hop"`
  224. Interface string `json:"interface"`
  225. }
  226. // RoutingFilterRule represents a route filter rule (/routing filter rule)
  227. type RoutingFilterRule struct {
  228. ID string `json:"id"`
  229. Chain string `json:"chain"` // e.g. "bgp-in", "bgp-out", "isp-in"
  230. RuleOrder int `json:"rule_order"` // e.g. 10, 20, 30... Sequence number
  231. Rule string `json:"rule"` // RouterOS v7 rule script e.g. "if (dst in 10.0.0.0/8) { set bgp-local-pref 150; accept; }"
  232. Action string `json:"action"` // "accept" (permit), "discard" (deny), "reject", "passthrough"
  233. Prefix string `json:"prefix,omitempty"` // CIDR e.g. "10.0.0.0/8" or "0.0.0.0/0"
  234. PrefixLen string `json:"prefix_len,omitempty"` // e.g. "24-32", "ge 24 le 32", "24"
  235. MatchProtocol string `json:"match_protocol,omitempty"` // "any", "bgp", "ospf", "connected", "static"
  236. MatchASPath string `json:"match_as_path,omitempty"` // regex e.g. "^65000_"
  237. MatchCommunity string `json:"match_community,omitempty"`// e.g. "65001:100"
  238. SetLocalPref int `json:"set_local_pref,omitempty"` // BGP Local Preference
  239. SetMetric int `json:"set_metric,omitempty"` // BGP MED / OSPF Metric
  240. SetASPrepend int `json:"set_as_prepend,omitempty"` // AS Path prepend count
  241. SetCommunity string `json:"set_community,omitempty"` // Set BGP community
  242. SetNextHop string `json:"set_next_hop,omitempty"` // Custom Next Hop IP
  243. SetDistance int `json:"set_distance,omitempty"` // Administrative Distance
  244. Disabled bool `json:"disabled"`
  245. Comment string `json:"comment,omitempty"`
  246. }
  247. // RoutingFilterSelectRule represents a deprecated route selection rule (/routing filter select-rule)
  248. type RoutingFilterSelectRule struct {
  249. ID string `json:"id"`
  250. Chain string `json:"chain"`
  251. RuleOrder int `json:"rule_order"`
  252. Rule string `json:"rule"`
  253. Disabled bool `json:"disabled"`
  254. Comment string `json:"comment,omitempty"`
  255. }
  256. // RoutingFilterCommunityList represents a named community set (/routing filter community-list)
  257. type RoutingFilterCommunityList struct {
  258. ID string `json:"id"`
  259. Name string `json:"name"`
  260. Communities []string `json:"communities"`
  261. Regexp string `json:"regexp,omitempty"`
  262. Disabled bool `json:"disabled"`
  263. Comment string `json:"comment,omitempty"`
  264. }
  265. // RoutingFilterASList represents a named AS number list (/routing filter num-list)
  266. type RoutingFilterASList struct {
  267. ID string `json:"id"`
  268. Name string `json:"name"`
  269. Range string `json:"range"`
  270. Disabled bool `json:"disabled"`
  271. Comment string `json:"comment,omitempty"`
  272. }
  273. // RIPInstance represents a RIP routing instance (/routing rip instance)
  274. type RIPInstance struct {
  275. ID string `json:"id"`
  276. Name string `json:"name"` // e.g. "default"
  277. Version int `json:"version"` // 2 for IPv4, 1 for RIPng IPv6 (default 2)
  278. VRF string `json:"vrf,omitempty"` // default "main"
  279. RoutingTable string `json:"routing_table,omitempty"`// default "main"
  280. Enabled bool `json:"enabled"`
  281. Disabled bool `json:"disabled"`
  282. Comment string `json:"comment,omitempty"`
  283. RedistributeConnected bool `json:"redistribute_connected"`
  284. RedistributeStatic bool `json:"redistribute_static"`
  285. RedistributeOSPF bool `json:"redistribute_ospf"`
  286. RedistributeBGP bool `json:"redistribute_bgp"`
  287. RedistributeDefault bool `json:"redistribute_default"`
  288. DefaultMetric int `json:"default_metric"` // default 1
  289. UpdateTime int `json:"update_time"` // default 30
  290. TimeoutTime int `json:"timeout_time"` // default 180
  291. GarbageTime int `json:"garbage_time"` // default 120
  292. Running bool `json:"running"`
  293. }
  294. // RIPInterface represents a RIP interface template (/routing rip interface)
  295. type RIPInterface struct {
  296. ID string `json:"id"`
  297. Instance string `json:"instance,omitempty"`
  298. Interface string `json:"interface"` // e.g. "eth0" or "*"
  299. Metric int `json:"metric"` // Metric/cost added (default 1)
  300. Mode string `json:"mode,omitempty"` // "multicast", "broadcast" (default multicast)
  301. Passive bool `json:"passive"`
  302. UseBFD bool `json:"use_bfd,omitempty"`
  303. Auth string `json:"auth,omitempty"` // "none", "simple", "md5"
  304. AuthKey string `json:"auth_key,omitempty"`
  305. Disabled bool `json:"disabled"`
  306. Comment string `json:"comment,omitempty"`
  307. }
  308. // RIPNeighbor represents an explicit RIP neighbor (/routing rip neighbor)
  309. type RIPNeighbor struct {
  310. ID string `json:"id"`
  311. Instance string `json:"instance,omitempty"`
  312. Address string `json:"address"` // Neighbor IP
  313. Interface string `json:"interface,omitempty"`
  314. Disabled bool `json:"disabled"`
  315. Comment string `json:"comment,omitempty"`
  316. }
  317. // RIPNeighborLive represents a live RIP neighbor detected by BIRD
  318. type RIPNeighborLive struct {
  319. Address string `json:"address"`
  320. Interface string `json:"interface"`
  321. Uptime string `json:"uptime"`
  322. LastSeen string `json:"last_seen"`
  323. }
  324. // RIPRoute represents an active RIP route learned or advertised
  325. type RIPRoute struct {
  326. Prefix string `json:"prefix"`
  327. NextHop string `json:"next_hop"`
  328. Metric int `json:"metric"`
  329. Interface string `json:"interface"`
  330. Uptime string `json:"uptime"`
  331. }
  332. // BFDInstance represents global BFD settings (/routing bfd instance)
  333. type BFDInstance struct {
  334. Enabled bool `json:"enabled"`
  335. Disabled bool `json:"disabled"`
  336. Comment string `json:"comment,omitempty"`
  337. Running bool `json:"running"`
  338. }
  339. // BFDInterface represents a BFD interface template (/routing bfd interface)
  340. type BFDInterface struct {
  341. ID string `json:"id"`
  342. Interface string `json:"interface"` // e.g. "eth0" or "*"
  343. MinRxInterval int `json:"min_rx_interval"` // ms, default 100
  344. MinTxInterval int `json:"min_tx_interval"` // ms, default 100
  345. IdleTxInterval int `json:"idle_tx_interval,omitempty"`// ms, default 1000
  346. Multiplier int `json:"multiplier"` // default 3
  347. Passive bool `json:"passive"`
  348. Auth string `json:"auth,omitempty"` // "none", "simple", "meticulous keyed sha1"
  349. AuthKey string `json:"auth_key,omitempty"`
  350. Disabled bool `json:"disabled"`
  351. Comment string `json:"comment,omitempty"`
  352. }
  353. // BFDNeighbor represents an explicit BFD neighbor / peer (/routing bfd peer)
  354. type BFDNeighbor struct {
  355. ID string `json:"id"`
  356. Address string `json:"address"`
  357. Interface string `json:"interface,omitempty"`
  358. Multihop bool `json:"multihop"`
  359. Disabled bool `json:"disabled"`
  360. Comment string `json:"comment,omitempty"`
  361. }
  362. // BFDSession represents a live BFD session (/routing bfd session)
  363. type BFDSession struct {
  364. IP string `json:"ip"`
  365. Interface string `json:"interface"`
  366. State string `json:"state"` // "Up", "Down", "Init", "AdminDown"
  367. Since string `json:"since"`
  368. Interval string `json:"interval"`
  369. Timeout string `json:"timeout"`
  370. }
  371. // BabelInstance represents a Babel instance (/routing babel instance)
  372. type BabelInstance struct {
  373. ID string `json:"id"`
  374. Name string `json:"name"` // "default"
  375. RouterID string `json:"router_id,omitempty"`
  376. VRF string `json:"vrf,omitempty"`
  377. RoutingTable string `json:"routing_table,omitempty"`
  378. Enabled bool `json:"enabled"`
  379. Disabled bool `json:"disabled"`
  380. Comment string `json:"comment,omitempty"`
  381. RedistributeConnected bool `json:"redistribute_connected"`
  382. RedistributeStatic bool `json:"redistribute_static"`
  383. RedistributeOSPF bool `json:"redistribute_ospf"`
  384. RedistributeBGP bool `json:"redistribute_bgp"`
  385. RedistributeDefault bool `json:"redistribute_default"`
  386. DefaultMetric int `json:"default_metric"`
  387. Running bool `json:"running"`
  388. }
  389. // BabelInterface represents a Babel interface template (/routing babel interface)
  390. type BabelInterface struct {
  391. ID string `json:"id"`
  392. Instance string `json:"instance,omitempty"`
  393. Interface string `json:"interface"` // "eth0" or "*"
  394. Type string `json:"type,omitempty"` // "wired", "wireless" (default "wired")
  395. RxCost int `json:"rxcost,omitempty"` // default 10 or 96
  396. HelloInterval int `json:"hello_interval,omitempty"` // default 4 s
  397. UpdateInterval int `json:"update_interval,omitempty"` // default 16 s
  398. Auth string `json:"auth,omitempty"` // "none", "mac"
  399. AuthKey string `json:"auth_key,omitempty"`
  400. Disabled bool `json:"disabled"`
  401. Comment string `json:"comment,omitempty"`
  402. }
  403. // BabelNeighbor represents a live Babel neighbor (/routing babel neighbor)
  404. type BabelNeighbor struct {
  405. IP string `json:"ip"`
  406. Interface string `json:"interface"`
  407. Metric int `json:"metric"`
  408. Cost int `json:"cost"`
  409. Uptime string `json:"uptime"`
  410. }
  411. // BabelRoute represents an active Babel route (/routing babel route)
  412. type BabelRoute struct {
  413. Prefix string `json:"prefix"`
  414. NextHop string `json:"next_hop"`
  415. Metric int `json:"metric"`
  416. Interface string `json:"interface"`
  417. }
  418. // RAdvInstance represents an IPv6 Router Advertisement instance (/routing radv instance)
  419. type RAdvInstance struct {
  420. ID string `json:"id"`
  421. Name string `json:"name"` // "default"
  422. Enabled bool `json:"enabled"`
  423. Disabled bool `json:"disabled"`
  424. Comment string `json:"comment,omitempty"`
  425. Running bool `json:"running"`
  426. }
  427. // RAdvInterface represents a RAdv interface (/routing radv interface)
  428. type RAdvInterface struct {
  429. ID string `json:"id"`
  430. Instance string `json:"instance,omitempty"`
  431. Interface string `json:"interface"`
  432. MinRAInterval int `json:"min_ra_interval,omitempty"` // default 200 s
  433. MaxRAInterval int `json:"max_ra_interval,omitempty"` // default 600 s
  434. DefaultLifetime int `json:"default_lifetime,omitempty"` // default 1800 s
  435. HopLimit int `json:"hop_limit,omitempty"` // default 64
  436. Prefixes []string `json:"prefixes,omitempty"` // IPv6 prefixes e.g. ["2001:db8::/64"]
  437. RDNSS []string `json:"rdnss,omitempty"` // IPv6 DNS servers e.g. ["2001:4860:4860::8888"]
  438. Disabled bool `json:"disabled"`
  439. Comment string `json:"comment,omitempty"`
  440. }
  441. // DynamicRoutingSummary aggregates status for dashboard & badges
  442. type DynamicRoutingSummary struct {
  443. BGPEnabled bool `json:"bgp_enabled"`
  444. BGPRunning bool `json:"bgp_running"`
  445. BGPPeerCount int `json:"bgp_peer_count"`
  446. BGPEstablishedCount int `json:"bgp_established_count"`
  447. OSPFEnabled bool `json:"ospf_enabled"`
  448. OSPFRunning bool `json:"ospf_running"`
  449. OSPFNeighborCount int `json:"ospf_neighbor_count"`
  450. OSPFAdjacentCount int `json:"ospf_adjacent_count"`
  451. RIPEnabled bool `json:"rip_enabled"`
  452. RIPRunning bool `json:"rip_running"`
  453. RIPNeighborCount int `json:"rip_neighbor_count"`
  454. BFDEnabled bool `json:"bfd_enabled"`
  455. BFDRunning bool `json:"bfd_running"`
  456. BFDSessionCount int `json:"bfd_session_count"`
  457. BabelEnabled bool `json:"babel_enabled"`
  458. BabelRunning bool `json:"babel_running"`
  459. BabelNeighborCount int `json:"babel_neighbor_count"`
  460. RAdvEnabled bool `json:"radv_enabled"`
  461. RAdvRunning bool `json:"radv_running"`
  462. RoutingFilterCount int `json:"routing_filter_count"`
  463. }
  464. // DynamicConfig stores all dynamic routing data on disk
  465. type DynamicConfig struct {
  466. BGPInstance BGPInstance `json:"bgp_instance"`
  467. BGPPeers []BGPPeer `json:"bgp_peers"`
  468. BGPNetworks []BGPNetwork `json:"bgp_networks"`
  469. OSPFInstances []OSPFInstance `json:"ospf_instances"`
  470. OSPFInstance OSPFInstance `json:"ospf_instance"` // Backward compatibility
  471. OSPFAreas []OSPFArea `json:"ospf_areas"`
  472. OSPFAreaRanges []OSPFAreaRange `json:"ospf_area_ranges"`
  473. OSPFInterfaces []OSPFInterface `json:"ospf_interfaces"`
  474. OSPFStaticNbrs []OSPFStaticNeighbor `json:"ospf_static_nbrs"`
  475. RIPInstances []RIPInstance `json:"rip_instances"`
  476. RIPInterfaces []RIPInterface `json:"rip_interfaces"`
  477. RIPNeighbors []RIPNeighbor `json:"rip_neighbors"`
  478. BFDInstance BFDInstance `json:"bfd_instance"`
  479. BFDInterfaces []BFDInterface `json:"bfd_interfaces"`
  480. BFDNeighbors []BFDNeighbor `json:"bfd_neighbors"`
  481. BabelInstances []BabelInstance `json:"babel_instances"`
  482. BabelInterfaces []BabelInterface `json:"babel_interfaces"`
  483. RAdvInstances []RAdvInstance `json:"radv_instances"`
  484. RAdvInterfaces []RAdvInterface `json:"radv_interfaces"`
  485. RoutingFilters []RoutingFilterRule `json:"routing_filters"`
  486. RoutingSelectRules []RoutingFilterSelectRule `json:"routing_select_rules,omitempty"` // Deprecated: unused in BIRD 2
  487. RoutingCommunityLists []RoutingFilterCommunityList `json:"routing_community_lists"`
  488. RoutingASLists []RoutingFilterASList `json:"routing_as_lists"`
  489. }