@takodotid/circuit 0.43.1 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +115 -37
  2. package/package.json +21 -58
  3. package/src/checks/across.ts +402 -0
  4. package/src/checks/built-in.ts +256 -0
  5. package/src/checks/device.ts +436 -0
  6. package/src/checks/index.ts +53 -0
  7. package/src/cli/advisories.ts +108 -0
  8. package/src/cli/app.ts +71 -0
  9. package/src/cli/editor-types.generated.ts +30 -0
  10. package/src/cli/editor-types.ts +69 -0
  11. package/src/cli/format.ts +124 -0
  12. package/src/cli/git-hooks.ts +79 -0
  13. package/src/cli/index.ts +350 -1170
  14. package/src/cli/migrate.ts +554 -0
  15. package/src/cli/project-commands.ts +656 -0
  16. package/src/cli/releases.ts +374 -0
  17. package/src/cli/remember.ts +339 -0
  18. package/src/cli/rename.ts +27 -33
  19. package/src/cli/secrets-password.ts +60 -0
  20. package/src/cli/secrets.ts +258 -0
  21. package/src/cli/setup.ts +300 -0
  22. package/src/cli/signing.ts +23 -0
  23. package/src/cli/text-editor.ts +268 -0
  24. package/src/cli/ui.ts +298 -0
  25. package/src/cli/version.ts +2 -0
  26. package/src/cli/versions.ts +158 -0
  27. package/src/config/address.ts +102 -0
  28. package/src/config/circuit.d.ts +30 -0
  29. package/src/config/common.ts +65 -0
  30. package/src/config/communities.ts +479 -0
  31. package/src/config/define.ts +684 -0
  32. package/src/config/device.ts +164 -0
  33. package/src/config/firewall.ts +150 -0
  34. package/src/config/index.ts +22 -0
  35. package/src/{schema → config}/interfaces.ts +121 -85
  36. package/src/config/keys.ts +434 -0
  37. package/src/config/management.ts +61 -0
  38. package/src/config/merge.ts +335 -0
  39. package/src/config/models.ts +70 -0
  40. package/src/config/monitoring.ts +64 -0
  41. package/src/config/network.ts +180 -0
  42. package/src/config/presets.ts +149 -0
  43. package/src/config/routing.ts +401 -0
  44. package/src/config/services.ts +51 -0
  45. package/src/config/switching.ts +84 -0
  46. package/src/config/system.ts +103 -0
  47. package/src/{schema → config}/time-zones.ts +1 -1
  48. package/src/core/address.ts +1 -1
  49. package/src/core/cabling.ts +8 -43
  50. package/src/core/graph.ts +40 -0
  51. package/src/{integrations → core}/registries.ts +5 -3
  52. package/src/core/secrets-file.ts +539 -0
  53. package/src/core/secrets.ts +83 -64
  54. package/src/core/topology.ts +103 -146
  55. package/src/core/utils.ts +12 -1
  56. package/src/model.ts +83 -0
  57. package/src/platforms/derive.ts +64 -37
  58. package/src/platforms/finding.ts +9 -0
  59. package/src/platforms/fortios/firewall.ts +76 -64
  60. package/src/platforms/fortios/index.ts +189 -125
  61. package/src/platforms/fortios/names.ts +51 -18
  62. package/src/platforms/fortios/render.ts +69 -62
  63. package/src/platforms/fortios/routing.ts +89 -58
  64. package/src/platforms/fortios/vdoms.ts +47 -16
  65. package/src/platforms/junos/TRAPS.md +2 -2
  66. package/src/platforms/junos/bgp.ts +63 -42
  67. package/src/platforms/junos/index.ts +122 -89
  68. package/src/platforms/junos/render.ts +139 -104
  69. package/src/platforms/platform.ts +10 -8
  70. package/src/platforms/raisecom-ros/TRAPS.md +1 -1
  71. package/src/platforms/raisecom-ros/index.ts +89 -70
  72. package/src/platforms/raisecom-ros/render.ts +49 -45
  73. package/src/platforms/routeros/TRAPS.md +3 -3
  74. package/src/platforms/routeros/index.ts +121 -60
  75. package/src/platforms/routeros/render.ts +214 -195
  76. package/src/platforms/vrp/TRAPS.md +1 -1
  77. package/src/platforms/vrp/index.ts +74 -50
  78. package/src/platforms/vrp/render.ts +67 -56
  79. package/src/project/project.ts +725 -0
  80. package/src/studio/app/env.d.ts +9 -0
  81. package/src/studio/app/index.html +18 -0
  82. package/src/studio/app/src/App.vue +95 -0
  83. package/src/studio/app/src/components/AddressesView.vue +38 -0
  84. package/src/studio/app/src/components/CablesView.vue +29 -0
  85. package/src/studio/app/src/components/CompareView.vue +160 -0
  86. package/src/studio/app/src/components/DataTable.vue +49 -0
  87. package/src/studio/app/src/components/DeviceView.vue +237 -0
  88. package/src/studio/app/src/components/DevicesView.vue +32 -0
  89. package/src/studio/app/src/components/Faceplate.vue +75 -0
  90. package/src/studio/app/src/components/GraphView.vue +282 -0
  91. package/src/studio/app/src/components/LineDiff.vue +24 -0
  92. package/src/studio/app/src/components/ProblemsView.vue +42 -0
  93. package/src/studio/app/src/components/SearchView.vue +72 -0
  94. package/src/studio/app/src/components/SecretsView.vue +112 -0
  95. package/src/studio/app/src/components/SessionsView.vue +35 -0
  96. package/src/studio/app/src/components/Settings.vue +95 -0
  97. package/src/studio/app/src/components/ToolsView.vue +118 -0
  98. package/src/studio/app/src/components/VlansView.vue +50 -0
  99. package/src/studio/app/src/lib/csv.ts +19 -0
  100. package/src/studio/{public/diff.js → app/src/lib/diff.ts} +40 -35
  101. package/src/studio/app/src/lib/format.ts +38 -0
  102. package/src/studio/app/src/lib/net.ts +68 -0
  103. package/src/studio/app/src/lib/secrets-crypto.ts +35 -0
  104. package/src/studio/app/src/lib/store.ts +71 -0
  105. package/src/studio/app/src/lib/tools.ts +217 -0
  106. package/src/studio/app/src/main.ts +9 -0
  107. package/src/studio/{public → app/src}/style.css +14 -4
  108. package/src/studio/app/tsconfig.json +17 -0
  109. package/src/studio/app/vite.config.ts +16 -0
  110. package/src/studio/assets.generated.ts +3 -0
  111. package/src/studio/data.ts +96 -188
  112. package/src/studio/git.ts +27 -43
  113. package/src/studio/server.ts +196 -107
  114. package/src/studio/types.ts +141 -0
  115. package/src/transport/console.ts +3 -3
  116. package/src/transport/ssh.ts +1 -1
  117. package/dist/chunks/index-3b343xva.js +0 -177
  118. package/dist/chunks/index-6wb41q67.js +0 -62
  119. package/dist/chunks/index-n7w3tg5y.js +0 -149
  120. package/dist/chunks/index-yzw86rc8.js +0 -921
  121. package/dist/chunks/new-w3zys5y4.js +0 -172
  122. package/dist/chunks/server-cxr9ynxc.js +0 -259
  123. package/dist/cli/index.js +0 -12922
  124. package/dist/helpers/index.js +0 -881
  125. package/dist/index.js +0 -28
  126. package/dist/types/core/address-space.d.ts +0 -62
  127. package/dist/types/core/address.d.ts +0 -44
  128. package/dist/types/core/cabling.d.ts +0 -41
  129. package/dist/types/core/cross-checks.d.ts +0 -28
  130. package/dist/types/core/define.d.ts +0 -79
  131. package/dist/types/core/project-files.d.ts +0 -12
  132. package/dist/types/core/schema-docs.d.ts +0 -25
  133. package/dist/types/core/secrets.d.ts +0 -62
  134. package/dist/types/core/topology.d.ts +0 -96
  135. package/dist/types/core/utils.d.ts +0 -10
  136. package/dist/types/core/validator.d.ts +0 -23
  137. package/dist/types/helpers/bgp.d.ts +0 -195
  138. package/dist/types/helpers/cables.d.ts +0 -69
  139. package/dist/types/helpers/checks.d.ts +0 -36
  140. package/dist/types/helpers/exchange.d.ts +0 -55
  141. package/dist/types/helpers/filters.d.ts +0 -51
  142. package/dist/types/helpers/index.d.ts +0 -14
  143. package/dist/types/helpers/route-server.d.ts +0 -52
  144. package/dist/types/helpers/upstreams.d.ts +0 -192
  145. package/dist/types/index.d.ts +0 -10
  146. package/dist/types/integrations/librenms.d.ts +0 -60
  147. package/dist/types/integrations/netbox.d.ts +0 -89
  148. package/dist/types/integrations/peeringdb.d.ts +0 -24
  149. package/dist/types/integrations/prometheus.d.ts +0 -24
  150. package/dist/types/integrations/registries.d.ts +0 -8
  151. package/dist/types/platforms/bgp-wait.d.ts +0 -24
  152. package/dist/types/platforms/catalog.d.ts +0 -109
  153. package/dist/types/platforms/derive.d.ts +0 -17
  154. package/dist/types/platforms/fortios/firewall.d.ts +0 -47
  155. package/dist/types/platforms/fortios/index.d.ts +0 -140
  156. package/dist/types/platforms/fortios/models.d.ts +0 -14
  157. package/dist/types/platforms/fortios/names.d.ts +0 -52
  158. package/dist/types/platforms/fortios/plan.d.ts +0 -114
  159. package/dist/types/platforms/fortios/render.d.ts +0 -77
  160. package/dist/types/platforms/fortios/routing.d.ts +0 -56
  161. package/dist/types/platforms/fortios/tree.d.ts +0 -37
  162. package/dist/types/platforms/fortios/vdoms.d.ts +0 -50
  163. package/dist/types/platforms/index.d.ts +0 -13
  164. package/dist/types/platforms/junos/bgp.d.ts +0 -44
  165. package/dist/types/platforms/junos/index.d.ts +0 -114
  166. package/dist/types/platforms/junos/models.d.ts +0 -14
  167. package/dist/types/platforms/junos/render.d.ts +0 -154
  168. package/dist/types/platforms/line-diff.d.ts +0 -67
  169. package/dist/types/platforms/platform.d.ts +0 -135
  170. package/dist/types/platforms/raisecom-ros/index.d.ts +0 -71
  171. package/dist/types/platforms/raisecom-ros/models.d.ts +0 -14
  172. package/dist/types/platforms/raisecom-ros/render.d.ts +0 -41
  173. package/dist/types/platforms/routeros/export.d.ts +0 -59
  174. package/dist/types/platforms/routeros/index.d.ts +0 -116
  175. package/dist/types/platforms/routeros/models.d.ts +0 -18
  176. package/dist/types/platforms/routeros/plan.d.ts +0 -58
  177. package/dist/types/platforms/routeros/render.d.ts +0 -250
  178. package/dist/types/platforms/vrp/index.d.ts +0 -83
  179. package/dist/types/platforms/vrp/models.d.ts +0 -12
  180. package/dist/types/platforms/vrp/render.d.ts +0 -96
  181. package/dist/types/schema/common.d.ts +0 -30
  182. package/dist/types/schema/device.d.ts +0 -126
  183. package/dist/types/schema/firewall.d.ts +0 -131
  184. package/dist/types/schema/index.d.ts +0 -8
  185. package/dist/types/schema/interfaces.d.ts +0 -205
  186. package/dist/types/schema/policy.d.ts +0 -107
  187. package/dist/types/schema/routing.d.ts +0 -161
  188. package/dist/types/schema/system.d.ts +0 -198
  189. package/dist/types/schema/time-zones.d.ts +0 -2
  190. package/dist/types/transport/console.d.ts +0 -115
  191. package/dist/types/transport/path-check.d.ts +0 -32
  192. package/dist/types/transport/ssh.d.ts +0 -27
  193. package/src/cli/graph-format.ts +0 -91
  194. package/src/cli/new.ts +0 -234
  195. package/src/core/address-space.ts +0 -320
  196. package/src/core/cross-checks.ts +0 -369
  197. package/src/core/define.ts +0 -124
  198. package/src/core/project-files.ts +0 -35
  199. package/src/core/schema-docs.ts +0 -174
  200. package/src/core/validator.ts +0 -508
  201. package/src/helpers/bgp.ts +0 -473
  202. package/src/helpers/cables.ts +0 -74
  203. package/src/helpers/checks.ts +0 -201
  204. package/src/helpers/exchange.ts +0 -123
  205. package/src/helpers/filters.ts +0 -107
  206. package/src/helpers/index.ts +0 -25
  207. package/src/helpers/route-server.ts +0 -212
  208. package/src/helpers/upstreams.ts +0 -369
  209. package/src/index.ts +0 -13
  210. package/src/integrations/librenms.ts +0 -291
  211. package/src/integrations/netbox.ts +0 -620
  212. package/src/integrations/peeringdb.ts +0 -173
  213. package/src/integrations/prometheus.ts +0 -90
  214. package/src/schema/common.ts +0 -41
  215. package/src/schema/device.ts +0 -145
  216. package/src/schema/firewall.ts +0 -140
  217. package/src/schema/index.ts +0 -8
  218. package/src/schema/policy.ts +0 -115
  219. package/src/schema/routing.ts +0 -173
  220. package/src/schema/system.ts +0 -203
  221. package/src/studio/public/app.js +0 -186
  222. package/src/studio/public/compare.js +0 -250
  223. package/src/studio/public/dom.js +0 -138
  224. package/src/studio/public/evaluate.js +0 -687
  225. package/src/studio/public/export.js +0 -130
  226. package/src/studio/public/graph.js +0 -1541
  227. package/src/studio/public/index.html +0 -83
  228. package/src/studio/public/net.js +0 -134
  229. package/src/studio/public/tables.js +0 -1289
  230. package/src/studio/public/tools.js +0 -610
  231. package/templates/colocation/checks.ts +0 -53
  232. package/templates/colocation/circuit.config.ts +0 -9
  233. package/templates/colocation/edge-01.ts +0 -133
  234. package/templates/colocation/routing.ts +0 -13
  235. package/templates/colocation/tenancy.ts +0 -76
  236. package/templates/colocation/tenants/acme.ts +0 -19
  237. package/templates/colocation/tenants/index.ts +0 -6
  238. package/templates/colocation/tor-01.ts +0 -33
  239. package/templates/edge-router/checks.ts +0 -20
  240. package/templates/edge-router/circuit.config.ts +0 -8
  241. package/templates/edge-router/edge-01.ts +0 -110
  242. package/templates/edge-router/routing.ts +0 -13
  243. package/templates/project/AGENTS.md +0 -51
  244. package/templates/project/CLAUDE.md +0 -1
  245. package/templates/project/README.md +0 -16
  246. package/templates/project/gitignore +0 -5
  247. package/templates/project/tsconfig.json +0 -13
  248. package/templates/single-site/checks.ts +0 -26
  249. package/templates/single-site/circuit.config.ts +0 -8
  250. package/templates/single-site/router.ts +0 -86
  251. package/templates/single-site/site.ts +0 -18
  252. package/templates/single-site/switch.ts +0 -34
  253. /package/src/studio/{public → app/public}/favicon.svg +0 -0
  254. /package/src/studio/{public → app/public}/special-gothic-latin-ext.woff2 +0 -0
  255. /package/src/studio/{public → app/public}/special-gothic-latin.woff2 +0 -0
  256. /package/src/studio/{public → app/public}/special-gothic-license.txt +0 -0
@@ -1,140 +0,0 @@
1
- import type { Neighbor } from "../../core/cabling.js";
2
- import type { Device, Family } from "../../schema/index.js";
3
- import { type ConsoleDialect } from "../../transport/console.js";
4
- import { type ApplyOptions, type OsSupport, type Plan, type ReadOptions, type ReadSession, Platform } from "../platform.js";
5
- /** What a session reads and writes: an SSH shell, or anything else that streams the CLI. */
6
- export type Channel = {
7
- write(data: string): unknown;
8
- on(event: "data", listener: (chunk: Buffer) => void): unknown;
9
- on(event: "close", listener: () => void): unknown;
10
- removeListener(event: "data", listener: (chunk: Buffer) => void): unknown;
11
- removeListener(event: "close", listener: () => void): unknown;
12
- };
13
- /** How a change that could cut access is guarded: the device reloads its saved configuration after `seconds` unless `prove` shows access survived. */
14
- export type Guard = {
15
- seconds: number;
16
- prove: () => Promise<void>;
17
- };
18
- /** A CLI over a channel: one line at a time, and what the device printed until its prompt came back. */
19
- export declare class FortiOsCli {
20
- private readonly channel;
21
- private readonly newline;
22
- /** The prompt at the end of what the device printed, `host # ` or `host (context) # `, or a question it waits on. */
23
- private static readonly PROMPT;
24
- static readonly QUESTION: RegExp;
25
- /** The pre-login banner, which waits for the reader to accept it. */
26
- static readonly BANNER: RegExp;
27
- /** The device ended the session and asks for a login again. */
28
- private static readonly LOGGED_OUT;
29
- /** The pager the device stops at, and how it erases itself once answered. */
30
- private static readonly PAGER;
31
- /** The prompt that ended the last answer, which shows where the session is: `(port1)` inside an entry. */
32
- prompt: string;
33
- constructor(channel: Channel, newline?: string);
34
- /** Wait for the prompt, after logging in. */
35
- ready(timeout?: number): Promise<void>;
36
- /** Send one line and return what the device printed after it, without the echo or the prompt. */
37
- run(line: string, timeout?: number): Promise<string>;
38
- /** Answer a question the device asked. */
39
- answer(reply: "y" | "n", timeout?: number): Promise<string>;
40
- /** What the device prints until its prompt or a question. A session the device ended, or that went silent, fails. */
41
- private collect;
42
- }
43
- export declare class FortiOs extends Platform {
44
- /** How the FortiOS console asks for a login, and what moves it on from where the last session left it. */
45
- static readonly CONSOLE: ConsoleDialect;
46
- /** The release this adapter renders for, and was proved on. */
47
- private static readonly SUPPORTED;
48
- /** The longest name the platform takes for an interface, and for an address or service. */
49
- private static readonly NAME_LENGTH;
50
- /** Names the platform keeps for interfaces of its own. */
51
- private static readonly RESERVED_INTERFACES;
52
- /** What the device prints when it refuses a line. */
53
- private static readonly REFUSED;
54
- /** How long a device may take to come back from a reload of its configuration, and how often to try it. */
55
- private static readonly RELOAD;
56
- /** Commands that only read: `show`, `get`, a set of `diagnose` and `execute` commands. `diagnose sys session filter` sets only this session's filter; `diagnose sys session clear`, which ends sessions, is not here. `diagnose lldprx` shows what LLDP received. */
57
- private static readonly READS;
58
- /** A session filter, which holds only in the shell that set it. */
59
- private static readonly SESSION_FILTER;
60
- readonly name = "fortios";
61
- readonly os: OsSupport;
62
- readonly extension = ".conf";
63
- readonly console: ConsoleDialect;
64
- unsupported(device: Device): string[];
65
- render(device: Device): string;
66
- read(device: Device, _network?: readonly Device[], options?: ReadOptions): Promise<string>;
67
- /** The LLDP neighbors the device received, read with `diagnose lldprx neighbor details`. A port hears LLDP only while it, or the aggregate it is in, has `lldp-reception` on. */
68
- neighbors(device: Device, _network?: readonly Device[], options?: ReadOptions): Promise<Neighbor[]>;
69
- /**
70
- * The neighbors in what `diagnose lldprx neighbor details` prints, one `lldprx.neighbor.<n>.<field>: <value>` line per field: `port.txt` is our port, `port.id.data` the far port and `system.name.data` the far device. Our port is given Circuit's name. A neighbor that sent no system name or port is left out.
71
- */
72
- static neighborsOf(text: string, device: Device): Neighbor[];
73
- plan(desired: string, current: string, options: ApplyOptions): Plan;
74
- apply(device: Device, network: readonly Device[], changes: Plan, options: ApplyOptions): Promise<void>;
75
- /** Replace a prefix list `refresh` fetched. It cannot cut access, so it is sent without a guard, and saved as it goes. `purge` asks to confirm, and is answered yes. */
76
- fill(device: Device, _network: readonly Device[], set: string, family: Family, prefixes: string[]): Promise<void>;
77
- readOnly(command: string): boolean;
78
- /** Over SSH, each command runs on its own until a session filter is set. The filter holds only in the shell that set it, so it and every command after it run in one shell. */
79
- session(device: Device, options?: ReadOptions): Promise<ReadSession>;
80
- /** The lines that replace a prefix list's entries with what a registry returned: every entry is purged, then each prefix added, matching it and anything more specific. */
81
- static fillLines(set: string, family: Family, prefixes: string[]): string[];
82
- /**
83
- * A line with each secret's value in place, escaped inside its quotes. A certificate's key from a variable is PEM encoded as one line of base64, and is sent as the PEM it holds. A file saved with Windows line endings is sent with plain ones: the CLI takes each carriage return as a line of its own, and refuses the key, `Invalid private key`. A `?`, which the CLI takes as a call for help, is typed literally.
84
- */
85
- static withSecrets(line: string): string;
86
- private static login;
87
- /** Log out of a console, so no session is left open on it. */
88
- private static consoleLogout;
89
- /** Log in on the console and open the CLI. Returns the CLI, a way to log in afresh on the same console, and how to let the console go. */
90
- private static openConsole;
91
- /** Log in on the console, open the CLI, and run `work` in it. `work` is also given a way to log in afresh on the same console. */
92
- private static consoleSession;
93
- /** Log in, open the CLI, and run `work` in it: through the console when asked, else over SSH. */
94
- private static withCli;
95
- /** Refuse a device on a release this adapter was not proved on, before anything is read or sent. Gives what `get system status` printed. */
96
- private static checkVersion;
97
- /** Run `work` among the device's own settings: inside `config global` on a device with VDOMs, as it is on one without. */
98
- private static inGlobal;
99
- /** Secrets the device prints: a password or an SNMPv3 key as a cipher, a certificate's key encrypted, and the SNMP community in clear. None leave the read. */
100
- private static scrub;
101
- /** Every section Circuit manages, as the device holds it, credentials scrubbed. */
102
- private static readConfig;
103
- /**
104
- * A device in multi-VDOM mode, read where each section lives: the device's own under `config global`, the rest in `root`, and a management VDOM's sections named as the render names them. A VDOM that does not exist yet is not entered, since `edit` would make it.
105
- */
106
- private static readVdoms;
107
- /** Leave every `config` and `edit` level, back to the top prompt. */
108
- private static leave;
109
- /** Send the lines that set how the device saves changes. */
110
- private static saving;
111
- /**
112
- * Send a plan line by line, each applied as it arrives. The device is first set to revert what is not saved, so a refused line or a fresh login that fails reloads its saved configuration. Once access is proved the change is saved, and changes save themselves again.
113
- */
114
- private static configure;
115
- /**
116
- * Once the device is back from a reload, set it to save changes on its own again: the saved configuration still says to revert. Setting it saves what runs, so it is set only once the device says nothing is left to reload; until then the reload is asked for again.
117
- */
118
- private static settle;
119
- private static applyOnce;
120
- /**
121
- * What transparent mode, which a bridge needs, leaves out: every address but one IPv4 management address outside the bridges, routing beyond static routes for it, NAT and DHCP. Without a management address the device is reached through its console and answers no service.
122
- */
123
- private static transparentGaps;
124
- private static systemGaps;
125
- private static managementGaps;
126
- /** Every name the platform knows a port by. */
127
- private static portNames;
128
- private static interfaceGaps;
129
- /** A port or LAG carries tagged only VLANs that have an interface here, and is the only one carrying each. */
130
- private static trunkGaps;
131
- /** Layer 3 settings the platform cannot express on a port or an interface. Only a tunnel takes an address with a peer. */
132
- private static routedGaps;
133
- /** An ACL as the platform's, which only drop: every drop comes before any accept, and no rule limits a rate or matches a VLAN. */
134
- private static aclGaps;
135
- private static staticGaps;
136
- private static firewallGaps;
137
- /** A filter rule the platform cannot express. */
138
- private static ruleGaps;
139
- private static serviceGaps;
140
- }
@@ -1,14 +0,0 @@
1
- export declare const models: {
2
- readonly "FG-3700D": {
3
- readonly ports: {
4
- readonly "40g": 4;
5
- readonly "10g": 28;
6
- readonly "1g": 2;
7
- };
8
- readonly spelling: {
9
- readonly "40g": "port{n}";
10
- readonly "10g": "port{n+4}";
11
- readonly "1g": "mgmt{n}";
12
- };
13
- };
14
- };
@@ -1,52 +0,0 @@
1
- import type { Device, Family } from "../../schema/index.js";
2
- type Addressed = {
3
- addresses?: readonly (string | {
4
- address: string;
5
- peer?: string;
6
- })[];
7
- vrf?: string;
8
- lag?: string;
9
- };
10
- export declare class FortiOsNames {
11
- /** The bridges a device has, in the config's order. A device with any runs in transparent mode, each bridge a forward domain numbered by its place. */
12
- static bridgesOf(device: Device): {
13
- name: string;
14
- members: readonly string[];
15
- }[];
16
- /** Whether the device runs in transparent mode: it has a bridge. */
17
- static isTransparent(device: Device): boolean;
18
- /**
19
- * The management address of a device in transparent mode: the one IPv4 address on a port or an interface outside every bridge. The device answers on it, the platform's `manageip`, through that interface alone. Undefined when there is none, and the device is reached only through its console.
20
- */
21
- static transparentManagement(device: Device): {
22
- name: string;
23
- address: string;
24
- } | undefined;
25
- /** The forward domain of a VLAN interface in a bridge, or undefined. */
26
- static forwardDomainOf(device: Device, name: string): number | undefined;
27
- /** The name the platform gives a port or an interface: a port by its spelling, any other interface by its key. */
28
- static nameOf(device: Device, name: string): string;
29
- /** A port's or an interface's settings, by its key. */
30
- static settingsOf(device: Device, name: string): Addressed | undefined;
31
- /** Every address of a port or an interface. */
32
- static addressesOf(settings: Addressed | undefined): string[];
33
- /** An address or prefix with its length, a bare address taken as a host. */
34
- static withLength(value: string): string;
35
- /** The family of an address or prefix. */
36
- static familyOfPrefix(value: string): Family;
37
- /** `192.0.2.0 255.255.255.0`, how the platform writes an IPv4 prefix. */
38
- static subnet(prefix: string): string;
39
- /** The canonical form of a prefix: its network address and length, a bare address taken as a host. */
40
- static network(prefix: string): string;
41
- /** The number of a VRF on the platform: its place among the device's VRFs, the default table being 0. */
42
- static vrfNumber(device: Device, vrf: string | undefined): number;
43
- /** Every port and interface that routes, by key, with its settings. A LAG member routes through its LAG. */
44
- private static routedHolders;
45
- /** The interface whose own network holds an address, the most specific when several do, in one routing table. */
46
- static interfaceFor(device: Device, address: string, vrf?: string): string | undefined;
47
- /** The interface that holds an address as its own. */
48
- static holderOf(device: Device, address: string): string | undefined;
49
- /** Every port and interface with an address, by key, where the device's services answer. */
50
- static addressed(device: Device): string[];
51
- }
52
- export {};
@@ -1,114 +0,0 @@
1
- import type { ApplyOptions, Plan } from "../platform.js";
2
- export declare class FortiOsPlan {
3
- /** Objects every FortiGate running 6.2 is shipped with, which policies and profiles of the factory name. */
4
- private static readonly FACTORY_ADDRESSES;
5
- private static readonly FACTORY_SERVICES;
6
- /** The device's own certificates, which the factory makes for each device. */
7
- private static readonly FACTORY_CERTIFICATES;
8
- /** An entry known by what it holds, or else by its description. */
9
- private static readonly BY_COMMENTS;
10
- private static readonly ORDERED;
11
- /** A static route known by what it holds, or else by its description. Many routes share a destination, so that is no key. */
12
- private static readonly ROUTES;
13
- /** Tables whose entries need more than a plain comparison, by section. */
14
- private static readonly TABLES;
15
- /** Settings the device keeps for itself: an object's UUID and an interface's SNMP index. */
16
- private static readonly IGNORED;
17
- /** Settings of one section the device keeps for itself: how changes are saved, which `apply` sets while it works, and the alias it gives itself at every start. */
18
- private static readonly IGNORED_IN;
19
- /** In a certificate's entry, the settings that matter: its text and its key. The device prints others it decides for itself. */
20
- private static readonly KEPT;
21
- /** A policy denies unless told otherwise. */
22
- private static readonly DENY;
23
- /** Defaults the device does not print, by section. A config may state one, such as SSH on port 22, and the render states some because other settings appear only once they hold: a DHCP server's resolvers show only while it names them itself, and a policy answers a denied sender only while it denies. */
24
- private static readonly DEFAULTS;
25
- /** Settings whose value is a secret wherever they appear, such as a certificate's key, which the device prints encrypted. */
26
- private static readonly SECRET_KEYS;
27
- /** Settings holding a certificate's text, compared without its line breaks. */
28
- private static readonly CERTIFICATES;
29
- /** Settings undone before a nested list is deleted. Any other goes after it. */
30
- private static readonly FIRST;
31
- /** Settings holding a list in no particular order. */
32
- private static readonly LISTS;
33
- /** Settings that name an interface: an entry's own, or a list a section holds, such as OSPF's passive interfaces or the interfaces NTP answers on. */
34
- private static readonly NAMES_INTERFACE;
35
- /** Tables whose entries are named after an interface, so that releasing the interface deletes its entry: `The vxlan device is currently used` otherwise. */
36
- private static readonly KEYED_BY_INTERFACE;
37
- /** The tables whose entries are interfaces, so that releasing one frees what names it. */
38
- private static readonly INTERFACE_TABLES;
39
- /**
40
- * Lists of interfaces that exist only while a setting is on, by the list. NTP serves only on interfaces it names, so its list cannot be emptied while it serves, `There aren't any interfaces with NTP server enabled`; turning it off hides the list and lets go of them.
41
- */
42
- private static readonly HELD_BY;
43
- /** The interfaces of tunnels, which their own tables create, compared after those tables as a section of their own. */
44
- private static readonly TUNNELS;
45
- /** A value that is a secret: a marker in the render, a cipher or a redaction in the read. */
46
- private static isSecret;
47
- /** A value in the form both sides compare in: words without quotes, a secret as one word, a list sorted. */
48
- private static canonical;
49
- /** Whether an entry changes a setting it keeps for life, so it must be created again. */
50
- private static changesFixed;
51
- /** Whether the device holds an entry the plan leaves alone. */
52
- private static isFactory;
53
- /** The configuration as the plan reads it: factory entries and the device's own settings left out. */
54
- static clean(text: string): string;
55
- private static dropIgnored;
56
- /** The words before a line a reviewer reads, naming the entry and block it sits in. */
57
- private static labelOf;
58
- /** A block's lines as reviewer lines, each with its place. An entry that holds nothing, such as an extra IPv6 address, is its own line. */
59
- private static shown;
60
- /** The lines that create an entry, with the settings the device adds unset when the render does not hold them. */
61
- private static creation;
62
- /**
63
- * Compare one block. `table` applies to its entries; `top` sends their removal to the end of the plan.
64
- *
65
- * What goes is undone before what comes is set, since a setting can hide another: `send-deny-packet` exists only while a policy denies. A nested list that goes is deleted before the settings, since one can hide the list and keep its entries hidden, such as `secondary-IP`; NTP refuses to delete its last server while it synchronises, so `ntpsync` goes before its list.
66
- */
67
- private static compare;
68
- /** Entries matched by name: new ones created, changed ones edited, gone ones deleted. */
69
- private static byId;
70
- /**
71
- * Entries the render numbers by their place, while on the device each keeps the number it was created with, so they are matched by what they are.
72
- *
73
- * An entry that holds the same as one on the device is kept. One that changes is found by the first of the table's keys that no other entry left to match shares, such as its description, and edited under its own number. Any other is new and takes a number the device does not use; in a table the device keeps in order, it is created at the end and moved into place. An entry on the device that nothing matched is deleted last, so every entry the render keeps stays on the device through the whole change.
74
- *
75
- * In a `distinct` table, an entry that changes is deleted and created again under its own number, and every deletion comes before any creation.
76
- */
77
- private static numbered;
78
- /** The `move` commands that put a table's entries in the render's order, by the device's numbers: `wanted` in the render's order, `held` the kept ones in the device's. Kept entries hold their place on the device and new ones are added at the end. */
79
- private static moves;
80
- /** An entry's settings in the form two entries compare in, whatever their numbers. A setting at its section's default is left out, as the device does not print it. */
81
- private static signature;
82
- /** Entries matched by what they hold. One the device holds and the render does not is deleted; one the render adds takes a number the device does not use. */
83
- private static byContent;
84
- /** The interface names a block's settings hold. */
85
- private static interfacesNamed;
86
- /**
87
- * What goes before anything else changes.
88
- *
89
- * A port joins a LAG only while nothing names it, and its speed cannot change while it is in one. So a LAG that keeps some of its ports lets the others go first, a port whose speed changes leaves its LAG and joins again later, a LAG whose ports join another goes first, and an interface whose type or parent changes is deleted and created again. Whatever names such an interface on the device is deleted first, or unset when a list names it, and set again later if the render holds it; an interface or tunnel deleted this way frees what names it in turn.
90
- *
91
- * A LAG that goes otherwise is deleted with everything else that goes, after what names it; its ports are changed after that.
92
- */
93
- private static released;
94
- /**
95
- * The lines, inside one block, that release what names a freed interface: an entry that names one is deleted, and a list a block holds that names one is unset. The device's tree loses them too, so the plan creates or sets them again. An interface the release deletes itself is in `gone`.
96
- */
97
- private static release;
98
- /**
99
- * Addresses that leave an interface, taken off before any is set: the device refuses an address in a subnet another interface still holds, `Subnets overlap`. A primary address that changes takes the secondary ones with it, since they hang on it.
100
- */
101
- private static movedAddresses;
102
- /**
103
- * What changes, by section, in the order the render lists them. Entries that go are deleted after everything else, in the reverse order, so nothing is deleted while another section still names it.
104
- *
105
- * A secret is sent when its entry is new, or with `secrets` set; it cannot be read back to compare.
106
- */
107
- static of(desired: string, current: string, options: Pick<ApplyOptions, "secrets">): Plan;
108
- /** The tree with each tunnel's interface moved from `system interface` to a section of its own, just after the tunnels' tables. The interface it leaves through is its tunnel's, and is left to the tunnel's table. */
109
- private static separateTunnels;
110
- /** A prefix list `refresh` fills keeps the entries the device holds. */
111
- private static keepFilled;
112
- /** The ports of a LAG that goes, taken out of the main comparison and changed in a step of their own once the LAG is deleted. */
113
- private static deferredPorts;
114
- }
@@ -1,77 +0,0 @@
1
- import type { Device, Helper, Severity } from "../../schema/index.js";
2
- export type Section = (typeof FortiOsRender.SECTIONS)[number];
3
- export declare class FortiOsRender {
4
- /** Where the pre-login banner's text is kept. */
5
- static readonly BANNER = "system replacemsg admin \"pre_admin-disclaimer-text\"";
6
- /** Every section Circuit manages, in the order a change goes in: what others name comes first. */
7
- static readonly SECTIONS: readonly ["vpn certificate local", "vpn certificate ca", "system global", "system replacemsg admin \"pre_admin-disclaimer-text\"", "system settings", "system accprofile", "system admin", "system interface", "system gre-tunnel", "system vxlan", "system dns", "system dns-server", "system ntp", "system snmp sysinfo", "system snmp community", "system snmp user", "log memory setting", "log memory filter", "log disk setting", ...string[], "system sflow", "system netflow", "system dhcp server", "router static", "router static6", "router prefix-list", "router prefix-list6", "router community-list", "router route-map", "router ospf", "router ospf6", "router bgp", "system session-helper", "firewall address", "firewall address6", "firewall addrgrp", "firewall addrgrp6", "firewall service custom", "firewall ippool", "firewall vip", "firewall policy", "firewall policy6", "firewall local-in-policy", "firewall local-in-policy6", "firewall central-snat-map", "firewall acl", "firewall acl6"];
8
- /** Sections `show` prints without what matters, which `show full-configuration` prints: a certificate's text. */
9
- static readonly FULL: readonly string[];
10
- /** The FortiOS zone number of each IANA zone it has one for. A number names a list of places in one zone; `00` is the device's default. */
11
- private static readonly ZONES;
12
- /** What each role may do: the factory profile for an admin, and a profile Circuit adds for the others. */
13
- static readonly PROFILE: {
14
- readonly admin: "super_admin";
15
- readonly operator: "circuit-operator";
16
- readonly "read-only": "circuit-read-only";
17
- };
18
- /** The permission groups of an access profile. */
19
- private static readonly PERMISSION_GROUPS;
20
- /** The most public keys a user holds. */
21
- static readonly SSH_KEYS = 3;
22
- /** The most resolvers the device and a DHCP server hold, per family. */
23
- static readonly RESOLVERS: {
24
- readonly device: 2;
25
- readonly dhcp: 4;
26
- };
27
- /** The most syslog collectors the device sends to. */
28
- static readonly COLLECTORS = 4;
29
- /** The most VRFs the device holds besides its default table. */
30
- static readonly VRFS = 31;
31
- /** A severity as the platform names it. */
32
- static readonly LEVEL: Record<Severity, string>;
33
- /** The helpers the factory runs, by the name a config gives them: protocol and port of each. */
34
- static readonly HELPERS: Partial<Record<Helper, readonly [string, number, number][]>>;
35
- /** Speed by the platform's spelling, for each class a port's cage takes. */
36
- static readonly SPEEDS: Record<string, Partial<Record<string, string>>>;
37
- /** The management address of a device in transparent mode, which is reached only through its console: link-local, on no network it can reach. */
38
- static readonly TRANSPARENT_MANAGEIP = "169.254.0.1/255.255.255.255";
39
- /** The zone number for an IANA zone. UTC when the config names none. */
40
- static zoneOf(timezone?: string): string | undefined;
41
- /** The services a port or an interface answers on its addresses: ping always, and every management service the config turns on. */
42
- private static allowAccess;
43
- /** The whole configuration the device should run, in the form `show` prints. */
44
- static of(device: Device): string;
45
- /** A management VDOM's routes, and who reaches the device's own services through it, as sections of their own after everything else. */
46
- private static managementVdom;
47
- /** A certificate with its key is the device's own; one without is only trusted. */
48
- private static certificates;
49
- private static global;
50
- /** Each user, with the profile its role takes. */
51
- private static users;
52
- /** Ports, then the LAGs they join, VLAN interfaces on them, loopbacks, and the tunnels with their own tables. */
53
- private static interfaces;
54
- /** The platform sends ICMP redirects unless an interface says otherwise; the config sends them only when asked. */
55
- private static redirects;
56
- /** The one port or LAG that carries a VLAN tagged, which its VLAN interface sits on. `unsupported()` refuses any other case. */
57
- static vlanParent(device: Device, vlan: string): string | undefined;
58
- /** Addresses and their routing table, the services answered on them, VRRP, DHCP relay, router advertisements, LLDP and flow sampling of a port or an interface. */
59
- private static routed;
60
- /** The device's resolvers, and the interfaces it answers DNS queries on when it serves them. */
61
- private static dns;
62
- /** The servers the device keeps time from, and the interfaces it answers time queries on when it serves them. */
63
- private static ntp;
64
- /** SNMP version 2c with one community, guarded by its hosts, and version 3 users. */
65
- private static snmp;
66
- /** Logs kept in memory from a level up, none on disk, and up to four syslog collectors, each with the least severe message it takes. */
67
- private static logging;
68
- /** One collector, and sampling on each interface it observes. */
69
- private static flowExport;
70
- private static dhcpServers;
71
- /** Each route by its position. A route goes in the routing table of the interface it leaves through. A default route is the platform's default destination and is not printed. */
72
- private static staticRoutes;
73
- /** BFD runs once a route or a session uses it, or the config sets its timers, which the device shows only while it runs. */
74
- private static bfd;
75
- /** The helpers the config lists, each on the protocols and ports the factory gives it. None run otherwise. */
76
- private static helpers;
77
- }
@@ -1,56 +0,0 @@
1
- import type { Device, Family, Neighbor, NeighborSettings, PolicyRule } from "../../schema/index.js";
2
- import { FortiOsBlock } from "./tree.js";
3
- type AnyRule = PolicyRule<string, string>;
4
- type AnyNeighbor = Neighbor<string, string, string>;
5
- /** The lengths a prefix list's rule takes within its prefix. */
6
- type Lengths = {
7
- ge?: number;
8
- le?: number;
9
- };
10
- export declare class FortiOsRouting {
11
- /** The route map a session takes when its config states none, so it learns or announces nothing. */
12
- static readonly REJECT_ALL = "circuit-reject-all";
13
- /** The start of the comment on a prefix list `refresh` fills. The plan keeps the entries the device holds in one. */
14
- static readonly FILLED = "Filled by circuit refresh";
15
- /** The table a prefix list of one family sits in. */
16
- static readonly PREFIX_LIST: {
17
- readonly ipv4: "router prefix-list";
18
- readonly ipv6: "router prefix-list6";
19
- };
20
- /** The longest prefix of each family. */
21
- static readonly BITS: {
22
- readonly ipv4: 32;
23
- readonly ipv6: 128;
24
- };
25
- /** A neighbor's settings with its group's beneath them. */
26
- static neighborSettings(device: Device, neighbor: AnyNeighbor): NeighborSettings<string, string>;
27
- /** The families a session carries: its own, or the family of its address. */
28
- static familiesOfNeighbor(device: Device, neighbor: AnyNeighbor): Family[];
29
- /** Whether a static route, OSPF or BGP detects a dead neighbor with BFD, which the device then runs. */
30
- static usesBfd(device: Device): boolean;
31
- static render(root: FortiOsBlock, device: Device): void;
32
- /** A prefix as the platform writes it in a prefix list of its family. */
33
- private static listPrefix;
34
- /** One rule of a prefix list: a prefix, and the lengths it takes within it. The device prints a bound the rule does not hold as `unset`. */
35
- static listRule(rule: FortiOsBlock, family: Family, prefix: string, lengths?: Lengths): void;
36
- /** The lengths a rule takes within a prefix to match lengths from `min` to `max`, or none when no length fits. A bound equal to the prefix's own length is left out. */
37
- static bounds(prefix: string, family: Family, min?: number, max?: number): Lengths | undefined;
38
- /** Each prefix set as a prefix list matching its prefixes and any more specific. One a registry fills starts with a rule that denies every prefix, so it matches nothing until `refresh` fills it. */
39
- private static prefixLists;
40
- /** The networks of an interface's addresses of one family, for an OSPF area to announce. */
41
- private static networksOf;
42
- /** OSPF for IPv4. An area runs on the networks of its interfaces; an interface named with a cost, a link type or BFD has settings of its own; a passive one forms no adjacency. */
43
- private static ospf;
44
- /** OSPFv3 for IPv6. Every interface of an area runs it in that area. */
45
- private static ospf6;
46
- /** BGP: each session with its settings and group's, the route maps its policies become for each family it carries, and the prefixes the device originates. */
47
- private static bgp;
48
- /** The family a rule is limited to, by its match: a family, a prefix, or a prefix set of one family. */
49
- static familyOfRule(device: Device, rule: AnyRule): Family | undefined;
50
- /** A policy's rules with each call replaced by the rules it calls, in order. A called policy that decides nothing hands back to the caller. */
51
- static flatten(device: Device, policy: string, seen?: string[]): AnyRule[];
52
- /** Routing the platform cannot express, or that this adapter does not yet write. */
53
- static gaps(device: Device): string[];
54
- private static ruleGaps;
55
- }
56
- export {};
@@ -1,37 +0,0 @@
1
- /** One `edit` of a table: its name as written, and what it holds. */
2
- export type Entry = {
3
- id: string;
4
- block: FortiOsBlock;
5
- };
6
- export declare class FortiOsBlock {
7
- readonly settings: Map<string, string>;
8
- readonly blocks: Map<string, FortiOsBlock>;
9
- readonly entries: Map<string, Entry>;
10
- /** Set a key. A value of several words is written as given. */
11
- set(key: string, value: string | number): this;
12
- /** The nested `config` block with this header, created when absent. */
13
- block(header: string): FortiOsBlock;
14
- /** The table entry with this name, created when absent. A name is quoted unless it is a number, or the table prints it bare, such as an OSPF area or an IPv6 prefix. */
15
- entry(id: string | number, plain?: boolean): FortiOsBlock;
16
- isEmpty(): boolean;
17
- }
18
- export declare class FortiOsTree {
19
- /** A setting the device prints as `unset <key>`, a key it holds empty on purpose, such as an ICMP service's type. */
20
- static readonly UNSET = "\0unset";
21
- /** A string as the CLI takes it, in double quotes. */
22
- static quote(text: string): string;
23
- /** Each of several strings quoted, as a list setting takes them. */
24
- static quoteAll(texts: readonly string[]): string;
25
- /** A value's words; a quoted string is one word with its quotes. */
26
- static words(value: string): string[];
27
- /** A word as the device means it, without quotes or escapes. */
28
- static bare(word: string): string;
29
- /** The lines that build a block, at an indent, in the form `show` prints and the CLI takes. */
30
- static lines(block: FortiOsBlock, indent?: string): string[];
31
- /** The whole configuration: each top-level block as `config <section>` to `end`. */
32
- static print(root: FortiOsBlock): string;
33
- /** Whether a line opens a quoted value it does not close, so the value goes on over the next lines. */
34
- private static unclosed;
35
- /** The tree of what `show` printed. Lines that are not configuration, such as the version header, are skipped. */
36
- static parse(text: string): FortiOsBlock;
37
- }
@@ -1,50 +0,0 @@
1
- import type { Device } from "../../schema/index.js";
2
- import type { Plan } from "../platform.js";
3
- import { FortiOsBlock } from "./tree.js";
4
- /** Where a section lives in multi-VDOM mode: the device's own, or one VDOM's. */
5
- type Scope = {
6
- kind: "global";
7
- } | {
8
- kind: "vdom";
9
- vdom: string;
10
- };
11
- export declare class FortiOsVdoms {
12
- /** The VDOM everything is in unless named otherwise. */
13
- static readonly ROOT = "root";
14
- /**
15
- * Sections under `config global` in multi-VDOM mode, from FortiOS 6.2's CLI reference: the device's identity, logins, interfaces, name resolution, time, SNMP, logging targets, flow export and session helpers. Every other section belongs to a VDOM. Not proved on a device yet.
16
- */
17
- static readonly GLOBAL: Set<string>;
18
- /** What a management VDOM holds: its routes, and who reaches the device's own services through it, with the objects those name. */
19
- static readonly MANAGEMENT_SECTIONS: readonly ["firewall address", "firewall address6", "firewall addrgrp", "firewall addrgrp6", "firewall service custom", "router static", "router static6", "firewall local-in-policy", "firewall local-in-policy6"];
20
- /** The management VDOM's name, when the device has one. */
21
- static managementOf(device: Device): string | undefined;
22
- /** The VDOM a port or interface is in, by Circuit's name. A port in a LAG is where its LAG is. */
23
- static vdomOf(device: Device, name: string): string;
24
- /** A management VDOM's section as the render and the read write it. */
25
- static key(vdom: string, section: string): string;
26
- /** A section's scope, and its name as the device writes it. */
27
- static scopeOf(key: string): {
28
- scope: Scope;
29
- section: string;
30
- };
31
- /** Whether a configuration runs in multi-VDOM mode. */
32
- static isMulti(tree: FortiOsBlock): boolean;
33
- /** Lines sent in a scope: inside `config global`, or inside one VDOM. */
34
- static wrap(scope: Scope, lines: readonly string[]): string[];
35
- /** What `show` printed in a management VDOM, each top-level section named as the render names it. */
36
- static named(vdom: string, text: string): string;
37
- /** The VDOMs `diagnose sys vd list` names, such as `name=mgmt/mgmt index=1`. */
38
- static listed(text: string): string[];
39
- /**
40
- * A plan for a device that may run in multi-VDOM mode. In one VDOM it is `planOne` as it is. In several, each scope is planned on its own and its steps sent in that scope: the global steps first, then each VDOM's, then the global removals, so an interface is gone only once no VDOM names it.
41
- *
42
- * Turning multi-VDOM mode on or off, and moving an interface into another VDOM, are left to an operator: the first moves everything into `root` and ends every session, and the second can cut the way in. A plan that needs either holds only the problem.
43
- */
44
- static plan(desired: string, current: string, planOne: (desired: string, current: string) => Plan): Plan;
45
- /** Interfaces the config puts in another VDOM than the device has them in. */
46
- private static moved;
47
- /** What a management VDOM can't hold yet, or a config with one can't have. */
48
- static gaps(device: Device): string[];
49
- }
50
- export {};
@@ -1,13 +0,0 @@
1
- import type { Platform } from "./platform.js";
2
- /** Every platform the framework can render and apply, by name. */
3
- export declare class Platforms {
4
- private static readonly BY_NAME;
5
- /** The platform of that name, or undefined when there is none. */
6
- static find(name: string): Platform | undefined;
7
- /** The platform of that name. Throws when there is none. */
8
- static get(name: string): Platform;
9
- /** Every platform, in the order the framework lists them. */
10
- static all(): Platform[];
11
- /** Every platform's name. */
12
- static names(): string[];
13
- }
@@ -1,44 +0,0 @@
1
- import type { Device, Neighbor, NeighborSettings } from "../../schema/index.js";
2
- import { type JunosStatements } from "./render.js";
3
- type AnyNeighbor = Neighbor<string, string, string>;
4
- /** BGP sessions, the policies they use, prefix sets and RPKI servers, added to one device's statements. */
5
- export declare class JunosBgp {
6
- private readonly out;
7
- private readonly device;
8
- /** The policy a session uses when it states none, so that it learns or announces nothing. */
9
- private static readonly REJECT_ALL;
10
- /** The policy every export starts with. BGP's own routes and the prefixes the device originates go on to the session's policy; the device's other routes never reach it. */
11
- private static readonly ORIGIN;
12
- /** The validator group every RPKI server joins. */
13
- private static readonly RPKI_GROUP;
14
- /** A comment in the render naming a path whose statements `refresh` fills, so the plan keeps what the device holds there. */
15
- static readonly GENERATED = "# generated ";
16
- private static readonly FAMILY;
17
- private static readonly VALIDATION;
18
- private constructor();
19
- /** Add the device's prefix sets, RPKI servers, BGP sessions and the policies they use. */
20
- static render(out: JunosStatements, device: Device): void;
21
- /** A neighbor's settings with its group's beneath them. */
22
- static settingsOf(device: Device, neighbor: AnyNeighbor): NeighborSettings<string, string>;
23
- /** A name made of a value's words, for a community or a path-length list: `64500:*` becomes `64500-any`. */
24
- private static slug;
25
- /** A community as the platform writes a member: a large community carries the `large:` prefix. */
26
- private static member;
27
- /** A term's name: its place, then the rule's description so a reader sees it on the device. */
28
- private static termName;
29
- private sessions;
30
- /** BGP's routes and the originated prefixes go on to the session's policy; anything else is rejected. */
31
- private origin;
32
- private prefixSets;
33
- private rpki;
34
- /** The family a rule is limited to, by its match: a family, a prefix, or a prefix set of one family. */
35
- private familyOfRule;
36
- /** A policy's rules with each call replaced by the rules it calls, in order. A called policy that decides nothing hands back to the caller, as it does on every platform. */
37
- private flatten;
38
- /** One policy as a policy statement: a term per rule, then a reject when the last rule does not decide on every route. */
39
- private policyStatement;
40
- private term;
41
- /** A named community holding these members, named after them. */
42
- private community;
43
- }
44
- export {};