@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.
- package/README.md +115 -37
- package/package.json +21 -58
- package/src/checks/across.ts +402 -0
- package/src/checks/built-in.ts +256 -0
- package/src/checks/device.ts +436 -0
- package/src/checks/index.ts +53 -0
- package/src/cli/advisories.ts +108 -0
- package/src/cli/app.ts +71 -0
- package/src/cli/editor-types.generated.ts +30 -0
- package/src/cli/editor-types.ts +69 -0
- package/src/cli/format.ts +124 -0
- package/src/cli/git-hooks.ts +79 -0
- package/src/cli/index.ts +350 -1170
- package/src/cli/migrate.ts +554 -0
- package/src/cli/project-commands.ts +656 -0
- package/src/cli/releases.ts +374 -0
- package/src/cli/remember.ts +339 -0
- package/src/cli/rename.ts +27 -33
- package/src/cli/secrets-password.ts +60 -0
- package/src/cli/secrets.ts +258 -0
- package/src/cli/setup.ts +300 -0
- package/src/cli/signing.ts +23 -0
- package/src/cli/text-editor.ts +268 -0
- package/src/cli/ui.ts +298 -0
- package/src/cli/version.ts +2 -0
- package/src/cli/versions.ts +158 -0
- package/src/config/address.ts +102 -0
- package/src/config/circuit.d.ts +30 -0
- package/src/config/common.ts +65 -0
- package/src/config/communities.ts +479 -0
- package/src/config/define.ts +684 -0
- package/src/config/device.ts +164 -0
- package/src/config/firewall.ts +150 -0
- package/src/config/index.ts +22 -0
- package/src/{schema → config}/interfaces.ts +121 -85
- package/src/config/keys.ts +434 -0
- package/src/config/management.ts +61 -0
- package/src/config/merge.ts +335 -0
- package/src/config/models.ts +70 -0
- package/src/config/monitoring.ts +64 -0
- package/src/config/network.ts +180 -0
- package/src/config/presets.ts +149 -0
- package/src/config/routing.ts +401 -0
- package/src/config/services.ts +51 -0
- package/src/config/switching.ts +84 -0
- package/src/config/system.ts +103 -0
- package/src/{schema → config}/time-zones.ts +1 -1
- package/src/core/address.ts +1 -1
- package/src/core/cabling.ts +8 -43
- package/src/core/graph.ts +40 -0
- package/src/{integrations → core}/registries.ts +5 -3
- package/src/core/secrets-file.ts +539 -0
- package/src/core/secrets.ts +83 -64
- package/src/core/topology.ts +103 -146
- package/src/core/utils.ts +12 -1
- package/src/model.ts +83 -0
- package/src/platforms/derive.ts +64 -37
- package/src/platforms/finding.ts +9 -0
- package/src/platforms/fortios/firewall.ts +76 -64
- package/src/platforms/fortios/index.ts +189 -125
- package/src/platforms/fortios/names.ts +51 -18
- package/src/platforms/fortios/render.ts +69 -62
- package/src/platforms/fortios/routing.ts +89 -58
- package/src/platforms/fortios/vdoms.ts +47 -16
- package/src/platforms/junos/TRAPS.md +2 -2
- package/src/platforms/junos/bgp.ts +63 -42
- package/src/platforms/junos/index.ts +122 -89
- package/src/platforms/junos/render.ts +139 -104
- package/src/platforms/platform.ts +10 -8
- package/src/platforms/raisecom-ros/TRAPS.md +1 -1
- package/src/platforms/raisecom-ros/index.ts +89 -70
- package/src/platforms/raisecom-ros/render.ts +49 -45
- package/src/platforms/routeros/TRAPS.md +3 -3
- package/src/platforms/routeros/index.ts +121 -60
- package/src/platforms/routeros/render.ts +214 -195
- package/src/platforms/vrp/TRAPS.md +1 -1
- package/src/platforms/vrp/index.ts +74 -50
- package/src/platforms/vrp/render.ts +67 -56
- package/src/project/project.ts +725 -0
- package/src/studio/app/env.d.ts +9 -0
- package/src/studio/app/index.html +18 -0
- package/src/studio/app/src/App.vue +95 -0
- package/src/studio/app/src/components/AddressesView.vue +38 -0
- package/src/studio/app/src/components/CablesView.vue +29 -0
- package/src/studio/app/src/components/CompareView.vue +160 -0
- package/src/studio/app/src/components/DataTable.vue +49 -0
- package/src/studio/app/src/components/DeviceView.vue +237 -0
- package/src/studio/app/src/components/DevicesView.vue +32 -0
- package/src/studio/app/src/components/Faceplate.vue +75 -0
- package/src/studio/app/src/components/GraphView.vue +282 -0
- package/src/studio/app/src/components/LineDiff.vue +24 -0
- package/src/studio/app/src/components/ProblemsView.vue +42 -0
- package/src/studio/app/src/components/SearchView.vue +72 -0
- package/src/studio/app/src/components/SecretsView.vue +112 -0
- package/src/studio/app/src/components/SessionsView.vue +35 -0
- package/src/studio/app/src/components/Settings.vue +95 -0
- package/src/studio/app/src/components/ToolsView.vue +118 -0
- package/src/studio/app/src/components/VlansView.vue +50 -0
- package/src/studio/app/src/lib/csv.ts +19 -0
- package/src/studio/{public/diff.js → app/src/lib/diff.ts} +40 -35
- package/src/studio/app/src/lib/format.ts +38 -0
- package/src/studio/app/src/lib/net.ts +68 -0
- package/src/studio/app/src/lib/secrets-crypto.ts +35 -0
- package/src/studio/app/src/lib/store.ts +71 -0
- package/src/studio/app/src/lib/tools.ts +217 -0
- package/src/studio/app/src/main.ts +9 -0
- package/src/studio/{public → app/src}/style.css +14 -4
- package/src/studio/app/tsconfig.json +17 -0
- package/src/studio/app/vite.config.ts +16 -0
- package/src/studio/assets.generated.ts +3 -0
- package/src/studio/data.ts +96 -188
- package/src/studio/git.ts +27 -43
- package/src/studio/server.ts +196 -107
- package/src/studio/types.ts +141 -0
- package/src/transport/console.ts +3 -3
- package/src/transport/ssh.ts +1 -1
- package/dist/chunks/index-3b343xva.js +0 -177
- package/dist/chunks/index-6wb41q67.js +0 -62
- package/dist/chunks/index-n7w3tg5y.js +0 -149
- package/dist/chunks/index-yzw86rc8.js +0 -921
- package/dist/chunks/new-w3zys5y4.js +0 -172
- package/dist/chunks/server-cxr9ynxc.js +0 -259
- package/dist/cli/index.js +0 -12922
- package/dist/helpers/index.js +0 -881
- package/dist/index.js +0 -28
- package/dist/types/core/address-space.d.ts +0 -62
- package/dist/types/core/address.d.ts +0 -44
- package/dist/types/core/cabling.d.ts +0 -41
- package/dist/types/core/cross-checks.d.ts +0 -28
- package/dist/types/core/define.d.ts +0 -79
- package/dist/types/core/project-files.d.ts +0 -12
- package/dist/types/core/schema-docs.d.ts +0 -25
- package/dist/types/core/secrets.d.ts +0 -62
- package/dist/types/core/topology.d.ts +0 -96
- package/dist/types/core/utils.d.ts +0 -10
- package/dist/types/core/validator.d.ts +0 -23
- package/dist/types/helpers/bgp.d.ts +0 -195
- package/dist/types/helpers/cables.d.ts +0 -69
- package/dist/types/helpers/checks.d.ts +0 -36
- package/dist/types/helpers/exchange.d.ts +0 -55
- package/dist/types/helpers/filters.d.ts +0 -51
- package/dist/types/helpers/index.d.ts +0 -14
- package/dist/types/helpers/route-server.d.ts +0 -52
- package/dist/types/helpers/upstreams.d.ts +0 -192
- package/dist/types/index.d.ts +0 -10
- package/dist/types/integrations/librenms.d.ts +0 -60
- package/dist/types/integrations/netbox.d.ts +0 -89
- package/dist/types/integrations/peeringdb.d.ts +0 -24
- package/dist/types/integrations/prometheus.d.ts +0 -24
- package/dist/types/integrations/registries.d.ts +0 -8
- package/dist/types/platforms/bgp-wait.d.ts +0 -24
- package/dist/types/platforms/catalog.d.ts +0 -109
- package/dist/types/platforms/derive.d.ts +0 -17
- package/dist/types/platforms/fortios/firewall.d.ts +0 -47
- package/dist/types/platforms/fortios/index.d.ts +0 -140
- package/dist/types/platforms/fortios/models.d.ts +0 -14
- package/dist/types/platforms/fortios/names.d.ts +0 -52
- package/dist/types/platforms/fortios/plan.d.ts +0 -114
- package/dist/types/platforms/fortios/render.d.ts +0 -77
- package/dist/types/platforms/fortios/routing.d.ts +0 -56
- package/dist/types/platforms/fortios/tree.d.ts +0 -37
- package/dist/types/platforms/fortios/vdoms.d.ts +0 -50
- package/dist/types/platforms/index.d.ts +0 -13
- package/dist/types/platforms/junos/bgp.d.ts +0 -44
- package/dist/types/platforms/junos/index.d.ts +0 -114
- package/dist/types/platforms/junos/models.d.ts +0 -14
- package/dist/types/platforms/junos/render.d.ts +0 -154
- package/dist/types/platforms/line-diff.d.ts +0 -67
- package/dist/types/platforms/platform.d.ts +0 -135
- package/dist/types/platforms/raisecom-ros/index.d.ts +0 -71
- package/dist/types/platforms/raisecom-ros/models.d.ts +0 -14
- package/dist/types/platforms/raisecom-ros/render.d.ts +0 -41
- package/dist/types/platforms/routeros/export.d.ts +0 -59
- package/dist/types/platforms/routeros/index.d.ts +0 -116
- package/dist/types/platforms/routeros/models.d.ts +0 -18
- package/dist/types/platforms/routeros/plan.d.ts +0 -58
- package/dist/types/platforms/routeros/render.d.ts +0 -250
- package/dist/types/platforms/vrp/index.d.ts +0 -83
- package/dist/types/platforms/vrp/models.d.ts +0 -12
- package/dist/types/platforms/vrp/render.d.ts +0 -96
- package/dist/types/schema/common.d.ts +0 -30
- package/dist/types/schema/device.d.ts +0 -126
- package/dist/types/schema/firewall.d.ts +0 -131
- package/dist/types/schema/index.d.ts +0 -8
- package/dist/types/schema/interfaces.d.ts +0 -205
- package/dist/types/schema/policy.d.ts +0 -107
- package/dist/types/schema/routing.d.ts +0 -161
- package/dist/types/schema/system.d.ts +0 -198
- package/dist/types/schema/time-zones.d.ts +0 -2
- package/dist/types/transport/console.d.ts +0 -115
- package/dist/types/transport/path-check.d.ts +0 -32
- package/dist/types/transport/ssh.d.ts +0 -27
- package/src/cli/graph-format.ts +0 -91
- package/src/cli/new.ts +0 -234
- package/src/core/address-space.ts +0 -320
- package/src/core/cross-checks.ts +0 -369
- package/src/core/define.ts +0 -124
- package/src/core/project-files.ts +0 -35
- package/src/core/schema-docs.ts +0 -174
- package/src/core/validator.ts +0 -508
- package/src/helpers/bgp.ts +0 -473
- package/src/helpers/cables.ts +0 -74
- package/src/helpers/checks.ts +0 -201
- package/src/helpers/exchange.ts +0 -123
- package/src/helpers/filters.ts +0 -107
- package/src/helpers/index.ts +0 -25
- package/src/helpers/route-server.ts +0 -212
- package/src/helpers/upstreams.ts +0 -369
- package/src/index.ts +0 -13
- package/src/integrations/librenms.ts +0 -291
- package/src/integrations/netbox.ts +0 -620
- package/src/integrations/peeringdb.ts +0 -173
- package/src/integrations/prometheus.ts +0 -90
- package/src/schema/common.ts +0 -41
- package/src/schema/device.ts +0 -145
- package/src/schema/firewall.ts +0 -140
- package/src/schema/index.ts +0 -8
- package/src/schema/policy.ts +0 -115
- package/src/schema/routing.ts +0 -173
- package/src/schema/system.ts +0 -203
- package/src/studio/public/app.js +0 -186
- package/src/studio/public/compare.js +0 -250
- package/src/studio/public/dom.js +0 -138
- package/src/studio/public/evaluate.js +0 -687
- package/src/studio/public/export.js +0 -130
- package/src/studio/public/graph.js +0 -1541
- package/src/studio/public/index.html +0 -83
- package/src/studio/public/net.js +0 -134
- package/src/studio/public/tables.js +0 -1289
- package/src/studio/public/tools.js +0 -610
- package/templates/colocation/checks.ts +0 -53
- package/templates/colocation/circuit.config.ts +0 -9
- package/templates/colocation/edge-01.ts +0 -133
- package/templates/colocation/routing.ts +0 -13
- package/templates/colocation/tenancy.ts +0 -76
- package/templates/colocation/tenants/acme.ts +0 -19
- package/templates/colocation/tenants/index.ts +0 -6
- package/templates/colocation/tor-01.ts +0 -33
- package/templates/edge-router/checks.ts +0 -20
- package/templates/edge-router/circuit.config.ts +0 -8
- package/templates/edge-router/edge-01.ts +0 -110
- package/templates/edge-router/routing.ts +0 -13
- package/templates/project/AGENTS.md +0 -51
- package/templates/project/CLAUDE.md +0 -1
- package/templates/project/README.md +0 -16
- package/templates/project/gitignore +0 -5
- package/templates/project/tsconfig.json +0 -13
- package/templates/single-site/checks.ts +0 -26
- package/templates/single-site/circuit.config.ts +0 -8
- package/templates/single-site/router.ts +0 -86
- package/templates/single-site/site.ts +0 -18
- package/templates/single-site/switch.ts +0 -34
- /package/src/studio/{public → app/public}/favicon.svg +0 -0
- /package/src/studio/{public → app/public}/special-gothic-latin-ext.woff2 +0 -0
- /package/src/studio/{public → app/public}/special-gothic-latin.woff2 +0 -0
- /package/src/studio/{public → app/public}/special-gothic-license.txt +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import type { Community } from "../core/define.js";
|
|
2
|
-
import type { Device, IP, LargeCommunity, PolicyRule, Prefix, StandardCommunity } from "../schema/index.js";
|
|
3
|
-
/** The prefix lengths a BGP import accepts. */
|
|
4
|
-
export type SanityLengths = {
|
|
5
|
-
/** Shortest and longest IPv4 prefix accepted. /8 to /24 when absent. */
|
|
6
|
-
ipv4?: {
|
|
7
|
-
min: number;
|
|
8
|
-
max: number;
|
|
9
|
-
};
|
|
10
|
-
/** Shortest and longest IPv6 prefix accepted. /16 to /48 when absent. */
|
|
11
|
-
ipv6?: {
|
|
12
|
-
min: number;
|
|
13
|
-
max: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
/** A prefix we announce, and what it is. */
|
|
17
|
-
export type Announced = {
|
|
18
|
-
prefix: Prefix;
|
|
19
|
-
description?: string;
|
|
20
|
-
};
|
|
21
|
-
/** What `Bgp.learn` builds an import from. */
|
|
22
|
-
export type LearnOptions<P extends string> = {
|
|
23
|
-
/** Rules of your own, first. */
|
|
24
|
-
before?: readonly PolicyRule<P, never>[];
|
|
25
|
-
/** A policy holding `Bgp.sanity()` to call. The sanity rules are written in the import itself when absent. */
|
|
26
|
-
sanity?: P;
|
|
27
|
-
/** The source address for routes of its family, one per family. */
|
|
28
|
-
sources?: readonly IP[];
|
|
29
|
-
/** Preference for the routes learned. Higher wins. */
|
|
30
|
-
local_pref?: number;
|
|
31
|
-
/** Where the route came from: `{ standard: "64500:100" }` or `{ large: "64500:1:1" }` adds that community, and a rule, such as `communityScheme(...).tag(...)`, is used as it is. */
|
|
32
|
-
tag?: {
|
|
33
|
-
standard: StandardCommunity;
|
|
34
|
-
} | {
|
|
35
|
-
large: LargeCommunity;
|
|
36
|
-
} | PolicyRule<never, never>;
|
|
37
|
-
};
|
|
38
|
-
/** What `Bgp.defaultOnly` sets on the default routes it takes. */
|
|
39
|
-
export type DefaultOnlyOptions = {
|
|
40
|
-
/** Preference for the default route. Higher wins. */
|
|
41
|
-
local_pref?: number;
|
|
42
|
-
/** Shown beside each rule. `Default route, ipv4` and `Default route, ipv6` when absent. */
|
|
43
|
-
description?: string;
|
|
44
|
-
/** The source address for the default of its family, one per family. */
|
|
45
|
-
sources?: readonly IP[];
|
|
46
|
-
/** End with `{ description: "Nothing else", action: "reject" }`, so the policy takes the default route only. Off by default: any other route goes on to the rules after these. */
|
|
47
|
-
reject?: boolean;
|
|
48
|
-
};
|
|
49
|
-
/** What `Bgp.announce` writes after the accepts. */
|
|
50
|
-
export type AnnounceOptions = {
|
|
51
|
-
/** End with `{ description: "Nothing else", action: "reject" }`, so nothing else leaves. On by default: it stops a route leak when the reject is forgotten. Turn it off for an export that adds rules after these. */
|
|
52
|
-
reject?: boolean;
|
|
53
|
-
};
|
|
54
|
-
/** Kinds of neighbor and the number each is tagged with, such as `{ transit: 1, customer: 3 }`. */
|
|
55
|
-
export type CommunityClasses = Readonly<Record<string, number>>;
|
|
56
|
-
/**
|
|
57
|
-
* A BGP community scheme of large communities, `asn:function:parameter`, in the style of RFC 8195. Each field names the function number your network uses for it; leave out what your network does not offer.
|
|
58
|
-
*
|
|
59
|
-
* The type parameters keep the exact numbers you write, so the communities `Bgp.communityScheme` gives back show them in the editor: Asn your AS, LearnedFrom the function of `learned_from`, Classes its classes.
|
|
60
|
-
*/
|
|
61
|
-
export type CommunityScheme<Asn extends number = number, LearnedFrom extends number = number, Classes extends CommunityClasses = CommunityClasses> = {
|
|
62
|
-
/** Your AS. It is the first part of every community. */
|
|
63
|
-
asn: Asn;
|
|
64
|
-
/** Set on import: the kind of neighbor a route came from, `asn:function:class`. */
|
|
65
|
-
learned_from?: {
|
|
66
|
-
function: LearnedFrom;
|
|
67
|
-
classes: Classes;
|
|
68
|
-
};
|
|
69
|
-
/** Set on import: the site a route was learned at, `asn:function:site`. `sites` names the sites, for the catalogue. */
|
|
70
|
-
learned_at?: {
|
|
71
|
-
function: number;
|
|
72
|
-
sites?: Readonly<Record<number, string>>;
|
|
73
|
-
};
|
|
74
|
-
/** Set on import: the AS a route was learned from, `asn:function:asn`. */
|
|
75
|
-
learned_from_as?: number;
|
|
76
|
-
/** A neighbor asks: do not announce the route to an AS, `asn:function:asn`, or to anyone, `asn:function:0`. */
|
|
77
|
-
do_not_announce?: number;
|
|
78
|
-
/** A neighbor asks: prepend toward an AS once, twice or three times, `asn:function:asn`. */
|
|
79
|
-
prepend?: {
|
|
80
|
-
once?: number;
|
|
81
|
-
twice?: number;
|
|
82
|
-
three_times?: number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A neighbor asks: drop all traffic to this route, `asn:function:0`, usually one address under attack. Your router drops it. An upstream whose own blackhole community you know (`communities.blackhole` on the neighbor you pass to `actions`) receives the route with it and drops the traffic too; any other never receives the route.
|
|
86
|
-
*/
|
|
87
|
-
blackhole?: {
|
|
88
|
-
function: number;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
/** The communities another network offers us, as its NOC gives them: what it does with a route we send it. */
|
|
92
|
-
export type NeighborCommunities = {
|
|
93
|
-
/** It drops traffic to a route we send it with this community. */
|
|
94
|
-
blackhole?: StandardCommunity | LargeCommunity;
|
|
95
|
-
/** It does not pass a route we send it with this community to the AS given, such as an exchange's route servers' `rs-asn:0:peer-asn`. */
|
|
96
|
-
do_not_announce_to?: (asn: number) => StandardCommunity | LargeCommunity;
|
|
97
|
-
};
|
|
98
|
-
/** A neighbor an export goes to: its AS, or its AS and the communities it offers. */
|
|
99
|
-
export type ExportNeighbor = number | {
|
|
100
|
-
asn: number;
|
|
101
|
-
communities?: NeighborCommunities;
|
|
102
|
-
};
|
|
103
|
-
/** The class names a scheme declares, or any name when it declares none. */
|
|
104
|
-
type ClassName<Classes extends CommunityClasses> = {} extends Classes ? string : Extract<keyof Classes, string>;
|
|
105
|
-
/** BGP policy: an import sanity policy, the shapes most imports and exports take, a community scheme, and helpers that read a device's BGP neighbors. */
|
|
106
|
-
export declare class Bgp {
|
|
107
|
-
private static readonly PREPENDS;
|
|
108
|
-
/** The default route of each family. */
|
|
109
|
-
private static readonly DEFAULTS;
|
|
110
|
-
/** Route policy rules rejecting what no neighbor should send: prefixes too short or too long for the global table, and RPKI invalid. Place it first in an import, or as a policy other imports call. */
|
|
111
|
-
static sanity(lengths?: SanityLengths): PolicyRule<never, never>[];
|
|
112
|
-
/**
|
|
113
|
-
* An export that announces each prefix, at exactly its length. It returns, in order:
|
|
114
|
-
*
|
|
115
|
-
* 1. `{ description, match: { prefix }, action: "accept" }` for each prefix;
|
|
116
|
-
* 2. `{ description: "Nothing else", action: "reject" }`, the unconditional reject `Checks.exportsEndInReject` looks for.
|
|
117
|
-
*
|
|
118
|
-
* The reject is there by default, so a forgotten one can't leak routes. `{ reject: false }` leaves it out, for an export that adds rules after these and ends in a reject of its own.
|
|
119
|
-
*/
|
|
120
|
-
static announce(prefixes: readonly Announced[], options?: AnnounceOptions): PolicyRule<never, never>[];
|
|
121
|
-
/** The reject that ends a policy: nothing else gets through. */
|
|
122
|
-
private static readonly NOTHING_ELSE;
|
|
123
|
-
/**
|
|
124
|
-
* An import policy that takes a neighbor's routes. It returns these rules, in order, each only when its option is given:
|
|
125
|
-
*
|
|
126
|
-
* 1. the `before` rules, as written;
|
|
127
|
-
* 2. `{ call: sanity }`, or the rules of `Bgp.sanity()` written in when `sanity` is left out;
|
|
128
|
-
* 3. `{ set: { preferred_source: source } }` for each of `sources`, one per family;
|
|
129
|
-
* 4. `{ set: { local_pref } }`;
|
|
130
|
-
* 5. the tag: `{ description: "Tag 64500:1:1", set: { add_large_communities: ["64500:1:1"] } }` for `{ large: "64500:1:1" }`, `add_communities` for `{ standard }`, or the rule given;
|
|
131
|
-
* 6. `{ action: "accept" }`.
|
|
132
|
-
*
|
|
133
|
-
* So `Bgp.learn({ sanity: "SANITY", local_pref: 200, tag: { large: "64500:1:1" } })` is
|
|
134
|
-
* `[{ call: "SANITY" }, { set: { local_pref: 200 } }, { description: "Tag 64500:1:1", set: { add_large_communities: ["64500:1:1"] } }, { action: "accept" }]`.
|
|
135
|
-
*
|
|
136
|
-
* FortiOS refuses it: a route map stops at the first rule that matches, so it can't hold rules 3 to 5, which change a route and go on; and its sanity rules match RPKI, which FortiOS doesn't have. `validate` names each such rule. On FortiOS, write the import by hand with what rules 3 to 5 set in the rule that accepts.
|
|
137
|
-
*/
|
|
138
|
-
static learn<const P extends string = never>(options?: LearnOptions<P>): PolicyRule<P, never>[];
|
|
139
|
-
/**
|
|
140
|
-
* Import rules that take the default route from a transit. They are, in order:
|
|
141
|
-
*
|
|
142
|
-
* 1. `{ description, match: { prefix: "0.0.0.0/0" }, set: { local_pref, preferred_source }, action: "accept" }`;
|
|
143
|
-
* 2. the same for `::/0`;
|
|
144
|
-
* 3. with `{ reject: true }` only, `{ description: "Nothing else", action: "reject" }`.
|
|
145
|
-
*
|
|
146
|
-
* Without `reject`, any other route goes on to the rules after these, so `[...Bgp.defaultOnly(), ...Bgp.learn()]` takes both. Each of `sources` is the source address for the default of its own family; `set` holds only what is given.
|
|
147
|
-
*/
|
|
148
|
-
static defaultOnly(options?: DefaultOnlyOptions): PolicyRule<never, never>[];
|
|
149
|
-
/** A rule adding one community, standard or large. */
|
|
150
|
-
private static adding;
|
|
151
|
-
/** Each BGP neighbor's own policies and role, or its group's. */
|
|
152
|
-
static neighborPolicies(device: Device): {
|
|
153
|
-
name: string;
|
|
154
|
-
address: IP;
|
|
155
|
-
role: import("../index.js").BgpRole | undefined;
|
|
156
|
-
import: string | undefined;
|
|
157
|
-
export: string | undefined;
|
|
158
|
-
}[];
|
|
159
|
-
/** The prefixes an export policy accepts by name. */
|
|
160
|
-
static offered(device: Device, policy: string | undefined): Prefix[];
|
|
161
|
-
/**
|
|
162
|
-
* Policy rules and a catalogue from one community scheme, so the communities your routers set, the ones they act on, and the ones you publish never disagree.
|
|
163
|
-
*
|
|
164
|
-
* - `tag(neighborClass, neighborAs, { site, trusted })`: one rule for an import policy, `{ description: "Learned from AS<n>", set }`. Its `set` removes your standard communities and your large ones (a `trusted` neighbor loses only the "where it came from" functions, so it keeps its requests: do not announce, prepend, blackhole), then adds `learned_from`, `learned_at` and `learned_from_as` where the scheme has them. `site` is needed when the scheme has `learned_at`.
|
|
165
|
-
* Each export helper takes the neighbor: its AS, or `{ asn, communities }` with the communities it offers, such as an `Upstreams.catalog` entry.
|
|
166
|
-
*
|
|
167
|
-
* - `actions(neighbor)`: the rules for an export policy toward one neighbor, before the rules that accept. They are `[...blackholeExport(n), ...rejectDoNotAnnounce(n), ...prepends(n), stripOurs()]`; toward a neighbor that takes blackholes (`communities.blackhole`), `rejectDoNotAnnounce(n)` comes first, so a route asked not to go there is never passed on as a blackhole.
|
|
168
|
-
* - `blackholeExport(neighbor)`: a blackholed route goes no further, `Blackholed here, never announced`, unless the neighbor has `communities.blackhole`: then it is passed on with it, so the neighbor drops the traffic too. Nothing without `blackhole` in the scheme.
|
|
169
|
-
* - `rejectDoNotAnnounce(neighbor)`: rejects a route asked not to be announced anywhere, then one asked not to be announced to this neighbor. Nothing without `do_not_announce`.
|
|
170
|
-
* - `prepends(neighbor)`: prepends once, twice or three times toward this neighbor, where a route asks. Nothing without `prepend`.
|
|
171
|
-
* - `stripOurs()`: one rule removing every community of yours, `Our communities stay inside our network`.
|
|
172
|
-
* - `blackhole(prefixSets)`: rules for the import policy of a neighbor you trust with blackholes, before anything that rejects long prefixes. They take a route the neighbor asked to blackhole, but only inside `prefixSets`, its own space, and drop traffic to it here. One rule per set, so one call covers both families.
|
|
173
|
-
* - `catalogue`: every community, for `communities` in `defineNetwork`.
|
|
174
|
-
* - `community(fn, parameter)`: one community of yours, for a rule of your own.
|
|
175
|
-
* - `learned_from`: the community each class is tagged with, by class name, such as `learned_from.customer`.
|
|
176
|
-
*/
|
|
177
|
-
static communityScheme<const Asn extends number, const LearnedFrom extends number = number, const Classes extends CommunityClasses = {}>(scheme: CommunityScheme<Asn, LearnedFrom, Classes>): {
|
|
178
|
-
community: <const Fn extends number, const Parameter extends number>(fn: Fn, parameter: Parameter) => `${Asn}:${Fn}:${Parameter}`;
|
|
179
|
-
learned_from: { readonly [Name in keyof Classes]: `${Asn}:${LearnedFrom}:${Classes[Name]}`; };
|
|
180
|
-
tag: (neighborClass: ClassName<Classes>, neighborAs: number, options?: {
|
|
181
|
-
site?: number;
|
|
182
|
-
trusted?: boolean;
|
|
183
|
-
}) => PolicyRule<never, never>;
|
|
184
|
-
actions: (neighbor: ExportNeighbor) => PolicyRule<never, never>[];
|
|
185
|
-
blackholeExport: (neighbor: ExportNeighbor) => PolicyRule<never, never>[];
|
|
186
|
-
rejectDoNotAnnounce: (neighbor: ExportNeighbor) => PolicyRule<never, never>[];
|
|
187
|
-
prepends: (neighbor: ExportNeighbor) => PolicyRule<never, never>[];
|
|
188
|
-
stripOurs: () => PolicyRule<never, never>;
|
|
189
|
-
blackhole: <S extends string>(prefixSets: readonly S[]) => PolicyRule<never, S>[];
|
|
190
|
-
catalogue: Community[];
|
|
191
|
-
};
|
|
192
|
-
/** A word with its article: "a customer", "an upstream". */
|
|
193
|
-
private static article;
|
|
194
|
-
}
|
|
195
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/** The far end of a port, for a description of your own: the device, its port by Circuit's name, and the port as printed on the device when that end names its platform and model. */
|
|
2
|
-
export type FarEnd = {
|
|
3
|
-
device: string;
|
|
4
|
-
port: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
};
|
|
7
|
-
/** One end of a cable entry: the device, and its platform and model if a description should name its ports as printed on it. */
|
|
8
|
-
type End = {
|
|
9
|
-
device: string;
|
|
10
|
-
platform?: string;
|
|
11
|
-
model?: string;
|
|
12
|
-
};
|
|
13
|
-
/** What every cable of one entry shares. */
|
|
14
|
-
type Shared = {
|
|
15
|
-
/** What is between the two ends, such as a carrier's local loop. Both ends get it on their `link`. */
|
|
16
|
-
through?: string;
|
|
17
|
-
/** A port's description from its far end, such as `(far) => \`${far.device} ${far.label}\``. No description when absent. */
|
|
18
|
-
describe?: (far: FarEnd) => string;
|
|
19
|
-
};
|
|
20
|
-
/** A port a cable builds: the other end, the LAG it is in, and a description when `describe` gives one. */
|
|
21
|
-
type CablePort<L extends string> = {
|
|
22
|
-
link: {
|
|
23
|
-
device: string;
|
|
24
|
-
port: string;
|
|
25
|
-
through?: string;
|
|
26
|
-
};
|
|
27
|
-
lag?: L;
|
|
28
|
-
description?: string;
|
|
29
|
-
};
|
|
30
|
-
/** Ports for both ends of the cables between two of our devices, each cable written once. */
|
|
31
|
-
export declare class Cables {
|
|
32
|
-
/**
|
|
33
|
-
* One cable, both ends. Spread each end into its device's `ports`:
|
|
34
|
-
*
|
|
35
|
-
* ```ts
|
|
36
|
-
* const uplink = Cables.link({ a: { device: "router-1", port: "25g-1" }, b: { device: "switch-1", port: "10g-48" } });
|
|
37
|
-
* // router-1: ports: { ...uplink.a }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
static link<const NA extends string, const NB extends string>(spec: Shared & {
|
|
41
|
-
a: End & {
|
|
42
|
-
port: NA;
|
|
43
|
-
};
|
|
44
|
-
b: End & {
|
|
45
|
-
port: NB;
|
|
46
|
-
};
|
|
47
|
-
}): {
|
|
48
|
-
a: Record<NA, CablePort<never>>;
|
|
49
|
-
b: Record<NB, CablePort<never>>;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* The cables of a LAG, both ends, from one list read from end A: `{ "25g-1": "10g-2" }` is a cable from A's 25g-1 to B's 10g-2. Each port is a member of its end's LAG. Spread each end into its device's `ports`; the LAG itself stays on each device.
|
|
53
|
-
*/
|
|
54
|
-
static lag<const LA extends string, const LB extends string, const C extends Readonly<Record<string, string>>>(spec: Shared & {
|
|
55
|
-
a: End & {
|
|
56
|
-
lag: LA;
|
|
57
|
-
};
|
|
58
|
-
b: End & {
|
|
59
|
-
lag: LB;
|
|
60
|
-
};
|
|
61
|
-
cables: C;
|
|
62
|
-
}): {
|
|
63
|
-
a: Record<keyof C & string, CablePort<LA>>;
|
|
64
|
-
b: Record<C[keyof C], CablePort<LB>>;
|
|
65
|
-
};
|
|
66
|
-
/** A port facing `port` on the far end. */
|
|
67
|
-
private static end;
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Check } from "../core/define.js";
|
|
2
|
-
/** Where traffic from outside, before anything filters it, may go. Every VLAN not listed as untrusted is trusted, so a VLAN added later is protected without being listed. */
|
|
3
|
-
export type TrustBoundary = {
|
|
4
|
-
/** VLANs carrying traffic straight from outside: transits, exchanges, an ISP handoff. */
|
|
5
|
-
untrusted: readonly string[];
|
|
6
|
-
/** The devices that filter: the only ones that may give an untrusted VLAN an address, and the only ones a port carrying both kinds may face. */
|
|
7
|
-
routers: readonly string[];
|
|
8
|
-
/**
|
|
9
|
-
* Links between two switches that may carry both kinds, each named by its two devices: a site's switch extended to another building, with an exchange's VLAN and its own management on one cable. Neither end gives an untrusted VLAN an address.
|
|
10
|
-
*/
|
|
11
|
-
extended?: readonly (readonly [string, string])[];
|
|
12
|
-
};
|
|
13
|
-
/** Checks for `checks` in `defineNetwork`, and helpers for checks of your own. */
|
|
14
|
-
export declare class Checks {
|
|
15
|
-
/**
|
|
16
|
-
* Every BGP export ends in a reject that matches everything, so nothing leaves by accident. An export to a neighbor whose `role` is `customer` is left out: sending a customer everything you know is what it pays for, and cannot leak a route to the rest of the internet.
|
|
17
|
-
*/
|
|
18
|
-
static readonly exportsEndInReject: Check;
|
|
19
|
-
/**
|
|
20
|
-
* Every BGP import ends in a rule that decides for every route, an accept or a reject without a match, so what the import takes is written in it and not left to the platform's default.
|
|
21
|
-
*/
|
|
22
|
-
static readonly importsEndInAcceptOrReject: Check;
|
|
23
|
-
/** A GRE or VXLAN tunnel's local address is outside what the neighbors over it are offered, or their replies route back into the tunnel. */
|
|
24
|
-
static readonly tunnelsOutsideOffered: Check;
|
|
25
|
-
/**
|
|
26
|
-
* A native VLAN is a dead end: native on one trunk (a port or a LAG) of a device at most, and never an access VLAN or a tagged VLAN anywhere on that device. On a switch, a native VLAN is an untagged member of every trunk it is native on, so one native VLAN shared by two trunks joins them: every untagged frame from one leaves on the other.
|
|
27
|
-
*/
|
|
28
|
-
static readonly nativeVlansAreDeadEnds: Check;
|
|
29
|
-
/** The VLANs a port carries, untagged or tagged. */
|
|
30
|
-
static vlansOf(port: {
|
|
31
|
-
access_vlan?: string;
|
|
32
|
-
trunk_vlans?: readonly string[];
|
|
33
|
-
}): string[];
|
|
34
|
-
/** A check: traffic from outside reaches your own VLANs only through a router. A port or LAG carrying an untrusted VLAN beside any other is on a router or faces one, and only a router gives an untrusted VLAN an address. */
|
|
35
|
-
static trustBoundary(boundary: TrustBoundary): Check;
|
|
36
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Check } from "../core/define.js";
|
|
2
|
-
import type { Ethertype, IP, Port, Prefix } from "../schema/index.js";
|
|
3
|
-
import { type RouteServer } from "./route-server.js";
|
|
4
|
-
/** A member of an internet exchange: a network with a port on the fabric and an address on the peering LAN. */
|
|
5
|
-
export type ExchangeMember = {
|
|
6
|
-
/** Lowercase, and never reused. */
|
|
7
|
-
name: string;
|
|
8
|
-
asn: number;
|
|
9
|
-
/** The member's port on each fabric switch, by switch name. */
|
|
10
|
-
ports: Readonly<Record<string, string>>;
|
|
11
|
-
/** Its addresses on the peering LAN. The route servers peer with these. */
|
|
12
|
-
ipv4?: IP;
|
|
13
|
-
ipv6?: IP;
|
|
14
|
-
};
|
|
15
|
-
/** An internet exchange's peering LAN, as its fabric carries it. */
|
|
16
|
-
export type InternetExchange<V extends string> = {
|
|
17
|
-
/** The peering VLAN, by the name the fabric switches give it. */
|
|
18
|
-
vlan: V;
|
|
19
|
-
/** The peering LAN's subnets. */
|
|
20
|
-
lan: {
|
|
21
|
-
ipv4?: Prefix;
|
|
22
|
-
ipv6?: Prefix;
|
|
23
|
-
};
|
|
24
|
-
/** Addresses on the peering LAN no member may take, such as the route servers'. */
|
|
25
|
-
reserved?: readonly IP[];
|
|
26
|
-
/** How much broadcast, multicast and unknown unicast a member port lets through, in percent of its speed. 1 when absent. */
|
|
27
|
-
storm_percent?: number;
|
|
28
|
-
/** The most MAC addresses a member port learns, usually 1. No limit when absent. No platform renders it yet, so `validate` refuses it. */
|
|
29
|
-
mac_limit?: number;
|
|
30
|
-
/** The only kinds of frame a member port takes in, usually `ipv4`, `ipv6` and `arp`. Every kind when absent. No platform renders it yet, so `validate` refuses it. */
|
|
31
|
-
ethertypes?: readonly Ethertype[];
|
|
32
|
-
/** LLDP on member ports. Off when absent: a member's router has no business learning the fabric. */
|
|
33
|
-
lldp?: boolean;
|
|
34
|
-
/** Spanning tree on member ports. Off when absent: a member's port faces a router, which must not join the fabric's spanning tree. */
|
|
35
|
-
stp?: boolean;
|
|
36
|
-
};
|
|
37
|
-
/** An internet exchange's fabric: its member ports, a check of its members, and its route servers' config. */
|
|
38
|
-
export declare class Exchange {
|
|
39
|
-
/**
|
|
40
|
-
* Member ports and a check for an internet exchange's fabric.
|
|
41
|
-
*
|
|
42
|
-
* - `ports(device)`: every member's port on one switch, each written as
|
|
43
|
-
* `{ description: "<name>, AS<asn>", access_vlan: vlan, stp: false, lldp: false, storm_control: { broadcast, multicast, unknown_unicast: { percent: storm_percent } } }`,
|
|
44
|
-
* plus `mac_limit` and `ethertypes` when the exchange sets them. `stp` and `lldp` are the exchange's own when it sets them, and storm control is 1 % when `storm_percent` is absent.
|
|
45
|
-
* - `check`: members never share a name, an AS, an address or a port; every address is inside the peering LAN and not reserved; every member port carries the peering VLAN alone.
|
|
46
|
-
* - `bird(server)`: one route server's BIRD 2 config, with a session to every member. Write it to a file for the server; Circuit never logs in to a route server.
|
|
47
|
-
* - `openbgpd(server)`: the same route server's config for OpenBGPD, its `bgpd.conf`, with the same sessions and the same rules.
|
|
48
|
-
*/
|
|
49
|
-
static build<const V extends string>(exchange: InternetExchange<V>, members: readonly ExchangeMember[]): {
|
|
50
|
-
ports: (device: string) => Record<string, Port<V, string, string, string>>;
|
|
51
|
-
check: Check;
|
|
52
|
-
bird: (server: RouteServer) => string;
|
|
53
|
-
openbgpd: (server: RouteServer) => string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { AclRule, FilterRule, Prefix } from "../schema/index.js";
|
|
2
|
-
/** What `Filters.antiAmplification` leaves alone. */
|
|
3
|
-
export type AntiAmplificationOptions = {
|
|
4
|
-
/** Prefixes inside the destinations whose UDP fragments pass: for a host that receives UDP too large for one packet, such as SIP or some VPNs. Every fragment after the first is dropped when absent. */
|
|
5
|
-
keep_fragments?: readonly Prefix[];
|
|
6
|
-
};
|
|
7
|
-
/** Address lists and edge filters: hardware ACL rules and firewall rules for traffic from outside. */
|
|
8
|
-
export declare class Filters {
|
|
9
|
-
/** IPv4 sources that never arrive from the internet: loopback, link-local and "this network", after RFC 6890. */
|
|
10
|
-
static readonly MARTIANS: readonly ["127.0.0.0/8", "169.254.0.0/16", "0.0.0.0/8"];
|
|
11
|
-
/** IPv4 private space, RFC 1918. */
|
|
12
|
-
static readonly PRIVATE_RANGES: readonly ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"];
|
|
13
|
-
/** UDP ports of services that answer a small request with a much larger reply, which attackers use to reflect floods at a victim. A reflected flood arrives from these ports. */
|
|
14
|
-
static readonly AMPLIFIERS: {
|
|
15
|
-
readonly qotd: 17;
|
|
16
|
-
readonly chargen: 19;
|
|
17
|
-
readonly dns: 53;
|
|
18
|
-
readonly portmap: 111;
|
|
19
|
-
readonly ntp: 123;
|
|
20
|
-
readonly netbios: 137;
|
|
21
|
-
readonly snmp: 161;
|
|
22
|
-
readonly cldap: 389;
|
|
23
|
-
readonly slp: 427;
|
|
24
|
-
readonly rip: 520;
|
|
25
|
-
readonly "ms-sql": 1434;
|
|
26
|
-
readonly ssdp: 1900;
|
|
27
|
-
readonly ard: 3283;
|
|
28
|
-
readonly "ws-discovery": 3702;
|
|
29
|
-
readonly mdns: 5353;
|
|
30
|
-
readonly coap: 5683;
|
|
31
|
-
readonly ubiquiti: 10001;
|
|
32
|
-
readonly memcached: 11211;
|
|
33
|
-
readonly dvr: 37810;
|
|
34
|
-
};
|
|
35
|
-
/** Of the amplifiers, the services hosts do ask across the internet: resolvers, time servers, monitoring. A reply to a real request goes back to the asking port, 1024 or above, or to the service's own port when two servers talk. */
|
|
36
|
-
private static readonly ASKED;
|
|
37
|
-
/** TCP flag combinations no legitimate packet carries: name, flags set, flags unset. */
|
|
38
|
-
private static readonly BAD_TCP_FLAGS;
|
|
39
|
-
/** Hardware ACL rules dropping traffic arriving on a VLAN from sources that cannot be there: your own space, martians, private ranges. One rule per source. */
|
|
40
|
-
static antiSpoofing<V extends string>(vlan: V, sources: readonly Prefix[]): AclRule<V>[];
|
|
41
|
-
/**
|
|
42
|
-
* Hardware ACL rules dropping reflected UDP floods toward `destinations`, in the switch chip, without limiting anything else.
|
|
43
|
-
*
|
|
44
|
-
* - Replies from an amplifier no host asks across the internet are dropped.
|
|
45
|
-
* - Replies from DNS, NTP and SNMP are dropped only toward a port below 1024 that is not the service's own. A host that runs its own resolver, time server or monitoring keeps its answers. The service's own port passes first, so every drop takes the one range 0 to 1023: a switch chip has few port-range checkers, and on RouterOS a rule past them is invalid with every rule after it.
|
|
46
|
-
* - The fragments after the first carry no port, and a switch chip reads them as port 0. They are dropped, but toward `keep_fragments`.
|
|
47
|
-
*/
|
|
48
|
-
static antiAmplification(destinations: readonly Prefix[], options?: AntiAmplificationOptions): AclRule<never>[];
|
|
49
|
-
/** Firewall rules dropping packets with a TCP flag combination no legitimate packet carries, for a forward chain. */
|
|
50
|
-
static badTcpFlags(): FilterRule<never, never>[];
|
|
51
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { Bgp } from "./bgp.js";
|
|
2
|
-
export type { AnnounceOptions, Announced, CommunityScheme, DefaultOnlyOptions, ExportNeighbor, LearnOptions, NeighborCommunities, SanityLengths, } from "./bgp.js";
|
|
3
|
-
export { Cables } from "./cables.js";
|
|
4
|
-
export type { FarEnd } from "./cables.js";
|
|
5
|
-
export { Checks } from "./checks.js";
|
|
6
|
-
export type { TrustBoundary } from "./checks.js";
|
|
7
|
-
export { Exchange } from "./exchange.js";
|
|
8
|
-
export type { ExchangeMember, InternetExchange } from "./exchange.js";
|
|
9
|
-
export { Filters } from "./filters.js";
|
|
10
|
-
export { RouteServerConfig } from "./route-server.js";
|
|
11
|
-
export { Upstreams } from "./upstreams.js";
|
|
12
|
-
export type { NamedVlan, Upstream, UpstreamCatalog, UpstreamOptions, UpstreamPolicy } from "./upstreams.js";
|
|
13
|
-
export type { RouteServer } from "./route-server.js";
|
|
14
|
-
export type { AntiAmplificationOptions } from "./filters.js";
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Family, IPv4, IPv6, Prefix } from "../schema/index.js";
|
|
2
|
-
import type { ExchangeMember } from "./exchange.js";
|
|
3
|
-
/** A route server on an exchange's peering LAN: a server running BIRD 2 or OpenBGPD that passes every member's routes to every other member. */
|
|
4
|
-
export type RouteServer = {
|
|
5
|
-
/** Its name, such as `rs1`, written at the top of its config. */
|
|
6
|
-
name: string;
|
|
7
|
-
/** Its own AS. Members peer with it, but it never adds itself to a path, so members see each other's paths as they were sent. */
|
|
8
|
-
asn: number;
|
|
9
|
-
/** Its BGP router ID, an IPv4 address of the server. Its address on the peering LAN is the usual pick. */
|
|
10
|
-
router_id: IPv4;
|
|
11
|
-
/** Its IPv4 address on the peering LAN. Every member with an IPv4 address gets an IPv4 session from it. */
|
|
12
|
-
ipv4?: IPv4;
|
|
13
|
-
/** Its IPv6 address on the peering LAN. Every member with an IPv6 address gets an IPv6 session from it. */
|
|
14
|
-
ipv6?: IPv6;
|
|
15
|
-
};
|
|
16
|
-
/** A route server's config, written from an exchange's member list. Circuit writes the file; it never logs in to the server. */
|
|
17
|
-
export declare class RouteServerConfig {
|
|
18
|
-
/** The shortest and longest prefix a member may send, by family. */
|
|
19
|
-
static readonly LENGTHS: Readonly<Record<Family, {
|
|
20
|
-
shortest: number;
|
|
21
|
-
longest: number;
|
|
22
|
-
}>>;
|
|
23
|
-
/** The rules a route must pass, the same in every config. */
|
|
24
|
-
private static readonly RULES;
|
|
25
|
-
/**
|
|
26
|
-
* The BIRD 2 config of one route server: one session per member and family, each passing on only the routes the member may send.
|
|
27
|
-
*
|
|
28
|
-
* Throws when the server has no address on the peering LAN, has one outside it, or two members would get sessions of one name.
|
|
29
|
-
*/
|
|
30
|
-
static bird(server: RouteServer, lan: {
|
|
31
|
-
ipv4?: Prefix;
|
|
32
|
-
ipv6?: Prefix;
|
|
33
|
-
}, members: readonly ExchangeMember[]): string;
|
|
34
|
-
/**
|
|
35
|
-
* The OpenBGPD config (`bgpd.conf`) of one route server: one session per member and family, in one group per family, and filter rules that pass on only the routes each member may send.
|
|
36
|
-
*
|
|
37
|
-
* Throws when the server has no address on the peering LAN, or has one outside it.
|
|
38
|
-
*/
|
|
39
|
-
static openbgpd(server: RouteServer, lan: {
|
|
40
|
-
ipv4?: Prefix;
|
|
41
|
-
ipv6?: Prefix;
|
|
42
|
-
}, members: readonly ExchangeMember[]): string;
|
|
43
|
-
/** The families the server has an address in, each checked to be inside the peering LAN. */
|
|
44
|
-
private static families;
|
|
45
|
-
/** A BIRD symbol: letters, digits and underscores, starting with a letter. */
|
|
46
|
-
private static protocolName;
|
|
47
|
-
/** A member's name and AS, safe inside double quotes. */
|
|
48
|
-
private static description;
|
|
49
|
-
private static birdSession;
|
|
50
|
-
/** One family's sessions: a group holding every member with an address in that family. */
|
|
51
|
-
private static openbgpdGroup;
|
|
52
|
-
}
|