line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
860
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
84
|
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use HH::Unispool::Config; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
6
|
use HH::Unispool::Config::OS; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
7
|
use HH::Unispool::Config::Entry::Filter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
6
|
1
|
|
|
1
|
|
8
|
use HH::Unispool::Config::Entry::System; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
7
|
1
|
|
|
1
|
|
6
|
use HH::Unispool::Config::Entry::Device::5; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
8
|
1
|
|
|
1
|
|
7
|
use HH::Unispool::Config::Entry::Device::6; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
9
|
1
|
|
|
1
|
|
7
|
use HH::Unispool::Config::Entry::RemoteSystem::8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
395
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Create a config from scratch |
12
|
|
|
|
|
|
|
my $conf3 = HH::Unispool::Config->new(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Create a filter and add it to the configuration |
15
|
|
|
|
|
|
|
my $flt = HH::Unispool::Config::Entry::Filter->new( { |
16
|
|
|
|
|
|
|
name => 'cat', |
17
|
|
|
|
|
|
|
file => '/usr/bin/cat', |
18
|
|
|
|
|
|
|
} ); |
19
|
|
|
|
|
|
|
$conf3->add_filter($flt); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Create the _Network_ system and add it to the configuration |
22
|
|
|
|
|
|
|
my $sysn = HH::Unispool::Config::Entry::System->new( { |
23
|
|
|
|
|
|
|
name => '_Network_', |
24
|
|
|
|
|
|
|
} ); |
25
|
|
|
|
|
|
|
$conf3->add_system($sysn); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Add a type 8 remote system to _Network_ |
28
|
|
|
|
|
|
|
my $rsys = HH::Unispool::Config::Entry::RemoteSystem::8->new( { |
29
|
|
|
|
|
|
|
name => 'foo', |
30
|
|
|
|
|
|
|
os => HH::Unispool::Config::OS->new( { os => 'Solaris' } ), |
31
|
|
|
|
|
|
|
remote_node_name => 'foo.bar.org', |
32
|
|
|
|
|
|
|
} ); |
33
|
|
|
|
|
|
|
$sysn->add_remote_system($rsys); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# Add a type 5 device to _Network_ |
36
|
|
|
|
|
|
|
my $dev = HH::Unispool::Config::Entry::Device::5->new( { |
37
|
|
|
|
|
|
|
name => 'lp', |
38
|
|
|
|
|
|
|
filter_name => 'cat', |
39
|
|
|
|
|
|
|
remote_device_name => 'lp', |
40
|
|
|
|
|
|
|
remote_system_name => 'foo', |
41
|
|
|
|
|
|
|
description => 'lp', |
42
|
|
|
|
|
|
|
} ); |
43
|
|
|
|
|
|
|
$sysn->add_device($dev); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Create the foo.bar.org system and add it to the configuration |
46
|
|
|
|
|
|
|
my $sysf = HH::Unispool::Config::Entry::System->new( { |
47
|
|
|
|
|
|
|
name => 'foo.bar.org', |
48
|
|
|
|
|
|
|
local_system_name => 'foo', |
49
|
|
|
|
|
|
|
network_name => 'foo.bar.org', |
50
|
|
|
|
|
|
|
os => HH::Unispool::Config::OS->new( { os => 'Solaris' } ), |
51
|
|
|
|
|
|
|
type => 'cs', |
52
|
|
|
|
|
|
|
} ); |
53
|
|
|
|
|
|
|
$conf3->add_system($sysf); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Add a type 6 device to foo.bar.org |
56
|
|
|
|
|
|
|
$dev = HH::Unispool::Config::Entry::Device::6->new( { |
57
|
|
|
|
|
|
|
name => 'lp1', |
58
|
|
|
|
|
|
|
filter_name => 'cat', |
59
|
|
|
|
|
|
|
remote_node_name => 'lp1.foo.bar.org', |
60
|
|
|
|
|
|
|
description => 'lp1', |
61
|
|
|
|
|
|
|
} ); |
62
|
|
|
|
|
|
|
$sysf->add_device($dev); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# Add another type 6 device to foo.bar.org |
65
|
|
|
|
|
|
|
$dev = HH::Unispool::Config::Entry::Device::6->new( { |
66
|
|
|
|
|
|
|
name => 'lp2', |
67
|
|
|
|
|
|
|
filter_name => 'cat', |
68
|
|
|
|
|
|
|
remote_node_name => 'lp2.foo.bar.org', |
69
|
|
|
|
|
|
|
description => 'lp2', |
70
|
|
|
|
|
|
|
} ); |
71
|
|
|
|
|
|
|
$sysf->add_device($dev); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Add another type 3 device to foo.bar.org |
74
|
|
|
|
|
|
|
$dev = HH::Unispool::Config::Entry::Device::3->new( { |
75
|
|
|
|
|
|
|
name => 'lp', |
76
|
|
|
|
|
|
|
filter_name => 'cat', |
77
|
|
|
|
|
|
|
member_device_name => [ qw( lp1 lp2 ) ], |
78
|
|
|
|
|
|
|
description => 'lp', |
79
|
|
|
|
|
|
|
} ); |
80
|
|
|
|
|
|
|
$sysf->add_device($dev); |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# Write the configuration |
83
|
|
|
|
|
|
|
$conf3->write('t/config.sample.d5.out'); |
84
|
|
|
|
|
|
|
1; |