Some reverse engenering of elemen 15

shell
7u83 5 months ago
parent 6dc8d80102
commit d4c80b5ebb
  1. 5
      INSTALL
  2. 82
      src/mod/cisco/cisco_actions.c
  3. 2
      src/mod/cisco/cisco_out_ac_descriptor.c
  4. 95
      src/wtp/cisco.ckv

@ -8,7 +8,6 @@ pre-requisites to build actube
On FreeBSD 10.2
----------------
pkg install libconfuse
pkg install wget
pkg install libnettle
@ -18,7 +17,6 @@ Ubuntu 14.04
apt-get install build-essential clang
apt-get install nettle-dev
apt-get install libgnutls28-dev
apt-get install libssl-dev
@ -29,10 +27,7 @@ pre-requisites to build wtp
Ubuntu 14.04
------------
apt-get install cmake
apt-get install libnl-genl-3-dev
cd src/contrib
sudo ./install_libuci.sh

@ -34,6 +34,12 @@ static int postprocess_discovery();
static int preprocess_join_request();
static int postprocess_join_request();
static cw_ValValRange_t cfg_type[]={
{1,1,"1 - global"},
{2,2,"2 - custom"},
{0,0,NULL}
};
static cw_ValStruct_t ap_time_sync[] = {
{CW_TYPE_DWORD, "timestamp", 4,-1},
@ -76,6 +82,19 @@ static cw_ValStruct_t cisco_8021xlogin[] = {
};
static cw_ValStruct_t cisco_elem_15[] = {
{CW_TYPE_BYTE, "cfg-type", 1, -1, cfg_type},
{CW_TYPE_BYTE, "channel", 1,-1},
{CW_TYPE_BSTR16, "rest",-1,-1},
{NULL,NULL,0,0}
};
static cw_ValEnum_t cisco_ap_username_and_password_enum[] ={
{2, "802.1x-credentials", CW_TYPE_STRUCT, cw_in_generic, cw_out_generic, cisco_8021xlogin },
@ -264,7 +283,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
{
char key[CW_CFG_MAX_KEY_LEN];
char testkey[CW_CFG_MAX_KEY_LEN];
// char testkey[CW_CFG_MAX_KEY_LEN];
int idx;
void * type;
cw_Val_t * result;
@ -305,9 +324,9 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
break;
if(type == NULL){
sprintf(testkey,"%s/%s",key,"band-id");
// sprintf(testkey,"%s/%s",key,"band-id");
stop();
result = cw_ktv_get_val_l(params->cfg_list,key,CW_TYPE_BYTE);
// result = cw_ktv_get_val_l(params->cfg_list,key,CW_TYPE_BYTE);
if (result==NULL){
type = cisco_ap_regulatory_domain4;
}
@ -340,7 +359,7 @@ static cw_ValStruct_t cisco_ap_model[]={
static cw_ValStruct_t cisco_direct_sequence_control70[]={
{CW_TYPE_BYTE,"cfg-type",1,-1},
{CW_TYPE_BYTE,"cfg-type",1,-1,cfg_type},
{CW_TYPE_BYTE,"current-channel",1,-1},
{CW_TYPE_BYTE,"current-cca-mode",1,-1},
{CW_TYPE_DWORD,"energy-detect-threshold",4,-1},
@ -413,7 +432,7 @@ static cw_ValStruct_t cisco_wtp_radio_config75[]={
static cw_ValStruct_t cisco_tx_power[]={
{CW_TYPE_BYTE,"reserved",1,-1},
{CW_TYPE_BYTE,"cfg-type",1,-1,cfg_type},
{CW_TYPE_WORD,"current-tx-power",2,-1},
{NULL,NULL,0,0}
};
@ -512,6 +531,7 @@ static cw_ValStruct_t cisco_ap_mode_and_type[]={
{NULL,NULL,0,0}
};
/*
static cw_ValStruct_t cisco_add_wlan[]={
{CW_TYPE_BYTE,"radio-id",1,-1},
{CW_TYPE_WORD,"wlan-capability",2,-1},
@ -530,7 +550,7 @@ static cw_ValStruct_t cisco_add_wlan[]={
{NULL,NULL,0,0}
};
*/
static cw_ValStruct_t cisco_add_wlan70[]={
{CW_TYPE_BYTE,"radio-id",1,-1},
@ -580,14 +600,14 @@ static int cisco_in_lw_del_wlan(struct cw_ElemHandler *eh,
}
/*
static int cw_mkradiokey(const char *pkey, uint8_t*data, int len, char *dst)
{
int radio_id;
radio_id = cw_get_byte(data);
sprintf(dst,"radio.%d/%s",radio_id,pkey);
return 1;
}
}*/
/*
static int cisoc_add_wlan_mkkey(const char *pkey, uint8_t*data, int len, char *dst)
@ -601,16 +621,18 @@ static int cisoc_add_wlan_mkkey(const char *pkey, uint8_t*data, int len, char *d
}
*/
static int cisoc_add_wlan_mkkey70(const char *pkey, uint8_t*data, int len, char *dst)
static int cisco_add_wlan_mkkey70(const char *pkey, uint8_t*data, int len, char *dst)
{
int wlan_id,radio_id;
stop();
radio_id = cw_get_byte(data);
wlan_id = cw_get_byte(data+4);
sprintf(dst,"radio.%d/wlan.%d/add-wlan",radio_id,wlan_id);
return 1;
}
/*
static int cisco_patch_add_wlan70(uint8_t * data, void * st)
{
stop();
@ -620,7 +642,7 @@ static int cisco_patch_add_wlan70(uint8_t * data, void * st)
return 0;
}
*/
static cw_ValStruct_t cisco_add_lwwlan[]={
{CW_TYPE_BSTR16, "misc", 8, 2},
@ -1381,14 +1403,18 @@ static struct cw_ElemHandler handlers70[] = {
},
{
"Cisco Elem 15", /* name */
"Cisco Elem 15 - Channel Setting (?)", /* name */
CISCO_ELEM_15, /* Element ID */
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
CW_TYPE_STRUCT, /* type */
"cisco/elem15", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
cw_out_radio_generic, /* put */
NULL,
NULL,
cisco_elem_15
},
{
@ -1714,19 +1740,20 @@ static struct cw_ElemHandler handlers70[] = {
}
,
// {
// "Add Cisco WLAN", /* name */
/// CISCO_ELEM_ADD_WLAN, /* Element ID */
/// CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
/// 7,1117, /* min/max length */
// cisco_add_wlan70, /* type */
// "radio/wlan/add-wlan", /* Key */
/// cw_in_generic_struct, /* get */
// cw_out_traverse, /* put */
// cisoc_add_wlan_mkkey70,
// cisco_patch_add_wlan70
// }
// ,
{
"Add Cisco WLAN", /* name */
CISCO_ELEM_ADD_WLAN, /* Element ID */
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
7,1117, /* min/max length */
CW_TYPE_STRUCT, /* type */
"radio/wlan/add-wlan", /* Key */
cw_in_generic, /* get */
cw_out_traverse, /* put */
cisco_add_wlan_mkkey70,
NULL, // cisco_patch_add_wlan70
cisco_add_wlan70
}
,
{
"Add Cisco WLAN (LWAPP)", /* name */
@ -2155,6 +2182,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0,0, CAPWAP_ELEM_RADIO_OPERATIONAL_STATE, 0,0},
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 0,0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_UPTIME, 0, 0},

@ -15,7 +15,7 @@
static int put_ac_status(cw_Cfg_t * cfg1, cw_Cfg_t * cfg2, uint8_t *dst, const char * parent_key){
uint8_t *d = dst;
uint8_t security;
// uint8_t security;
char key[CW_CFG_MAX_KEY_LEN];

@ -89,18 +89,19 @@ radio.0/cisco/antenna-payload/diversity-selection: 255
radio.0/cisco/antenna-payload/number-of-antennas: 2
radio.0/cisco/antenna-payload/unknown: 3
radio.0/cisco/channel-power: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe
radio.0/cisco/direct-sequence-control/cfg-type: 1
radio.0/cisco/direct-sequence-control/cfg-type: 2 - custom
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/current-channel: 13
radio.0/cisco/direct-sequence-control/energy-detect-threshold: -50
radio.0/cisco/direct-sequence-control/unknown: 1
radio.0/cisco/elem145: .x01
radio.0/cisco/elem146: .x690f
radio.0/cisco/elem153: .x00
radio.0/cisco/elem156: .x020100
radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem22: .x0d00b400320102030405060708090a0b0c0d
radio.0/cisco/elem24: .x003c000c
radio.0/cisco/elem39: .x0078
radio.0/cisco/elem47: .x0100000000000000000000000000000000
radio.0/cisco/elem48: .x00
radio.0/cisco/elem81: .x00000000010101010a001e0a02051cbfffbfff0a00
@ -118,8 +119,10 @@ radio.0/cisco/multi-domain-capability/max-tx-power-level: 20
radio.0/cisco/multi-domain-capability/number-of-channels: 13
radio.0/cisco/multi-domain-capability/reserved: 1
radio.0/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.0/cisco/tx-power/current-tx-power: 1
radio.0/cisco/tx-power/cfg-type: 2 - custom
radio.0/cisco/tx-power/current-tx-power: 7
radio.0/cisco/tx-power/reserved: 1
radio.0/cisco/tx-power/type: 1 - global
radio.0/cisco/wtp-radio-config/beacon-period: 100
radio.0/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.0/cisco/wtp-radio-config/cfg-period: 4
@ -133,6 +136,40 @@ radio.0/decryption-error-report-period: 120
radio.0/operational-state/cause: Normal
radio.0/operational-state/state: enabled
radio.0/rate_set: .x82848b960c1218243048606c
radio.0/wlan.1/add-wlan/aironet-ie: true
radio.0/wlan.1/add-wlan/broadcast-ssid: true
radio.0/wlan.1/add-wlan/dtim-period: 1
radio.0/wlan.1/add-wlan/encryption-policy: 4
radio.0/wlan.1/add-wlan/hreap-local-switch: 0
radio.0/wlan.1/add-wlan/profile-name: tubeC
radio.0/wlan.1/add-wlan/qos: 0
radio.0/wlan.1/add-wlan/radio-id: 0
radio.0/wlan.1/add-wlan/scan-defer-period: 28784
radio.0/wlan.1/add-wlan/scan-defer-time: 100
radio.0/wlan.1/add-wlan/session-timout: 1800
radio.0/wlan.1/add-wlan/ssid: tubeC
radio.0/wlan.1/add-wlan/wep-encryption: false
radio.0/wlan.1/add-wlan/wep-key: .x46686ca89e5cfff1e6389f3879
radio.0/wlan.1/add-wlan/wep-key-index: 1
radio.0/wlan.1/add-wlan/wlan-capability: 1073
radio.0/wlan.1/add-wlan/wlan-id: 1
radio.0/wlan.13/add-wlan/aironet-ie: true
radio.0/wlan.13/add-wlan/broadcast-ssid: true
radio.0/wlan.13/add-wlan/dtim-period: 19
radio.0/wlan.13/add-wlan/encryption-policy: 1
radio.0/wlan.13/add-wlan/hreap-local-switch: 16
radio.0/wlan.13/add-wlan/profile-name: SuerWLAN
radio.0/wlan.13/add-wlan/qos: 0
radio.0/wlan.13/add-wlan/radio-id: 0
radio.0/wlan.13/add-wlan/scan-defer-period: 15420
radio.0/wlan.13/add-wlan/scan-defer-time: 100
radio.0/wlan.13/add-wlan/session-timout: 1800
radio.0/wlan.13/add-wlan/ssid: SuperSSID
radio.0/wlan.13/add-wlan/wep-encryption: false
radio.0/wlan.13/add-wlan/wep-key: .x46686ca89e5cfff1e6389f3879
radio.0/wlan.13/add-wlan/wep-key-index: 1
radio.0/wlan.13/add-wlan/wlan-capability: 1057
radio.0/wlan.13/add-wlan/wlan-id: 13
radio.0/wtp-radio-information: 1
radio.1/admin-state: 1 - enabled
radio.1/cisco/air-space-capability: 0
@ -141,17 +178,23 @@ radio.1/cisco/antenna-payload/802-11n-tx-antennas: 0
radio.1/cisco/antenna-payload/antenna-1: 1
radio.1/cisco/antenna-payload/antenna-2: 1
radio.1/cisco/antenna-payload/antenna-mode: 3
radio.1/cisco/antenna-payload/diversity-selection: 255
radio.1/cisco/antenna-payload/diversity-selection: 1
radio.1/cisco/antenna-payload/number-of-antennas: 2
radio.1/cisco/antenna-payload/unknown: 3
radio.1/cisco/channel-power: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
radio.1/cisco/elem145: .x01
radio.1/cisco/elem15: .x012407ffffffce000000
radio.1/cisco/elem15: .x028407ffffffce010101
radio.1/cisco/elem15/cfg-type: 2 - custom
radio.1/cisco/elem15/channel: 140
radio.1/cisco/elem15/rest: .x07ffffffce010101
radio.1/cisco/elem15/type: 2 - custom
radio.1/cisco/elem15/val-1: 2
radio.1/cisco/elem153: .x00
radio.1/cisco/elem156: .x020100
radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem22: .x1000b4003224282c3034383c4064686c707484888c
radio.1/cisco/elem24: .x003c000c
radio.1/cisco/elem39: .x0078
radio.1/cisco/elem47: .x0100000000000000000000000000000000
radio.1/cisco/elem48: .x00
radio.1/cisco/elem81: .x00000000010101010a001e0a02050fbfffbfff0a00
@ -170,8 +213,10 @@ radio.1/cisco/multi-domain-capability/max-tx-power-level: 20
radio.1/cisco/multi-domain-capability/number-of-channels: 4
radio.1/cisco/multi-domain-capability/reserved: 1
radio.1/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.1/cisco/tx-power/current-tx-power: 1
radio.1/cisco/tx-power/cfg-type: 2 - custom
radio.1/cisco/tx-power/current-tx-power: 7
radio.1/cisco/tx-power/reserved: 1
radio.1/cisco/tx-power/type: 2 - custom
radio.1/cisco/wtp-radio-config/beacon-period: 100
radio.1/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.1/cisco/wtp-radio-config/cfg-period: 4
@ -185,6 +230,40 @@ radio.1/decryption-error-report-period: 120
radio.1/operational-state/cause: Normal
radio.1/operational-state/state: enabled
radio.1/rate_set: .x8c129824b048606c
radio.1/wlan.1/add-wlan/aironet-ie: true
radio.1/wlan.1/add-wlan/broadcast-ssid: true
radio.1/wlan.1/add-wlan/dtim-period: 1
radio.1/wlan.1/add-wlan/encryption-policy: 4
radio.1/wlan.1/add-wlan/hreap-local-switch: 0
radio.1/wlan.1/add-wlan/profile-name: tubeC
radio.1/wlan.1/add-wlan/qos: 0
radio.1/wlan.1/add-wlan/radio-id: 1
radio.1/wlan.1/add-wlan/scan-defer-period: 28784
radio.1/wlan.1/add-wlan/scan-defer-time: 100
radio.1/wlan.1/add-wlan/session-timout: 1800
radio.1/wlan.1/add-wlan/ssid: tubeC
radio.1/wlan.1/add-wlan/wep-encryption: false
radio.1/wlan.1/add-wlan/wep-key: .x26e985791600bf4e79554da038
radio.1/wlan.1/add-wlan/wep-key-index: 1
radio.1/wlan.1/add-wlan/wlan-capability: 17
radio.1/wlan.1/add-wlan/wlan-id: 1
radio.1/wlan.13/add-wlan/aironet-ie: true
radio.1/wlan.13/add-wlan/broadcast-ssid: true
radio.1/wlan.13/add-wlan/dtim-period: 19
radio.1/wlan.13/add-wlan/encryption-policy: 1
radio.1/wlan.13/add-wlan/hreap-local-switch: 16
radio.1/wlan.13/add-wlan/profile-name: SuerWLAN
radio.1/wlan.13/add-wlan/qos: 0
radio.1/wlan.13/add-wlan/radio-id: 1
radio.1/wlan.13/add-wlan/scan-defer-period: 15420
radio.1/wlan.13/add-wlan/scan-defer-time: 100
radio.1/wlan.13/add-wlan/session-timout: 1800
radio.1/wlan.13/add-wlan/ssid: SuperSSID
radio.1/wlan.13/add-wlan/wep-encryption: false
radio.1/wlan.13/add-wlan/wep-key: .x26e985791600bf4e79554da038
radio.1/wlan.13/add-wlan/wep-key-index: 1
radio.1/wlan.13/add-wlan/wlan-capability: 1
radio.1/wlan.13/add-wlan/wlan-id: 13
radio.1/wtp-radio-information: 2
radio.2/cisco/lwelem33: .x00
radio.255/admin-state: 1 - enabled

Loading…
Cancel
Save