/bin/funcs.inc.php/opt/nac/bin/funcs.inc.php
common PHP functions used by several scripts
PHP version 5
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.
require_once
('etc/config.inc')
(line 45)
Get configuration variables from config file
Search the array for a given key and return its value, but using tokenizers
Search the array for a given value and return it, but using tokenizers
Perform a case insensitive search for a given value in an array and return its key
Perform a case insensitive search for a given value in a bi-dimensional array and return its key
Delete all references to a MAC address from the FreeNAC tables
Creates a connection to the MySQL database with the parameters defined in config.inc
Wrapper around the debug method part of the logger object.
Logs to debug level 1 It will be soon depreciated. Present only for backwards compatibility.
Wrapper around the debug method part of the logger object.
Logs to debug level 1 It will be soon depreciated. Present only for backwards compatibility.
Wrapper around the debug method part of the logger object.
Logs to debug level 2 It will be soon depreciated. Present only for backwards compatibility.
Delete a record of the specified table
Get WINS Name from IP Address
Original contribution from johnboy68
Get the last number of an SNMP OID The OID is separated by dots and we use them as a separator.
Example: OID=1.2.3.4.5.6.7.8 Returns: 8
Since we could not reliably count affected rows after mysql operations
see also http://php.net/manual/en/function.mysql-info.php USAGE: $vals = get_mysql_info($linkid); if($vals['rows_matched'] == 0){ mysql_query("INSERT INTO table values('val1','val2', 'valetc')", $linkid); }
Write key events to naclog which is visible from the GUI This should NOT be called from a secondary server, i.e.
avoid it in vmpsd_external
Wrapper around the logit method part of the logger object.
It will be soon depreciated. Present only for backwards compatibility.
Execute query and return assoc array
Assuming a table t1 with 2 Fields Code and Value: $r= mssql_fetch_all("SELECT * from t1") foreach ($r as $row) { $logger->logit("$row[Code], $row[Value]\n");}
Execute query, fetch one row and return assoc array
Execute query and return assoc array
Assuming a table t1 with 2 Fields Code and Value: $r= mysql_fetch_all("SELECT * from t1") foreach ($r as $row) { $logger->logit("$row[Code], $row[Value]\n");
Execute query, fetch one row and return assoc array
Normalise mac address format
Get a MAC address from the from XX:XX:XX:XX:XX:XX and convert it to XXXX.XXXX.XXXX
Reformat a MAC Adress from 0123.2345.2345 to 01:23:23:45:23:45
Return the last parts of a tokenized string
Abstract calling of unix commands.
Problem: popen does not pass back command success so syscall cannot say if the command works.
Returns the difference between 2 dates in secs
Get the netmask in 255.255.0.0 form
Tell if an IPv4 address is valid (well-formed)
Converts a vlan id to a vlan name
Send SQL and expect just one /field/row to return
Send SQL and expect just one row to change
Load automagically a file containing the class specified by classname
Documentation generated on Mon, 13 Oct 2008 01:10:30 +0200 by phpDocumentor 1.4.0