]> git.proxmox.com Git - pve-firewall.git/blame_incremental - PVE/Firewall.pm
start example code
[pve-firewall.git] / PVE / Firewall.pm
... / ...
CommitLineData
1package PVE::Firewall;
2
3use warnings;
4use strict;
5use Data::Dumper;
6
7use PVE::QemuServer;
8
9# we need complete VM configuration of all VMs (openvz/qemu)
10# in vmdata
11
12sub compile {
13 my ($vmdata) = @_;
14
15 my $netinfo;
16
17 foreach my $vmid (keys %{$vmdata->{qemu}}) {
18 $netinfo->{$vmid} = {};
19 my $conf = $vmdata->{qemu}->{$vmid};
20 foreach my $opt (keys %$conf) {
21 next if $opt !~ m/^net(\d+)$/;
22 my $net = PVE::QemuServer::parse_net($conf->{$opt});
23 next if !$net;
24 $netinfo->{$vmid} = $net;
25 }
26 }
27
28 print Dumper($netinfo);
29
30}
31
32sub activate {
33
34}
35
36
371;