<<

NAME

pf::config - PacketFence configuration

DESCRIPTION

pf::config contains the code necessary to read and manipulate the PacketFence configuration files.

It automatically imports gazillions of globals into your namespace. You have been warned.

CONFIGURATION AND ENVIRONMENT

Read the following configuration files: log.conf, pf.conf, pf.conf.defaults, networks.conf, dhcp_fingerprints.conf, oui.txt, floating_network_device.conf.

SUBROUTINES

init_config

Load configuration. Can be used to reload it too.

WARNING: This has been recently introduced and was not tested with our multi-threaded daemons.

ipset_version - check the ipset version on the system
os_detection - check the os system
readPfDocConfigFiles
readPfConfigFiles - pf.conf.defaults & pf.conf
readNetworkConfigFiles - networks.conf
readFloatingNetworkDeviceFile - floating_network_device.conf
readFirewallSSOFile - firewall_sso.conf
readRealmFile - realm.conf
normalize_time - formats date

Returns the number of seconds represented by the time period.

Months and years are approximate. Do not use for anything serious about time.

access_duration

Calculate the unregdate from from specific trigger.

Returns a formatted date (YYYY-MM-DD HH:MM:SS).

dynamic_unreg_date

We compute the unreg date dynamicaly If the year is lower than the current year, year is zero or not defined.

start_date

Calculate the beginning of the period.

The beginning of a day is at midnight
The beginning of the week is on Monday at midnight
The beginning of the month is on the first at midnight
The beginning of the year is on Januaray 1st at midnight

Returns the number of seconds since the Epoch.

duration

Calculate the number of seconds to reach the end of the period from the beginning of the period.

Example: duration(1D, 2001-01-02 12:00:00) returns 1 * 24 * 60 * 60
Example: duration(2W, 2001-01-02 12:00:00) returns 2 * 7 * 24 * 60 * 60
Example: duration(2M, 2001-01-02 12:00:00) returns (31+28) * 24 * 60 * 60
is_vlan_enforcement_enabled

Returns true or false based on if vlan enforcement is enabled or not

is_inline_enforcement_enabled

Returns true or false based on if inline enforcement is enabled or not

is_type_inline
get_newtork_type

Returns the type of a network. The call encapsulate the type configuration changes that we made.

Returns undef on unrecognized types.

is_network_type_vlan_reg

Returns true if given network is of type vlan-registration and false otherwise.

is_network_type_vlan_isol

Returns true if given network is of type vlan-isolation and false otherwise.

is_network_type_inline

Returns true if given network is of type inline and false otherwise.

is_in_list

Searches for an item in a comma separated list of elements (like we do in our configuration files).

Returns true or false values based on if item was found or not.

_fetch_virtual_ip

Returns the virtual IP (vip) on a given interface.

First, if there's a vip parameter defined on the interface, we return that.

Othwerise, we assume that the vip has a /32 netmask and that's how we fetch it.

We return the first vip that matches the above criteria in decimal dotted notation (ex: 192.168.1.1). Undef if nothing is found.

_load_captive_portal

Populate captive portal related configuration and constants.

isenabled

Is the given configuration parameter considered enabled? y, yes, true, enable and enabled are all positive values for PacketFence.

AUTHOR

Inverse inc. <info@inverse.ca>

Minor parts of this file may have been contributed. See CREDITS.

COPYRIGHT

Copyright (C) 2005-2013 Inverse inc.

Copyright (C) 2005 Kevin Amorin

Copyright (C) 2005 David LaPorte

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

<<