diff --git a/src/mod/capwap/capwap_actions_wtp.c b/src/mod/capwap/capwap_actions_wtp.c index eda29105..b98cd49d 100644 --- a/src/mod/capwap/capwap_actions_wtp.c +++ b/src/mod/capwap/capwap_actions_wtp.c @@ -251,13 +251,13 @@ static cw_action_out_t actions_out[] = { } , - /* WTP MAC Type - Join Request */ + /* Session ID - Join Request */ { .msg_id = CW_MSG_JOIN_REQUEST, - .elem_id = CW_ELEM_WTP_MAC_TYPE, - .item_id = CW_ITEM_WTP_MAC_TYPE, + .elem_id = CW_ELEM_SESSION_ID, + .item_id = CW_ITEM_SESSION_ID, .out = cw_out_generic, - .get = cw_out_get_local, + .get = cw_out_get_session_id, .mand = 1 } , @@ -273,17 +273,42 @@ static cw_action_out_t actions_out[] = { } , - /* Session ID - Join Request */ + + /* WTP MAC Type - Join Request */ { .msg_id = CW_MSG_JOIN_REQUEST, - .elem_id = CW_ELEM_SESSION_ID, - .item_id = CW_ITEM_SESSION_ID, + .elem_id = CW_ELEM_WTP_MAC_TYPE, + .item_id = CW_ITEM_WTP_MAC_TYPE, .out = cw_out_generic, - .get = cw_out_get_session_id, + .get = cw_out_get_local, .mand = 1 } , + /* ECN Support - Join Request */ + { + .msg_id = CW_MSG_JOIN_REQUEST, + .elem_id = CW_ELEM_ECN_SUPPORT, + .item_id = CW_ITEM_ECN_SUPPORT, + .out = cw_out_generic, + .get = cw_out_get_config, + .mand = 1 + } + , + + /* CAPWAP Local IP Address - Join Request */ + { + .msg_id = CW_MSG_JOIN_REQUEST, + .item_id = CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS, + .out = cw_out_capwap_local_ip_address, + // .get = cw_out_get_config, + .mand = 1 + } + , + + + + /* --------------------------------------------------------------- * Configuration Status Request - Out diff --git a/src/wtp/cfg.json b/src/wtp/cfg.json index ebdc5c8c..a64410a1 100644 --- a/src/wtp/cfg.json +++ b/src/wtp/cfg.json @@ -1,4 +1,5 @@ { + "ecn_support":"0", "location_data":"Superposition", "wtp_bootloader_version":"11591,W-FAT-BL-0.1", "wtp_hardware_version":"11591,0.1", diff --git a/src/wtp/join.c b/src/wtp/join.c index 3b6136db..d3ebf32b 100644 --- a/src/wtp/join.c +++ b/src/wtp/join.c @@ -111,7 +111,10 @@ int run_join_d(struct sockaddr *sa) conn->sock = sockfd; sock_copyaddr(&conn->addr, sa); -/* rc = connect(sockfd, (struct sockaddr *) sa, + + /* we call connect to bind this socket to a local IP address, + * which we can later obtain by getsockname */ + rc = connect(sockfd, (struct sockaddr *) sa, sock_addrlen((struct sockaddr *) sa)); if (rc < 0) { @@ -120,7 +123,7 @@ int run_join_d(struct sockaddr *sa) close(sockfd); return -1; } -*/ + cw_dbg(DBG_DTLS, "Establishing DTLS session with %s", sock_addr2str(sa)); diff --git a/src/wtp/setup_conf.c b/src/wtp/setup_conf.c index da04a2e4..520c5fb5 100644 --- a/src/wtp/setup_conf.c +++ b/src/wtp/setup_conf.c @@ -59,6 +59,7 @@ int setup_conf(struct conn * conn) + mbag_set_byte(conn->config,CW_ITEM_ECN_SUPPORT,get_ecn_support()); return 0; diff --git a/src/wtp/wtp_interface.c b/src/wtp/wtp_interface.c index 2f1e020e..29f8631f 100644 --- a/src/wtp/wtp_interface.c +++ b/src/wtp/wtp_interface.c @@ -21,3 +21,7 @@ bstr_t get_base_rmac() } +uint8_t get_ecn_support() +{ + return 0; +} diff --git a/src/wtp/wtp_interface.h b/src/wtp/wtp_interface.h index ba7b5df8..81817215 100644 --- a/src/wtp/wtp_interface.h +++ b/src/wtp/wtp_interface.h @@ -1,11 +1,12 @@ #ifndef __WTP_INTERFACE_H #define __WTP_INTERFACE_H - +#include #include "cw/bstr.h" extern struct conn * get_conn(); extern bstr_t get_base_rmac(); +uint8_t get_ecn_support(); #endif