-sub parse_fw_rules {
- my ($filename, $fh) = @_;
-
- my $section;
-
- my $res = { in => [], out => [] };
-
- while (defined(my $line = <$fh>)) {
- next if $line =~ m/^#/;
- next if $line =~ m/^\s*$/;
-
- if ($line =~ m/^\[(in|out)\]\s*$/i) {
- $section = lc($1);
- next;
- }
- next if !$section;
-
- my ($action, $iface, $source, $dest, $proto, $dport, $sport) =
- split(/\s+/, $line);
-
- if (!($action && $iface && $source && $dest)) {
- warn "skip incomplete line\n";
- next;
- }
-
- if ($action !~ m/^(ACCEPT|DROP)$/) {
- warn "unknown action '$action'\n";
-# next;
- }
-
- if ($iface !~ m/^(all|net0|net1|net2|net3|net4|net5)$/) {
- warn "unknown interface '$iface'\n";
- next;
- }
+__PACKAGE__->register_method({
+ name => 'enabletaprules',
+ path => 'enabletaprules',
+ method => 'POST',
+ parameters => {
+ additionalProperties => 0,
+ properties => {
+ vmid => get_standard_option('pve-vmid'),
+ netid => {
+ type => 'string',
+ },
+
+ },
+ },
+ returns => { type => 'null' },
+ code => sub {
+ my ($param) = @_;