pf::iplog - Module to manage IP address <-> MAC address bindings
pf::iplog contains the functions necessary to read and manage the DHCP information gathered by PacketFence on the network.
Get the OMAPI cache
Lookup for the MAC address of a given IP address
Returns '0' if no match
Look for the MAC address of a given IP address in the DHCP leases using OMAPI
Not meant to be used outside of this class. Refer to pf::iplog::ip2mac
Look for the MAC address of a given IP address using the SQL 'iplog' table
Not meant to be used outside of this class. Refer to pf::iplog::ip2mac
Lookup for the IP address of a given MAC address
Returns '0' if no match
Look for the IP address of a given MAC address in the DHCP leases using OMAPI
Not meant to be used outside of this class. Refer to pf::iplog::mac2ip
Look for the IP address of a given MAC address using the SQL 'iplog' table
Not meant to be used outside of this class. Refer to pf::iplog::mac2ip
Get the full iplog for a given IP address or MAC address.
TODO: Rename to 'history' once the "issue" with pfcmd is resolved. Also remove from the export...
Get the full iplog for a given IP address.
Not meant to be used outside of this class. Refer to pf::iplog::iplog_history
Get the full iplog for a given MAC address.
Not meant to be used outside of this class. Refer to pf::iplog::iplog_history
Consult the 'iplog' SQL table for a given IP address or MAC address.
Returns a single row for the given parameter.
Consult the 'iplog' SQL table for a given IP address.
Not meant to be used outside of this class. Refer to pf::iplog::view
Consult the 'iplog' SQL table for a given MAC address.
Not meant to be used outside of this class. Refer to pf::iplog::view
List all the current open 'iplog' SQL table entries (either for a given IP address, MAC address of both)
List all the current open 'iplog' SQL table entries for a given IP address
Not meant to be used outside of this class. Refer to pf::iplog::list_open
List all the current open 'iplog' SQL table entries for a given MAC address
Not meant to be used outside of this class. Refer to pf::iplog::list_open
Check if there is an existing 'iplog' table entry for the IP address.
Not meant to be used outside of this class.
Handle 'iplog' table "new" entries. Will take care of either adding or updating an entry.
Insert a new 'iplog' table entry.
Not meant to be used outside of this class. Refer to pf::iplog::open
Update an existing 'iplog' table entry.
Please note that a trigger (iplog_insert_in_iplog_history_before_update_trigger) exists in the database schema to copy the old existing record into the 'iplog_history' table and adjust the end_time accordingly.
Not meant to be used outside of this class. Refer to pf::iplog::open
Close (update the end_time as of now) an existing 'iplog' table entry.
Get the omapi client return undef if omapi is disabled
Will retrieve the lease from the cache or from the dhcpd server using omapi
Get the lease information using omapi
Check if the lease has expired
Inverse inc. <info@inverse.ca>
Minor parts of this file may have been contributed. See CREDITS.
Copyright (C) 2005-2015 Inverse inc.
Copyright (C) 2005 Kevin Amorin
Copyright (C) 2005 David LaPorte
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.