WTP joins now a Cisco vwlc via mod cisco.
FossilOrigin-Name: 21ef75e0a9c1bd22396902887a13ebd383bbbf97fe30834c8232f86ef6bb8eb6
This commit is contained in:
@ -198,28 +198,28 @@ int read_config(const char * filename){
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"board_id");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_board_id,s);
|
||||
uint8_t * s = bstr16_create_from_cfgstr(str);
|
||||
bstr16_replace(&conf_board_id,s);
|
||||
}
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"board_revision");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_board_revision,s);
|
||||
uint8_t * s = bstr16_create_from_cfgstr(str);
|
||||
bstr16_replace(&conf_board_revision,s);
|
||||
}
|
||||
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"serial_no");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_serial_no,s);
|
||||
uint8_t * s = bstr16_create_from_cfgstr(str);
|
||||
bstr16_replace(&conf_serial_no,s);
|
||||
}
|
||||
|
||||
|
||||
str = uci_lookup_option_string(ctx,section,"model_no");
|
||||
if (str){
|
||||
uint8_t * s = bstr_create_from_cfgstr(str);
|
||||
bstr_replace(&conf_model_no,s);
|
||||
uint8_t * s = bstr16_create_from_cfgstr(str);
|
||||
bstr16_replace(&conf_model_no,s);
|
||||
}
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ int discovery()
|
||||
{
|
||||
struct conn *conn = get_conn();
|
||||
|
||||
printf("Raqddios = %d\n",conn->radios->count);
|
||||
printf("Radios = %d\n",conn->radios->count);
|
||||
|
||||
cw_run_discovery(conn, "255.255.255.255");
|
||||
conn->capwap_state=CW_STATE_JOIN;
|
||||
|
@ -182,7 +182,7 @@ int run_join(struct conn *conn)
|
||||
// conn_send_msg(conn, conn->req_buffer);
|
||||
|
||||
|
||||
|
||||
mbag_del_all(conn->incomming);
|
||||
int rc = cw_send_request(conn, CW_MSG_JOIN_REQUEST);
|
||||
|
||||
if (!cw_rcok(rc)) {
|
||||
@ -211,6 +211,8 @@ int join()
|
||||
|
||||
printf("Join\n");
|
||||
|
||||
mbag_del_all(conn->incomming);
|
||||
|
||||
cw_aciplist_t iplist =
|
||||
mbag_get_mavl(conn->local, CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST);
|
||||
if (!iplist) {
|
||||
|
@ -83,7 +83,49 @@ int setup_conf(struct conn * conn)
|
||||
if (!n) {
|
||||
mbag_set_word(conn->config, CW_ITEM_STATISTICS_TIMER, 120);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mbag_t board_data=mbag_get_mbag_c(conn->config,CW_ITEM_WTP_BOARD_DATA,mbag_create);
|
||||
|
||||
printf("We have bd %p\n",board_data);
|
||||
|
||||
// mbag_set_mbag(conn->config, CW_ITEM_WTP_BOARD_DATA, board_data);
|
||||
|
||||
|
||||
uint32_t vendor = mbag_get_dword(board_data,CW_ITEM_WTP_BOARD_VENDOR,conf_vendor_id);
|
||||
mbag_set_dword(board_data, CW_ITEM_WTP_BOARD_VENDOR, vendor);
|
||||
|
||||
|
||||
mbag_set_bstrn(board_data, CW_ITEM_WTP_BOARD_MACADDRESS,
|
||||
conf_macaddress, conf_macaddress_len);
|
||||
|
||||
// mbag_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_MODELNO, bstr_data(conf_model_no),
|
||||
// bstr_len(conf_model_no));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,9 +14,11 @@
|
||||
|
||||
bstr_t get_base_rmac()
|
||||
{
|
||||
// static uint8_t rm[8]={0x00,0x4a,0x99,0x02,0xfa,0xc0};
|
||||
|
||||
static uint8_t rm[8] = { 0x00, 0x4a, 0x99, 0x02, 0xfa, 0xc0 };
|
||||
// static uint8_t rm[8] = { 0x00, 0x4a, 0x99, 0x02, 0xfa, 0xc0 };
|
||||
// static uint8_t rm[8]={0x00,0x3a,0x99,0x02,0xfa,0xc0};
|
||||
static uint8_t rm[8]={0x00,0x3a,0x99,0x03,0xfa,0xc0};
|
||||
|
||||
return bstr_create(rm, 6);
|
||||
}
|
||||
|
||||
|
@ -200,28 +200,28 @@ int main()
|
||||
mod_init_config(mod,conn->config);
|
||||
cfg_to_json();
|
||||
|
||||
mbag_t board_data = mbag_create();
|
||||
mbag_set_dword(board_data, CW_ITEM_WTP_BOARD_VENDOR, conf_vendor_id);
|
||||
// mbag_t board_data = mbag_create();
|
||||
// mbag_set_dword(board_data, CW_ITEM_WTP_BOARD_VENDOR, conf_vendor_id);
|
||||
|
||||
|
||||
mbag_set_bstrn(board_data, CW_ITEM_WTP_BOARD_MACADDRESS, conf_macaddress,
|
||||
conf_macaddress_len);
|
||||
mbag_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
bstr_data(conf_serial_no), bstr_len(conf_serial_no));
|
||||
// mbag_set_bstrn(board_data, CW_ITEM_WTP_BOARD_MACADDRESS, conf_macaddress,
|
||||
// conf_macaddress_len);
|
||||
// mbag_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_SERIALNO,
|
||||
// bstr_data(conf_serial_no), bstr_len(conf_serial_no));
|
||||
|
||||
mbag_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_MODELNO, bstr_data(conf_model_no),
|
||||
bstr_len(conf_model_no));
|
||||
// mbag_set_bstr16n(board_data, CW_ITEM_WTP_BOARD_MODELNO, bstr_data(conf_model_no),
|
||||
// bstr_len(conf_model_no));
|
||||
|
||||
|
||||
|
||||
mbag_set_mbag(conn->config, CW_ITEM_WTP_BOARD_DATA, board_data);
|
||||
// mbag_set_mbag(conn->config, CW_ITEM_WTP_BOARD_DATA, board_data);
|
||||
|
||||
|
||||
|
||||
|
||||
// mbag_set_bstrv(conn->config, CW_ITEM_WTP_SOFTWARE_VERSION, sw);
|
||||
|
||||
printf("Board_data %p\n", board_data);
|
||||
// printf("Board_data %p\n", board_data);
|
||||
|
||||
mbag_t mb = mbag_get_mbag(conn->config, CW_ITEM_WTP_BOARD_DATA, NULL);
|
||||
printf("mbag %p\n", mb);
|
||||
|
@ -34,10 +34,14 @@ config 'wtp'
|
||||
option discovery_interval 5
|
||||
|
||||
|
||||
# capwap mmode
|
||||
# capwap mode
|
||||
# possible values: capwap, cisco
|
||||
# default is "capwap"
|
||||
option capwap_mode "capwap"
|
||||
|
||||
# bindings mode
|
||||
# possible values: capwpa80211, cisco
|
||||
|
||||
|
||||
|
||||
config 'dbg'
|
||||
|
Reference in New Issue
Block a user