| 1 |
Value Key index (\d+) |
| 2 |
Value flags ([XID]+) |
| 3 |
Value comment (\S+[\S ]*\S) |
| 4 |
Value chain (dstnat|srcnat) |
| 5 |
Value action (accept|add-dst-to-address-list|add-src-to-address-list|dst-nat|jump|log|masquerade|netmap|passthrough|redirect|return|same|src-nat) |
| 6 |
Value to_addresses ([\w!,./:\d]+) |
| 7 |
Value to_ports ([\d,-]+) |
| 8 |
Value protocol (!?(dccp|egp|etherip|gre|icmp|idpr-cmtp|ipencap|ipsec-ah|ipv6-encap|ipv6-nonxt|ipv6-route|l2tp|pim|rdp|rsvp|st|udp|vmtp|xns-idp|ddp|encap|ggp|hmp|icmpv6|igmp|ipip|ipsec-esp|ipv6-frag|ipv6-opts|iso-tp4|ospf|pup|rspf|sctp|tcp|udp-lite|vrrp|xtp)) |
| 9 |
Value src_address ([\w!.:/\d]+) |
| 10 |
Value src_address_list (\S+) |
| 11 |
Value src_port (\S+) |
| 12 |
Value in_interface (\S+) |
| 13 |
Value out_interface (\S+) |
| 14 |
Value in_interface_list (\S+) |
| 15 |
Value out_interface_list (\S+) |
| 16 |
Value ipsec_policy (\S+) |
| 17 |
Value dst_address ([\w!.:/\d]+) |
| 18 |
Value dst_address_list (\S+) |
| 19 |
Value dst_port (\S+) |
| 20 |
Value log (yes|no) |
| 21 |
Value log_prefix (\S+[\S ]*\S) |
| 22 |
|
| 23 |
Start |
| 24 |
^Flags:.*$$ -> NATTable |
| 25 |
|
| 26 |
NATTable |
| 27 |
^\s?${index}\s+(${flags})?\s+;;;\s${comment} |
| 28 |
^\s+chain=${chain}\saction=${action}(\sto-addresses=${to_addresses})?(\sto-ports=${to_ports})?(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface=${in_interface})?(\sin-interface-list=${in_interface_list})?(\sout-interface=${out_interface})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\slog=${log})?(\slog-prefix="(${log_prefix})?")?(\sipsec-policy=${ipsec_policy})?\s*$$ -> Record |
| 29 |
^\s?${index}\s+(${flags})?\s+chain=${chain}\saction=${action}(\sto-addresses=${to_addresses})?(\sto-ports=${to_ports})?(\sprotocol=${protocol})?(\ssrc-address=${src_address})?(\sdst-address=${dst_address})?(\ssrc-address-list=${src_address_list})?(\sdst-address-list=${dst_address_list})?(\sin-interface=${in_interface})?(\sin-interface-list=${in_interface_list})?(\sout-interface=${out_interface})?(\sout-interface-list=${out_interface_list})?(\ssrc-port=${src_port})?(\sdst-port=${dst_port})?(\slog=${log})?(\slog-prefix="(${log_prefix})?")?(\sipsec-policy=${ipsec_policy})?\s*$$ -> Record |
| 30 |
^\s*(?:\d{2}:){2}\d{2}\s+echo:\s*.*$$ -> Next |
| 31 |
^. -> Error |