callback (line
89)
This function is called for any errors or
messages sent to stdout/err. The idea is to catch all such messages and send them to syslog, this this is a daemon normally detached from the console
void
callback
( $buffer)
detect_hub (line
244)
Detect if a hub is attached to a certain port If a hub is detected, suggest another vlan to avoid port flapping.
So far it is only an adaptation from the old algorithm It hasn't been tested yet
void
detect_hub
( $REQUEST)
format_snmpmac (line
932)
void
format_snmpmac
( $mac)
get_cisco_info (line
883)
void
get_cisco_info
( $switch, $snmp_ro)
get_snmp_index (line
485)
void
get_snmp_index
( $what, $where)
get_snmp_port_index (line
104)
Get the snmp port index
mixed
get_snmp_port_index
(mixed $switch, mixed $port)
-
mixed
$port: Port name to look for.
-
mixed
$switch: Switch to ask
get_vlanid (line
862)
void
get_vlanid
( $default_id)
iface_exist (line
819)
void
iface_exist
( $switchid, $portname)
is_mac_on_port (line
368)
Tell whether a MAC address is on a certain port using SNMP
boolean
is_mac_on_port
(mixed $mac, mixed $switch, mixed $port, mixed $vlan)
-
mixed
$mac: MAC to look for
-
mixed
$switch: Switch to look on
-
mixed
$port: Switch port to look on
-
mixed
$vlan: Vlan we'll use to look for that MAC address
is_port_vmps (line
613)
void
is_port_vmps
( $myiface)
mac_exist (line
797)
void
mac_exist
( $mac)
ping_mac2 (line
226)
Ping a MAC address on a specific switch port
boolean
ping_mac2
(mixed $mac, mixed $switch, mixed $port, mixed $vlan)
-
mixed
$mac: MAC address to ping
-
mixed
$switch: Switch we want to query
-
mixed
$port: switch port we want to query
-
mixed
$vlan: VLAN to use to perform the query
ports_on_switch (line
412)
void
ports_on_switch
( $switch)
remove_type (line
210)
Remove the type of one element and leave only the value.
This function is to be used when performing SNMP operations Example: INTEGER:33
mixed
remove_type
(mixed $element)
-
mixed
$element: Element to remove type from
set_port_as_dynamic (line
500)
void
set_port_as_dynamic
( $switch, $port, [ $snmp_port_index = false])
-
$switch
-
$port
-
$snmp_port_index
set_port_as_static (line
544)
void
set_port_as_static
( $switch, $port, $vlan, [ $snmp_port_index = false])
-
$switch
-
$port
-
$vlan
-
$snmp_port_index
snmp_restart_port (line
322)
Wrapper around the restart_port script.
Restart a switch port
void
snmp_restart_port
(mixed $port, mixed $switch)
-
mixed
$port: Port name
-
mixed
$switch: Switch
snmp_restart_port_id (line
341)
Wrapper around snmp_restart_port
void
snmp_restart_port_id
(integer $port_id)
-
integer
$port_id: ID of the port we want to restart
switch_exist (line
841)
void
switch_exist
( $name, $value)
turn_off_port (line
170)
Turn off a determined port identified by its index.
boolean
turn_off_port
( $switch, $port, [mixed $port_index = false])
-
mixed
$port_index: Port index according to SNMP
-
$switch
-
$port
turn_on_port (line
132)
Turn on a determined port identified by its index.
boolean
turn_on_port
( $switch, $port, [mixed $port_index = false])
-
mixed
$port_index: Port index according to SNMP
-
$switch
-
$port
vlans_on_switch (line
462)
void
vlans_on_switch
( $switch)
vm_type (line
439)
void
vm_type
( $switch)
walk_macs (line
942)
void
walk_macs
( $switch, $vlanid, $snmp_ro)
walk_ports (line
635)
void
walk_ports
( $switch, $snmp_ro)
walk_switchhw (line
1060)
void
walk_switchhw
( $switch, $snmp_ro)
walk_switchsw (line
1080)
void
walk_switchsw
( $switch, $snmp_ro)
walk_vlans (line
1029)
void
walk_vlans
( $switch, $snmp_ro)