From a3065f0366667ca933163a9abff0b1b4ca7ea1af Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 26 Apr 2015 14:08:44 +0000 Subject: [PATCH] More CAPWAP sctrictness. FossilOrigin-Name: d7497af8567a692b4d9135001237330244621652c664f18be1c3017f898311ec --- src/ac/wtpman.c | 17 ++++++++++++----- src/capwap/capwap_80211_actions_ac.c | 14 ++++++++++++++ src/capwap/capwap_actions_ac.c | 14 +++++++------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/ac/wtpman.c b/src/ac/wtpman.c index c689c6d5..f08f292c 100644 --- a/src/ac/wtpman.c +++ b/src/ac/wtpman.c @@ -222,6 +222,17 @@ static int wtpman_establish_dtls(void *arg) static int wtpman_join(void *arg, time_t timer) { struct wtpman *wtpman = (struct wtpman *) arg; + struct conn * conn = wtpman->conn; + + wtpman->conn->outgoing = mbag_create(); + wtpman->conn->incomming = mbag_create(); + wtpman->conn->local = ac_config; + + mbag_set_str(conn->local,CW_ITEM_AC_NAME,conf_acname); + + + + extern cw_actionlist_in_t the_tree; wtpman->conn->actions = &capwap_actions; @@ -232,15 +243,10 @@ static int wtpman_join(void *arg, time_t timer) // wtpman->conn->itemstore = mbag_create(); - wtpman->conn->outgoing = mbag_create(); - wtpman->conn->incomming = mbag_create(); - wtpman->conn->local = ac_config; - struct conn * conn = wtpman->conn; -conn->strict_capwap=1; cw_dbg(DBG_INFO,"Join State - %s",sock_addr2str(&conn->addr)); @@ -478,6 +484,7 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr) wtpman->conn->strict_capwap = conf_strict_capwap; wtpman->conn->strict_hdr = conf_strict_headers; + wtpman->conn->radios=mbag_create(); return wtpman; } diff --git a/src/capwap/capwap_80211_actions_ac.c b/src/capwap/capwap_80211_actions_ac.c index 8684950d..0fa6059a 100644 --- a/src/capwap/capwap_80211_actions_ac.c +++ b/src/capwap/capwap_80211_actions_ac.c @@ -19,6 +19,14 @@ cw_action_in_t capwap_80211_actions_ac_in[] = { {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_REQUEST, CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1} , + /* -------------------------------------------------------- + * Discovery Resquest + */ + + {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, + CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1} + , + {0, 0, 0} @@ -30,6 +38,12 @@ cw_action_out_t capwap_80211_actions_ac_out[]={ {CW_MSG_DISCOVERY_RESPONSE, CW_ELEM80211_WTP_RADIO_INFORMATION, 0, CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1} , + + /* Radio Infos */ + {CW_MSG_JOIN_RESPONSE, CW_ELEM80211_WTP_RADIO_INFORMATION, 0, + CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1} + , + {0,0,0} }; diff --git a/src/capwap/capwap_actions_ac.c b/src/capwap/capwap_actions_ac.c index eb67b998..00fc4bd2 100644 --- a/src/capwap/capwap_actions_ac.c +++ b/src/capwap/capwap_actions_ac.c @@ -72,22 +72,22 @@ cw_action_in_t capwap_actions_ac_in[] = { 0, cw_in_check_join_req} , - /* Element Location Data */ + /* Location Data */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_LOCATION_DATA, 1} , - /* Element WTP Board Data */ + /* WTP Board Data */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_WTP_BOARD_DATA, 1} , - /* Element WTP Board Data */ + /* WTP Board Descriptor */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_WTP_DESCRIPTOR, 1} , - /* Element WTP Board Data */ + /* Element WTP Name */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_WTP_NAME, 1} , - /* Element WTP Board Data */ + /* Element Session ID */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_SESSION_ID, 1} , - /* Element WTP Board Data */ + /* Element WTP Frame Tunnel Mode */ {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, CW_ACTION_IN_WTP_FRAME_TUNNEL_MODE, 1} , /* Element WTP MAC Type */ @@ -208,7 +208,7 @@ cw_action_out_t capwap_actions_ac_out[] = { /* AC Name */ {CW_MSG_JOIN_RESPONSE, CW_ITEM_AC_NAME, 0, - CW_ELEM_AC_NAME, NULL, cw_out_generic, cw_out_get_outgoing} + CW_ELEM_AC_NAME, NULL, cw_out_generic, cw_out_get_local} ,