@@ -11,6 +11,7 @@ use RESTAPI\Fields\FilterAddressField;
1111use RESTAPI \Fields \ForeignModelField ;
1212use RESTAPI \Fields \InterfaceField ;
1313use RESTAPI \Fields \PortField ;
14+ use RESTAPI \Fields \SpecialNetworkField ;
1415use RESTAPI \Fields \StringField ;
1516use RESTAPI \Fields \UnixTimeField ;
1617use RESTAPI \Responses \ServerError ;
@@ -27,7 +28,7 @@ class PortForward extends Model {
2728 public PortField $ source_port ;
2829 public FilterAddressField $ destination ;
2930 public PortField $ destination_port ;
30- public StringField $ target ;
31+ public SpecialNetworkField $ target ;
3132 public PortField $ local_port ;
3233 public BooleanField $ disabled ;
3334 public BooleanField $ nordr ;
@@ -65,7 +66,7 @@ class PortForward extends Model {
6566 );
6667 $ this ->protocol = new StringField (
6768 required: true ,
68- choices: ['tcp ' , 'udp ' , 'tcp/udp ' , 'icmp ' , 'esp ' , 'ah ' , 'gre ' , 'ipv6 ' , 'igmp ' , 'pim ' , 'ospf ' ],
69+ choices: ['any ' , ' tcp ' , 'udp ' , 'tcp/udp ' , 'icmp ' , 'esp ' , 'ah ' , 'gre ' , 'ipv6 ' , 'igmp ' , 'pim ' , 'ospf ' ],
6970 help_text: 'The IP/transport protocol this port forward rule should match. ' ,
7071 );
7172 $ this ->source = new FilterAddressField (
@@ -96,9 +97,17 @@ class PortForward extends Model {
9697 conditions: ['protocol ' => ['tcp ' , 'udp ' , 'tcp/udp ' ]],
9798 help_text: 'The destination port this port forward rule applies to. Set to `null` to allow any destination port. ' ,
9899 );
99- $ this ->target = new StringField (
100+ $ this ->target = new SpecialNetworkField (
100101 required: true ,
101- validators: [new IPAddressValidator (allow_ipv4: true , allow_ipv6: true , allow_alias: true )],
102+ allow_ipaddr: true ,
103+ allow_subnet: false ,
104+ allow_alias: true ,
105+ allow_interface: false ,
106+ allow_interface_ip: true ,
107+ allow_interface_groups: false ,
108+ allow_self: false ,
109+ allow_l2tp: false ,
110+ allow_pppoe: false ,
102111 help_text: 'The IP address or alias of the internal host to forward matching traffic to. ' ,
103112 );
104113 $ this ->local_port = new PortField (
0 commit comments