@takodotid/circuit 0.34.2 → 0.35.0

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 (240) hide show
  1. package/README.md +13 -14
  2. package/dist/chunks/index-20kcjxjg.js +174 -0
  3. package/dist/chunks/index-2r4bbhac.js +977 -0
  4. package/dist/chunks/index-n7w3tg5y.js +149 -0
  5. package/dist/chunks/new-w3zys5y4.js +172 -0
  6. package/dist/chunks/server-gzsf5me5.js +259 -0
  7. package/dist/cli/index.js +11347 -9018
  8. package/dist/helpers/index.js +594 -0
  9. package/dist/index.js +9 -28
  10. package/dist/types/core/{addresses.d.ts → address-space.d.ts} +23 -7
  11. package/dist/types/core/address.d.ts +44 -0
  12. package/dist/types/core/cabling.d.ts +41 -0
  13. package/dist/types/core/cross-checks.d.ts +28 -0
  14. package/dist/types/core/define.d.ts +25 -3
  15. package/dist/types/core/project-files.d.ts +12 -0
  16. package/dist/types/core/schema-docs.d.ts +13 -4
  17. package/dist/types/core/secrets.d.ts +62 -21
  18. package/dist/types/core/{graph.d.ts → topology.d.ts} +32 -12
  19. package/dist/types/core/utils.d.ts +8 -0
  20. package/dist/types/core/validator.d.ts +19 -0
  21. package/dist/types/helpers/bgp.d.ts +97 -0
  22. package/dist/types/helpers/checks.d.ts +32 -0
  23. package/dist/types/helpers/exchange.d.ts +49 -0
  24. package/dist/types/helpers/filters.d.ts +51 -0
  25. package/dist/types/helpers/index.d.ts +10 -0
  26. package/dist/types/helpers/route-server.d.ts +52 -0
  27. package/dist/types/index.d.ts +5 -3
  28. package/dist/types/integrations/librenms.d.ts +60 -0
  29. package/dist/types/integrations/netbox.d.ts +89 -0
  30. package/dist/types/integrations/peeringdb.d.ts +24 -0
  31. package/dist/types/integrations/prometheus.d.ts +24 -0
  32. package/dist/types/integrations/registries.d.ts +8 -0
  33. package/dist/types/platforms/bgp-wait.d.ts +18 -0
  34. package/dist/types/platforms/catalog.d.ts +109 -0
  35. package/dist/types/platforms/derive.d.ts +17 -0
  36. package/dist/types/platforms/fortios/firewall.d.ts +45 -0
  37. package/dist/types/platforms/fortios/index.d.ts +134 -0
  38. package/dist/types/platforms/fortios/names.d.ts +52 -0
  39. package/dist/types/platforms/fortios/plan.d.ts +104 -0
  40. package/dist/types/platforms/fortios/render.d.ts +75 -0
  41. package/dist/types/platforms/fortios/routing.d.ts +56 -0
  42. package/dist/types/platforms/fortios/tree.d.ts +37 -0
  43. package/dist/types/platforms/index.d.ts +13 -0
  44. package/dist/types/platforms/junos/bgp.d.ts +44 -0
  45. package/dist/types/platforms/junos/index.d.ts +114 -0
  46. package/dist/types/platforms/junos/render.d.ts +154 -0
  47. package/dist/types/platforms/line-diff.d.ts +67 -0
  48. package/dist/types/platforms/platform.d.ts +120 -0
  49. package/dist/types/platforms/raisecom-ros/index.d.ts +71 -0
  50. package/dist/types/platforms/raisecom-ros/render.d.ts +41 -0
  51. package/dist/types/platforms/routeros/export.d.ts +59 -0
  52. package/dist/types/platforms/routeros/index.d.ts +96 -0
  53. package/dist/types/{adapters/devices → platforms}/routeros/models.d.ts +4 -0
  54. package/dist/types/platforms/routeros/plan.d.ts +54 -0
  55. package/dist/types/platforms/routeros/render.d.ts +240 -0
  56. package/dist/types/platforms/vrp/index.d.ts +83 -0
  57. package/dist/types/platforms/vrp/render.d.ts +96 -0
  58. package/dist/types/schema/common.d.ts +12 -6
  59. package/dist/types/schema/index.d.ts +1 -0
  60. package/dist/types/schema/interfaces.d.ts +14 -6
  61. package/dist/types/schema/policy.d.ts +18 -10
  62. package/dist/types/schema/routing.d.ts +14 -1
  63. package/dist/types/schema/system.d.ts +16 -6
  64. package/dist/types/schema/time-zones.d.ts +2 -0
  65. package/dist/types/transport/console.d.ts +79 -23
  66. package/dist/types/transport/path-check.d.ts +32 -0
  67. package/dist/types/transport/ssh.d.ts +17 -15
  68. package/package.json +17 -11
  69. package/src/cli/graph-format.ts +91 -0
  70. package/src/cli/index.ts +1074 -484
  71. package/src/cli/new.ts +208 -175
  72. package/src/cli/rename.ts +97 -91
  73. package/src/core/address-space.ts +320 -0
  74. package/src/core/address.ts +202 -0
  75. package/src/core/cabling.ts +154 -0
  76. package/src/core/cross-checks.ts +364 -0
  77. package/src/core/define.ts +26 -3
  78. package/src/core/project-files.ts +35 -0
  79. package/src/core/schema-docs.ts +138 -130
  80. package/src/core/secrets.ts +170 -76
  81. package/src/core/topology.ts +656 -0
  82. package/src/core/utils.ts +37 -0
  83. package/src/core/validator.ts +407 -0
  84. package/src/helpers/bgp.ts +301 -0
  85. package/src/helpers/checks.ts +178 -0
  86. package/src/helpers/exchange.ts +117 -0
  87. package/src/helpers/filters.ts +107 -0
  88. package/src/helpers/index.ts +12 -0
  89. package/src/helpers/route-server.ts +212 -0
  90. package/src/index.ts +6 -3
  91. package/src/integrations/librenms.ts +291 -0
  92. package/src/integrations/netbox.ts +620 -0
  93. package/src/integrations/peeringdb.ts +173 -0
  94. package/src/integrations/prometheus.ts +90 -0
  95. package/src/integrations/registries.ts +25 -0
  96. package/src/platforms/bgp-wait.ts +41 -0
  97. package/src/platforms/catalog.ts +69 -0
  98. package/src/platforms/derive.ts +117 -0
  99. package/src/{adapters/devices → platforms}/fortios/TRAPS.md +6 -0
  100. package/src/platforms/fortios/firewall.ts +377 -0
  101. package/src/platforms/fortios/index.ts +1060 -0
  102. package/src/platforms/fortios/names.ts +130 -0
  103. package/src/platforms/fortios/plan.ts +929 -0
  104. package/src/platforms/fortios/render.ts +779 -0
  105. package/src/platforms/fortios/routing.ts +476 -0
  106. package/src/platforms/fortios/tree.ts +129 -0
  107. package/src/platforms/index.ts +36 -0
  108. package/src/{adapters/devices → platforms}/junos/TRAPS.md +8 -0
  109. package/src/platforms/junos/bgp.ts +293 -0
  110. package/src/platforms/junos/index.ts +1006 -0
  111. package/src/platforms/junos/render.ts +967 -0
  112. package/src/platforms/line-diff.ts +244 -0
  113. package/src/platforms/platform.ts +122 -0
  114. package/src/platforms/raisecom-ros/TRAPS.md +40 -0
  115. package/src/platforms/raisecom-ros/index.ts +731 -0
  116. package/src/platforms/raisecom-ros/render.ts +328 -0
  117. package/src/{adapters/devices → platforms}/routeros/TRAPS.md +16 -2
  118. package/src/platforms/routeros/export.ts +342 -0
  119. package/src/platforms/routeros/index.ts +636 -0
  120. package/src/{adapters/devices → platforms}/routeros/models.ts +2 -0
  121. package/src/platforms/routeros/plan.ts +444 -0
  122. package/src/platforms/routeros/render.ts +1483 -0
  123. package/src/platforms/vrp/TRAPS.md +45 -0
  124. package/src/platforms/vrp/index.ts +652 -0
  125. package/src/platforms/vrp/render.ts +615 -0
  126. package/src/schema/common.ts +15 -6
  127. package/src/schema/index.ts +1 -0
  128. package/src/schema/interfaces.ts +15 -5
  129. package/src/schema/policy.ts +22 -10
  130. package/src/schema/routing.ts +16 -1
  131. package/src/schema/system.ts +16 -6
  132. package/src/schema/time-zones.ts +482 -0
  133. package/src/studio/data.ts +172 -168
  134. package/src/studio/git.ts +95 -90
  135. package/src/studio/public/app.js +161 -150
  136. package/src/studio/public/compare.js +219 -212
  137. package/src/studio/public/diff.js +77 -75
  138. package/src/studio/public/dom.js +118 -108
  139. package/src/studio/public/evaluate.js +584 -545
  140. package/src/studio/public/export.js +120 -118
  141. package/src/studio/public/graph.js +1343 -1266
  142. package/src/studio/public/net.js +115 -109
  143. package/src/studio/public/tables.js +1135 -1083
  144. package/src/studio/public/tools.js +561 -529
  145. package/src/studio/server.ts +202 -196
  146. package/src/transport/console.ts +363 -271
  147. package/src/transport/path-check.ts +91 -0
  148. package/src/transport/ssh.ts +98 -94
  149. package/templates/colocation/checks.ts +11 -6
  150. package/templates/colocation/edge-01.ts +9 -9
  151. package/templates/colocation/routing.ts +2 -2
  152. package/templates/colocation/tenancy.ts +3 -3
  153. package/templates/colocation/tor-01.ts +3 -3
  154. package/templates/edge-router/checks.ts +4 -4
  155. package/templates/edge-router/edge-01.ts +5 -5
  156. package/templates/edge-router/routing.ts +2 -2
  157. package/templates/project/AGENTS.md +5 -1
  158. package/templates/single-site/checks.ts +2 -2
  159. package/dist/chunks/index-47debt16.js +0 -956
  160. package/dist/chunks/index-v8zgr7wm.js +0 -128
  161. package/dist/chunks/new-ny89s7y7.js +0 -166
  162. package/dist/chunks/server-tjbb3rqc.js +0 -251
  163. package/dist/presets/index.js +0 -394
  164. package/dist/types/adapters/devices/catalog.d.ts +0 -86
  165. package/dist/types/adapters/devices/derive.d.ts +0 -7
  166. package/dist/types/adapters/devices/fortios/firewall.d.ts +0 -23
  167. package/dist/types/adapters/devices/fortios/index.d.ts +0 -58
  168. package/dist/types/adapters/devices/fortios/names.d.ts +0 -48
  169. package/dist/types/adapters/devices/fortios/plan.d.ts +0 -28
  170. package/dist/types/adapters/devices/fortios/render.d.ts +0 -38
  171. package/dist/types/adapters/devices/fortios/routing.d.ts +0 -32
  172. package/dist/types/adapters/devices/fortios/tree.d.ts +0 -33
  173. package/dist/types/adapters/devices/index.d.ts +0 -3
  174. package/dist/types/adapters/devices/junos/bgp.d.ts +0 -11
  175. package/dist/types/adapters/devices/junos/index.d.ts +0 -42
  176. package/dist/types/adapters/devices/junos/render.d.ts +0 -52
  177. package/dist/types/adapters/devices/lines.d.ts +0 -56
  178. package/dist/types/adapters/devices/raisecom-ros/index.d.ts +0 -28
  179. package/dist/types/adapters/devices/routeros/export.d.ts +0 -39
  180. package/dist/types/adapters/devices/routeros/index.d.ts +0 -30
  181. package/dist/types/adapters/devices/routeros/plan.d.ts +0 -4
  182. package/dist/types/adapters/devices/routeros/render.d.ts +0 -100
  183. package/dist/types/adapters/devices/types.d.ts +0 -40
  184. package/dist/types/adapters/devices/vrp/index.d.ts +0 -27
  185. package/dist/types/adapters/registries/index.d.ts +0 -3
  186. package/dist/types/adapters/registries/librenms.d.ts +0 -15
  187. package/dist/types/adapters/registries/peeringdb.d.ts +0 -16
  188. package/dist/types/adapters/registries/prometheus.d.ts +0 -16
  189. package/dist/types/core/across.d.ts +0 -4
  190. package/dist/types/core/addr.d.ts +0 -34
  191. package/dist/types/core/files.d.ts +0 -6
  192. package/dist/types/core/merge.d.ts +0 -4
  193. package/dist/types/core/time.d.ts +0 -2
  194. package/dist/types/core/validate.d.ts +0 -2
  195. package/dist/types/presets/index.d.ts +0 -183
  196. package/src/adapters/devices/catalog.ts +0 -41
  197. package/src/adapters/devices/derive.ts +0 -59
  198. package/src/adapters/devices/fortios/firewall.ts +0 -362
  199. package/src/adapters/devices/fortios/index.ts +0 -923
  200. package/src/adapters/devices/fortios/names.ts +0 -115
  201. package/src/adapters/devices/fortios/plan.ts +0 -888
  202. package/src/adapters/devices/fortios/render.ts +0 -768
  203. package/src/adapters/devices/fortios/routing.ts +0 -444
  204. package/src/adapters/devices/fortios/tree.ts +0 -121
  205. package/src/adapters/devices/index.ts +0 -9
  206. package/src/adapters/devices/junos/bgp.ts +0 -269
  207. package/src/adapters/devices/junos/index.ts +0 -862
  208. package/src/adapters/devices/junos/render.ts +0 -872
  209. package/src/adapters/devices/lines.ts +0 -212
  210. package/src/adapters/devices/raisecom-ros/TRAPS.md +0 -25
  211. package/src/adapters/devices/raisecom-ros/index.ts +0 -693
  212. package/src/adapters/devices/routeros/export.ts +0 -321
  213. package/src/adapters/devices/routeros/index.ts +0 -346
  214. package/src/adapters/devices/routeros/plan.ts +0 -398
  215. package/src/adapters/devices/routeros/render.ts +0 -1490
  216. package/src/adapters/devices/types.ts +0 -38
  217. package/src/adapters/devices/vrp/TRAPS.md +0 -26
  218. package/src/adapters/devices/vrp/index.ts +0 -865
  219. package/src/adapters/registries/index.ts +0 -19
  220. package/src/adapters/registries/librenms.ts +0 -92
  221. package/src/adapters/registries/peeringdb.ts +0 -169
  222. package/src/adapters/registries/prometheus.ts +0 -71
  223. package/src/cli/graph.ts +0 -89
  224. package/src/core/across.ts +0 -350
  225. package/src/core/addr.ts +0 -174
  226. package/src/core/addresses.ts +0 -316
  227. package/src/core/files.ts +0 -32
  228. package/src/core/graph.ts +0 -640
  229. package/src/core/merge.ts +0 -19
  230. package/src/core/time.ts +0 -15
  231. package/src/core/validate.ts +0 -348
  232. package/src/presets/index.ts +0 -579
  233. /package/dist/types/{adapters/devices → platforms}/fortios/models.d.ts +0 -0
  234. /package/dist/types/{adapters/devices → platforms}/junos/models.d.ts +0 -0
  235. /package/dist/types/{adapters/devices → platforms}/raisecom-ros/models.d.ts +0 -0
  236. /package/dist/types/{adapters/devices → platforms}/vrp/models.d.ts +0 -0
  237. /package/src/{adapters/devices → platforms}/fortios/models.ts +0 -0
  238. /package/src/{adapters/devices → platforms}/junos/models.ts +0 -0
  239. /package/src/{adapters/devices → platforms}/raisecom-ros/models.ts +0 -0
  240. /package/src/{adapters/devices → platforms}/vrp/models.ts +0 -0
@@ -0,0 +1,54 @@
1
+ import type { ApplyOptions, Plan } from "../platform";
2
+ export declare class RouterOsPlan {
3
+ private readonly sendSecrets;
4
+ /** A plan line the apply handles itself: upload a certificate and its key, and import them. */
5
+ static readonly INSTALL_CERTIFICATE = "#install-certificate ";
6
+ /** Dependency order. A menu not listed sorts after all of these. The longest matching prefix decides. */
7
+ private static readonly ORDER;
8
+ /** Menus that also hold entries the device learned rather than was told. A selector must not match those. */
9
+ private static readonly DYNAMIC;
10
+ /** Menus where an entry that keeps its name but changes what it is known by is changed with a `set`, so what points at it by name, such as an address on a VLAN interface, stays attached. In every other menu it is removed and added again. */
11
+ private static readonly CHANGED_IN_PLACE;
12
+ /** The variable holding the old rules of an ordered menu while the new ones are added. Removed when the rewrite ends. */
13
+ private static readonly OLD_RULES;
14
+ /** What blocks an apply: something this plan cannot converge. */
15
+ private readonly problems;
16
+ /** Also send every secret, so a rotated value reaches the device. */
17
+ private constructor();
18
+ /** What it takes to go from `current` to `desired`. */
19
+ static of(desired: string, current: string, options: Pick<ApplyOptions, "secrets">): Plan;
20
+ private static rank;
21
+ /** Quote a value for a command. */
22
+ private static quote;
23
+ /** A value as a command takes it: bare when plain, quoted otherwise. A bare value is checked by `:parse` against the values the property takes; a quoted one is not (TRAPS.md). */
24
+ private static value;
25
+ /** In a `find`, a quoted `yes` is a string and matches no boolean, while an unquoted slash matches nothing. Plain words go bare, anything else quoted. */
26
+ private static findValue;
27
+ /** A selector for the entry with this identity. */
28
+ private static find;
29
+ /** A whole command as sent: menu, verb, selector, flags, then properties. */
30
+ private static line;
31
+ private static describe;
32
+ /** Group commands by menu. */
33
+ private static byMenu;
34
+ /**
35
+ * The properties to send so that the device's entry matches the rendered one. A property the device holds and the render does not state is reset to its default.
36
+ */
37
+ private changes;
38
+ /** Settings addressed by a selector: `set ftp ...`, `set [ find default=yes ] ...`. They are changed, never added or removed. */
39
+ private settings;
40
+ /** Entries, told apart by identity. New ones are added, changed ones set, and ones the render does not hold removed in the last phase. */
41
+ private entries;
42
+ /**
43
+ * Certificates are installed from the config when missing or different, after the old one of that name is removed. One the device holds under another name, with the same fingerprint and key, is renamed rather than imported a second time. One the config does not hold is removed in the last phase.
44
+ */
45
+ private static certificates;
46
+ /**
47
+ * An ordered menu is rewritten whole whenever it differs, so the device lists its rules in the order the render gives.
48
+ *
49
+ * The old rules are captured, the new ones added after them, then the captured ones removed. Until that moment the old rules keep deciding, so no chain is ever empty or half new.
50
+ *
51
+ * In a menu with chains, an old rule is removed in this step only if its chain is still wanted. A chain no longer wanted is removed in the last phase, after whatever pointed at it has been changed.
52
+ */
53
+ private static ordered;
54
+ }
@@ -0,0 +1,240 @@
1
+ import type { AclRule, Device, Ethertype, Interface, Port } from "../../schema";
2
+ /** A property value as a command takes it. `undefined` and `false` leave the property out. */
3
+ export type Value = string | number | undefined | false;
4
+ export type AnyPort = Port<string, string, string, string>;
5
+ /** One switch rule: the port it is on, the ACL rule it comes from, and the one source and destination port or range it takes. */
6
+ export type SwitchRule = {
7
+ port: string;
8
+ rule: AclRule<string>;
9
+ srcPort?: string;
10
+ dstPort?: string;
11
+ };
12
+ export type AnyInterface = Interface<string, string>;
13
+ type Speed = NonNullable<AnyPort["speed"]>;
14
+ /** One device's render: the device, and the commands collected under their menu. */
15
+ export declare class RouterOsRender {
16
+ private readonly device;
17
+ /** The bridge every switched port joins. One per device. */
18
+ private static readonly BRIDGE;
19
+ /** Destination of spanning tree BPDUs, so a filter can drop them on one port. */
20
+ private static readonly BPDU_DESTINATION;
21
+ /** The platform names a fixed speed by its medium: an optic in a cage, or copper. */
22
+ private static readonly MEDIUM;
23
+ /** Address lists holding the prefixes BGP originates. A session reads the one of its family. */
24
+ private static readonly NETWORKS;
25
+ /** A kind of frame as a switch rule's `mac-protocol` names it. */
26
+ private static readonly MAC_PROTOCOLS;
27
+ /** Helpers the platform has, all stated so that one the config does not list is off. */
28
+ private static readonly HELPERS;
29
+ private static readonly CHAINS;
30
+ /** The validator group every RPKI server joins. */
31
+ private static readonly RPKI_GROUP;
32
+ /** The chain a session without a policy uses, so that it learns or announces nothing. */
33
+ private static readonly REJECT_ALL;
34
+ private static readonly ROLES;
35
+ /** Neutral service name to the platform's. `native` is the platform's own desktop client. */
36
+ private static readonly SERVICES;
37
+ private static readonly USER_GROUPS;
38
+ private static readonly SNMP_AUTH;
39
+ private static readonly SNMP_PRIVACY;
40
+ /** Severity threshold to the topics the platform logs under, most severe first. */
41
+ private static readonly TOPICS;
42
+ private static readonly SEVERITY_ORDER;
43
+ private readonly ports;
44
+ private readonly interfaces;
45
+ /** Commands under their menu. */
46
+ private readonly menus;
47
+ private constructor();
48
+ /** The whole configuration the device should run. */
49
+ static of(device: Device): string;
50
+ /** The platform's name for a fixed speed on a port, or undefined when it has none. */
51
+ static medium(platformPortName: string, speed: Speed): string | undefined;
52
+ /** Quote a value when it holds anything but plain characters. */
53
+ private static quote;
54
+ /**
55
+ * A command: a verb such as `add` or `set [ find name=x ]`, then `property=value` for every property that has a value.
56
+ *
57
+ * Properties are written in the order given.
58
+ */
59
+ private static command;
60
+ /** `yes` or `no`. */
61
+ private static yesNo;
62
+ /** `V4` or `V6`, the suffix of a chain rendered for one family. */
63
+ private static familySuffix;
64
+ /** Each port or range of ports as the platform writes it: `53`, `0-52`. */
65
+ private static eachPort;
66
+ /** One port, a range, or a list of them, as `53,0-52`. */
67
+ private static portList;
68
+ /** Seconds as the platform writes a duration: `3600` becomes `1h`, `90` becomes `1m30s`. */
69
+ private static duration;
70
+ /** A rate as the switch chip takes it: `2G` becomes `2.0Gbps`. */
71
+ private static bitrate;
72
+ /** An IPv4 prefix with a dotted mask, as the switch chip takes it: `10.0.0.0/8` becomes `10.0.0.0/255.0.0.0`. */
73
+ private static dottedMask;
74
+ /** A community pattern with `*` as a regular expression the platform matches on: `64500:*:*` becomes `^64500:[0-9]+:[0-9]+$`. */
75
+ private static communityPattern;
76
+ /** The name of the VLAN interface under one with a MAC of its own, which takes the configured name itself. */
77
+ private static underMacvlan;
78
+ /** The interface holding one VRRP group. */
79
+ private static vrrpName;
80
+ /** `host:port` into its parts. The last colon separates them, so an IPv6 host keeps its own. */
81
+ private static splitEndpoint;
82
+ /** The chain a policy is rendered as for one family. A policy can test prefix lengths that mean different things per family, so each family gets its own. */
83
+ private static chainName;
84
+ /** The conditions of a rule, as the platform's filter language writes them. */
85
+ private static conditions;
86
+ /** What a rule does to a matching route, then its decision. */
87
+ private static actions;
88
+ /** One rule as the platform writes it: hand off, ask the validator, test, change, decide. */
89
+ private static ruleText;
90
+ /** SHA-256 of the certificate's DER encoding, lowercase hex, as the platform prints it. */
91
+ private static fingerprint;
92
+ /** Every topic at or above a severity. Emergency and alert are logged as critical; the platform has no notice topic. */
93
+ private static topicsFrom;
94
+ /** Add a line to a menu as it is. */
95
+ private addLine;
96
+ /** Add a command to a menu. */
97
+ private add;
98
+ /** The whole configuration as text. */
99
+ private text;
100
+ /** What the platform calls a port or an interface. A port is spelled by the model; an interface keeps its config name. */
101
+ private name;
102
+ /** The number of a VLAN, by its config name. */
103
+ private vlanId;
104
+ /** Ports and LAGs that are layer 2 members of a VLAN, with their settings. A port in a LAG is represented by the LAG. */
105
+ private switched;
106
+ /** VLAN interfaces, with their settings. */
107
+ private declaredVlanInterfaces;
108
+ /** Every port and interface that holds addresses or other layer 3 settings. Ports are named as the platform spells them. */
109
+ private routed;
110
+ private interfaceMenus;
111
+ /**
112
+ * Routing in the switch chip. With it on, routed traffic bypasses the forward chain unless its interface opts out.
113
+ *
114
+ * Restarting the offload after a failure, and offloading IPv6 too, follow the same switch.
115
+ */
116
+ private hardwareOffload;
117
+ /** One VLAN-filtering bridge carries every switched port. A loopback is a bridge with no ports, the platform's idiom for one. */
118
+ private bridge;
119
+ /** Every port of the model is stated. One the config does not declare is disabled. */
120
+ private ethernet;
121
+ /**
122
+ * Storm control in the switch chip. The platform takes one rate, in percent, and which kinds of flooded traffic it limits.
123
+ *
124
+ * `unsupported()` refuses packets per second and different percentages per kind, so here they are always one shared percent.
125
+ */
126
+ private switchPorts;
127
+ /** A LAG is a bonding interface. Its members are named as the platform spells them. */
128
+ private lags;
129
+ /**
130
+ * A VLAN interface sits on the bridge. When the device offloads, one that opts out is routed in software so the firewall applies.
131
+ *
132
+ * Every VLAN interface on the bridge has the bridge's MAC. One with a MAC of its own is a MACVLAN on top of the VLAN interface: the MACVLAN takes the configured name, so its addresses and every rule naming it land on it.
133
+ */
134
+ private vlanInterfaces;
135
+ private tunnels;
136
+ private wireguard;
137
+ /** Each VRRP group is an interface of its own, holding the shared address. Version 3 carries IPv6. */
138
+ private vrrp;
139
+ /** A switched port or LAG joins the bridge. Its untagged VLAN is its port VLAN ID. */
140
+ private bridgePorts;
141
+ /** A VLAN is tagged on every trunk carrying it, and on the bridge itself when the router has an interface in it. */
142
+ private bridgeVlans;
143
+ /** The platform cannot take a port out of spanning tree, so `stp: false` drops the BPDUs it would send and receive. */
144
+ private bridgeFilters;
145
+ /**
146
+ * Interface lists scope what works at layer 2: neighbor discovery, and the platform's own client over MAC. The IP firewall never sees either.
147
+ */
148
+ private interfaceLists;
149
+ /**
150
+ * Where LLDP runs, when it is limited to some ports. Undefined when it runs everywhere or nowhere, which the discovery settings say directly.
151
+ */
152
+ private lldpMembers;
153
+ /** A VRF lists its interfaces. */
154
+ private vrfs;
155
+ private addressing;
156
+ /** Every address goes on the menu of its family, with the interface's description as its comment. */
157
+ private addresses;
158
+ private dhcp;
159
+ private dns;
160
+ /**
161
+ * Address lists come from firewall address sets, prefix sets typed in the config, and what BGP originates.
162
+ *
163
+ * A prefix set fetched from a registry is filled by `refresh`, so only its name is marked, and the plan leaves its entries alone.
164
+ */
165
+ private addressLists;
166
+ private firewall;
167
+ /** Untracked prefixes skip connection tracking in the raw table, both ways, before a connection is ever made. */
168
+ private untracked;
169
+ /**
170
+ * The families a rule applies to. An address in the rule decides it; otherwise it applies to both.
171
+ *
172
+ * A rule naming an address set applies only to the families the set has members in.
173
+ */
174
+ private families;
175
+ /** The match properties of a rule, as the platform names them. */
176
+ private matchProperties;
177
+ private filter;
178
+ private nat;
179
+ private helpers;
180
+ /**
181
+ * ACLs run in the switch chip on the port traffic arrives on. The chip matches addresses with a dotted mask on IPv4, drops by forwarding to no port, and limits by rate. A rule takes one port or range, so a list becomes one rule for each.
182
+ */
183
+ private switchAcls;
184
+ /**
185
+ * A port that takes only some kinds of frame: a rule that lets each kind through, then one that drops the rest. The chip takes the first rule that matches on the port, so these come after the port's ACL, whose rules match only IPv4 or IPv6.
186
+ */
187
+ private ethertypeFilters;
188
+ /** The ports with an ethertype filter, with the kinds each takes. Each makes one switch rule per kind and one more. */
189
+ static ethertypeFilters(device: Device): {
190
+ port: string;
191
+ ethertypes: readonly Ethertype[];
192
+ }[];
193
+ /** Every switch rule the device's hardware ACLs make, in order: one for each port with an ACL, each rule of it, and each source and destination port or range of the rule. */
194
+ static switchRules(device: Device): SwitchRule[];
195
+ private routing;
196
+ private staticRoutes;
197
+ private rpki;
198
+ /** The default instance exists on every device; it is stated in the form the export prints it. */
199
+ private bgpInstance;
200
+ /** A neighbor's settings with its group's beneath them. */
201
+ private settingsOf;
202
+ /** The families a neighbor exchanges: the ones it states, or its address's. */
203
+ private familiesOf;
204
+ /** Does a rule belong on a family's chain? A rule naming a prefix, a family, or a prefix set of one family belongs only there. */
205
+ private appliesTo;
206
+ /**
207
+ * Policies become filter chains, one per family a session uses, plus every chain those call.
208
+ *
209
+ * A chain a session uses directly ends in a reject when its last rule does not decide, so a route nothing accepted is rejected on any platform default. A chain only called returns to its caller instead.
210
+ */
211
+ private policies;
212
+ /** One connection per neighbor. The platform carries one family per connection. */
213
+ private bgpConnections;
214
+ /** One instance per OSPF version, an area per area and instance, and a template per interface. */
215
+ private ospf;
216
+ /**
217
+ * BFD runs where a session or an OSPF interface asks for it, with the device's timers when it states them. One configuration covers every interface. A multihop session has no interface, and BFD for it is forbidden unless a configuration names its address, so each gets one of its own.
218
+ */
219
+ private bfd;
220
+ private management;
221
+ /** Every service the platform has is stated. One the config does not name is disabled. */
222
+ private services;
223
+ /** What works at layer 2: the platform's client over MAC, MAC ping, the bandwidth test server and neighbor discovery. */
224
+ private layerTwo;
225
+ /**
226
+ * The platform keeps one community it will not delete. With version 2c it becomes the read community; without, it is disabled. Version 3 users are communities of their own.
227
+ */
228
+ private snmp;
229
+ private users;
230
+ /**
231
+ * Certificates are not part of an export, so the reader lists them in this same form: a name, the SHA-256 fingerprint of the certificate, and whether the device holds its private key. A difference is installed from the config, not edited.
232
+ */
233
+ private certificates;
234
+ private system;
235
+ /** Local logging uses the platform's built-in disk action, number 1. Each remote collector gets an action of its own. */
236
+ private logging;
237
+ /** NetFlow version 9 and IPFIX through traffic flow. The platform has no sFlow, which `unsupported()` reports. */
238
+ private flowExport;
239
+ }
240
+ export {};
@@ -0,0 +1,83 @@
1
+ import type { Neighbor } from "../../core/cabling";
2
+ import type { Device } from "../../schema";
3
+ import { type ConsoleDialect } from "../../transport/console";
4
+ import { type ApplyOptions, type OsSupport, type Plan, type ReadOptions, type ReadSession, Platform } from "../platform";
5
+ export declare class Vrp extends Platform {
6
+ /** How the console asks for a login: the same question to change the password, always answered no, a system view left with `return`, and the line's banner after a logout or a refused password answered with Enter. Not yet proved on a device. */
7
+ static readonly CONSOLE: ConsoleDialect;
8
+ /** Lines the device prints whatever is configured, or that describe the hardware rather than its configuration. */
9
+ private static readonly DEVICE_FACTS;
10
+ /** Lines whose removal takes only their keyword, not their value. */
11
+ private static readonly UNDO_BY_KEYWORD;
12
+ /** Lines a new line of the same kind replaces whole, so the old one is not undone first. */
13
+ private static readonly REPLACED_WHOLE;
14
+ private static readonly DIALECT;
15
+ /** The platform offers an ECDSA host key it then signs wrongly, so RSA is asked for. */
16
+ private static readonly HOST_KEYS;
17
+ /** What the device prints when it refuses a line. */
18
+ private static readonly REFUSED;
19
+ /** A setting whose password the platform asks for interactively: the command, then the password, then the password again. */
20
+ private static readonly INTERACTIVE;
21
+ private static readonly NOT_SAVED;
22
+ /** Commands that only read. A `?` sent by a script is run, not taken as help, so a line with one is refused. */
23
+ private static readonly READS;
24
+ readonly name = "vrp";
25
+ readonly os: OsSupport;
26
+ readonly extension = ".cfg";
27
+ readonly console: ConsoleDialect;
28
+ unsupported(device: Device): string[];
29
+ render(device: Device): string;
30
+ /** What the device runs, credentials scrubbed. */
31
+ read(device: Device, _network?: readonly Device[], options?: ReadOptions): Promise<string>;
32
+ /**
33
+ * What changes, in the order the platform accepts.
34
+ *
35
+ * A VLAN list changes by ID. VLANs no longer used go first, with their VLAN interfaces, so their names and numbers are free before a new VLAN takes them: a VLAN name is unique, and a VLAN with an interface cannot be removed. The whole plan is one candidate, so going first leaves nothing half done.
36
+ */
37
+ plan(desired: string, current: string, options: ApplyOptions): Plan;
38
+ apply(device: Device, _network: readonly Device[], plan: Plan, options: ApplyOptions): Promise<void>;
39
+ neighbors(device: Device, _network?: readonly Device[], options?: ReadOptions): Promise<Neighbor[]>;
40
+ /**
41
+ * The neighbors in `display lldp neighbor`: a header per port, `10GE1/0/2 has 1 neighbor(s):`, then a block per neighbor where `Port ID` comes before `System name`. A port Circuit does not know, such as the management port, is left out.
42
+ */
43
+ static neighborsOf(device: Device, output: string): Neighbor[];
44
+ readOnly(command: string): boolean;
45
+ /** One shell for every command, as the platform takes commands only there. */
46
+ session(device: Device, options?: ReadOptions): Promise<ReadSession>;
47
+ private static undo;
48
+ /** Secrets the device prints as ciphers and the render writes as markers compare equal. */
49
+ private static canon;
50
+ /** Blocks other blocks refer to come first: VRFs, VLANs, the ACL and users, then device-wide lines, then LAGs, ports, VLAN interfaces, OSPF and logins. */
51
+ private static order;
52
+ /**
53
+ * A log host the config no longer has is removed. One at the default level prints as `info-center loghost <address>`, whose head is the bare command, so a new log host would otherwise seem to replace it.
54
+ */
55
+ private static removeLoghosts;
56
+ /** An ACL rule sent over a rule of the same number merges into it: `rule 10 deny` over `rule 10 permit source A` leaves `rule 10 deny source A`. A changed rule is undone first. */
57
+ private static replaceRules;
58
+ /** A static route's BFD template sent again replaces the old one whole, options left out included, so the old one is not undone: a route still uses it. */
59
+ private static keepReplacedWhole;
60
+ /** `undo alarm` is not a command: the `alarm` view goes once each line in it is undone. */
61
+ private static emptyAlarmView;
62
+ /** The VLAN IDs of a `vlan batch` line: `vlan batch 10 20 to 30`. */
63
+ private static batchIds;
64
+ private static login;
65
+ /**
66
+ * An interactive shell at the user prompt, paging off.
67
+ *
68
+ * Every login asks whether to change the password. Answering yes replaces it at once and every stored credential with it, so the answer is always no. Anything sent before the question is answered is taken as the answer.
69
+ */
70
+ private static shell;
71
+ /** Log in on the console with paging off. Returns the console, a way to log in afresh, and how to let the console go. */
72
+ private static openConsole;
73
+ /** Log in on the console with paging off, run `work` with a way to log in afresh, and log out. */
74
+ private static onConsole;
75
+ /** The configuration in a dump, without the prompt or the stamp of the last change. */
76
+ private static configurationOf;
77
+ /** Send one line, answering a confirmation, and return what the device said. */
78
+ private static sendLine;
79
+ /** Send a plan into the candidate and commit it. A refused line clears the candidate, which leaves the device as it was. */
80
+ private static commitPlan;
81
+ /** Save what runs, so a reboot keeps it. */
82
+ private static save;
83
+ }
@@ -0,0 +1,96 @@
1
+ import type { Device } from "../../schema";
2
+ /** Builds the configuration as blocks: a header line, its indented lines, then `#`. */
3
+ export declare class VrpRender {
4
+ private readonly device;
5
+ /** The ACL that guards every management service. */
6
+ private static readonly MANAGEMENT_ACL;
7
+ /** The ACL that guards SNMP when it has sources of its own. */
8
+ private static readonly SNMP_ACL;
9
+ /** The channel that writes the log files on the device's own storage. */
10
+ private static readonly LOGFILE_CHANNEL;
11
+ /** How many log files the device keeps when the config sets none. It is not printed. */
12
+ private static readonly LOGFILES_DEFAULT;
13
+ /** The BFD multiplier the device uses when the config sets none. It is not printed. */
14
+ private static readonly BFD_MULTIPLIER;
15
+ /** The syslog port the device uses when the config sets none. It is not printed. */
16
+ private static readonly SYSLOG_PORT;
17
+ /** A severity as the platform spells it. `debugging` is the default for a log host and for the log files, and is not printed. */
18
+ private static readonly LOG_LEVEL;
19
+ /** The OSPF process number. One process per device. */
20
+ private static readonly OSPF_PROCESS;
21
+ /** The sFlow collectors are numbered from here, in the order the config lists them. */
22
+ private static readonly FIRST_COLLECTOR;
23
+ /** The SNMPv3 group every user joins, with read access to everything. */
24
+ private static readonly SNMP_GROUP;
25
+ /** An alarm severity as the platform prints it. */
26
+ private static readonly ALARM_SEVERITY;
27
+ private static readonly USER_LEVEL;
28
+ private static readonly SNMP_AUTH;
29
+ private static readonly SNMP_PRIVACY;
30
+ /** Layer 2 ACLs, one for each set of ethertypes a port takes, are numbered from here. */
31
+ private static readonly FIRST_L2_ACL;
32
+ /** An ethertype as the platform prints it in a layer 2 ACL rule: `0x0800` prints as `type ip`. */
33
+ private static readonly ETHERTYPE;
34
+ private readonly lines;
35
+ private readonly vlans;
36
+ private readonly interfaces;
37
+ private readonly lagNumbers;
38
+ /** The layer 2 ACL of each set of ethertypes the ports take, by the set written as `ipv4 ipv6 arp`. */
39
+ private readonly ethertypeAcls;
40
+ private constructor();
41
+ /** The whole configuration the device should run. Secrets appear as markers, never values. */
42
+ static of(device: Device): string;
43
+ /** `99 999 to 1000 2000`, the platform's compression of a VLAN list. */
44
+ static vlanBatch(ids: number[]): string;
45
+ private build;
46
+ private line;
47
+ /** A header and its lines. A block with nothing in it is still written, so that its header exists. */
48
+ private block;
49
+ private separator;
50
+ private text;
51
+ private vlanId;
52
+ /** What the platform calls a port, a LAG or a VLAN interface. */
53
+ private nameOf;
54
+ private system;
55
+ private vlanBlocks;
56
+ /** One ACL guards every management service: a permit per source, then an explicit deny. */
57
+ private managementAcl;
58
+ /** SNMP with sources of its own gets an ACL of its own, built the same way. */
59
+ private ethertypeAclBlocks;
60
+ private snmpAcl;
61
+ /** A permit per source, then an explicit deny. The platform prints the wildcard of a single address as `0`. */
62
+ private static aclRules;
63
+ private users;
64
+ private vrfs;
65
+ private static lagMode;
66
+ /** Layer 2 membership of a port or LAG. */
67
+ private switching;
68
+ private static vrrpLines;
69
+ private vlanInterface;
70
+ /** A port the config does not declare is shut down. A LAG member holds only its membership. */
71
+ private physicalPort;
72
+ /**
73
+ * Static routes. A route watched by BFD needs a BFD template for its next hop first, from the device's own address on that network, with the device's timers.
74
+ */
75
+ private staticRoutes;
76
+ /** The device's own IPv4 address on the network that holds `nextHop`. `unsupported()` refuses a watched route without one. */
77
+ static localAddressTo(device: Device, nextHop: string): string | undefined;
78
+ /** The BFD timers of `routing.bfd`, after `prefix`, or nothing for the platform's own. The platform does not print its default multiplier, 3. */
79
+ private bfdTimers;
80
+ /**
81
+ * OSPF for IPv4. An area announces the networks of its interfaces; a passive interface is silent. `unsupported()` refuses IPv6.
82
+ */
83
+ private ospf;
84
+ private wantsBfd;
85
+ /** sFlow from the management address, to each collector in order. */
86
+ private flowExport;
87
+ /** The log files' level and count, then each syslog collector. A default the device does not print is not written: level `debugging`, 200 files, port 514. */
88
+ private logging;
89
+ /** Alarms raised at another severity than the platform's own, in the `alarm` view. The platform prints a severity with a capital, `Warning`. */
90
+ private alarms;
91
+ /** SNMP version 2c with one read community, version 3 with users in one read-only group, or both. */
92
+ private snmp;
93
+ private ssh;
94
+ /** The console logs in with the device's users unless the config gives it a password of its own. Remote logins always use the users. */
95
+ private userInterfaces;
96
+ }
@@ -10,12 +10,18 @@ export type Secret = {
10
10
  /** Path of the file with the value, relative to the config file. */
11
11
  readonly secret_file: string;
12
12
  };
13
- /** An address without a length, IPv4 or IPv6, for example `10.0.0.1`. */
14
- export type IP = string;
15
- /** A network with its length, for example `10.0.0.0/24`. */
16
- export type Prefix = string;
17
- /** An interface address with its length, for example `10.0.0.1/24`. */
18
- export type Address = string;
13
+ /** An IPv4 address, four numbers with dots between them, for example `10.0.0.1`. The type checks the shape; `circuit validate` checks each number is 0 to 255. */
14
+ export type IPv4 = `${number}.${number}.${number}.${number}`;
15
+ /** An IPv6 address, groups with colons between them, for example `2001:db8::1`. The type only checks there is a colon; `circuit validate` checks the rest. */
16
+ export type IPv6 = `${string}:${string}`;
17
+ /** An address without a length, IPv4 or IPv6, for example `10.0.0.1` or `2001:db8::1`. */
18
+ export type IP = IPv4 | IPv6;
19
+ /** A network with its length, for example `10.0.0.0/24` or `2001:db8::/32`. */
20
+ export type Prefix = `${IP}/${number}`;
21
+ /** An interface address with its length, for example `10.0.0.1/24` or `2001:db8::1/64`. */
22
+ export type InterfaceAddress = `${IP}/${number}`;
23
+ /** A MAC address, six pairs of hex digits with colons between them, for example `02:00:00:00:00:01`. */
24
+ export type MacAddress = `${string}:${string}:${string}:${string}:${string}:${string}`;
19
25
  /** An address family. */
20
26
  export type Family = "ipv4" | "ipv6";
21
27
  /** Bits per second, for example `2G`, `500M` or `64k`. */
@@ -5,3 +5,4 @@ export type * from "./interfaces";
5
5
  export type * from "./policy";
6
6
  export type * from "./routing";
7
7
  export type * from "./system";
8
+ export type * from "./time-zones";
@@ -1,4 +1,4 @@
1
- import type { Address, IP, Prefix, Secret } from "./common";
1
+ import type { InterfaceAddress, IP, MacAddress, Prefix, Secret } from "./common";
2
2
  /** A VLAN. Its key in `vlans` is its name. */
3
3
  export type Vlan = {
4
4
  /** The VLAN's number on the wire, 1 to 4094. */
@@ -12,6 +12,8 @@ export type Threshold = {
12
12
  } | {
13
13
  percent: number;
14
14
  };
15
+ /** A kind of frame, by the ethertype in its header: `ipv4` is 0x0800, `ipv6` 0x86DD, `arp` 0x0806. */
16
+ export type Ethertype = "ipv4" | "ipv6" | "arp";
15
17
  /** A virtual router address shared with other devices on the same segment, RFC 5798. */
16
18
  export type Vrrp = {
17
19
  /** Virtual router number, 1 to 255. The same on every device sharing the address. */
@@ -28,8 +30,8 @@ export type Vrrp = {
28
30
  /** Layer 3 settings shared by every interface that can have an address. */
29
31
  export type Routed<F extends string> = {
30
32
  /** Addresses with their length. Use `{ address, peer }` for a point-to-point address whose far end is outside its own prefix. */
31
- addresses?: readonly (Address | {
32
- address: Address;
33
+ addresses?: readonly (InterfaceAddress | {
34
+ address: InterfaceAddress;
33
35
  peer: IP;
34
36
  })[];
35
37
  /** Send IPv6 router advertisements on this interface. Off when absent. */
@@ -77,6 +79,10 @@ export type Switched<V extends string> = {
77
79
  multicast?: Threshold;
78
80
  unknown_unicast?: Threshold;
79
81
  };
82
+ /** The most MAC addresses this port or LAG learns, 1 or more. Frames from any other source address are dropped. An exchange sets 1 on a member port, so each member sends from one router only. No limit when absent. */
83
+ mac_limit?: number;
84
+ /** The only kinds of frame this port or LAG takes in; any other kind is dropped. An exchange takes `ipv4`, `ipv6` and `arp` on a member port. Every kind when absent. */
85
+ ethertypes?: readonly Ethertype[];
80
86
  };
81
87
  /** The other end of a cable: another device and its port. Both ends must agree on how they are switched. */
82
88
  export type Link = {
@@ -117,7 +123,7 @@ export type VlanInterface<V extends string, F extends string> = Base<F> & {
117
123
  /**
118
124
  * A MAC address of its own, instead of the one it shares with the device's other VLAN interfaces. A gateway in front of a transparent firewall needs one: frames to it come back on another VLAN, where the bridge would otherwise take a shared MAC for its own and keep them.
119
125
  */
120
- mac?: string;
126
+ mac?: MacAddress;
121
127
  };
122
128
  /** An interface that is always up and is on no link, for addresses that must not depend on one. */
123
129
  export type Loopback<F extends string> = Base<F> & {
@@ -151,8 +157,10 @@ export type Vxlan<F extends string> = Base<F> & {
151
157
  /** UDP port. 4789 when absent. */
152
158
  port?: number;
153
159
  /** Fixed MAC address, so a rebuild keeps the one the far side learned. */
154
- mac?: string;
160
+ mac?: MacAddress;
155
161
  };
162
+ /** A host and a UDP port, `host:port`, for example `203.0.113.10:51820` or `vpn.example.net:51820`. */
163
+ export type Endpoint = `${string}:${number}`;
156
164
  /** One peer of a WireGuard interface. */
157
165
  export type WireGuardPeer = {
158
166
  /** Who or what the peer is. */
@@ -162,7 +170,7 @@ export type WireGuardPeer = {
162
170
  /** Addresses the peer may send from and that are routed to it. */
163
171
  allowed_addresses: readonly Prefix[];
164
172
  /** `host:port`, for a peer this side dials. The peer dials in when absent. */
165
- endpoint?: string;
173
+ endpoint?: Endpoint;
166
174
  /** Seconds between keepalives, for a peer behind NAT. None when absent. */
167
175
  keepalive?: number;
168
176
  /** What a generated client config routes into the tunnel. Affects no forwarding here. */
@@ -1,4 +1,12 @@
1
1
  import type { Family, IP, Prefix } from "./common";
2
+ /** A standard BGP community, `asn:value`, for example `64500:100`. Each part is 0 to 65535. */
3
+ export type StandardCommunity = `${number}:${number}`;
4
+ /** A large BGP community, `asn:function:parameter`, for example `64500:1:6939`. Each part is 0 to 4294967295. */
5
+ export type LargeCommunity = `${number}:${number}:${number}`;
6
+ /** A standard community to remove. `*` stands for any value of a part, as in `64500:*`. */
7
+ export type StandardCommunityPattern = `${number | "*"}:${number | "*"}`;
8
+ /** A large community to remove. `*` stands for any value of a part, as in `64500:*:*`. */
9
+ export type LargeCommunityPattern = `${number | "*"}:${number | "*"}:${number | "*"}`;
2
10
  /** Registries a prefix set can be fetched from. */
3
11
  export type Registry = "ripe-stat";
4
12
  /** Prefixes listed here, or fetched from a registry by `refresh` and never typed by hand. */
@@ -38,9 +46,9 @@ export type Match<S extends string> = {
38
46
  /** The route's origin validation state. */
39
47
  rpki?: "valid" | "invalid" | "not-found";
40
48
  /** Has this standard community, `asn:value`. */
41
- community?: string;
49
+ community?: StandardCommunity;
42
50
  /** Has this large community, `asn:function:parameter`. */
43
- large_community?: string;
51
+ large_community?: LargeCommunity;
44
52
  };
45
53
  /** Changes to a route. In community lists to remove, `*` stands for any value of a field, as in `64500:*:*`. */
46
54
  export type Sets = {
@@ -51,17 +59,17 @@ export type Sets = {
51
59
  /** Prepend our own AS this many times, to make the path look longer. */
52
60
  prepend?: number;
53
61
  /** Replace the route's standard communities with these. */
54
- communities?: readonly string[];
62
+ communities?: readonly StandardCommunity[];
55
63
  /** Add these standard communities. */
56
- add_communities?: readonly string[];
57
- /** Remove standard communities matching these. */
58
- remove_communities?: readonly string[];
64
+ add_communities?: readonly StandardCommunity[];
65
+ /** Remove standard communities matching these. A part may be `*`. */
66
+ remove_communities?: readonly StandardCommunityPattern[];
59
67
  /** Replace the route's large communities with these. */
60
- large_communities?: readonly string[];
68
+ large_communities?: readonly LargeCommunity[];
61
69
  /** Add these large communities. */
62
- add_large_communities?: readonly string[];
63
- /** Remove large communities matching these. */
64
- remove_large_communities?: readonly string[];
70
+ add_large_communities?: readonly LargeCommunity[];
71
+ /** Remove large communities matching these. A part may be `*`. */
72
+ remove_large_communities?: readonly LargeCommunityPattern[];
65
73
  /** Next hop for the route. */
66
74
  next_hop?: IP;
67
75
  /** Source address for traffic the device itself sends to the route. Applies to routes of the same family as the address. */