{
    foreach my $filter ( sort {$a->prop('UDPPort') cmp $b->prop('UDPPort')}
	$DB->get_all_by_prop( UDPPort => '\d+') )
    {
	my %props = $filter->props();

        my $port = $props{UDPPort};

	my $deny_hosts = $props{DenyHosts} || '';

	my $allow_hosts = $props{AllowHosts} || '0.0.0.0/0';

	unless ( ($props{status} || 'disabled') eq 'enabled')
	{
	    $allow_hosts = '';
	}

	unless ( ($props{access} || 'private') eq 'public')
	{
	    $allow_hosts = '';
	}

	$OUT .= "    # " . $filter->key . ": UDPPort $port, AllowHosts: $allow_hosts, DenyHosts: $deny_hosts\n";

	foreach my $host (split(',', $deny_hosts))
	{
	    $OUT .= <<HERE;
    /sbin/iptables -A \$NEW_InboundUDP --proto udp --dport $port \\
	--destination \$OUTERNET --src $host --jump denylog
HERE
	}

	foreach my $host (split(',', $allow_hosts))
	{
	    $OUT .= <<HERE;
    /sbin/iptables -A \$NEW_InboundUDP --proto udp --dport $port \\
	--destination \$OUTERNET --src $host --jump ACCEPT
HERE
	}

	$OUT .= <<HERE;
    /sbin/iptables -A \$NEW_InboundUDP --proto udp --dport $port \\
	--destination \$OUTERNET --jump denylog

HERE
    }
}
