Net_Wifi
[ class tree: Net_Wifi ] [ index: Net_Wifi ] [ all elements ]

Class: Net_Wifi

Source Location: /Net_Wifi-1.2.0/Net/Wifi.php

Class Overview


A class for scanning wireless networks and identifying local wireless network interfaces.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 30]
A class for scanning wireless networks and identifying local wireless network interfaces.


[ Top ]


Class Variables

$arFileLocation = array(
        'iwconfig'           => '/usr/sbin/iwconfig',
        'iwlist'             => '/usr/sbin/iwlist',
        '/proc/net/wireless' => '/proc/net/wireless'
    )

[line 58]

Various locations of programs

Type:   array


[ Top ]

$REG_ACCESS_POINT =  '/Access Point: ([0-9:A-F]{17})/'

[line 32]


Type:   mixed


[ Top ]

$REG_AUTH_SUITES =  '|Authentication Suites \([0-9]+\) : (.*)|'

[line 45]


Type:   mixed


[ Top ]

$REG_BIT_RATE =  '/Bit Rate[:=]([0-9.]+) [mk]b\\/s/i'

[line 33]


Type:   mixed


[ Top ]

$REG_ESSID =  '/ESSID:"([^"]+)"/'

[line 34]


Type:   mixed


[ Top ]

$REG_GROUP_CIPHER =  '|Group Cipher : (.*)|'

[line 43]


Type:   mixed


[ Top ]

$REG_INVALID_MISC =  '/Invalid misc[:=](-?[0-9]+)/'

[line 35]


Type:   mixed


[ Top ]

$REG_MISSED_BEACON =  '/Missed beacon[:=](-?[0-9]+)/'

[line 36]


Type:   mixed


[ Top ]

$REG_NICKNAME =  '/Nickname:"([^"]+)"/'

[line 37]


Type:   mixed


[ Top ]

$REG_NOISE_LEVEL =  '/Noise level[:=](-?[0-9]+) dBm/'

[line 38]


Type:   mixed


[ Top ]

$REG_PAIRWISE_CIPHERS =  '|Pairwise Ciphers \([0-9]+\) : (.*)|'

[line 44]


Type:   mixed


[ Top ]

$REG_POWER =  '/Power[:=]([0-9]+) dBm/'

[line 39]


Type:   mixed


[ Top ]

$REG_PROTOCOL_1 =  '/IEEE ([0-9.]+[a-z])/'

[line 40]


Type:   mixed


[ Top ]

$REG_PROTOCOL_2 =  '/([0-9.]+[a-z])\s+linked\s+ESSID/'

[line 41]


Type:   mixed


[ Top ]

$REG_RATES =  '|([0-9.]+) Mb/s|'

[line 42]


Type:   mixed


[ Top ]

$REG_RX_INVALID_CRYPT =  '/Rx invalid crypt[:=](-?[0-9]+)/'

[line 46]


Type:   mixed


[ Top ]

$REG_RX_INVALID_FRAG =  '/Rx invalid frag[:=](-?[0-9]+)/'

[line 47]


Type:   mixed


[ Top ]

$REG_RX_INVALID_NWID =  '/Rx invalid nwid[:=](-?[0-9]+)/'

[line 48]


Type:   mixed


[ Top ]

$REG_SIGNAL_LEVEL =  '/Signal level[:=](-?[0-9]+) dBm/'

[line 49]


Type:   mixed


[ Top ]

$REG_TX_EXCESSIVE_RETRIES =  '/Tx excessive retries[:=](-?[0-9]+)/'

[line 50]


Type:   mixed


[ Top ]

$REG_WPA2_IE_STRING =  'IEEE 802.11i/WPA2 Version 1'

[line 52]


Type:   mixed


[ Top ]

$REG_WPA_IE_STRING =  'WPA Version 1'

[line 51]


Type:   mixed


[ Top ]

$unknowns =  null

[line 73]

How to handle unknown lines in iwconfig output
  • 'echo': Echo to stderr
  • $object: Log to object with debug priority.

assume 'Log' instance

  • null: Ignore unknowns


Type:   string


[ Top ]



Method Detail

Net_Wifi (Constructor)   [line 80]

Net_Wifi Net_Wifi( )

Constructor which tries to guess the paths of the tools

[ Top ]

connectToAccessPoint   [line 579]

boolean connectToAccessPoint( string $strInterface, string $strMac)

Tells the driver to use the access point with the given MAC address only.

You can use "off" to enable automatic mode again without changing the current AP, or "any" resp. "auto" to force the card to re-associate with the currently best AP

EXPERIMENTAL! WILL CHANGE IN FUTURE VERSIONS

  • Return: True if setting was ok, false if not
  • Access: public

Parameters:

string   $strInterface   —  The interface to use
string   $strMac   —  The mac address of the access point

[ Top ]

getCurrentConfig   [line 109]

Net_Wifi_Config getCurrentConfig( string $strInterface)

Returns an object with the current state of the interface (connected/not connected, AP,...).
  • Return: The state information
  • Access: public

Parameters:

string   $strInterface   —  The interface to check

[ Top ]

getPathIwconfig   [line 666]

string getPathIwconfig( )

Returns the set path to iwconfig.
  • Return: The path to iwconfig
  • Access: public

[ Top ]

getPathIwlist   [line 695]

string getPathIwlist( )

Returns the set path to iwlist.
  • Return: The path to iwlist
  • Access: public

[ Top ]

getPathProcWireless   [line 638]

string getPathProcWireless( )

Returns the set path to /proc/wireless.
  • Return: The path to "/proc/net/wireless"
  • Access: public

[ Top ]

getSupportedInterfaces   [line 229]

array getSupportedInterfaces( )

Returns an array with the names/device files of all supported wireless lan devices.
  • Return: Array with wireless interfaces as values
  • Access: public

[ Top ]

handleUnknown   [line 605]

void handleUnknown( string $strId, string $strSubId)

Handle unknown configuration lines.

Parameters:

string   $strId   —  iwconfig output prefix (i.e. 'frequency')
string   $strSubId   —  iwconfig output value

[ Top ]

isConnected   [line 213]

boolean isConnected( string $strInterface)

Checks if a network interface is connected to an access point.
  • Return: If the interface is connected
  • Access: public

Parameters:

string   $strInterface   —  The network interface to check

[ Top ]

parseCurrentConfig   [line 133]

Net_Wifi_Config parseCurrentConfig( string $strAll)

Parses the iwconfig output to collect the current config information.
  • Return: The current config object
  • Access: protected

Parameters:

string   $strAll   —  The iwconfig output to parse

[ Top ]

parseScan   [line 298]

array parseScan( array $arLines)

Parses the output of iwlist and returns the recognized cells.
  • Return: Array with cell information objects
  • Access: protected

Parameters:

array   $arLines   —  Lines of the iwlist output as an array

[ Top ]

scan   [line 276]

array scan( string $strInterface)

Scans for access points / ad hoc cells and returns them.
  • Return: Array with cell information objects (Net_Wifi_Cell)
  • Access: public

Parameters:

string   $strInterface   —  The interface to use

[ Top ]

setPathIwconfig   [line 681]

null setPathIwconfig( string $strPathIwconfig)

Set the path to iwconfig.
  • Access: public

Parameters:

string   $strPathIwconfig   —  The new ifwconfig path

[ Top ]

setPathIwlist   [line 710]

void setPathIwlist( string $strPathIwlist)

Returns the set path to iwlist.
  • Access: public

Parameters:

string   $strPathIwlist   —  The new iwlist path

[ Top ]

setPathProcWireless   [line 653]

null setPathProcWireless( string $strProcWireless)

Set the path to /proc/net/wireless.
  • Access: public

Parameters:

string   $strProcWireless   —  The new /proc/net/wireless path

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:53:50 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.