- 论坛徽章:
- 7
|
:- use XML::Generator;
- my $xml = XML::Generator->new(
- 'conformance' => 'strict',
- 'escape' => 'always',
- 'pretty' => 3,
- 'encoding' => 'GBK'
- );
- my @rules = split /\n/, <<REND;
- rule deny 192.168.1.1 0.0.0.255
- rule deny 192.168.2.1 0.0.0.128
- rule permit any
- REND
- print $xml->xmldecl, $xml->function(
- { funcname => 'acl_black_list', mode => 'predefined', no => 'no' },
- $xml->task_name('20130502152226_815403777'),
- $xml->device(
- $xml->device_name('202.197.12.200'),
- $xml->interface_name('GigabitEthernet0/0/2'),
- $xml->rule_list( map $xml->rule($_), @rules )
- )
- );
复制代码 |
|