summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-15 15:53:40 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-15 15:54:20 +0200
commitf931d316a6360e8b0e760d60a0c8fcc01e3ded13 (patch)
treec3abcbc7b625dc58f8555ed2b69c1023b9d5901b /data/templates
parentc3c9d8da767161bca8d6e1e01f6223141376cdd6 (diff)
downloadvyos-1x-f931d316a6360e8b0e760d60a0c8fcc01e3ded13.tar.gz
vyos-1x-f931d316a6360e8b0e760d60a0c8fcc01e3ded13.zip
conntrack: T3535: add op-mode commands for tracked connections"
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/conntrackd/conntrackd.op-mode.tmpl13
1 files changed, 13 insertions, 0 deletions
diff --git a/data/templates/conntrackd/conntrackd.op-mode.tmpl b/data/templates/conntrackd/conntrackd.op-mode.tmpl
new file mode 100644
index 000000000..82a4b09ad
--- /dev/null
+++ b/data/templates/conntrackd/conntrackd.op-mode.tmpl
@@ -0,0 +1,13 @@
+Source Destination Protocol
+{% for parsed in data if parsed.flow is defined and parsed.flow.meta is defined %}
+{% for key in parsed.flow.meta %}
+{% if key['@direction'] == 'original' %}
+{% set saddr = key.layer3.src | bracketize_ipv6 %}
+{% set sport = key.layer4.sport %}
+{% set daddr = key.layer3.dst | bracketize_ipv6 %}
+{% set dport = key.layer4.dport %}
+{% set protocol = key.layer4['@protoname'] %}
+{{ "%-48s" | format(saddr ~ ':' ~ sport) }} {{ "%-48s" | format(daddr ~ ':' ~ dport) }} {{ protocol }}
+{% endif %}
+{% endfor %}
+{% endfor %}