summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md75
-rw-r--r--op-mode-definitions/nat.xml.in6
-rw-r--r--op-mode-definitions/nat66.xml.in26
-rwxr-xr-xsrc/conf_mode/nat66.py1
4 files changed, 91 insertions, 17 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7ac48ee4c..8458d3208 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -8,6 +8,81 @@ review this contribution guideline.
The following paragraphs are an excerpt from our Documentation.
+## Submit a Patch
+
+Patches are always more than welcome. To have a clean and easy to maintain
+repository we have some guidelines when working with Git. A clean repository
+eases the automatic generation of a changelog file.
+
+A good approach for writing commit messages is actually to have a look at the
+file(s) history by invoking git log path/to/file.txt.
+
+### Prepare patch/commit
+
+In a big system, such as VyOS, that is comprised of multiple components, it’s
+impossible to keep track of all the changes and bugs/feature requests in one’s
+head. We use a bugtracker known as Phabricator for it (“issue tracker” would
+be a better term, but this one stuck).
+
+The information is used in three ways:
+
+* Keep track of the progress (what we have already done in this branch and
+ what we still need to do).
+* Prepare automatic release notes for upcoming releases
+* Help future maintainers of VyOS (it could be you!) to find out why certain
+ things have been changed in the codebase or why certain features have been
+ added
+
+To make this approach work, every change must be associated with a task number
+(prefixed with **T**) and a component. If there is no bug report/feature
+request for the changes you are going to make, you have to create a Phabricator
+task first. Once there is an entry in Phabricator, you should reference its id
+in your commit message, as shown below:
+
+* `ddclient: T1030: auto create runtime directories`
+* `Jenkins: add current Git commit ID to build description`
+
+If there is no [Phabricator](https://phabricator.vyos.net) reference in the
+commits of your pull request, we have to ask you to amend the commit message.
+Otherwise we will have to reject it.
+
+## Writing good commit messages
+
+The format should be and is inspired by this very good and detailed
+[Git documentation](https://git-scm.com/book/ch5-2.html), it is also worth
+reading https://chris.beams.io/posts/git-commit/.
+
+This is nothing VyOS specific - it is more a general topic for distributed
+development environments.
+
+* A single, short, summary of the commit (recommended 50 characters or less,
+ not exceeding 80 characters) containing a prefix of the changed component
+ and the corresponding Phabricator reference e.g. `snmp: T1111:` or
+ `ethernet: T2222:` - multiple components could be concatenated as in `snmp:
+ ethernet: T3333`
+* In some contexts, the first line is treated as the subject of an email and
+ the rest of the text as the body. The blank line separating the summary from
+ the body is critical (unless you omit the body entirely); tools like rebase
+ can get confused if you run the two together.
+* Followed by a message which describes all the details like:
+ * What/why/how something has been changed, makes everyone’s life easier when
+ working with `git bisect`
+ * All text of the commit message should be wrapped at 72 characters if
+ possible which makes reading commit logs easier with git log on a standard
+ terminal (which happens to be 80x25)
+ * If applicable a reference to a previous commit should be made linking those
+ commits nicely when browsing the history: `After commit abcd12ef ("snmp:
+ this is a headline") a Python import statement is missing, throwing the
+ following exception: ABCDEF`
+* Always use the `-x` option to the `git cherry-pick` command when back or
+ forward porting an individual commit. This automatically appends the line:
+ `(cherry picked from commit <ID>)` to the original authors commit message
+ making it easier when bisecting problems.
+* Every change set must be consistent (self containing)! Do not fix multiple
+ bugs in a single commit. If you already worked on multiple fixes in the same
+ file use git add –patch to only add the parts related to the one issue into
+ your upcoming commit.
+
## Bug Report/Issue
Issues or bugs are found in any software project. VyOS is not an exception.
diff --git a/op-mode-definitions/nat.xml.in b/op-mode-definitions/nat.xml.in
index 949400eba..084e2e7e3 100644
--- a/op-mode-definitions/nat.xml.in
+++ b/op-mode-definitions/nat.xml.in
@@ -4,12 +4,12 @@
<children>
<node name="nat">
<properties>
- <help>Show Network Address Translation (NAT) information</help>
+ <help>Show IPv4 to IPv4 Network Address Translation (NAT) information</help>
</properties>
<children>
<node name="source">
<properties>
- <help>Show source Network Address Translation (NAT) information</help>
+ <help>Show source IPv4 to IPv4 Network Address Translation (NAT) information</help>
</properties>
<children>
<node name="rules">
@@ -51,7 +51,7 @@
</node>
<node name="destination">
<properties>
- <help>Show destination Network Address Translation (NAT) information</help>
+ <help>Show destination IPv4 to IPv4 Network Address Translation (NAT) information</help>
</properties>
<children>
<node name="rules">
diff --git a/op-mode-definitions/nat66.xml.in b/op-mode-definitions/nat66.xml.in
index c57c7c8b3..1ec46eb11 100644
--- a/op-mode-definitions/nat66.xml.in
+++ b/op-mode-definitions/nat66.xml.in
@@ -4,34 +4,34 @@
<children>
<node name="nat66">
<properties>
- <help>Show Network Address Translation (NAT) information</help>
+ <help>Show IPv6 to IPv6 Network Address Translation (NAT66) information</help>
</properties>
<children>
<node name="source">
<properties>
- <help>Show source Network Address Translation (NAT) information</help>
+ <help>Show source IPv6 to IPv6 Network Address Translation (NAT66) information</help>
</properties>
<children>
<node name="rules">
<properties>
- <help>Show configured source NAT rules</help>
+ <help>Show configured source NAT66 rules</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_rules.py --source</command>
</node>
<node name="statistics">
<properties>
- <help>Show statistics for configured source NAT rules</help>
+ <help>Show statistics for configured source NAT66 rules</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_statistics.py --source</command>
</node>
<node name="translations">
<properties>
- <help>Show active source NAT translations</help>
+ <help>Show active source NAT66 translations</help>
</properties>
<children>
<tagNode name="address">
<properties>
- <help>Show active source NAT translations for an IP address</help>
+ <help>Show active source NAT66 translations for an IPv6 address</help>
<completionHelp>
<list>&lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
@@ -40,7 +40,7 @@
</tagNode>
<node name="detail">
<properties>
- <help>Show active source NAT translations detail</help>
+ <help>Show active source NAT66 translations detail</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_translations.py --type=source --verbose</command>
</node>
@@ -51,29 +51,29 @@
</node>
<node name="destination">
<properties>
- <help>Show destination Network Address Translation (NAT) information</help>
+ <help>Show destination IPv6 to IPv6 Network Address Translation (NAT66) information</help>
</properties>
<children>
<node name="rules">
<properties>
- <help>Show configured destination NAT rules</help>
+ <help>Show configured destination NAT66 rules</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_rules.py --destination</command>
</node>
<node name="statistics">
<properties>
- <help>Show statistics for configured destination NAT rules</help>
+ <help>Show statistics for configured destination NAT66 rules</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_statistics.py --destination</command>
</node>
<node name="translations">
<properties>
- <help>Show active destination NAT translations</help>
+ <help>Show active destination NAT66 translations</help>
</properties>
<children>
<tagNode name="address">
<properties>
- <help>Show active NAT destination translations for an IP address</help>
+ <help>Show active NAT66 destination translations for an IPv6 address</help>
<completionHelp>
<list>&lt;h:h:h:h:h:h:h:h&gt;</list>
</completionHelp>
@@ -82,7 +82,7 @@
</tagNode>
<node name="detail">
<properties>
- <help>Show active destination NAT translations detail</help>
+ <help>Show active destination NAT66 translations detail</help>
</properties>
<command>${vyos_op_scripts_dir}/show_nat66_translations.py --type=destination --verbose</command>
</node>
diff --git a/src/conf_mode/nat66.py b/src/conf_mode/nat66.py
index 86c27c77a..e2bd6417d 100755
--- a/src/conf_mode/nat66.py
+++ b/src/conf_mode/nat66.py
@@ -28,7 +28,6 @@ from vyos.util import cmd
from vyos.util import check_kmod
from vyos.util import dict_search
from vyos.template import is_ipv6
-from vyos.template import is_ip_network
from vyos.xml import defaults
from vyos import ConfigError
from vyos import airbag