116 | | * drop_config() |
117 | | * restart_dhcp() |
118 | | * execConfigCmd(prop, value=nil) |
119 | | * getCmdForRoute(value) |
120 | | * getCmdForFilter(value) |
| 126 | * drop_config() - not used, can be used to recover interface (will reestablish address via dhcp) |
| 127 | * restart_dhcp() - not used, part of drop_config |
| 128 | * apply_conf(prop, value) - checks if prop is from this context. If it is, calls appropriate method, otherwise, calls parent's apply_conf with same args |
| 129 | * configure(prop, value) - check current state (@isActive, @isUP, @isStarted) and apply config. Live if the device was started (may require starting interface). |
| 130 | * get_eth_status(devName) - live check of the Ethernet state of devName, this is independent of @configHash which stores the "desired" state. |
| 131 | * get_gateway |
| 132 | * get_hw_mac(devName) - retrieve the original hardware mac (read from ethtool -p) |
| 133 | * get_up?(devName) - Live check if devName is up (independent of @isUP the desired state) |
| 134 | * '''readable instance vars: ''' |
| 135 | * isUp - Desired state Var |
| 136 | |
| 137 | This class is responsible for all of the ifconfig/route handling code (all things ethernet). The same cocaine lib will handle shell commands with similar exception handeling. The interface has been extended to implement setters for all the requisite interface state (ip, netmask, etc...). The usage scenario is expected to flow as follows: |
| 138 | 1. include file and instantiate ''object'' (will probably instantiate one of the hardware specific children instead of !EthernetDevice class proper). |
| 139 | 2. Set Logical Name (via constructor or assignment) |
| 140 | 3. Activate via ''object''.activate |
| 141 | 4. configure requisite parameters via multiple calls to ''object''.configure("prop","value"), this will store them |
| 142 | 5. apply configs and bring up interfaces via ''object''.start |
| 143 | 6. device should now be ready to used for traffic experiments |
| 144 | |
| 145 | ''' File: wifi.rb '''[[BR]] |
| 146 | ''' Class: !WifiDevice < !EthernetDevice '''[[BR]] |
| 147 | ''' Interface: ''' |
| 148 | * ''' public methods: ''' |
| 149 | * initialize(logName = nil) |
| 150 | * activate(logicalNumber = nil) |
| 151 | * get_ranges() - determine what the allowable ranges are for a given card. (collected but not used) |
| 152 | * get_current_mode(devName) - live mode check, independent of @configHahs["mode"] (e.g. managed, ibss). |
| 153 | * get_wifi_status(devName, att = @stat_retry) - live status check. |
| 154 | * get_connected?(att = 1, refresh = 5) - live connection check. |
| 155 | * connect_adhoc(ssid, freq) - attempt to connect in ibss mode - will raise exceptions if connection fails |
| 156 | * disconnect_adhoc() - attempt ibss leave |
| 157 | * connect_simple(ssid, freq=nil) - attempt to connect to an open managed AP (no WEP/WPA) |
| 158 | * disconnect_simple() - disconnect form managed AP |
| 159 | * start() |
| 160 | * stop() |
| 161 | * build_monitor() - create a monitor interface for the given device |
| 162 | * del_monitor() - take down monitor interface |
| 163 | * set_freq(freq = @configHash["freq"]) |
| 164 | * scan() - scan channel sets to learn hearable AP's / adhoc clients |
| 165 | * set_mode(mode) - switch between IBSS (adhoc) and managed mode |
| 166 | * set_essid(essid) |
| 167 | * set_channel(chan) - logical mapping between channel numbers and frequency (really just a wrapper around setting a specific frequency) |
| 168 | * set_rate(rateStr) - takes a string argument of allowable rates (can't be a single item list) |
| 169 | * set_type(type) - Wrapper around rate str that translates a/b/g to rate strings |
| 170 | * apply_conf(prop, value) - same concept as the Ethernet. If prop is in the wifi context set it, otherwise pass it down |
| 171 | * configure(prop, value) - Similar to the Ethernet case. Some settings (e.g. frequency) can be set live. If the can just apply them immediately. Others require a reconnect (e.g. mode) if the interface is already started, this method handles that problem. |
123 | | * '''accesible instance vars: ''' |
124 | | |
125 | | This class is responsible for all of the ifconfig/route handling code (all things ethernet). The same cocaine lib will handle shell commands with similar exception handeling. The interface has been extended to implement getters and setters for all the requisite interface state (ip, netmask, etc...). We've left the original get config command structure alone, but now also have implemented an execConfigCmd which will actually implement these config commands. |
126 | | |
127 | | ''' wifi.rb < ethernet.rb '''[[BR]] |
128 | | ''' Interface: ''' |
129 | | * initialize() |
130 | | * check_time |
131 | | * connected?() |
132 | | * connect_simple(ssid) |
133 | | * connect_adhoc |
134 | | * disconnect_simple |
135 | | * disconnect_adhoc |
136 | | * disconnect() |
137 | | * checkStatus(retries = true) |
138 | | * scan() |
139 | | |
140 | | |
141 | | ''' rcDrv_e1000e.rb < ethernet.rb'''[[BR]] |
142 | | ''' Interface ''' |
143 | | * new |
144 | | |
145 | | e1000e kernel module specif driver. A child of ethernet. Overides any thing that is specific to e1000e, but mostly leaves the parent class in tact. Also sets the value of @kmodName |
146 | | |
147 | | |
148 | | ''' rcdrv_r8169.rb < ethernet.rb'''[[BR]] |
149 | | ''' Interface ''' |
150 | | * new |
151 | | |
152 | | ''' rcdrv_skge.rb < ethernet.rb'''[[BR]] |
153 | | ''' Interface ''' |
154 | | * new |
155 | | |
156 | | ''' rcdrv_ath5k.rb < wifi.rb'''[[BR]] |
157 | | ''' Interface ''' |
158 | | * new |
159 | | |
160 | | ''' rcdrv_ath9k.rb < wifi.rb'''[[BR]] |
161 | | ''' Interface ''' |
162 | | * new |
163 | | |
164 | | ''' rcdrv_ipw2200.rb < wifi.rb'''[[BR]] |
165 | | ''' Interface ''' |
166 | | * new |
| 178 | * media |
| 179 | * freq_range |
| 180 | * bitrate_range |
| 181 | * monIf |
| 182 | * isConnected - Desired state Var |
| 183 | |
| 184 | ''' File: wimax.rb '''[[BR]] |
| 185 | ''' Class: !WimaxDevice < !EthernetDevice '''[[BR]] |
| 186 | ''' Interface: ''' |
| 187 | * ''' public methods: ''' |
| 188 | * initialize(logName = nil) |
| 189 | * activate(logicalNumber = nil) - in addition to loading the module this checks to make sure wimaxd was started. |
| 190 | * start() |
| 191 | * stop() |
| 192 | * connect() |
| 193 | * disconnect() |
| 194 | * scan() - "wimaxcu scan" |
| 195 | * get_connected?() - uses "wimaxcu info stats" as a check of connectivity. If the interface is connected the stats call will return some values, if it is disconnected it will terminate in error (which will raise a handled exception). |
| 196 | * info() - returns a string that is the result of "wimaxcu info" |
| 197 | * configure(prop, value) - same function wifi |
| 198 | * get_mac() - uses the get_eth_status method to get the current mac |
| 199 | * current_ip() - uses the get_eth_status method to get the ip for the current device |
| 200 | * '''readable instance vars: ''' |
| 201 | * media |
| 202 | * isConnected - Desired state Var |
| 203 | |
| 204 | |
| 205 | ''' File: rcDrv_e1000e.rb '''[[BR]] |
| 206 | ''' Class: RcDrv_e1000e < !EthernetDevice '''[[BR]] |
| 207 | ''' Interface: ''' |
| 208 | * ''' public methods: ''' |
| 209 | * initialize(logName = nil) - sets kmod name(s) |
| 210 | |
| 211 | e1000e kernel module specifc driver. A child of ethernet. Overides any thing that is specific to e1000e, but mostly leaves the parent class in tact. Also sets the value of @kmodName |
| 212 | |
| 213 | ''' File: rcDrv_e1000e.rb '''[[BR]] |
| 214 | ''' Class: RcDrv_e1000e < !EthernetDevice '''[[BR]] |
| 215 | ''' Interface: ''' |
| 216 | * ''' public methods: ''' |
| 217 | * initialize(logName = nil) - sets kmod name(s) |
| 218 | |
| 219 | ''' File: rcdrv_r8169.rb '''[[BR]] |
| 220 | ''' Class: Rcdrv_r8169.rb < !EthernetDevice '''[[BR]] |
| 221 | ''' Interface: ''' |
| 222 | * ''' public methods: ''' |
| 223 | * initialize(logName = nil) - sets kmod name(s) |
| 224 | |
| 225 | ''' File: rcdrv_skge.rb '''[[BR]] |
| 226 | ''' Class: Rcdrv_skge.rb < !EthernetDevice '''[[BR]] |
| 227 | ''' Interface: ''' |
| 228 | * ''' public methods: ''' |
| 229 | * initialize(logName = nil) - sets kmod name(s) |
| 230 | |
| 231 | ''' File: rcdrv_ath5k.rb '''[[BR]] |
| 232 | ''' Class: Rcdrv_ath5k.rb < !WifiDevice '''[[BR]] |
| 233 | ''' Interface: ''' |
| 234 | * ''' public methods: ''' |
| 235 | * initialize(logName = nil) - sets kmod name(s) |
| 236 | |
| 237 | ''' File: rcdrv_ath9k.rb '''[[BR]] |
| 238 | ''' Class: Rcdrv_ath9k.rb < !WifiDevice '''[[BR]] |
| 239 | ''' Interface: ''' |
| 240 | * ''' public methods: ''' |
| 241 | * initialize(logName = nil) - sets kmod name(s) |
| 242 | |
| 243 | ''' File: rcdrv_ipw2200.rb '''[[BR]] |
| 244 | ''' Class: Rcdrv_ipw2200.rb < !WifiDevice '''[[BR]] |
| 245 | ''' Interface: ''' |
| 246 | * ''' public methods: ''' |
| 247 | * initialize(logName = nil) - sets kmod name(s) |
| 248 | |
| 249 | ''' File: rcdrv_wl.rb '''[[BR]] |
| 250 | ''' Class: Rcdrv_wl.rb < !WifiDevice '''[[BR]] |
| 251 | ''' Interface: ''' |
| 252 | * ''' public methods: ''' |
| 253 | * initialize(logName = nil) - sets kmod name(s) |
| 254 | |
| 255 | |