Compare commits
	
		
			3 Commits
		
	
	
		
			8a8381731f
			...
			085e657c76
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 085e657c76 | |||
| f62b1c56e1 | |||
| acc7b692ee | 
							
								
								
									
										50
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								README.md
									
									
									
									
									
								
							| @ -2,11 +2,57 @@ AC-Tube | |||||||
| ======= | ======= | ||||||
| Open Source CAPWAP WLC + WTP | Open Source CAPWAP WLC + WTP | ||||||
|  |  | ||||||
| Current status: early development. | Current status: development. | ||||||
|  |  | ||||||
| See also http://7u83.cauwersin.com/?cat=28 | See also http://7u83.cauwersin.com/?cat=28 | ||||||
|  |  | ||||||
| What you can do so far ... | What you can do so far ... | ||||||
|  |  | ||||||
| Compile as stated in INSTALL. | Read INSTALL and compile actube. | ||||||
|  | Then ... | ||||||
|  |  | ||||||
|  | Create certificates: | ||||||
|  |   cd ssl | ||||||
|  |   sh all.sh | ||||||
|  |   cd .. | ||||||
|  |  | ||||||
|  | Edit src/actube/config.ckv and set your IP in | ||||||
|  | capwap/control-ip-address/address.0 | ||||||
|  |  | ||||||
|  | Start actube with some debug options: | ||||||
|  |   cd src/ac | ||||||
|  |   /actube -d std -d mod -d elem\_detail -d elem\_dmp | ||||||
|  |  | ||||||
|  | If you have an AP with IOS 7.3x it should connect. Others | ||||||
|  | might connect, too. | ||||||
|  | Make sure on the AP you heve made  | ||||||
|  | clear capwap private-config.    | ||||||
|  |  | ||||||
|  | In another shell connect to the RPC interface: | ||||||
|  |   cd src/ac | ||||||
|  |   ./act -s 127.0.0.1:5000 | ||||||
|  |  | ||||||
|  | Send some commands to bring up a WLAN: | ||||||
|  |    list			# list all connected APs | ||||||
|  |    select <apname>	# set <apname> to the name of AP you want to select | ||||||
|  |    status 		# show status of selected AP | ||||||
|  |    | ||||||
|  |    # the following sequence activates a WLAN called actube on AP | ||||||
|  |      | ||||||
|  |    load wlan1	 | ||||||
|  |    send       | ||||||
|  |    clear                	 | ||||||
|  |    load activate  | ||||||
|  |    send | ||||||
|  |  | ||||||
|  |    status		# This should display now oper status for  | ||||||
|  | 			# interface 0 enabled | ||||||
|  |  | ||||||
|  |     | ||||||
|  | CWAPWAP data layer is still not finished, so you can't use the WLAN    | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								src/ac/rpc-macros/activate.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/ac/rpc-macros/activate.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | radio.255/capwap/operational-state/state: enabled | ||||||
|  | radio.255/capwap/admin-state: 1 | ||||||
|  | radio.0/capwap/operational-state/state: enabled | ||||||
|  | radio.0/capwap/admin-state: 1 | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								src/ac/rpc-macros/admin-on.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/ac/rpc-macros/admin-on.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # | ||||||
|  | # Managed by acTube | ||||||
|  | # | ||||||
|  |  | ||||||
|  | radio.0/capwap/admin-state: 1 | ||||||
							
								
								
									
										60
									
								
								src/ac/rpc-macros/all.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								src/ac/rpc-macros/all.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,60 @@ | |||||||
|  |  | ||||||
|  | radio.0/cisco/air-space-capability: 0 | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-rx-antennas: 3 | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-tx-antennas: 7 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-cnt: 2 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-mode: 3 | ||||||
|  | radio.0/cisco/antenna-payload/antenna.0: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/antenna.1: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/diversity-selection: 255 | ||||||
|  | radio.0/cisco/antenna-payload/unknown: 0 | ||||||
|  |  | ||||||
|  | radio.0/cisco/channel-power: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe | ||||||
|  |  | ||||||
|  | radio.0/capwap80211/rate-set: .x82848b960c1218243048606c | ||||||
|  | radio.0/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||||
|  | radio.0/capwap80211/tx-power/current-tx-power: 1 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/beacon-period: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/bssid: .x04fe7f499b90 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-period: 4 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-type: 1 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfp-maximum-duration: 60 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str1: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str2: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/occupancy-limit: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/reg: 167772416 | ||||||
|  | radio.0/capwap80211/wtp-radio-information: 1 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | radio.0/cisco/mac-operation/long-retry: 4 | ||||||
|  | radio.0/cisco/mac-operation/reserved: 1 | ||||||
|  | radio.0/cisco/mac-operation/rts-threshold: 2347 | ||||||
|  | radio.0/cisco/mac-operation/rx-msdu-lifetime: 512 | ||||||
|  | radio.0/cisco/mac-operation/short-retry: 7 | ||||||
|  | radio.0/cisco/mac-operation/tx-msdu-lifetime: 512 | ||||||
|  | radio.0/cisco/multi-domain-capability/first-channel: 1 | ||||||
|  | radio.0/cisco/multi-domain-capability/max-tx-power-level: 65535 | ||||||
|  | radio.0/cisco/multi-domain-capability/number-of-channels: 13 | ||||||
|  | radio.0/cisco/multi-domain-capability/reserved: 1 | ||||||
|  |  | ||||||
|  | radio.0/cisco/phy-ht-cap/asel-cap: 0 | ||||||
|  | radio.0/cisco/phy-ht-cap/extended-ht-cap-info: .x0000 | ||||||
|  | radio.0/cisco/phy-ht-cap/ht-cap-info: 6 | ||||||
|  | radio.0/cisco/phy-ht-cap/mcsrates-1: .x00000000 | ||||||
|  | radio.0/cisco/phy-ht-cap/mcsrates-2: .x00000000 | ||||||
|  | radio.0/cisco/phy-ht-cap/mcsrates-3: .x00000000 | ||||||
|  | radio.0/cisco/phy-ht-cap/mcsrates-4: .x0000ffff | ||||||
|  | radio.0/cisco/phy-ht-cap/tx-bf-cap: .x00000000 | ||||||
|  | radio.0/cisco/phy-ht-control/cfg-type: 1 - global | ||||||
|  | radio.0/cisco/phy-ht-control/channel-width: 20 | ||||||
|  | radio.0/cisco/phy-ht-control/cur-freq-is-dfs-channel: 0 | ||||||
|  | radio.0/cisco/phy-ht-control/current-freq: 1 | ||||||
|  | radio.0/cisco/phy-ht-control/enable-ht: 3 | ||||||
|  | radio.0/cisco/phy-ht-control/ext-channel: 0 | ||||||
|  | radio.0/cisco/phy-ht-control/flash-commit: 0 | ||||||
|  | radio.0/cisco/phy-ht-control/frequency-bands-support: 206 | ||||||
|  | radio.0/cisco/phy-ht-control/rest: .x00ffffff | ||||||
|  | radio.0/cisco/phy-ht-control/ti-threshold: 0 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								src/ac/rpc-macros/antenna.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/ac/rpc-macros/antenna.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | |||||||
|  | radio.0/cisco/air-space-capability: 0 | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-rx-antennas: 3 | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-tx-antennas: 7 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-cnt: 2 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-mode: 3 | ||||||
|  | radio.0/cisco/antenna-payload/antenna.0: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/antenna.1: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/diversity-selection: 255 | ||||||
|  | radio.0/cisco/antenna-payload/unknown: 0 | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								src/ac/rpc-macros/macopts.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/ac/rpc-macros/macopts.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | |||||||
|  | radio.0/cisco/mac-operation/fragmentation-threshold: 2346 | ||||||
|  | radio.0/cisco/mac-operation/long-retry: 4 | ||||||
|  | radio.0/cisco/mac-operation/reserved: 1 | ||||||
|  | radio.0/cisco/mac-operation/rts-threshold: 2347 | ||||||
|  | radio.0/cisco/mac-operation/rx-msdu-lifetime: 512 | ||||||
|  | radio.0/cisco/mac-operation/short-retry: 7 | ||||||
|  | radio.0/cisco/mac-operation/tx-msdu-lifetime: 512 | ||||||
|  |  | ||||||
							
								
								
									
										5
									
								
								src/ac/rpc-macros/oper-off.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/ac/rpc-macros/oper-off.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # | ||||||
|  | # Managed by acTube | ||||||
|  | # | ||||||
|  |  | ||||||
|  | radio.0/capwap/operational-state/state: disabled | ||||||
							
								
								
									
										5
									
								
								src/ac/rpc-macros/oper-on.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/ac/rpc-macros/oper-on.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | |||||||
|  | # | ||||||
|  | # Managed by acTube | ||||||
|  | # | ||||||
|  |  | ||||||
|  | radio.0/capwap/operational-state/state: enabled | ||||||
							
								
								
									
										13
									
								
								src/ac/rpc-macros/radio.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/ac/rpc-macros/radio.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | radio.0/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||||
|  | radio.0/capwap80211/tx-power/current-tx-power: 1 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/beacon-period: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/bssid: .x04fe7f499b90 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-period: 4 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-type: 1 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfp-maximum-duration: 60 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str1: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str2: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/occupancy-limit: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/reg: 167772416 | ||||||
|  | radio.0/capwap80211/wtp-radio-information: 1 | ||||||
|  |  | ||||||
							
								
								
									
										89
									
								
								src/ac/rpc-macros/sr.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								src/ac/rpc-macros/sr.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,89 @@ | |||||||
|  | capwap/timers/echo-interval: 30 | ||||||
|  | capwap/timers/max-discovery-interval: 10 | ||||||
|  |  | ||||||
|  | radio.255/capwap/admin-state: 1 - enabled | ||||||
|  | radio.0/capwap/admin-state: 1 - enabled | ||||||
|  | radio.1/capwap/admin-state: 1 - enabled | ||||||
|  |  | ||||||
|  | radio.0/capwap/decryption-error-report-period: 120 | ||||||
|  | radio.1/capwap/decryption-error-report-period: 120 | ||||||
|  |  | ||||||
|  | capwap/idle-timeout: 300 | ||||||
|  |  | ||||||
|  | capwap/wtp-fallback: 1 | ||||||
|  |  | ||||||
|  | cisco/spam-domain-secret: .xe1ffd18a8f15b3b59c0a47a7f17a96e7cb36174f00 | ||||||
|  |  | ||||||
|  | radio.0/capwap80211/wtp-radio-config/beacon-period: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/bssid: .x003a9902fac0 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-period: 4 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfg-type: 1 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/cfp-maximum-duration: 60 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str1: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/country-str2: "DE " | ||||||
|  | radio.0/capwap80211/wtp-radio-config/occupancy-limit: 100 | ||||||
|  | radio.0/capwap80211/wtp-radio-config/reg: 167772416 | ||||||
|  | radio.0/capwap80211/wtp-radio-information: 1 | ||||||
|  |  | ||||||
|  | radio.0/capwap80211/rate-set: .x82848b960c1218243048606c | ||||||
|  |  | ||||||
|  | radio.0/cisco/multi-domain-capability/first-channel: 1 | ||||||
|  | radio.0/cisco/multi-domain-capability/max-tx-power-level: 65535 | ||||||
|  | radio.0/cisco/multi-domain-capability/number-of-channels: 13 | ||||||
|  | radio.0/cisco/multi-domain-capability/reserved: 1 | ||||||
|  |  | ||||||
|  | radio.0/cisco/mac-operation/fragmentation-threshold: 2346 | ||||||
|  | radio.0/cisco/mac-operation/long-retry: 4 | ||||||
|  | radio.0/cisco/mac-operation/reserved: 1 | ||||||
|  | radio.0/cisco/mac-operation/rts-threshold: 2347 | ||||||
|  | radio.0/cisco/mac-operation/rx-msdu-lifetime: 512 | ||||||
|  | radio.0/cisco/mac-operation/short-retry: 7 | ||||||
|  | radio.0/cisco/mac-operation/tx-msdu-lifetime: 512 | ||||||
|  |  | ||||||
|  | radio.1/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||||
|  | radio.1/capwap80211/tx-power/current-tx-power: 1 | ||||||
|  |  | ||||||
|  | radio.0/cisco/direct-sequence-control/cfg-type: 1 - global | ||||||
|  | radio.0/cisco/direct-sequence-control/current-cca-mode: 0 | ||||||
|  | radio.0/cisco/direct-sequence-control/current-channel: 1 | ||||||
|  | radio.0/cisco/direct-sequence-control/energy-detect-threshold: -50 | ||||||
|  | radio.0/cisco/direct-sequence-control/unknown: 1 | ||||||
|  |  | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-rx-antennas: 3 | ||||||
|  | radio.0/cisco/antenna-payload/802-11n-tx-antennas: 7 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-cnt: 2 | ||||||
|  | radio.0/cisco/antenna-payload/antenna-mode: 3 | ||||||
|  | radio.0/cisco/antenna-payload/antenna.0: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/antenna.1: 1 - Internal Antenna | ||||||
|  | radio.0/cisco/antenna-payload/diversity-selection: 255 | ||||||
|  | radio.0/cisco/antenna-payload/unknown: 0 | ||||||
|  |  | ||||||
|  | radio.0/cisco/air-space-capability: 0 | ||||||
|  |  | ||||||
|  | radio.0/capwap/operational-state/cause: Normal | ||||||
|  | radio.0/capwap/operational-state/state: enabled | ||||||
|  |  | ||||||
|  | radio.0/cisco/80211h/count: 0 | ||||||
|  | radio.0/cisco/80211h/enable: 0 | ||||||
|  | radio.0/cisco/80211h/mode: 0 | ||||||
|  | radio.0/cisco/80211h/power: 0 | ||||||
|  |  | ||||||
|  | radio.0/cisco/elem153: .x00 | ||||||
|  | radio.0/cisco/elem156: .x020100 | ||||||
|  | radio.0/cisco/lwelem48: .x01055a0101a6c405b06432b03232 | ||||||
|  | radio.1/cisco/lwelem33: .x00 | ||||||
|  | radio.0/cisco/elem146: .x690f | ||||||
|  |  | ||||||
|  | radio.255/capwap/operational-state/cause: Normal | ||||||
|  | radio.255/capwap/operational-state/state: enabled | ||||||
|  |  | ||||||
|  | cisco/bcast-ssid-mode: 1 | ||||||
|  | capwap/timers/max-discovery-interval: 10 | ||||||
|  | capwap/timers/echo-interval: 30 | ||||||
|  |  | ||||||
|  | cisco/client-auto-handoff: 0 | ||||||
|  |  | ||||||
|  | cisco/lwelem14: .x000001000000000000000000000000000000 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								src/ac/rpc-macros/txp.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/ac/rpc-macros/txp.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | radio.0/capwap80211/tx-power/@cisco/cfg-type: 1 - global | ||||||
|  | radio.0/capwap80211/tx-power/current-tx-power: 1 | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								src/ac/rpc-macros/wlan.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/ac/rpc-macros/wlan.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | |||||||
|  | radio.0/wlan.1/capwap80211/capability: 1073 | ||||||
|  | radio.0/wlan.1/capwap80211/qos: 0 | ||||||
|  | radio.0/wlan.1/capwap80211/ssid: tubeC | ||||||
|  | radio.0/wlan.1/cisco/aironet-ie: true | ||||||
|  | radio.0/wlan.1/cisco/broadcast-ssid: true | ||||||
|  | radio.0/wlan.1/cisco/dtim-period: 1 | ||||||
|  | radio.0/wlan.1/cisco/encryption-policy: 4 | ||||||
|  | radio.0/wlan.1/cisco/hreap-local-switch: 0 | ||||||
|  | radio.0/wlan.1/cisco/profile-name: tubeC | ||||||
|  | radio.0/wlan.1/cisco/scan-defer-period: 28784 | ||||||
|  | radio.0/wlan.1/cisco/scan-defer-time: 100 | ||||||
|  | radio.0/wlan.1/cisco/session-timout: 1800 | ||||||
|  | radio.0/wlan.1/cisco/wep-encryption: false | ||||||
|  | radio.0/wlan.1/cisco/wep-key: .xc3e9d4b1360d7cf5bcfc759753 | ||||||
|  | radio.0/wlan.1/cisco/wep-key-index: 1 | ||||||
|  | radio.0/wlan.1/radio-id: 0 | ||||||
|  | radio.0/wlan.1/wlan-id: 1 | ||||||
							
								
								
									
										14
									
								
								src/ac/rpc-macros/wlan1.ckv
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/ac/rpc-macros/wlan1.ckv
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | |||||||
|  | radio.0/wlan.1/capwap80211/capability: 1057 | ||||||
|  | radio.0/wlan.1/capwap80211/ssid: actube | ||||||
|  | radio.0/wlan.1/cisco/allow-aaa-override: 0 | ||||||
|  | radio.0/wlan.1/cisco/broadcast-ssid: true | ||||||
|  | radio.0/wlan.1/cisco/dtim-period: 1 | ||||||
|  | radio.0/wlan.1/cisco/encryption-policy: 16777216 | ||||||
|  | radio.0/wlan.1/cisco/max-stations: 200 | ||||||
|  | radio.0/wlan.1/cisco/profile-name: ACTUBE | ||||||
|  | radio.0/wlan.1/cisco/session-timout: 1800 | ||||||
|  | radio.0/wlan.1/cisco/wep-encryption: 0 | ||||||
|  | radio.0/wlan.1/cisco/wep-key: .x00000000000000000000000000 | ||||||
|  | radio.0/wlan.1/radio-id: 0 | ||||||
|  | radio.0/wlan.1/wlan-id: 1 | ||||||
|  |  | ||||||
							
								
								
									
										162
									
								
								src/ac/rpc.c
									
									
									
									
									
								
							
							
						
						
									
										162
									
								
								src/ac/rpc.c
									
									
									
									
									
								
							| @ -159,10 +159,6 @@ int list_cmd(struct rpcdata *sd, const char *cmd) | |||||||
|  |  | ||||||
| int exit_cmd(struct rpcdata *sd, const char *cmd) | int exit_cmd(struct rpcdata *sd, const char *cmd) | ||||||
| { | { | ||||||
| 		//fprintf(sd->out,"Unknown command: '%s'\n\r\n\r",cmd); |  | ||||||
|  |  | ||||||
| //	printf("Exitcmd %s\n",cmd); |  | ||||||
| 	//fprintf(sd->out,"END: %s\n\r",cmd); |  | ||||||
| 	finish_cmd(sd->out); | 	finish_cmd(sd->out); | ||||||
| 	fflush(sd->out); | 	fflush(sd->out); | ||||||
| 	return 1; | 	return 1; | ||||||
| @ -290,7 +286,6 @@ send_cmd(struct rpcdata * sd, const char *cmd) | |||||||
|  |  | ||||||
| 		fprintf(sd->out, "Sending update cmd\n"); | 		fprintf(sd->out, "Sending update cmd\n"); | ||||||
|  |  | ||||||
| //		conn->update_cfg=sd->update_cfg; |  | ||||||
| 	} | 	} | ||||||
| errX:	 | errX:	 | ||||||
| 	wtplist_unlock(); | 	wtplist_unlock(); | ||||||
| @ -311,8 +306,6 @@ wlan0_cmd(struct rpcdata * sd, const char *cmd) | |||||||
| 	} | 	} | ||||||
| 	else { | 	else { | ||||||
| 		FILE *f=fopen("wlan0.ktv","r"); | 		FILE *f=fopen("wlan0.ktv","r"); | ||||||
| //		cw_ktv_read_file(f,sd->update_cfg,conn->msgset->types_tree); |  | ||||||
| 		//conn->update_cfg=sd->update_cfg; |  | ||||||
| 		fclose(f); | 		fclose(f); | ||||||
| 	} | 	} | ||||||
| 	wtplist_unlock(); | 	wtplist_unlock(); | ||||||
| @ -395,31 +388,6 @@ int del_cmd(struct rpcdata *sd, const char *str) | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| /* |  | ||||||
| void show_cfg (FILE *out, mavl_t ktv) |  | ||||||
| { |  | ||||||
| 	char value[500]; |  | ||||||
| 	struct cw_Val * data; |  | ||||||
| 	mavliter_t it; |  | ||||||
| 	const struct cw_Type * type; |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| 	mavliter_init(&it,ktv); |  | ||||||
|  |  | ||||||
| 	mavliter_foreach(&it){ |  | ||||||
| 		 |  | ||||||
| 		data = mavliter_get(&it); |  | ||||||
| 		type = data->type; |  | ||||||
| 		type->to_str(data,value,0); |  | ||||||
| 		 |  | ||||||
| 		fprintf(out,"%s :%s: %s\n",data->key,type->get_type_name(data), value); |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| } |  | ||||||
| */ |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void print_mw(FILE *f, int w, const char * str) | void print_mw(FILE *f, int w, const char * str) | ||||||
| { | { | ||||||
| 	int n,i; | 	int n,i; | ||||||
| @ -505,62 +473,6 @@ struct cw_Conn * find_ap(const char *name) | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void con (FILE *out) |  | ||||||
| { |  | ||||||
| 	stop(); |  | ||||||
|  |  | ||||||
| /*	 |  | ||||||
| 	struct connlist * cl; |  | ||||||
| 	mavliter_t it; |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| 	wtplist_lock(); |  | ||||||
| 	 |  | ||||||
| 	cl = wtplist_get_connlist(); |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| 	mavliter_init (&it, cl->by_addr); |  | ||||||
| 	fprintf (out, "IP\t\t\twtp-name\n"); |  | ||||||
| 	mavliter_foreach (&it) { |  | ||||||
| 		cw_Val_t * result; |  | ||||||
| 		char addr[SOCK_ADDR_BUFSIZE]; |  | ||||||
| 		char wtp_name[CAPWAP_MAX_WTP_NAME_LEN]; |  | ||||||
| 		struct cw_Conn * conn; |  | ||||||
| 		conn = mavliter_get_ptr (&it); |  | ||||||
| 		 |  | ||||||
| 		sock_addr2str_p (&conn->addr, addr); |  | ||||||
| 		 |  | ||||||
| 		result = cw_ktv_get (conn->remote_cfg, "wtp-name", NULL); |  | ||||||
| 		 |  | ||||||
| 		if (result == NULL) { |  | ||||||
| 			strcpy (wtp_name, ""); |  | ||||||
| 			 |  | ||||||
| 		} else { |  | ||||||
| 			result->type->to_str (result, wtp_name, CAPWAP_MAX_WTP_NAME_LEN); |  | ||||||
| 		} |  | ||||||
| 		 |  | ||||||
| 		 |  | ||||||
| 		fprintf (out, "Con!! %s\t\t%s\n", addr, wtp_name); |  | ||||||
| 		 |  | ||||||
| 		{ |  | ||||||
| 			stop(); |  | ||||||
|  |  | ||||||
| 			mavl_t update; |  | ||||||
| //			update = cw_ktv_create(); |  | ||||||
| //			cw_ktv_set_byte(update,"radio.255/admin-state",1); |  | ||||||
| //			conn->update_cfg=update; |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 		fprintf(out,"\n"); |  | ||||||
|  |  | ||||||
| 	} |  | ||||||
| 	wtplist_unlock(); |  | ||||||
| 	*/ |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| struct command * find_cmd(const char *cmd) | struct command * find_cmd(const char *cmd) | ||||||
| { | { | ||||||
| 	struct command * search,*result; | 	struct command * search,*result; | ||||||
| @ -585,7 +497,6 @@ int execute_cmd (struct rpcdata * sd, const char *str) | |||||||
| 	char cmd[1024]; | 	char cmd[1024]; | ||||||
| 	char args[1024]; | 	char args[1024]; | ||||||
| 	int n; | 	int n; | ||||||
| 	struct cw_Val_Reader reader; |  | ||||||
| 	struct command * searchcmd; | 	struct command * searchcmd; | ||||||
|  |  | ||||||
| 	args[0]=0; | 	args[0]=0; | ||||||
| @ -619,73 +530,8 @@ int execute_cmd (struct rpcdata * sd, const char *str) | |||||||
|  |  | ||||||
| 	return 0; | 	return 0; | ||||||
| 	 | 	 | ||||||
| 	 |  | ||||||
| 	char key[CW_CFG_MAX_KEY_LEN]; |  | ||||||
| 	char type[128]; |  | ||||||
| 	char val[2048]; |  | ||||||
|  |  | ||||||
| 	key[0]=0; |  | ||||||
| 	type[0]=0; |  | ||||||
| 	val[0]=0; |  | ||||||
|  |  | ||||||
| 	stop(); |  | ||||||
| //	cw_ktv_init_str_reader(&reader,str, strlen(str)); |  | ||||||
| //	n = cw_ktv_parse_string(&reader, key,type,val); |  | ||||||
| 	 |  | ||||||
| 	if (n==-1){ |  | ||||||
| 		int i; |  | ||||||
| 		fprintf(sd->out,"Error on pos %d\n",reader.pos); |  | ||||||
| 		fprintf(sd->out,"%s",str); |  | ||||||
| 		for(i=0;i<reader.pos;i++){ |  | ||||||
| 			fprintf(sd->out," "); |  | ||||||
| 		} |  | ||||||
| 		fprintf(sd->out,"^\n"); |  | ||||||
| 		fprintf(sd->out,"%s\n",reader.error); |  | ||||||
| 	} |  | ||||||
| 	else{ |  | ||||||
| 		fprintf(sd->out,"%s :%s: %s\n", key,type,val); |  | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| 	n = sscanf (str, "%s%s", cmd, args); |  | ||||||
|  |  | ||||||
| 	if (n<=0) |  | ||||||
| 		return 0; |  | ||||||
| 	/*printf("CMD: %s, ARGS:\n",cmd);*/ |  | ||||||
| 	 |  | ||||||
| 	if (strcmp (cmd, "s") == 0) { |  | ||||||
| 		show_aps (sd->out); |  | ||||||
| 		return 0; |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| 	if (strcmp (cmd, "con")==0){ |  | ||||||
| 		con(sd->out); |  | ||||||
| 		return 0; |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| struct esc_strings { |  | ||||||
| 	char *str; |  | ||||||
| 	char * result; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| struct esc_strings estr[] = { |  | ||||||
| 	{"\x1b[H", "home"}, |  | ||||||
| 	{"\x1b[F", "end"}, |  | ||||||
| 	{"\x1b[A", "up"}, |  | ||||||
| 	{"\x1b[B", "donw"}, |  | ||||||
| 	{"\x1b[D", "left"}, |  | ||||||
| 	{"\x1b[C", "right"}, |  | ||||||
|  |  | ||||||
| 	{NULL,NULL} |  | ||||||
|  |  | ||||||
| }; |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| void rpc_loop (FILE *file, cw_Cfg_t *global_cfg) | void rpc_loop (FILE *file, cw_Cfg_t *global_cfg) | ||||||
| @ -751,9 +597,6 @@ void * run_rpc_server (void * arg) | |||||||
| 			close (clientsock); | 			close (clientsock); | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 		 |  | ||||||
| 		 |  | ||||||
| 		//cw_dbg (DBG_INFO,"Accepting shell session %i, %s", rc, strerror (errno)); |  | ||||||
| 	}	 | 	}	 | ||||||
| 	 | 	 | ||||||
| 	return NULL; | 	return NULL; | ||||||
| @ -793,8 +636,6 @@ int create_tcp_fd(const char *name) | |||||||
| } | } | ||||||
| static int create_unix_fd(const char *name) | static int create_unix_fd(const char *name) | ||||||
| { | { | ||||||
|         //struct sockaddr_storage client; |  | ||||||
| 	//socklen_t client_size; |  | ||||||
| 	struct sockaddr_un addr; | 	struct sockaddr_un addr; | ||||||
| 	int rc,fd; | 	int rc,fd; | ||||||
|  |  | ||||||
| @ -808,7 +649,6 @@ static int create_unix_fd(const char *name) | |||||||
| 		cw_log (LOG_ERR, "Can't bind socket 'unix:%s', %s", name, strerror (errno)); | 		cw_log (LOG_ERR, "Can't bind socket 'unix:%s', %s", name, strerror (errno)); | ||||||
| 		return -1; | 		return -1; | ||||||
| 	} | 	} | ||||||
| 	//int clientsock = accept (fd, (struct sockaddr*) &client, &client_size); |  | ||||||
|  |  | ||||||
| 	return fd; | 	return fd; | ||||||
| } | } | ||||||
| @ -817,7 +657,7 @@ int start_rpc(cw_Cfg_t *global_cfg) | |||||||
| { | { | ||||||
| 	struct sockdata * sockdata; | 	struct sockdata * sockdata; | ||||||
| 	const char *sockname; | 	const char *sockname; | ||||||
| 	int rc; //, type; | 	int rc;  | ||||||
| 	int fd; | 	int fd; | ||||||
|  |  | ||||||
| 	rc = cw_cfg_get_bool(global_cfg,"actube/rpc/enable",1); | 	rc = cw_cfg_get_bool(global_cfg,"actube/rpc/enable",1); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user