use Digest::SHA;
use PVE::INotify;
use PVE::Exception qw(raise raise_param_exc);
-use PVE::JSONSchema qw(get_standard_option);
+use PVE::JSONSchema qw(register_standard_option get_standard_option);
use PVE::Cluster;
use PVE::ProcFSTools;
use PVE::Tools qw($IPV4RE);
die "value does not look like a valid IP address or CIDR network\n";
}
+PVE::JSONSchema::register_standard_option('ipset-name', {
+ description => "IP set name.",
+ type => 'string',
+ pattern => '[A-Za-z][A-Za-z0-9\-\_]+',
+ minLength => 2,
+ maxLength => 20,
+});
+
+PVE::JSONSchema::register_standard_option('pve-security-group-name', {
+ description => "Security Group name.",
+ type => 'string',
+ pattern => '[A-Za-z][A-Za-z0-9\-\_]+',
+ minLength => 2,
+ maxLength => 20,
+});
my $feature_ipset_nomatch = 0;
eval {
sub parse_address_list {
my ($str) = @_;
- return if $str !~ m/^(\+)(\S+)$/; # ipset ref
+ return if $str =~ m/^(\+)(\S+)$/; # ipset ref
my $count = 0;
my $iprange = 0;
if ($line =~ m/^\[group\s+(\S+)\]\s*$/i) {
$section = 'groups';
$group = lc($1);
+ $res->{$section}->{$group} = [];
next;
}
if ($line =~ m/^\[ipset\s+(\S+)\]\s*$/i) {
$section = 'ipset';
$group = lc($1);
+ $res->{$section}->{$group} = [];
next;
}