Page Menu
Home
VyOS Platform
Search
Configure Global Search
Log In
Files
F119062930
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
23 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/Makefile b/Makefile
index 549c778b2..1cc51a161 100644
--- a/Makefile
+++ b/Makefile
@@ -1,136 +1,137 @@
TMPL_DIR := templates-cfg
OP_TMPL_DIR := templates-op
BUILD_DIR := build
DATA_DIR := data
CFLAGS :=
src = $(wildcard interface-definitions/*.xml.in)
obj = $(src:.xml.in=.xml)
%.xml: %.xml.in
@echo Generating $(BUILD_DIR)/$@ from $<
# -ansi This turns off certain features of GCC that are incompatible
# with ISO C90. Without this regexes containing '/' as in an URL
# won't work
# -x c By default GCC guesses the input language from its file extension,
# thus XML is unknown. Force it to C language
# -E Stop after the preprocessing stage
# -undef Do not predefine any system-specific or GCC-specific macros.
# -nostdinc Do not search the standard system directories for header files
# -P Inhibit generation of linemarkers in the output from the
# preprocessor
@$(CC) -x c-header -E -undef -nostdinc -P -I$(CURDIR)/interface-definitions -o $(BUILD_DIR)/$@ -c $<
$(BUILD_DIR):
install -d -m 0755 $(BUILD_DIR)/interface-definitions
install -d -m 0755 $(BUILD_DIR)/op-mode-definitions
.PHONY: interface_definitions
.ONESHELL:
interface_definitions: $(BUILD_DIR) $(obj)
mkdir -p $(TMPL_DIR)
find $(BUILD_DIR)/interface-definitions -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-templates {} $(CURDIR)/schema/interface_definition.rng $(TMPL_DIR) || exit 1
# XXX: delete top level node.def's that now live in other packages
rm -f $(TMPL_DIR)/firewall/node.def
rm -f $(TMPL_DIR)/interfaces/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/vif/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/vif-s/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/bonding/node.tag/vif-s/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/bridge/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/bridge/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/l2tpv3/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/openvpn/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/pppoe/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/pppoe/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/tunnel/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/vxlan/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/vxlan/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/wireless/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/wireless/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/wireless/node.tag/vif/node.tag/ip/node.def
rm -f $(TMPL_DIR)/interfaces/wireless/node.tag/vif/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/interfaces/wirelessmodem/node.tag/ipv6/node.def
rm -f $(TMPL_DIR)/protocols/node.def
mv $(TMPL_DIR)/protocols/nbgp $(TMPL_DIR)/protocols/.nbgp
+ mv $(TMPL_DIR)/protocols/nrip $(TMPL_DIR)/protocols/.nrip
rm -f $(TMPL_DIR)/protocols/static/node.def
rm -f $(TMPL_DIR)/system/node.def
rm -f $(TMPL_DIR)/vpn/node.def
rm -f $(TMPL_DIR)/vpn/ipsec/node.def
.PHONY: op_mode_definitions
.ONESHELL:
op_mode_definitions:
mkdir -p $(OP_TMPL_DIR)
find $(CURDIR)/op-mode-definitions/ -type f -name "*.xml" | xargs -I {} $(CURDIR)/scripts/build-command-op-templates {} $(CURDIR)/schema/op-mode-definition.rng $(OP_TMPL_DIR) || exit 1
# XXX: delete top level op mode node.def's that now live in other packages
rm -f $(OP_TMPL_DIR)/clear/node.def
rm -f $(OP_TMPL_DIR)/clear/interfaces/node.def
rm -f $(OP_TMPL_DIR)/set/node.def
rm -f $(OP_TMPL_DIR)/show/node.def
rm -f $(OP_TMPL_DIR)/show/interfaces/node.def
rm -f $(OP_TMPL_DIR)/show/ipv6/node.def
rm -f $(OP_TMPL_DIR)/show/ipv6/route/node.def
rm -f $(OP_TMPL_DIR)/restart/node.def
rm -f $(OP_TMPL_DIR)/monitor/node.def
rm -f $(OP_TMPL_DIR)/generate/node.def
rm -f $(OP_TMPL_DIR)/show/system/node.def
rm -f $(OP_TMPL_DIR)/show/log/node.def
rm -f $(OP_TMPL_DIR)/show/vpn/node.def
rm -f $(OP_TMPL_DIR)/delete/node.def
rm -f $(OP_TMPL_DIR)/reset/vpn/node.def
.PHONY: component_versions
.ONESHELL:
component_versions: $(BUILD_DIR) $(obj)
$(CURDIR)/scripts/build-component-versions $(BUILD_DIR)/interface-definitions $(DATA_DIR)
.PHONY: all
all: clean interface_definitions op_mode_definitions component_versions
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
rm -rf $(TMPL_DIR)
rm -rf $(OP_TMPL_DIR)
.PHONY: test
test:
set -e; python3 -m compileall -q .
PYTHONPATH=python/ python3 -m "nose" --with-xunit src --with-coverage --cover-erase --cover-xml --cover-package src/conf_mode,src/op_mode,src/completion,src/helpers,src/validators,src/tests --verbose
.PHONY: sonar
sonar:
sonar-scanner -X -Dsonar.login=${SONAR_TOKEN}
.PHONY: docs
.ONESHELL:
docs:
sphinx-apidoc -o sphinx/source/ python/
cd sphinx/
PYTHONPATH=../python make html
deb:
dpkg-buildpackage -uc -us -tc -b
diff --git a/interface-definitions/include/rip-redistribute.xml.i b/interface-definitions/include/rip-redistribute.xml.i
new file mode 100644
index 000000000..d94dfa5a8
--- /dev/null
+++ b/interface-definitions/include/rip-redistribute.xml.i
@@ -0,0 +1,24 @@
+<leafNode name="metric">
+ <properties>
+ <help>Metric for redistributed routes</help>
+ <valueHelp>
+ <format><1-16></format>
+ <description>Redistribute route metric</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-16"/>
+ </constraint>
+ </properties>
+</leafNode>
+<leafNode name="route-map">
+ <properties>
+ <help>Route map reference</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Route map reference</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy route-map</path>
+ </completionHelp>
+ </properties>
+</leafNode>
diff --git a/interface-definitions/protocols-rip.xml.in b/interface-definitions/protocols-rip.xml.in
new file mode 100644
index 000000000..a9c295f4c
--- /dev/null
+++ b/interface-definitions/protocols-rip.xml.in
@@ -0,0 +1,406 @@
+<!-- Routing Information Protocol (RIP) configuration -->
+<interfaceDefinition>
+ <node name="protocols">
+ <children>
+ <node name="nrip" owner="${vyos_conf_scripts_dir}/protocols_rip.py">
+ <properties>
+ <help>Routing Information Protocol (RIP) parameters</help>
+ </properties>
+ <children>
+ <leafNode name="default-distance">
+ <properties>
+ <help>Administrative distance</help>
+ <valueHelp>
+ <format><1-255></format>
+ <description>Administrative distance</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <node name="default-information">
+ <properties>
+ <help>Control distribution of default route</help>
+ </properties>
+ <children>
+ <leafNode name="originate">
+ <properties>
+ <help>Distribute a default route</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <leafNode name="default-metric">
+ <properties>
+ <help>Metric of redistributed routes</help>
+ <valueHelp>
+ <format><1-16></format>
+ <description>Redistributed routes metric</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-16"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <node name="distribute-list">
+ <properties>
+ <help>Filter networks in routing updates</help>
+ </properties>
+ <children>
+ <node name="access-list">
+ <properties>
+ <help>Access-list</help>
+ </properties>
+ <children>
+ <leafNode name="in">
+ <properties>
+ <help>Access list to apply to input packets</help>
+ <valueHelp>
+ <format><0-4294967295></format>
+ <description>Access list to apply to input packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy access-list</path>
+ </completionHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="out">
+ <properties>
+ <help>Access list to apply to output packets</help>
+ <valueHelp>
+ <format><0-4294967295></format>
+ <description>Access list to apply to output packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy access-list</path>
+ </completionHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <tagNode name="interface">
+ <properties>
+ <help>Apply filtering to an interface</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Apply filtering to an interface</description>
+ </valueHelp>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="access-list">
+ <properties>
+ <help>Access list</help>
+ </properties>
+ <children>
+ <leafNode name="in">
+ <properties>
+ <help>Access list to apply to input packets</help>
+ <valueHelp>
+ <format><0-4294967295></format>
+ <description>Access list to apply to input packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy access-list</path>
+ </completionHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="out">
+ <properties>
+ <help>Access list to apply to output packets</help>
+ <valueHelp>
+ <format><0-4294967295></format>
+ <description>Access list to apply to output packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy access-list</path>
+ </completionHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-4294967295"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ <node name="prefix-list">
+ <properties>
+ <help>Prefix-list</help>
+ </properties>
+ <children>
+ <leafNode name="in">
+ <properties>
+ <help>Prefix-list to apply to input packets</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Prefix-list to apply to input packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy prefix-list</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <leafNode name="out">
+ <properties>
+ <help>Prefix-list to apply to output packets</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Prefix-list to apply to output packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy prefix-list</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </tagNode>
+ <node name="prefix-list">
+ <properties>
+ <help>Prefix-list</help>
+ </properties>
+ <children>
+ <leafNode name="in">
+ <properties>
+ <help>Prefix-list to apply to input packets</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Prefix-list to apply to input packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy prefix-list</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <leafNode name="out">
+ <properties>
+ <help>Prefix-list to apply to output packets</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Prefix-list to apply to output packets</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy prefix-list</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ <leafNode name="interface">
+ <properties>
+ <help>Interface name</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Apply filtering to an interface</description>
+ </valueHelp>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ <multi/>
+ </properties>
+ </leafNode>
+ <leafNode name="neighbor">
+ <properties>
+ <help>Neighbor router</help>
+ <valueHelp>
+ <format>ipv4</format>
+ <description>Neighbor router</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-address"/>
+ </constraint>
+ <multi/>
+ </properties>
+ </leafNode>
+ <leafNode name="network">
+ <properties>
+ <help>RIP network</help>
+ <valueHelp>
+ <format>ipv4net</format>
+ <description>RIP network</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-prefix"/>
+ </constraint>
+ <multi/>
+ </properties>
+ </leafNode>
+ <tagNode name="network-distance">
+ <properties>
+ <help>Source network</help>
+ <valueHelp>
+ <format>ipv4net</format>
+ <description>Source network</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-prefix"/>
+ </constraint>
+ </properties>
+ <children>
+ <leafNode name="access-list">
+ <properties>
+ <help>Access list</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Access list</description>
+ </valueHelp>
+ <completionHelp>
+ <path>policy access-list</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <leafNode name="distance">
+ <properties>
+ <help>Administrative distance for network</help>
+ <valueHelp>
+ <format><1-255></format>
+ <description>Administrative distance</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </tagNode>
+ <leafNode name="passive-interface">
+ <properties>
+ <help>Passive interface</help>
+ <valueHelp>
+ <format><text></format>
+ <description>Suppress routing updates on interface</description>
+ </valueHelp>
+ <valueHelp>
+ <format>default</format>
+ <description>Suppress routing updates on all interfaces by default</description>
+ </valueHelp>
+ <completionHelp>
+ <list>default</list>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ <multi/>
+ </properties>
+ </leafNode>
+ <node name="redistribute">
+ <properties>
+ <help>Redistribute information from another routing protocol</help>
+ </properties>
+ <children>
+ <node name="bgp">
+ <properties>
+ <help>Redistribute BGP routes</help>
+ </properties>
+ <children>
+ #include <include/rip-redistribute.xml.i>
+ </children>
+ </node>
+ <node name="connected">
+ <properties>
+ <help>Redistribute connected routes</help>
+ </properties>
+ <children>
+ #include <include/rip-redistribute.xml.i>
+ </children>
+ </node>
+ <node name="kernel">
+ <properties>
+ <help>Redistribute kernel routes</help>
+ </properties>
+ <children>
+ #include <include/rip-redistribute.xml.i>
+ </children>
+ </node>
+ <node name="ospf">
+ <properties>
+ <help>Redistribute OSPF routes</help>
+ </properties>
+ <children>
+ #include <include/rip-redistribute.xml.i>
+ </children>
+ </node>
+ <node name="static">
+ <properties>
+ <help>Redistribute static routes</help>
+ </properties>
+ <children>
+ #include <include/rip-redistribute.xml.i>
+ </children>
+ </node>
+ </children>
+ </node>
+ <leafNode name="route">
+ <properties>
+ <help>RIP static route</help>
+ <valueHelp>
+ <format>ipv4net</format>
+ <description>RIP static route</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-prefix"/>
+ </constraint>
+ <multi/>
+ </properties>
+ </leafNode>
+ <node name="timers">
+ <properties>
+ <help>RIP timer values</help>
+ </properties>
+ <children>
+ <leafNode name="garbage-collection">
+ <properties>
+ <help>Garbage collection timer</help>
+ <valueHelp>
+ <format><5-2147483647></format>
+ <description>Garbage colletion time (default 120)</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 5-2147483647"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="timeout">
+ <properties>
+ <help>Routing information timeout timer</help>
+ <valueHelp>
+ <format><5-2147483647></format>
+ <description>Routing information timeout timer (default 180)</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 5-2147483647"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="update">
+ <properties>
+ <help>Routing table update timer</help>
+ <valueHelp>
+ <format><5-2147483647></format>
+ <description>Routing table update timer in seconds (default 30)</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 5-2147483647"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 6, 7:38 AM (1 d, 22 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4653183
Default Alt Text
(23 KB)
Attached To
Mode
rVYOSONEX vyos-1x
Attached
Detach File
Event Timeline
Log In to Comment