### ### Copyright 2000-2007 University of Illinois Board of Trustees ### All rights reserved. ### ### PSGConf::Action::GenerateFile::netmasks - action to generate /etc/netmasks ### ### Campus Information Technologies and Educational Services ### University of Illinois at Urbana-Champaign ### package PSGConf::Action::GenerateFile::netmasks; use strict; use PSGConf::Action::GenerateFile; our @ISA = qw(PSGConf::Action::GenerateFile); ############################################################################### ### generate method ############################################################################### sub generate { my ($self, $fh, $psgconf) = @_; map { print $fh "$_\t"; if (ref($self->{networks}->{$_}) eq 'HASH') { print $fh "$self->{networks}->{$_}->{mask}\t" . "# $self->{networks}->{$_}->{comment}\n"; } else { print $fh "$self->{networks}->{$_}\n"; } } sort keys (%{$self->{networks}}); return 1; } ############################################################################### ### documentation ############################################################################### 1; __END__ =head1 NAME PSGConf::Action::GenerateFile::netmasks - generate /etc/netmasks file =head1 SYNOPSIS use PSGConf::Action::GenerateFile::netmasks; $psgconf->register_actions( PSGConf::Action::GenerateFile::netmasks->new( 'name' => '/etc/netmasks', 'networks' => { ... }, ... ), ... ); =head1 DESCRIPTION The B module provides a B action class for generating the Solaris F file. The B class is derived from the B class, but it defines/overrides the following methods: =over 4 =item generate() Generates the F file. =back In addition to the attributes supported by the B class, the B class supports the following attributes: =over 4 =item I A hash containing the networks for which entries should be added. The key is the network address. The value can be either a scalar, in which case it is assumed to be the netmask for the network, or a reference to a hash, in which case the sub-hash should contain the fields I, which is the netmask, and I, which is a one-line comment for the entry. =back =head1 SEE ALSO L L L =cut