From 13fd5bdc274a4f1c88edcde6f7f8f3eed3f052e1 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 3 Apr 2018 16:11:14 +0000 Subject: [PATCH] More Join Message Elements added FossilOrigin-Name: 8948a1bf0e34873bbc9f9744e1bbb13049079b829a49944a1331d973c7350f01 --- src/ACConfig.mak | 2 +- src/ac/config.ktv | 2 +- src/ac/dataman.c | 2 +- src/cw/capwap.h | 4 ++-- src/cw/capwap_strings_elem.c | 2 +- src/cw/cw_inline.c | 3 ++- src/mod/capwap/capwap_actions_ac.c | 14 +++++++++++++- src/mod/capwap/capwap_actions_wtp.c | 2 +- src/mod/fortinet/fortinet_actions_ac.c | 2 +- src/wtp/config.ktv | 2 ++ 10 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/ACConfig.mak b/src/ACConfig.mak index 35f23b55..023c3f2a 100644 --- a/src/ACConfig.mak +++ b/src/ACConfig.mak @@ -3,6 +3,6 @@ include ../Config.mak # Define SSL Library: OPENSSL or GNUTLS # SSL_LIBRARY=OPENSSL -SSL_LIBRARY=OPENSSL +SSL_LIBRARY=GNUTLS diff --git a/src/ac/config.ktv b/src/ac/config.ktv index dc625dd4..48b98b24 100644 --- a/src/ac/config.ktv +++ b/src/ac/config.ktv @@ -15,7 +15,7 @@ ac-descriptor/hardware/vendor:Dword:1234567 ac-descriptor/hardware/version:Bstr16:"1.7.3" ac-name:Bstr16:"TubesAC" -capwap-control-ip-address/address.0:IPAddress:192.168.0.14 +capwap-control-ip-address/address.0:IPAddress:172.16.66.229 #capwap-control-ip-address/address.1:IPAddress:2a00:c1a0:48c6:4a00:9965:1b6e:aca3:1398 capwap-control-ip-address/wtps.0:Word:0 #capwap-control-ip-address/wtps.1:Word:11 diff --git a/src/ac/dataman.c b/src/ac/dataman.c index 2c93c1e0..22b07aff 100644 --- a/src/ac/dataman.c +++ b/src/ac/dataman.c @@ -104,7 +104,7 @@ int dataman_process_keep_alive(struct netconn *nc, uint8_t *rawmsg, int len) cw_foreach_elem(elem, elems_ptr, elems_len) { - if (cw_get_elem_id(elem) == CW_ELEM_SESSION_ID){ + if (cw_get_elem_id(elem) == CAPWAP_ELEM_SESSION_ID){ uint8_t sessid[16]; memset(sessid,0,16); diff --git a/src/cw/capwap.h b/src/cw/capwap.h index 163a8042..8427b7ca 100644 --- a/src/cw/capwap.h +++ b/src/cw/capwap.h @@ -248,7 +248,7 @@ #define CW_ELEM_RADIO_OPERATIONAL_STATE 32 #define CW_ELEM_RESULT_CODE 33 #define CW_ELEM_RETURNED_MESSAGE_ELEMENT 34 -#define CW_ELEM_SESSION_ID 35 +#define CAPWAP_ELEM_SESSION_ID 35 #define CW_ELEM_STATISTICS_TIMER 36 /** * The Vendor Specific Payload allows tronasport of @@ -357,7 +357,7 @@ //#define CWMSG_MAX_SIZE 2048 */ -#define CW_SESSION_ID_LEN 16 +#define CAPWAP_SESSION_ID_LEN 16 #define CAPWAP_MAX_AC_NAME_LEN 512 #define CAPWAP_MAX_WTP_NAME_LEN 512 #define CAPWAP_MAX_LOCATION_DATA_LEN 1024 diff --git a/src/cw/capwap_strings_elem.c b/src/cw/capwap_strings_elem.c index 16847ebf..e968a086 100644 --- a/src/cw/capwap_strings_elem.c +++ b/src/cw/capwap_strings_elem.c @@ -42,7 +42,7 @@ struct cw_StrListElem capwap_strings_elem[] = { {CW_ELEM_RADIO_OPERATIONAL_STATE, "Radio Operational State"}, {CW_ELEM_RESULT_CODE, "Result Code"}, {CW_ELEM_RETURNED_MESSAGE_ELEMENT, "Returned Message Element"}, - {CW_ELEM_SESSION_ID, "Session ID"}, + {CAPWAP_ELEM_SESSION_ID, "Session ID"}, {CW_ELEM_STATISTICS_TIMER, "Statistics Timer"}, {CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, "Vendor Specific Payload"}, {CAPWAP_ELEM_WTP_BOARD_DATA, "WTP Board Data"}, diff --git a/src/cw/cw_inline.c b/src/cw/cw_inline.c index 234c43d3..8cd41d72 100644 --- a/src/cw/cw_inline.c +++ b/src/cw/cw_inline.c @@ -199,9 +199,10 @@ int cw_put_elem_radio_administrative_state(uint8_t * dst, int rid, int state) { return 2+cw_put_elem_hdr(dst,CW_ELEM_RADIO_ADMINISTRATIVE_STATE,2); } + int cw_put_elem_session_id(uint8_t *dst, uint8_t *session_id, int len){ memcpy(dst+4,session_id,len); - return len+cw_put_elem_hdr(dst,CW_ELEM_SESSION_ID,len); + return len+cw_put_elem_hdr(dst,CAPWAP_ELEM_SESSION_ID,len); } diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c index 219f4bd7..0827fe33 100644 --- a/src/mod/capwap/capwap_actions_ac.c +++ b/src/mod/capwap/capwap_actions_ac.c @@ -179,6 +179,18 @@ static struct cw_ElemHandler handlers[] = { cw_out_generic /* put */ } , + { + "Session ID", /* name */ + CAPWAP_ELEM_SESSION_ID, /* Element ID */ + 0,0, /* Vendor / Proto */ + CAPWAP_SESSION_ID_LEN,CAPWAP_SESSION_ID_LEN, /* min/max length */ + CW_TYPE_BSTR16, /* type */ + "session-id", /* Key */ + cw_in_generic, /* get */ + cw_out_generic /* put */ + } + , + {0,0,0,0,0,0,0,0} @@ -216,7 +228,7 @@ static struct cw_ElemDef join_request_elements[] ={ {0,0,CAPWAP_ELEM_WTP_BOARD_DATA, 1, 0}, {0,0,CAPWAP_ELEM_WTP_DESCRIPTOR, 1, 0}, {0,0,CAPWAP_ELEM_WTP_NAME, 1, 0}, - /* Session ID */ + {0,0,CAPWAP_ELEM_SESSION_ID, 1, 0}, {0,0,CAPWAP_ELEM_WTP_FRAME_TUNNEL_MODE, 1, 0}, {0,0,CAPWAP_ELEM_WTP_MAC_TYPE, 1, 0}, diff --git a/src/mod/capwap/capwap_actions_wtp.c b/src/mod/capwap/capwap_actions_wtp.c index 585065cb..714a1313 100644 --- a/src/mod/capwap/capwap_actions_wtp.c +++ b/src/mod/capwap/capwap_actions_wtp.c @@ -555,7 +555,7 @@ static cw_action_out_t actions_out[] = { /* Session ID - Join Request */ { .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CW_ELEM_SESSION_ID, + .elem_id = CAPWAP_ELEM_SESSION_ID, .item_id = CW_ITEM_SESSION_ID, .out = cw_out_generic, .get = cw_out_get_session_id, diff --git a/src/mod/fortinet/fortinet_actions_ac.c b/src/mod/fortinet/fortinet_actions_ac.c index b4b3465a..1f333b93 100644 --- a/src/mod/fortinet/fortinet_actions_ac.c +++ b/src/mod/fortinet/fortinet_actions_ac.c @@ -94,7 +94,7 @@ static cw_action_in_t actions_in[] = { /* Cisco uses 4 byte session ids */ .capwap_state = CAPWAP_STATE_JOIN, .msg_id = CW_MSG_JOIN_REQUEST, - .elem_id = CW_ELEM_SESSION_ID, + .elem_id = CAPWAP_ELEM_SESSION_ID, .start = cw_in_generic2, .item_id = CW_ITEM_SESSION_ID, .mand = 1, diff --git a/src/wtp/config.ktv b/src/wtp/config.ktv index 54933435..e1493b8f 100644 --- a/src/wtp/config.ktv +++ b/src/wtp/config.ktv @@ -32,6 +32,8 @@ wtp-descriptor/max-radios:Byte:3 radio/0/wtp-radio-information:Dword:01 radio/1/wtp-radio-information:Dword:02 +radio/2/wtp-radio-information:Dword:03 + wtp-name:Bstr16:WFAT01