Projet

Général

Profil

Révision 77abc10b

ID77abc10b1080ee450cc6080bdcee28f0ddb6b622
Parent fb58f7b3
Enfant af15de48

Ajouté par Nacho Barrientos il y a plus de 4 ans

Implement nftables::simplerule::sport

Voir les différences:

templates/simplerule.epp
4 4
      Optional[String]        $proto,
5 5
      Optional[Variant[Stdlib::IP::Address::V6, Stdlib::IP::Address::V4, Pattern[/^@[-a-zA-Z0-9_]+$/]]] $daddr,
6 6
      Enum['ip', 'ip6']       $set_type,
7
      Optional[Variant[Array[Stdlib::Port, 1], Stdlib::Port, String]] $sport,
7 8
      Boolean                 $counter,
8 9
| -%>
9 10
<%- if $proto {
......
43 44
} else {
44 45
  $_comment = undef
45 46
} -%>
47
<%- if $proto and $sport {
48
  $_src_port = "${_proto} sport {${Array($sport, true).join(', ')}}"
49
} else {
50
  $_src_port = undef
51
} -%>
46 52
<%- if $counter {
47 53
  $_counter = "counter"
48 54
} else {
49 55
  $_counter = undef
50 56
} -%>
51
<%= regsubst(strip([$_ip_version_filter, $_dst_port, $_dst_hosts, $_counter, $action, $_comment].join(' ')), '\s+', ' ', 'G') -%>
57
<%= regsubst(strip([$_ip_version_filter, $_src_port, $_dst_port, $_dst_hosts, $_counter, $action, $_comment].join(' ')), '\s+', ' ', 'G') -%>

Formats disponibles : Unified diff