<<

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

ipset_version - check the ipset version on the system
os_detection - check the os system
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_network_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.

is_omapi_enabled

Check whether pf::iplog::ip2mac or pf::iplog::mac2ip are configured to use OMAPI based on configuration parameters.

configreload

Reload the config

AUTHOR

Inverse inc. <info@inverse.ca>

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

COPYRIGHT

Copyright (C) 2005-2015 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.

<<