Simulate dump2 Multi-AP setup && Fix a crash

This commit is contained in:
Amin Ben Ramdhane 2021-12-13 08:24:06 +00:00
parent 591d7ac3c5
commit 2486dffd24
7 changed files with 524 additions and 1083 deletions

3
.gitignore vendored
View file

@ -41,3 +41,6 @@ tools/__pycache__
*\.log
.libs
m4/
bbf_ubus
memory-report.xml
*.la

View file

@ -656,7 +656,7 @@ static json_object *dump2_find_device_object(const char *unique_key)
return NULL;
}
static json_object *find_radio_object(json_object *device_obj, const char *unique_key)
static json_object *dump_find_radio_object(json_object *device_obj, const char *unique_key)
{
json_object *radio_arr = NULL;
json_object *radio_obj = NULL;
@ -675,6 +675,22 @@ static json_object *find_radio_object(json_object *device_obj, const char *uniqu
return NULL;
}
static json_object *dump2_find_radio_object(json_object *device_obj, const char *unique_key)
{
json_object *radio_arr = NULL;
json_object *radio_obj = NULL;
int i = 0;
dmjson_foreach_obj_in_array(device_obj, radio_arr, radio_obj, i, 1, "RadioList") {
char *mac = dmjson_get_value(radio_obj, 1, "macaddr");
if (strcmp(unique_key, mac) == 0)
return radio_obj;
}
return NULL;
}
static int browseWiFiDataElementsNetworkDeviceInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
{
struct wifi_data_element_args wifi_da_device_args = {0};
@ -734,8 +750,8 @@ static int browseWiFiDataElementsNetworkDeviceRadioInst(struct dmctx *dmctx, DMN
continue;
wifi_da_radio_args.uci_s = p;
wifi_da_radio_args.dump_obj = find_radio_object(wifi_da_device->dump_obj, key);
wifi_da_radio_args.dump2_obj = find_radio_object(wifi_da_device->dump2_obj, key);
wifi_da_radio_args.dump_obj = dump_find_radio_object(wifi_da_device->dump_obj, key);
wifi_da_radio_args.dump2_obj = dump2_find_radio_object(wifi_da_device->dump2_obj, key);
inst = handle_instance(dmctx, parent_node, p->dmmap_section, "wifi_da_device_instance", "wifi_da_device_alias");

View file

@ -1567,7 +1567,7 @@ char *base64_decode(const char *src)
{
int i, j = 0;
if (!src)
if (!src || *src == '\0')
return "";
size_t decsize = strlen(src)*6/8;

View file

@ -1,108 +1,62 @@
config controller 'controller'
option enabled '1'
option registrar '5 2'
option debug '0'
option enable_sta_steer '0'
option enable_bsta_steer '0'
option use_bcn_metrics '0'
option use_usta_metrics '0'
option primary_vid '1'
option primary_pcp '0'
option backhaul_steer '0'
option beacon_metrics '0'
option usta_metrics '0'
option traffic_separation '0'
option coordinated_cac '0'
config ap
option band '5'
option ssid '5GHz-main'
option encryption 'sae-mixed'
option vid '100'
option type 'fronthaul'
option network 'lan'
option key 'M7YrYVYh9ULtm3QG'
config ap
option band '5'
option ssid '5GHz-guest'
option encryption 'sae-mixed'
option vid '200'
option type 'fronthaul'
option network 'lan'
option key 'M7YrYVYh9ULtm3QG'
config ap
option band '2'
option ssid 'MAP-608D26C4983C-2.4GHz'
option encryption 'sae-mixed'
option vid '100'
option type 'fronthaul'
option network 'lan'
option key 'M7YrYVYh9ULtm3QG'
config ap
option band '5'
option ssid 'MAP-608D26C4983C-BH-5GHz'
option encryption 'sae'
option vid '1'
option type 'backhaul'
option network 'lan'
option key 'c12bf5457bc6189133d2a803fb09bb5b49e35b0e05d9abe449a5f6025441cc4'
config ap
option band '2'
option ssid 'MAP-608D26C4983C-BH-2.4GHz'
option encryption 'sae'
option vid '10'
option type 'backhaul'
option network 'lan'
option key 'c12bf5457bc6189133d2a803fb09bb5b49e35b0e05d9abe449a5f6025441cc4'
config node 'node_021111aabbcc'
option agent_id '02:11:11:aa:bb:cc'
option backhaul_ul_macaddr '00:00:00:00:00:01'
option backhaul_dl_macaddr '06:10:20:30:40:50'
option backhaul_type 'none'
option primary_vid '1'
option primary_pcp '0'
option report_sta_assocfails '1'
option report_sta_assocfails_rate '2'
option report_metric_periodic '0'
option report_scan '0'
list steer_exclude '00:aa:bb:cc:dd:11'
list steer_exclude '00:aa:bb:cc:dd:22'
list steer_exclude '00:aa:bb:cc:dd:33'
list steer_exclude_btm '00:aa:bb:cc:dd:44'
list steer_exclude_btm '00:aa:bb:cc:dd:55'
option steer_disallow '0'
option coordinated_cac '1'
option traffic_separation '1'
option sta_steer '1'
config radio
option agent_id '02:11:11:aa:bb:cc'
option macaddr '02:12:12:bb:cc:dd'
option band '5'
option steer_policy '0'
option util_threshold '200'
option rcpi_threshold '60'
option report_rcpi_threshold '0'
option report_rcpi_hysteresis_margin '0'
option report_util_threshold '0'
option include_sta_stats '0'
option include_sta_metric '0'
config radio
option agent_id '02:11:11:aa:bb:cc'
option macaddr '02:12:12:bb:cc:de'
option band '2'
option steer_policy '0'
option util_threshold '200'
option rcpi_threshold '30'
option report_rcpi_threshold '0'
option report_rcpi_hysteresis_margin '0'
option report_util_threshold '0'
option include_sta_stats '0'
option include_sta_metric '0'
option enabled '1'
option registrar '5 2'
option debug '0'
option enable_sta_steer '0'
option enable_bsta_steer '0'
option use_bcn_metrics '0'
option use_usta_metrics '0'
option primary_vid '1'
option primary_pcp '0'
config interface 'lan'
config ap
option band '5'
option ssid 'iopsysWrt-44D43771B410'
option encryption 'sae-mixed'
option key 'PCTQ44TNVKK5NU'
option vid '1'
option type 'fronthaul'
option network 'lan'
config ap
option band '2'
option ssid 'iopsysWrt-44D43771B410'
option encryption 'sae-mixed'
option key 'PCTQ44TNVKK5NU'
option vid '1'
option type 'fronthaul'
option network 'lan'
config ap
option band '5'
option ssid 'MAP-44D43771B410-BH-5GHz'
option encryption 'sae'
option type 'backhaul'
option vid '1'
option network 'lan'
option key '029be741b7ff7b4caf9b1b3c48c56030fed877c22f5031bc9cf0132d1672c2c'
config ap
option band '2'
option ssid 'MAP-44D43771B410-BH-2.4GHz'
option encryption 'sae'
option type 'backhaul'
list disallow_bsta '0'
option vid '1'
option network 'lan'
option key '029be741b7ff7b4caf9b1b3c48c56030fed877c22f5031bc9cf0132d1672c2c'
config node
option agent_id '46:d4:37:71:b4:10'
config radio
option agent_id '46:d4:37:71:b4:10'
option macaddr '44:d4:37:71:b4:1f'
option band '5'
config radio
option agent_id '46:d4:37:71:b4:10'
option macaddr '44:d4:37:71:b4:1e'
option band '2'

File diff suppressed because it is too large Load diff

View file

@ -1,204 +1,160 @@
{
"num_ssid": 1,
"ssidlist": [
{
"ssid": "5GHz-main",
"band": "5GHz",
"vid": 100,
"security": "WPA"
},
{
"ssid": "5GHz-guest",
"band": "5GHz",
"vid": 200,
"security": "WPA"
},
{
"ssid": "MAP-608D26C4983C-2.4GHz",
"band": "2.4GHz",
"vid": 100,
"security": "WPA"
},
{
"ssid": "MAP-608D26C4983C-BH-5GHz",
"band": "5GHz",
"vid": 100,
"security": "WPA"
},
{
"ssid": "MAP-608D26C4983C-BH-2.4GHz",
"band": "2.4GHz",
"vid": 100,
"security": "WPA"
}
],
"num_ap_devices":1,
"APDeviceList": [
{
"macaddr": "02:11:11:aa:bb:cc",
"manufacturer": "IOPSYS",
"oui": "00:22:07",
"product_class": "AP",
"serialnumber": "12345",
"version": "6.4",
"last_connect_time": "TODO",
"backhaul_type": "TODO",
"backhaul_macaddr": "TODO",
"backhaul_tx_bytes": 0,
"backhaul_rx_bytes": 0,
"backhaul_utilization": 0,
"backhaul_rcpi": 0,
"radar_detections": [
],
"MaxReportingRate": 80,
"MultiAPProfile": "TODO",
"MaxVIDs": 4095,
"DFSEnable": true,
"EasyMeshControllerOperationMode": "TODO",
"EasyMeshAgentOperationMode": "TODO",
"Backhaul_BackhaulMACAddress": "TODO",
"Backhaul_BackhaulDeviceID": "TODO",
"Backhaul_CurrentOperatingClassProfileNumberOfEntries": 1,
"Backhaul_CurrentOperatingClassProfile": [
{
"Class": 10,
"Channel": 15,
"TxPower": -50,
"TimeStamp": "TODO"
}
],
"Backhaul_BytesSent": 1,
"Backhaul_BytesReceived": 2,
"Backhaul_PacketsSent": 3,
"Backhaul_PacketsReceived": 4,
"Backhaul_ErrorsSent": 5,
"Backhaul_ErrorsReceived": 6,
"Backhaul_LinkUtilization": 7,
"Backhaul_SignalStrength": 8,
"Backhaul_LastDataDownlinkRate": 9,
"Backhaul_LastDataUplinkRate": 10,
"Backhaul_TimeStamp": "TODO",
"num_radios": 2,
"RadioList": [
{
"ID": "AhISu8zd",
"band": 2,
"standard": "ax",
"channel": 8,
"bandwidth": 40,
"channel_ext": 1,
"mcs": 7,
"txpower": 23,
"channels": [
],
"num_bss": 1,
"APList": [
{
"bssid": "",
"ssid": "",
"num_steer_assoc_control": 12,
"num_steer_btm": 5,
"num_steer_btm_query": 1,
"num_stations": 1,
"StationList": [
{
"macaddr": "",
"standard": "a",
"active": true,
"connect_time": 51,
"dl_rate": -52,
"ul_rate": -40,
"rcpi": 55,
"noise": -90,
"tx_bytes": 1,
"rx_bytes": 2,
"tx_packets": 3,
"rx_packets": 4,
"tx_error_packets": 5,
"rx_error_packets": 6,
"tx_retrans_packets": 7
}
]
}
],
"scan_boot_only": true,
"scan_impact": 2,
"scan_interval": 50,
"scan_num_opclass": 1,
"OpClassChannels": [
{
"OpClass": 10,
"ChannelList": "TODO"
}
],
"num_CACMethod": 1,
"CACMethod": [
{
"Method": 12
}
]
},
{
"ID": "AhISu8ze",
"band": 2,
"standard": "ax",
"channel": 8,
"bandwidth": 40,
"channel_ext": 1,
"mcs": 7,
"txpower": 23,
"channels": [
],
"num_bss": 1,
"APList": [
{
"bssid": "",
"ssid": "",
"num_steer_assoc_control": 12,
"num_steer_btm": 5,
"num_steer_btm_query": 1,
"num_stations": 1,
"StationList": [
{
"macaddr": "",
"standard": "a",
"active": true,
"connect_time": 51,
"dl_rate": -52,
"ul_rate": -40,
"rcpi": 55,
"noise": -90,
"tx_bytes": 1,
"rx_bytes": 2,
"tx_packets": 3,
"rx_packets": 4,
"tx_error_packets": 5,
"rx_error_packets": 6,
"tx_retrans_packets": 7
}
]
}
],
"scan_boot_only": true,
"scan_impact": 2,
"scan_interval": 50,
"scan_num_opclass": 1,
"OpClassChannels": [
{
"OpClass": 10,
"ChannelList": "TODO"
}
],
"num_CACMethod": 1,
"CACMethod": [
{
"Method": 12
}
]
}
]
}
]
"num_ssid": 4,
"ssidlist": [
{
"ssid": "iopsysWrt-44D43771B410",
"band": "5GHz",
"vid": 1,
"security": "WPA3PSK/WPA2PSK+WPA3PSK"
},
{
"ssid": "iopsysWrt-44D43771B410",
"band": "2.4GHz",
"vid": 1,
"security": "WPA3PSK/WPA2PSK+WPA3PSK"
},
{
"ssid": "MAP-44D43771B410-BH-5GHz",
"band": "5GHz",
"vid": 1,
"security": "WPA3PSK"
},
{
"ssid": "MAP-44D43771B410-BH-2.4GHz",
"band": "2.4GHz",
"vid": 1,
"security": "WPA3PSK"
}
],
"num_ap_devices": 1,
"APDeviceList": [
{
"macaddr": "46:d4:37:71:b4:10",
"manufacturer": "IOPSYS",
"oui": "00:22:07",
"product_class": "AP",
"serialnumber": "12345",
"version": "6.4",
"last_connect_time": "TODO",
"backhaul_type": "TODO",
"backhaul_macaddr": "TODO",
"backhaul_tx_bytes": 0,
"backhaul_rx_bytes": 0,
"backhaul_utilization": 0,
"backhaul_rcpi": 0,
"radar_detections": [
],
"num_radios": 2,
"RadioList": [
{
"macaddr": "44:d4:37:71:b4:1f",
"band": 5,
"standard": "ax",
"channel": 36,
"bandwidth": 80,
"channel_ext": 0,
"mcs": 0,
"txpower": 23,
"channels": [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
120,
124,
128,
132,
136,
140,
144
],
"num_bss": 2,
"APList": [
{
"bssid": "7e:d4:37:71:b4:18",
"ssid": "MAP-44D43771B410-BH-5GHz",
"num_steer_assoc_control": 0,
"num_steer_btm": 0,
"num_steer_btm_query": 0,
"num_stations": 0,
"StationList": [
]
},
{
"bssid": "44:d4:37:71:b4:1f",
"ssid": "iopsysWrt-44D43771B410",
"num_steer_assoc_control": 0,
"num_steer_btm": 0,
"num_steer_btm_query": 0,
"num_stations": 0,
"StationList": [
]
}
]
},
{
"macaddr": "44:d4:37:71:b4:1e",
"band": 2,
"standard": "ax",
"channel": 6,
"bandwidth": 20,
"channel_ext": 0,
"mcs": 0,
"txpower": 20,
"channels": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13
],
"num_bss": 2,
"APList": [
{
"bssid": "7a:d4:37:71:b4:1f",
"ssid": "MAP-44D43771B410-BH-2.4GHz",
"num_steer_assoc_control": 0,
"num_steer_btm": 0,
"num_steer_btm_query": 0,
"num_stations": 0,
"StationList": [
]
},
{
"bssid": "44:d4:37:71:b4:1e",
"ssid": "iopsysWrt-44D43771B410",
"num_steer_assoc_control": 0,
"num_steer_btm": 0,
"num_steer_btm_query": 0,
"num_stations": 0,
"StationList": [
]
}
]
}
]
}
]
}

View file

@ -4,10 +4,15 @@
case "$1" in
list)
echo '{ "dump" : {}, "event": {}, "dump2": {} }'
echo '{ "status": {}, "dump" : {}, "event": {}, "dump2": {} }'
;;
call)
case "$2" in
status)
json_init
json_add_string status available
json_dump
;;
dump)
cat /tmp/wifi.dataelements.collector.dump.data 2>/dev/null
;;