Projet

Général

Profil

Révision e846c98b

IDe846c98b9a6b7e161e884652b579f02c2ea32534
Parent 22c16919
Enfant 7fcc85bc

Ajouté par Tim Meusel il y a plus d'un an

simplerule: Allow multiple oifname/iifname

Voir les différences:

templates/simplerule.epp
7 7
      Optional[Nftables::Addr] $saddr,
8 8
      String                   $set_type,
9 9
      Optional[Nftables::Port] $sport,
10
      Optional[String[1]]      $iifname,
11
      Optional[String[1]]      $oifname,
10
      Array[String[1]]         $iifname,
11
      Array[String[1]]         $oifname,
12 12
| -%>
13 13
<%- if $proto {
14 14
  $_proto = $proto ? {
......
71 71
} else {
72 72
  $_counter = undef
73 73
} -%>
74
<%- if $iifname {
75
  $_iifname = "iifname \"${iifname}\""
76
} else {
74
<%- if empty($iifname) {
77 75
  $_iifname = undef
78
} -%>
79
<%- if $oifname {
80
  $_oifname = "oifname \"${oifname}\""
81 76
} else {
77
  $iifdata = $iifname.map |String[1] $interface| { "\"${interface}\"" }.join(', ')
78
  $_iifname = "iifname { ${iifdata} }"
79
} -%>
80
<%- if empty($oifname) {
82 81
  $_oifname = undef
82
} else {
83
  $oifdata = $oifname.map |String[1] $interface| { "\"${interface}\"" }.join(', ')
84
  $_oifname = "oifname { ${oifdata} }"
83 85
} -%>
84 86
<%= regsubst(strip([$_ip_version_filter, $_iifname, $_oifname, $_src_port, $_dst_port, $_src_hosts, $_dst_hosts, $_counter, $action, $_comment].join(' ')), '\s+', ' ', 'G') -%>

Formats disponibles : Unified diff