From f43b88af0a1645dc1aa2415683d1411551da1709 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Mar 2020 12:08:58 +0000 Subject: [PATCH 1/3] Let compile AC under FreeBSD FossilOrigin-Name: f73785f101fc422e11fd00aa367a69093f8344e4e7ad2edb13f6883dd42ac231 --- src/ACConfig.mak | 2 +- src/Config.mak | 2 +- src/ac/ac.h | 3 ++- src/ac/conf.c | 4 +++ src/ac/shell.c | 3 +++ src/wtp/cisco.ktv | 62 +++++++++++++++++++++-------------------------- 6 files changed, 39 insertions(+), 37 deletions(-) diff --git a/src/ACConfig.mak b/src/ACConfig.mak index 023c3f2a..35f23b55 100644 --- a/src/ACConfig.mak +++ b/src/ACConfig.mak @@ -3,6 +3,6 @@ include ../Config.mak # Define SSL Library: OPENSSL or GNUTLS # SSL_LIBRARY=OPENSSL -SSL_LIBRARY=GNUTLS +SSL_LIBRARY=OPENSSL diff --git a/src/Config.mak b/src/Config.mak index 96899acc..c43d46d1 100644 --- a/src/Config.mak +++ b/src/Config.mak @@ -35,7 +35,7 @@ WITH_OPENSSL=1 LIBDIR=lib OPTFLAGS := -g -O0 -CFLAGS := -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE=1 -pedantic -std=c90 -Wall +#CFLAGS := -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE=1 -pedantic -std=c99 -Wall SSL_LIBRARY:=GNUTLS diff --git a/src/ac/ac.h b/src/ac/ac.h index de742a77..eb990166 100644 --- a/src/ac/ac.h +++ b/src/ac/ac.h @@ -22,4 +22,5 @@ enum { -#endif \ No newline at end of file +#endif + diff --git a/src/ac/conf.c b/src/ac/conf.c index 291e37b2..b132cf5d 100644 --- a/src/ac/conf.c +++ b/src/ac/conf.c @@ -29,6 +29,10 @@ #include "cw/cw_util.h" #include "cw/dtls.h" + #include + #include + #include + #include #include "conf.h" #include "ac.h" diff --git a/src/ac/shell.c b/src/ac/shell.c index 3c374a2f..5d1a352f 100644 --- a/src/ac/shell.c +++ b/src/ac/shell.c @@ -32,6 +32,8 @@ void ucfg_cmd(struct shelldata *sd, const char * cmd); void set_cmd(struct shelldata *sd, const char * cmd); void del_cmd(struct shelldata *sd, const char * cmd); void send_cmd(struct shelldata *sd, const char * cmd); +void show_cfg (FILE *out, mavl_t ktv); +void show_aps (FILE *out); struct conn * find_ap(const char *name); @@ -89,6 +91,7 @@ void ucfg_cmd(struct shelldata *sd, const char *cmd) #include "wtpman.h" +void send_cmd(struct shelldata * sd, const char *cmd) { struct conn * conn; diff --git a/src/wtp/cisco.ktv b/src/wtp/cisco.ktv index 4ffd2083..b031f5df 100644 --- a/src/wtp/cisco.ktv +++ b/src/wtp/cisco.ktv @@ -1,27 +1,27 @@ -ac-descriptor/active-wtps :Word: 1 -ac-descriptor/dtls-policy :Byte: 1 +ac-descriptor/active-wtps :Word: 2 +ac-descriptor/dtls-policy :Byte: 0 ac-descriptor/hardware/vendor :Dword: 4232704 ac-descriptor/hardware/version :Bstr16: .x01000001 -ac-descriptor/max-wtps :Word: 200 +ac-descriptor/max-wtps :Word: 12 ac-descriptor/r-mac-field :Byte: 1 ac-descriptor/reserved1 :Byte: 0 ac-descriptor/security :Byte: 2 ac-descriptor/software/vendor :Dword: 4232704 -ac-descriptor/software/version :Bstr16: .x08007900 +ac-descriptor/software/version :Bstr16: .x07007400 ac-descriptor/station-limit :Word: 1000 ac-descriptor/stations :Word: 0 -ac-name :Bstr16: CisAC +ac-name :Bstr16: Cisco_e2:60:a0 ac-name-with-index.0 :Bstr16: tabbe88 ac-name-with-index.1 :Bstr16: nudelnudel ac-name-with-index.2 :Bstr16: nadelnalde ac-name-with-priority/X1 :Byte: 3 ac-name-with-priority/ac2 :Byte: 5 -capwap-control-ip-address/address.0 :IPAddress: 192.168.0.180 -capwap-control-ip-address/address.1 :IPAddress: 192.168.0.180 -capwap-control-ip-address/address.2 :IPAddress: 192.168.0.173 -capwap-control-ip-address/wtps.0 :Word: 1 -capwap-control-ip-address/wtps.1 :Word: 1 -capwap-control-ip-address/wtps.2 :Word: 1 +capwap-control-ip-address/address.0 :IPAddress: 192.168.0.162 +capwap-control-ip-address/address.1 :IPAddress: d96c:4c0a:da6c:4c0a:db6c:4c0a:dc6c:4c0a +capwap-control-ip-address/address.2 :IPAddress: 192.168.0.162 +capwap-control-ip-address/wtps.0 :Word: 0 +capwap-control-ip-address/wtps.1 :Word: 10 +capwap-control-ip-address/wtps.2 :Word: 0 capwap-local-ip-address :IPAddress: 192.168.0.14 capwap-timers/echo-interval :Byte: 30 capwap-timers/max-discovery-interval :Byte: 10 @@ -34,35 +34,30 @@ cisco/ac-ip-addr-with-index.1 :IPAddress: 9.9.9.9 cisco/ac-ip-addr-with-index.2 :IPAddress: 3.3.3.3 cisco/ap-core-dump/compression :Bool: false cisco/ap-core-dump/enable :Bool: false -cisco/ap-core-dump/filename :Str: 7.7.7.7 -cisco/ap-core-dump/tftp-server :IPAddress: 7.7.7.7 +cisco/ap-core-dump/filename :Str: +cisco/ap-core-dump/tftp-server :IPAddress: 0.0.0.0 cisco/ap-failover-priority :Byte: 3 cisco/ap-group-name :Bstr16: default-group cisco/ap-led-state-config/led-state :Byte: 1 cisco/ap-led-state-config/save-flag :Byte: 1 cisco/ap-log-facility :Byte: 0 -cisco/ap-mode-and-type/mode :Byte: 2 +cisco/ap-mode-and-type/mode :Byte: 0 cisco/ap-mode-and-type/type :Byte: 0 cisco/ap-model/model :Str: AIR-LAP1142N-E-K9 cisco/ap-power-injector-config/selection :Byte: 0 cisco/ap-power-injector-config/sitch-mac-address :Bstr16: .x000000000000 cisco/ap-power-injector-config/state :Byte: 17 -cisco/ap-pre-std-switch-config :Byte: 1 +cisco/ap-pre-std-switch-config :Byte: 0 cisco/ap-regulatory-domain.0/band-id :Byte: 0 cisco/ap-regulatory-domain.0/code0 :Byte: 0 cisco/ap-regulatory-domain.0/code1 :Byte: 1 cisco/ap-regulatory-domain.0/set :Bool: true cisco/ap-regulatory-domain.0/slot :Byte: 0 -cisco/ap-regulatory-domain.1/band-id :Byte: 1 -cisco/ap-regulatory-domain.1/code0 :Byte: 0 -cisco/ap-regulatory-domain.1/code1 :Byte: 1 -cisco/ap-regulatory-domain.1/set :Bool: true -cisco/ap-regulatory-domain.1/slot :Byte: 1 cisco/ap-sub-mode :Byte: 0 cisco/ap-telnet-ssh/ssh :Bool: false cisco/ap-telnet-ssh/telnet :Bool: false -cisco/ap-timesync/timestamp :Dword: 1527274666 -cisco/ap-timesync/type :Byte: 0 +cisco/ap-timesync/timestamp :Dword: 1583784035 +cisco/ap-timesync/type :Byte: 1 cisco/ap-username-and-password/802.1x-credentials/option :Word: 2 cisco/ap-username-and-password/802.1x-credentials/password :Str: cisco/ap-username-and-password/802.1x-credentials/username :Str: @@ -121,7 +116,7 @@ idle-timeout :Dword: 300 location-data :Bstr16: Berlin lwapp20 :Bstr16: .x000001 maximum-message-length :Word: 4096 -radio.0/admin-state :Byte: enabled +radio.0/admin-state :Byte: reserved radio.0/cisco-multi-domain-capability/first-channel :Word: 1 radio.0/cisco-multi-domain-capability/max-tx-power-level :Word: 65535 radio.0/cisco-multi-domain-capability/number-of-channels :Word: 13 @@ -145,7 +140,7 @@ radio.0/cisco/rad-extended-config/c-ccat :Word: 0 radio.0/cisco/rad-extended-config/multicast-buffer :Word: 0 radio.0/cisco/rad-extended-config/multicast-data-range :Word: 0 radio.0/cisco/rad-extended-config/rx-sensop-threshold :Word: 0 -radio.0/cisco/tx-power/current-tx-power :Word: 0 +radio.0/cisco/tx-power/current-tx-power :Word: 10 radio.0/cisco/tx-power/reserved :Byte: 1 radio.0/cisco/wtp-radio-config/beacon-period :Word: 100 radio.0/cisco/wtp-radio-config/bss-id :Bstr16: 123456 @@ -153,7 +148,7 @@ radio.0/cisco/wtp-radio-config/cfg-period :Byte: 4 radio.0/cisco/wtp-radio-config/cfg-type :Byte: 1 radio.0/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60 radio.0/cisco/wtp-radio-config/country-str1 :Str: DE -radio.0/cisco/wtp-radio-config/country-str2 :Str: DE +radio.0/cisco/wtp-radio-config/country-str2 :Str: DE radio.0/cisco/wtp-radio-config/gpr-period :Byte: 10 radio.0/cisco/wtp-radio-config/max-stations :Byte: 200 radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 100 @@ -161,7 +156,7 @@ radio.0/cisco/wtp-radio-config/reg :Dword: 65536 radio.0/cisco/wtp-radio-config/unknown75 :Byte: 0 radio.0/decryption-error-report-period :Word: 120 radio.0/operational-state/cause :Byte: Normal -radio.0/operational-state/state :Byte: enabled +radio.0/operational-state/state :Byte: 0 radio.0/rate_set :Bstr16: .x82848b960c1218243048606c radio.0/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100 radio.0/wlan.0/add-lw-wlan/misc2 :Word: 4 @@ -179,7 +174,7 @@ radio.0/wlan.0/wep-key :Bstr16: .xaa0c0a02000000000000000000 radio.0/wlan.0/wlan-capability :Word: 1057 radio.0/wlan.0/wlan-id :Byte: 0 radio.0/wtp-radio-information :Dword: 1 -radio.1/admin-state :Byte: enabled +radio.1/admin-state :Byte: reserved radio.1/cisco-multi-domain-capability/first-channel :Word: 36 radio.1/cisco-multi-domain-capability/max-tx-power-level :Word: 65535 radio.1/cisco-multi-domain-capability/number-of-channels :Word: 16 @@ -197,7 +192,7 @@ radio.1/cisco/multi-domain-capability/first-channel :Word: 36 radio.1/cisco/multi-domain-capability/max-tx-power-level :Word: 20 radio.1/cisco/multi-domain-capability/number-of-channels :Word: 4 radio.1/cisco/multi-domain-capability/reserved :Byte: 1 -radio.1/cisco/tx-power/current-tx-power :Word: 0 +radio.1/cisco/tx-power/current-tx-power :Word: 10 radio.1/cisco/tx-power/reserved :Byte: 1 radio.1/cisco/wtp-radio-config/beacon-period :Word: 100 radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90 @@ -205,7 +200,7 @@ radio.1/cisco/wtp-radio-config/cfg-period :Byte: 4 radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1 radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60 radio.1/cisco/wtp-radio-config/country-str1 :Str: DE -radio.1/cisco/wtp-radio-config/country-str2 :Str: DE +radio.1/cisco/wtp-radio-config/country-str2 :Str: DE radio.1/cisco/wtp-radio-config/gpr-period :Byte: 10 radio.1/cisco/wtp-radio-config/max-stations :Byte: 200 radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 100 @@ -213,7 +208,7 @@ radio.1/cisco/wtp-radio-config/reg :Dword: 65536 radio.1/cisco/wtp-radio-config/unknown75 :Byte: 1 radio.1/decryption-error-report-period :Word: 120 radio.1/operational-state/cause :Byte: Normal -radio.1/operational-state/state :Byte: enabled +radio.1/operational-state/state :Byte: 0 radio.1/rate_set :Bstr16: .x8c129824b048606c radio.1/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100 radio.1/wlan.0/add-lw-wlan/misc2 :Word: 4 @@ -231,15 +226,14 @@ radio.3/cisco/rad-extended-config/c-ccat :Word: 1 radio.3/cisco/rad-extended-config/multicast-buffer :Word: 0 radio.3/cisco/rad-extended-config/multicast-data-range :Word: 0 radio.3/cisco/rad-extended-config/rx-sensop-threshold :Word: 0 -radio.255/admin-state :Byte: enabled +radio.255/admin-state :Byte: reserved radio.255/operational-state/cause :Byte: Normal -radio.255/operational-state/state :Byte: enabled +radio.255/operational-state/state :Byte: 0 radio/0/cisco/regulatory-domain/code0 :Byte: 0 radio/0/cisco/regulatory-domain/code1 :Byte: 1 radio/0/cisco/regulatory-domain/set :Bool: true radio/0/cisco/regulatory-domain/slot :Byte: 0 radio/0/wtp-radio-information :Dword: 1 -radio/1/wtp-radio-information :Dword: 2 radio/wlan/encryption-policy :Dword: 16777216 radio/wlan/radio-od :Byte: 1 radio/wlan/wlan-capability :Word: 17 @@ -263,7 +257,7 @@ wtp-descriptor/hardware/version :Bstr16: .x01000000 wtp-descriptor/max-radios :Byte: 2 wtp-descriptor/radios-in-use :Byte: 2 wtp-descriptor/software/vendor :Dword: 4232704 -wtp-descriptor/software/version :Bstr16: .x08007900 +wtp-descriptor/software/version :Bstr16: .x07007400 wtp-fallback :Byte: 1 wtp-frame-tunnel-mode :Byte: 4 wtp-mac-type :Byte: 1 From 9f68858bfc49a9c54ef7b34ffe1a1a41a4538f12 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Mar 2020 12:24:22 +0000 Subject: [PATCH 2/3] Uses /bin/sh instead of bash FossilOrigin-Name: 9e2ddc1f45b5d992d6cb6afc3761d9578ac17f5cf4537d9deffd1e816d5032b4 --- ssl/mkcerts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssl/mkcerts.sh b/ssl/mkcerts.sh index f0078b6e..115bddbc 100755 --- a/ssl/mkcerts.sh +++ b/ssl/mkcerts.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh ./mkcert.sh ac ./mkcert.sh ac-cisco cisco-ac From afaf12731260a69953a59fde7608fdd5c03882f9 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 9 Mar 2020 19:50:08 +0000 Subject: [PATCH 3/3] Changed IP FossilOrigin-Name: e97a685eb0a0b1bc1e18073c9e1a5e13cfe3c5f878091bbb15e685c32328dd05 --- src/ac/config.ktv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ac/config.ktv b/src/ac/config.ktv index 59dd0978..7a0e9443 100644 --- a/src/ac/config.ktv +++ b/src/ac/config.ktv @@ -29,7 +29,7 @@ ac-descriptor/software/vendor :Dword: 4232704 ac-descriptor/software/version :Bstr16: .x07036500 ac-descriptor/station-limit :Word: 1000 ac-descriptor/stations :Word: 0 -capwap-control-ip-address/address.0 :IPAddress: 192.168.0.14 +capwap-control-ip-address/address.0 :IPAddress: 192.168.0.29 #capwap-control-ip-address/address.0 :IPAddress: 192.168.42.51 capwap-control-ip-address/wtps.0 :Word: 2 cisco/mwar-type :Byte: 0 @@ -42,15 +42,15 @@ result-code :Dword: 0 ac-name:Bstr16:"X1" #capwap-control-ip-address/address.0:IPAddress:1192.168.0.14 -capwap-control-ip-address/address.0:IPAddress:192.168.0.14 +capwap-control-ip-address/address.0:IPAddress:192.168.0.29 #capwap-control-ip-address/address.0:IPAddress:192.168.0.131 #capwap-control-ip-address/address.1:IPAddress:2a00:c1a0:48c6:4a00:9965:1b6e:aca3:1398 capwap-control-ip-address/wtps.0:Word:0 #capwap-control-ip-address/wtps.1:Word:11 -cisco/ssl-keyfile:Str:"../../ssl/certs/cisco-ac.key" -cisco/ssl-certfile:Str:"../../ssl/certs/cisco-ac.pem" +cisco/ssl-keyfile:Str:"../../ssl/certs/ac-cisco.key" +cisco/ssl-certfile:Str:"../../ssl/certs/ac-cisco.pem" cisco/ssl-cipher:Str:NORMAL #cisco/ssl-cipher:Str:+DHE-RSA:+AES-256-CBC:+AES-128-CBC:+SHA1:+PSK cisco/ssl-dhbits:Word:2048