@birdcc/lsp 0.0.1-alpha.0 → 0.1.0-beta.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.
- package/README.md +25 -23
- package/dist/asn-completion.d.ts +21 -0
- package/dist/asn-completion.d.ts.map +1 -0
- package/dist/asn-completion.js +42 -0
- package/dist/asn-completion.js.map +1 -0
- package/dist/asn-context.d.ts +9 -0
- package/dist/asn-context.d.ts.map +1 -0
- package/dist/asn-context.js +203 -0
- package/dist/asn-context.js.map +1 -0
- package/dist/asn-hover.d.ts +11 -0
- package/dist/asn-hover.d.ts.map +1 -0
- package/dist/asn-hover.js +33 -0
- package/dist/asn-hover.js.map +1 -0
- package/dist/asn-inlay-hints.d.ts +13 -0
- package/dist/asn-inlay-hints.d.ts.map +1 -0
- package/dist/asn-inlay-hints.js +47 -0
- package/dist/asn-inlay-hints.js.map +1 -0
- package/dist/diagnostic.d.ts.map +1 -1
- package/dist/diagnostic.js +2 -10
- package/dist/diagnostic.js.map +1 -1
- package/dist/document-symbol.js +1 -1
- package/dist/document-symbol.js.map +1 -1
- package/dist/hover-context.d.ts +31 -0
- package/dist/hover-context.d.ts.map +1 -0
- package/dist/hover-context.js +125 -0
- package/dist/hover-context.js.map +1 -0
- package/dist/hover-docs/00-base.yaml +5 -0
- package/dist/hover-docs/10-global-options.yaml +442 -0
- package/dist/hover-docs/20-filter-language.yaml +209 -0
- package/dist/hover-docs/30-channel-options.yaml +244 -0
- package/dist/hover-docs/40-protocol-common.yaml +59 -0
- package/dist/hover-docs/41-protocol-igp.yaml +305 -0
- package/dist/hover-docs/42-protocol-kernel-static.yaml +220 -0
- package/dist/hover-docs/43-protocol-mpls.yaml +40 -0
- package/dist/hover-docs/44-protocol-extended.yaml +635 -0
- package/dist/hover-docs/50-protocol-bgp.yaml +482 -0
- package/dist/hover-docs/60-protocol-ospf.yaml +527 -0
- package/dist/hover-docs.d.ts +5 -1
- package/dist/hover-docs.d.ts.map +1 -1
- package/dist/hover-docs.js +376 -51
- package/dist/hover-docs.js.map +1 -1
- package/dist/hover-usage/00-base.yaml +2 -0
- package/dist/hover-usage/10-global-usage.yaml +73 -0
- package/dist/hover-usage/20-filter-usage.yaml +41 -0
- package/dist/hover-usage/30-channel-usage.yaml +41 -0
- package/dist/hover-usage/40-protocol-usage.yaml +258 -0
- package/dist/hover-usage/50-bgp-usage.yaml +254 -0
- package/dist/hover-usage/60-ospf-usage.yaml +340 -0
- package/dist/hover.d.ts +10 -0
- package/dist/hover.d.ts.map +1 -1
- package/dist/hover.js +152 -46
- package/dist/hover.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/init/workspace-init.d.ts +28 -0
- package/dist/init/workspace-init.d.ts.map +1 -0
- package/dist/init/workspace-init.js +72 -0
- package/dist/init/workspace-init.js.map +1 -0
- package/dist/lsp-server.d.ts +7 -1
- package/dist/lsp-server.d.ts.map +1 -1
- package/dist/lsp-server.js +277 -65
- package/dist/lsp-server.js.map +1 -1
- package/dist/project-config.d.ts +22 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +307 -0
- package/dist/project-config.js.map +1 -0
- package/dist/shared.d.ts +1 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -24
- package/dist/shared.js.map +1 -1
- package/dist/symbol-utils.d.ts +6 -6
- package/dist/symbol-utils.d.ts.map +1 -1
- package/dist/symbol-utils.js +24 -25
- package/dist/symbol-utils.js.map +1 -1
- package/dist/type-hint-inlay.d.ts +4 -0
- package/dist/type-hint-inlay.d.ts.map +1 -0
- package/dist/type-hint-inlay.js +27 -0
- package/dist/type-hint-inlay.js.map +1 -0
- package/dist/utils.d.ts +65 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +97 -0
- package/dist/utils.js.map +1 -0
- package/package.json +20 -9
- package/.oxfmtrc.json +0 -16
- package/dist/hover-docs.yaml +0 -600
- package/scripts/copy-hover-yaml.mjs +0 -14
- package/src/completion.ts +0 -223
- package/src/definition.ts +0 -50
- package/src/diagnostic.ts +0 -48
- package/src/document-symbol.ts +0 -27
- package/src/hover-docs.ts +0 -223
- package/src/hover-docs.yaml +0 -600
- package/src/hover.ts +0 -122
- package/src/index.ts +0 -8
- package/src/lsp-server.ts +0 -350
- package/src/references.ts +0 -107
- package/src/server.ts +0 -4
- package/src/shared.ts +0 -182
- package/src/symbol-utils.ts +0 -126
- package/src/validation.ts +0 -85
- package/test/hover-docs.test.ts +0 -18
- package/test/lsp.test.ts +0 -304
- package/test/perf-baseline.test.ts +0 -96
- package/test/validation.test.ts +0 -212
- package/tsconfig.json +0 -8
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { getLineText } from "./utils.js";
|
|
2
|
+
const CONTEXT_CACHE_LIMIT = 16;
|
|
3
|
+
const contextIndexCache = new Map();
|
|
4
|
+
const CONTEXT_WORD_PATTERN = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
5
|
+
const stripLineComment = (line) => {
|
|
6
|
+
const commentIndex = line.indexOf("#");
|
|
7
|
+
if (commentIndex === -1) {
|
|
8
|
+
return line;
|
|
9
|
+
}
|
|
10
|
+
return line.slice(0, commentIndex);
|
|
11
|
+
};
|
|
12
|
+
const extractWords = (text) => Array.from(text.matchAll(CONTEXT_WORD_PATTERN), (match) => match[0].toLowerCase());
|
|
13
|
+
const parseBlockSegments = (header) => {
|
|
14
|
+
const words = extractWords(header);
|
|
15
|
+
if (words.length === 0) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
if (words[0] === "protocol" && words[1]) {
|
|
19
|
+
return ["protocol", words[1]];
|
|
20
|
+
}
|
|
21
|
+
if (words[0] === "template" && words[1]) {
|
|
22
|
+
return ["protocol", words[1]];
|
|
23
|
+
}
|
|
24
|
+
if (words[0] === "area") {
|
|
25
|
+
return ["area"];
|
|
26
|
+
}
|
|
27
|
+
if (words[0] === "interface") {
|
|
28
|
+
return ["interface"];
|
|
29
|
+
}
|
|
30
|
+
if (words[0] === "ipv4" || words[0] === "ipv6") {
|
|
31
|
+
return ["channel", words[0]];
|
|
32
|
+
}
|
|
33
|
+
if (words[0] === "channel") {
|
|
34
|
+
return ["channel"];
|
|
35
|
+
}
|
|
36
|
+
if (words[0] === "external") {
|
|
37
|
+
return ["external"];
|
|
38
|
+
}
|
|
39
|
+
if (words[0] === "authentication") {
|
|
40
|
+
return ["authentication"];
|
|
41
|
+
}
|
|
42
|
+
if (words[0] === "password") {
|
|
43
|
+
return ["password"];
|
|
44
|
+
}
|
|
45
|
+
if (words[0] === "virtual" && words[1] === "link") {
|
|
46
|
+
return ["virtual-link"];
|
|
47
|
+
}
|
|
48
|
+
return [];
|
|
49
|
+
};
|
|
50
|
+
const processLineIntoStack = (line, stack, maxCharacter) => {
|
|
51
|
+
const text = stripLineComment(line.slice(0, Math.max(0, maxCharacter)));
|
|
52
|
+
let headerStart = 0;
|
|
53
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
54
|
+
const char = text[index];
|
|
55
|
+
if (char === "}") {
|
|
56
|
+
if (stack.length > 0) {
|
|
57
|
+
stack.pop();
|
|
58
|
+
}
|
|
59
|
+
headerStart = index + 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (char === "{") {
|
|
63
|
+
const header = text.slice(headerStart, index).trim();
|
|
64
|
+
stack.push({
|
|
65
|
+
segments: parseBlockSegments(header),
|
|
66
|
+
});
|
|
67
|
+
headerStart = index + 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const cloneFrames = (frames) => frames.map((frame) => ({
|
|
72
|
+
segments: frame.segments,
|
|
73
|
+
}));
|
|
74
|
+
const buildContextIndex = (document) => {
|
|
75
|
+
const stack = [];
|
|
76
|
+
const lineFrames = [];
|
|
77
|
+
for (let lineIndex = 0; lineIndex < document.lineCount; lineIndex += 1) {
|
|
78
|
+
lineFrames.push(cloneFrames(stack));
|
|
79
|
+
processLineIntoStack(getLineText(document, lineIndex), stack, Number.MAX_SAFE_INTEGER);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
version: document.version,
|
|
83
|
+
fingerprint: toDocumentFingerprint(document),
|
|
84
|
+
lineFrames,
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const toDocumentFingerprint = (document) => {
|
|
88
|
+
if (document.lineCount === 0) {
|
|
89
|
+
return "0::";
|
|
90
|
+
}
|
|
91
|
+
const firstLine = getLineText(document, 0);
|
|
92
|
+
const lastLine = getLineText(document, document.lineCount - 1);
|
|
93
|
+
return `${String(document.lineCount)}:${firstLine}:${lastLine}`;
|
|
94
|
+
};
|
|
95
|
+
const getCachedContextIndex = (document) => {
|
|
96
|
+
const cacheKey = typeof document.uri === "string" ? document.uri : document.uri.toString();
|
|
97
|
+
const cached = contextIndexCache.get(cacheKey);
|
|
98
|
+
const fingerprint = toDocumentFingerprint(document);
|
|
99
|
+
if (cached &&
|
|
100
|
+
cached.version === document.version &&
|
|
101
|
+
cached.fingerprint === fingerprint) {
|
|
102
|
+
return cached;
|
|
103
|
+
}
|
|
104
|
+
const rebuilt = buildContextIndex(document);
|
|
105
|
+
contextIndexCache.set(cacheKey, rebuilt);
|
|
106
|
+
if (contextIndexCache.size > CONTEXT_CACHE_LIMIT) {
|
|
107
|
+
const oldestKey = contextIndexCache.keys().next().value;
|
|
108
|
+
if (oldestKey) {
|
|
109
|
+
contextIndexCache.delete(oldestKey);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return rebuilt;
|
|
113
|
+
};
|
|
114
|
+
export const resolveHoverContextPath = (document, targetLine, targetCharacter) => {
|
|
115
|
+
const index = getCachedContextIndex(document);
|
|
116
|
+
const baseFrames = index.lineFrames[targetLine] ??
|
|
117
|
+
index.lineFrames[index.lineFrames.length - 1] ??
|
|
118
|
+
[];
|
|
119
|
+
const stack = cloneFrames(baseFrames);
|
|
120
|
+
const lineText = getLineText(document, targetLine);
|
|
121
|
+
const maxCharacter = Math.min(targetCharacter + 1, lineText.length);
|
|
122
|
+
processLineIntoStack(lineText, stack, maxCharacter);
|
|
123
|
+
return stack.flatMap((frame) => frame.segments);
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=hover-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-context.js","sourceRoot":"","sources":["../src/hover-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAiCzC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA8B,CAAC;AAEhE,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAEvD,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAU,EAAE;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,IAAY,EAAqB,EAAE,CACvD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CACxD,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CACvB,CAAC;AAEJ,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAqB,EAAE;IAC/D,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,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C,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
entries:
|
|
2
|
+
- keyword: attribute
|
|
3
|
+
description: Define custom route attribute
|
|
4
|
+
detail: Create a custom route attribute that can be attached to routes and used in filters.
|
|
5
|
+
diff: same
|
|
6
|
+
version: v2+
|
|
7
|
+
anchor: opt-attribute
|
|
8
|
+
path: global
|
|
9
|
+
parameters:
|
|
10
|
+
- name: type
|
|
11
|
+
description: Custom attribute value type.
|
|
12
|
+
- name: name
|
|
13
|
+
description: Attribute identifier.
|
|
14
|
+
- keyword: cork threshold
|
|
15
|
+
description: Cork threshold (v3 only)
|
|
16
|
+
detail: Memory pressure control threshold for batching updates.
|
|
17
|
+
diff: added
|
|
18
|
+
version: v3+
|
|
19
|
+
anchor: rtable-cork-threshold
|
|
20
|
+
notes:
|
|
21
|
+
v3: "v3 only: Memory pressure control."
|
|
22
|
+
path: global
|
|
23
|
+
parameters:
|
|
24
|
+
- name: number
|
|
25
|
+
description: Memory pressure threshold for corking updates.
|
|
26
|
+
- keyword: debug
|
|
27
|
+
description: Table debug options
|
|
28
|
+
detail: Enable debugging for routing table operations. v3 has simplified option set.
|
|
29
|
+
diff: modified
|
|
30
|
+
version: v2-v3
|
|
31
|
+
anchors:
|
|
32
|
+
v2: table-debug
|
|
33
|
+
v3: rtable-debug
|
|
34
|
+
notes:
|
|
35
|
+
v3: "v3 Breaking Change: Options simplified to {states|routes|events}"
|
|
36
|
+
path: global
|
|
37
|
+
related:
|
|
38
|
+
- debug latency
|
|
39
|
+
- debug tables
|
|
40
|
+
parameters:
|
|
41
|
+
- name: options
|
|
42
|
+
description: Debug categories to enable.
|
|
43
|
+
- keyword: debug latency
|
|
44
|
+
description: Enable latency debugging
|
|
45
|
+
detail:
|
|
46
|
+
Enable debugging of scheduling latency. v3 extends this to support granular event type
|
|
47
|
+
filtering.
|
|
48
|
+
diff: modified
|
|
49
|
+
version: v2-v3
|
|
50
|
+
anchor: opt-debug-latency
|
|
51
|
+
notes:
|
|
52
|
+
v3:
|
|
53
|
+
"v3 Breaking Change: Extended to {ping|wakeup|scheduling|sockets|events|timers} for granular
|
|
54
|
+
control."
|
|
55
|
+
path: global
|
|
56
|
+
related:
|
|
57
|
+
- debug
|
|
58
|
+
parameters:
|
|
59
|
+
- name: switch-or-categories
|
|
60
|
+
description: Enable latency debug globally or by category.
|
|
61
|
+
- keyword: debug tables
|
|
62
|
+
description: Enable routing table debugging
|
|
63
|
+
detail: Log detailed information about routing table operations and state changes.
|
|
64
|
+
diff: same
|
|
65
|
+
version: v2+
|
|
66
|
+
anchor: opt-debug-tables
|
|
67
|
+
path: global
|
|
68
|
+
related:
|
|
69
|
+
- debug
|
|
70
|
+
parameters:
|
|
71
|
+
- name: switch
|
|
72
|
+
description: Enable routing table debug logs.
|
|
73
|
+
- keyword: define
|
|
74
|
+
description: Define a constant value
|
|
75
|
+
detail: Create a named constant that can be referenced throughout the configuration.
|
|
76
|
+
diff: same
|
|
77
|
+
version: v2+
|
|
78
|
+
anchor: opt-define
|
|
79
|
+
path: global
|
|
80
|
+
parameters:
|
|
81
|
+
- name: name
|
|
82
|
+
description: Constant identifier.
|
|
83
|
+
- name: value
|
|
84
|
+
description: Literal or expression value.
|
|
85
|
+
- keyword: eval
|
|
86
|
+
description: Evaluate expression at config load time
|
|
87
|
+
detail: Execute a filter expression during configuration parsing. Useful for dynamic configuration.
|
|
88
|
+
diff: same
|
|
89
|
+
version: v2+
|
|
90
|
+
anchor: opt-eval
|
|
91
|
+
path: global
|
|
92
|
+
parameters:
|
|
93
|
+
- name: expression
|
|
94
|
+
description: Expression executed at config load time.
|
|
95
|
+
- keyword: export settle time
|
|
96
|
+
description: Export settle time (v3 only)
|
|
97
|
+
detail: Time to wait before exporting route changes to protocols.
|
|
98
|
+
diff: added
|
|
99
|
+
version: v3+
|
|
100
|
+
anchor: rtable-export-settle-time
|
|
101
|
+
notes:
|
|
102
|
+
v3: "v3 only: Replaces min/max settle time from v2."
|
|
103
|
+
path: global
|
|
104
|
+
related:
|
|
105
|
+
- min settle time
|
|
106
|
+
- max settle time
|
|
107
|
+
- table
|
|
108
|
+
parameters:
|
|
109
|
+
- name: time
|
|
110
|
+
description: Export settle duration.
|
|
111
|
+
- keyword: filter
|
|
112
|
+
description: Define a routing filter
|
|
113
|
+
detail:
|
|
114
|
+
Create a named filter that can be used to accept, reject, or modify routes during
|
|
115
|
+
import/export.
|
|
116
|
+
diff: same
|
|
117
|
+
version: v2+
|
|
118
|
+
anchor: opt-filter
|
|
119
|
+
path: global
|
|
120
|
+
related:
|
|
121
|
+
- function
|
|
122
|
+
- protocol
|
|
123
|
+
- import
|
|
124
|
+
- export
|
|
125
|
+
parameters:
|
|
126
|
+
- name: name
|
|
127
|
+
description: Filter function name.
|
|
128
|
+
- keyword: function
|
|
129
|
+
description: Define a reusable filter function
|
|
130
|
+
detail:
|
|
131
|
+
Create a named function that can be called from filters. Supports typed parameters and
|
|
132
|
+
return values.
|
|
133
|
+
diff: same
|
|
134
|
+
version: v2+
|
|
135
|
+
anchor: opt-function
|
|
136
|
+
path: global
|
|
137
|
+
related:
|
|
138
|
+
- filter
|
|
139
|
+
- define
|
|
140
|
+
parameters:
|
|
141
|
+
- name: signature
|
|
142
|
+
description: Function signature and return type.
|
|
143
|
+
- keyword: gc period
|
|
144
|
+
description: Garbage collection period
|
|
145
|
+
detail: Set the interval between garbage collection runs.
|
|
146
|
+
diff: same
|
|
147
|
+
version: v2+
|
|
148
|
+
anchor: rtable-gc-period
|
|
149
|
+
path: global
|
|
150
|
+
related:
|
|
151
|
+
- gc threshold
|
|
152
|
+
- table
|
|
153
|
+
parameters:
|
|
154
|
+
- name: seconds
|
|
155
|
+
description: Interval between GC runs.
|
|
156
|
+
- keyword: gc threshold
|
|
157
|
+
description: Garbage collection threshold
|
|
158
|
+
detail: Configure the garbage collection threshold for the routing table.
|
|
159
|
+
diff: same
|
|
160
|
+
version: v2+
|
|
161
|
+
anchor: rtable-gc-threshold
|
|
162
|
+
path: global
|
|
163
|
+
related:
|
|
164
|
+
- gc period
|
|
165
|
+
- table
|
|
166
|
+
parameters:
|
|
167
|
+
- name: number
|
|
168
|
+
description: Threshold before GC is triggered.
|
|
169
|
+
- keyword: graceful restart wait
|
|
170
|
+
description: Set graceful restart timeout
|
|
171
|
+
detail: Configure how long to wait for protocols to recover after a graceful restart.
|
|
172
|
+
diff: same
|
|
173
|
+
version: v2+
|
|
174
|
+
anchor: opt-graceful-restart-wait
|
|
175
|
+
path: global
|
|
176
|
+
parameters:
|
|
177
|
+
- name: seconds
|
|
178
|
+
description: Maximum graceful-restart wait.
|
|
179
|
+
- keyword: hostname
|
|
180
|
+
description: Set router hostname
|
|
181
|
+
detail: Override the system hostname used in protocol announcements and logging.
|
|
182
|
+
diff: same
|
|
183
|
+
version: v2+
|
|
184
|
+
anchor: opt-hostname
|
|
185
|
+
path: global
|
|
186
|
+
parameters:
|
|
187
|
+
- name: name
|
|
188
|
+
description: Hostname string.
|
|
189
|
+
- keyword: include
|
|
190
|
+
description: Include another configuration file
|
|
191
|
+
detail:
|
|
192
|
+
Include and parse another configuration file at this point. Supports glob patterns for
|
|
193
|
+
including multiple files.
|
|
194
|
+
diff: same
|
|
195
|
+
version: v2+
|
|
196
|
+
anchor: opt-include
|
|
197
|
+
path: global
|
|
198
|
+
related:
|
|
199
|
+
- define
|
|
200
|
+
- template
|
|
201
|
+
- protocol
|
|
202
|
+
parameters:
|
|
203
|
+
- name: path-or-glob
|
|
204
|
+
description: Path or glob to include.
|
|
205
|
+
- keyword: log
|
|
206
|
+
description: Configure logging destination and format
|
|
207
|
+
detail:
|
|
208
|
+
Set log output to stderr, syslog, or a file. BIRD 3 adds 'fixed' option for ring buffer
|
|
209
|
+
logging.
|
|
210
|
+
diff: modified
|
|
211
|
+
version: v2-v3
|
|
212
|
+
anchor: opt-log
|
|
213
|
+
notes:
|
|
214
|
+
v3: v3 adds 'fixed' ring buffer option for memory-constrained environments.
|
|
215
|
+
path: global
|
|
216
|
+
related:
|
|
217
|
+
- timeformat
|
|
218
|
+
- debug
|
|
219
|
+
- debug latency
|
|
220
|
+
parameters:
|
|
221
|
+
- name: target
|
|
222
|
+
description: Logging target like syslog/file/stderr.
|
|
223
|
+
- name: classes
|
|
224
|
+
description: Enabled log classes.
|
|
225
|
+
- keyword: max settle time
|
|
226
|
+
description: Maximum settle time (v2 only)
|
|
227
|
+
detail: Maximum time to wait before announcing route changes. Removed in v3.
|
|
228
|
+
diff: removed
|
|
229
|
+
version: v2
|
|
230
|
+
anchor: rtable-max-settle-time
|
|
231
|
+
notes:
|
|
232
|
+
v3: "v3: Removed - use export settle time instead"
|
|
233
|
+
path: global
|
|
234
|
+
related:
|
|
235
|
+
- min settle time
|
|
236
|
+
- export settle time
|
|
237
|
+
parameters:
|
|
238
|
+
- name: time
|
|
239
|
+
description: Legacy max settle time (v2).
|
|
240
|
+
- keyword: min settle time
|
|
241
|
+
description: Minimum settle time (v2 only)
|
|
242
|
+
detail: Minimum time to wait before announcing route changes. Removed in v3.
|
|
243
|
+
diff: removed
|
|
244
|
+
version: v2
|
|
245
|
+
anchor: rtable-min-settle-time
|
|
246
|
+
notes:
|
|
247
|
+
v3: "v3: Removed - use export settle time instead"
|
|
248
|
+
path: global
|
|
249
|
+
related:
|
|
250
|
+
- max settle time
|
|
251
|
+
- export settle time
|
|
252
|
+
parameters:
|
|
253
|
+
- name: time
|
|
254
|
+
description: Legacy min settle time (v2).
|
|
255
|
+
- keyword: mrtdump
|
|
256
|
+
description: Configure MRT dump output
|
|
257
|
+
detail: Set up MRT format dump for BGP updates and routing table dumps for analysis.
|
|
258
|
+
diff: same
|
|
259
|
+
version: v2+
|
|
260
|
+
anchor: opt-mrtdump
|
|
261
|
+
path: global
|
|
262
|
+
parameters:
|
|
263
|
+
- name: path
|
|
264
|
+
description: MRT dump file path.
|
|
265
|
+
- keyword: protocol
|
|
266
|
+
description: Define a routing protocol instance
|
|
267
|
+
detail: Create a named instance of a routing protocol (BGP, OSPF, etc.) with its configuration.
|
|
268
|
+
diff: same
|
|
269
|
+
version: v2+
|
|
270
|
+
anchor: opt-protocol
|
|
271
|
+
path: global
|
|
272
|
+
related:
|
|
273
|
+
- template
|
|
274
|
+
- filter
|
|
275
|
+
- function
|
|
276
|
+
- router id
|
|
277
|
+
parameters:
|
|
278
|
+
- name: type
|
|
279
|
+
description: Protocol type (bgp/ospf/etc).
|
|
280
|
+
- name: name
|
|
281
|
+
description: Protocol instance name.
|
|
282
|
+
- keyword: router id
|
|
283
|
+
description: Set BIRD's router ID
|
|
284
|
+
detail:
|
|
285
|
+
"Router ID is a 4-byte integer that should be unique within an AS. It is used to identify
|
|
286
|
+
the router in routing protocols. Default: the lowest IPv4 address of the router."
|
|
287
|
+
diff: same
|
|
288
|
+
version: v2+
|
|
289
|
+
anchor: opt-router-id
|
|
290
|
+
path: global
|
|
291
|
+
related:
|
|
292
|
+
- router id from
|
|
293
|
+
- protocol
|
|
294
|
+
parameters:
|
|
295
|
+
- name: router-id
|
|
296
|
+
description: Router ID in IPv4 format.
|
|
297
|
+
required: true
|
|
298
|
+
- keyword: router id from
|
|
299
|
+
description: Derive router ID from interface
|
|
300
|
+
detail: Automatically determine the router ID from the lowest IP address of the specified interface.
|
|
301
|
+
diff: same
|
|
302
|
+
version: v2+
|
|
303
|
+
anchor: opt-router-id-from
|
|
304
|
+
path: global
|
|
305
|
+
related:
|
|
306
|
+
- router id
|
|
307
|
+
parameters:
|
|
308
|
+
- name: interface-pattern
|
|
309
|
+
description: Interface selection pattern.
|
|
310
|
+
required: true
|
|
311
|
+
- keyword: sorted
|
|
312
|
+
description: Enable sorted table mode
|
|
313
|
+
detail: Keep routes sorted for faster route lookups.
|
|
314
|
+
diff: same
|
|
315
|
+
version: v2+
|
|
316
|
+
anchor: rtable-sorted
|
|
317
|
+
path: global
|
|
318
|
+
parameters:
|
|
319
|
+
- name: switch
|
|
320
|
+
description: Enable sorted table mode.
|
|
321
|
+
- keyword: table
|
|
322
|
+
description: Define a routing table
|
|
323
|
+
detail:
|
|
324
|
+
Create a named routing table to store routes. Tables can be associated with channels for
|
|
325
|
+
import/export.
|
|
326
|
+
diff: same
|
|
327
|
+
version: v2+
|
|
328
|
+
anchor: rtable-opts
|
|
329
|
+
path: global
|
|
330
|
+
related:
|
|
331
|
+
- sorted
|
|
332
|
+
- trie
|
|
333
|
+
- gc period
|
|
334
|
+
- gc threshold
|
|
335
|
+
- export settle time
|
|
336
|
+
parameters:
|
|
337
|
+
- name: name
|
|
338
|
+
description: Routing table name.
|
|
339
|
+
- keyword: template
|
|
340
|
+
description: Define a protocol template
|
|
341
|
+
detail: Create a reusable protocol configuration template that can be inherited by other protocols.
|
|
342
|
+
diff: same
|
|
343
|
+
version: v2+
|
|
344
|
+
anchor: opt-template
|
|
345
|
+
path: global
|
|
346
|
+
related:
|
|
347
|
+
- protocol
|
|
348
|
+
- function
|
|
349
|
+
- filter
|
|
350
|
+
parameters:
|
|
351
|
+
- name: protocol-type
|
|
352
|
+
description: Template protocol type.
|
|
353
|
+
- name: name
|
|
354
|
+
description: Template name.
|
|
355
|
+
- keyword: max latency
|
|
356
|
+
description: Set maximum latency for thread group (v3 only)
|
|
357
|
+
detail: Configure the maximum allowed latency for threads in a thread group before warnings.
|
|
358
|
+
diff: added
|
|
359
|
+
version: v3+
|
|
360
|
+
anchor: thread-setup
|
|
361
|
+
notes:
|
|
362
|
+
v3: "v3 only: Thread group performance tuning option."
|
|
363
|
+
path: global
|
|
364
|
+
parameters:
|
|
365
|
+
- name: time
|
|
366
|
+
description: Maximum thread-group latency.
|
|
367
|
+
- keyword: thread group
|
|
368
|
+
description: Configure thread groups for multi-threading (v3 only)
|
|
369
|
+
detail:
|
|
370
|
+
Define a thread group for running protocol and channel tasks in parallel. BIRD 3.0+ supports
|
|
371
|
+
multi-threading with configurable thread groups.
|
|
372
|
+
diff: added
|
|
373
|
+
version: v3+
|
|
374
|
+
anchor: thread-setup
|
|
375
|
+
notes:
|
|
376
|
+
v3: "v3.2.0+: BIRD runs in several threads with configurable thread groups for different workloads."
|
|
377
|
+
path: global
|
|
378
|
+
related: &a1
|
|
379
|
+
- threads
|
|
380
|
+
- max latency
|
|
381
|
+
parameters: &a2
|
|
382
|
+
- name: name
|
|
383
|
+
description: Thread group name.
|
|
384
|
+
- keyword: thread group
|
|
385
|
+
description: Assign protocol to thread group (v3 only)
|
|
386
|
+
detail: Specify which thread group should handle this protocol's tasks.
|
|
387
|
+
diff: added
|
|
388
|
+
version: v3+
|
|
389
|
+
anchor: proto-thread-group
|
|
390
|
+
notes:
|
|
391
|
+
v3: "v3 only: Multi-threading support for protocol tasks."
|
|
392
|
+
path: protocol
|
|
393
|
+
related: *a1
|
|
394
|
+
parameters: *a2
|
|
395
|
+
- keyword: threads
|
|
396
|
+
description: Set number of threads (deprecated in v3)
|
|
397
|
+
detail:
|
|
398
|
+
Configure the number of worker threads. In v3, use 'thread group' instead for more granular
|
|
399
|
+
control.
|
|
400
|
+
diff: modified
|
|
401
|
+
version: v2-v3
|
|
402
|
+
anchors:
|
|
403
|
+
v2: opt-threads
|
|
404
|
+
v3: thread-setup
|
|
405
|
+
notes:
|
|
406
|
+
v3: "v3: Deprecated in favor of 'thread group' configuration blocks."
|
|
407
|
+
path: global
|
|
408
|
+
related:
|
|
409
|
+
- thread group
|
|
410
|
+
parameters:
|
|
411
|
+
- name: number
|
|
412
|
+
description: Legacy worker thread count.
|
|
413
|
+
- keyword: timeformat
|
|
414
|
+
description: Set time format for logging
|
|
415
|
+
detail: Configure the format string used for timestamps in log messages.
|
|
416
|
+
diff: same
|
|
417
|
+
version: v2+
|
|
418
|
+
anchor: opt-timeformat
|
|
419
|
+
path: global
|
|
420
|
+
parameters:
|
|
421
|
+
- name: format
|
|
422
|
+
description: Time format string.
|
|
423
|
+
- keyword: trie
|
|
424
|
+
description: Use trie data structure
|
|
425
|
+
detail: Store routes in a trie data structure for optimized longest-prefix matching.
|
|
426
|
+
diff: same
|
|
427
|
+
version: v2+
|
|
428
|
+
anchor: rtable-trie
|
|
429
|
+
path: global
|
|
430
|
+
parameters:
|
|
431
|
+
- name: switch
|
|
432
|
+
description: Enable trie table mode.
|
|
433
|
+
- keyword: watchdog warning
|
|
434
|
+
description: Set watchdog warning threshold
|
|
435
|
+
detail: Configure the time threshold after which a warning is logged if the scheduler doesn't respond.
|
|
436
|
+
diff: same
|
|
437
|
+
version: v2+
|
|
438
|
+
anchor: opt-watchdog-warning
|
|
439
|
+
path: global
|
|
440
|
+
parameters:
|
|
441
|
+
- name: time
|
|
442
|
+
description: Scheduler warning threshold.
|