Capwap timers are send by the AC now.

FossilOrigin-Name: 1ed8f5d11629d5bff7118339de964f06840bcb85ef916c57c2a70658ad55cec8
This commit is contained in:
7u83@mail.ru 2016-03-15 18:23:41 +00:00
parent 5c192fbe27
commit 0b8f5bbace
6 changed files with 37 additions and 3 deletions

View File

@ -368,6 +368,8 @@ CW_MSG_MAXMSG = 26
#define CAPWAP_WAIT_DTLS 60
#define CAPWAP_WAIT_JOIN 60
#define CAPWAP_IDLE_TIMEOUT 300
#define CAPWAP_STATISTICS_TIMER 120

View File

@ -165,14 +165,14 @@ static inline int mbag_set_byte(mbag_t s, const char *id, uint8_t byte)
return 1;
}
static inline int mbag_set_word(mbag_t s, const char *id, uint16_t word)
static inline struct mbag_item * mbag_set_word(mbag_t s, const char *id, uint16_t word)
{
struct mbag_item *i = mbag_item_create(s, id);
if (!i)
return 0;
i->word = word;
i->type = &mbag_type_word;
return 1;
return i;
}

View File

@ -578,6 +578,18 @@ static cw_action_out_t actions_out[]={
}
,
{
.msg_id = CW_MSG_CONFIGURATION_STATUS_RESPONSE,
.elem_id = CW_ELEM_CAPWAP_TIMERS,
.item_id = CW_ITEM_CAPWAP_TIMERS,
.out = cw_out_generic,
.get = capwap_out_get_capwap_timers,
.mand = 1
}
,
/* Change State Event Response */

View File

@ -1,6 +1,7 @@
#include "cw/action.h"
#include "cw/capwap_items.h"
#include "cw/capwap.h"
struct mbag_item * capwap_out_get_idle_timeout(struct conn *conn,struct cw_action_out * a)
@ -9,5 +10,16 @@ struct mbag_item * capwap_out_get_idle_timeout(struct conn *conn,struct cw_actio
if (m)
return m;
return mbag_set_dword(conn->config,CW_ITEM_IDLE_TIMEOUT,300);
return mbag_set_dword(conn->config,CW_ITEM_IDLE_TIMEOUT,CAPWAP_IDLE_TIMEOUT);
}
struct mbag_item * capwap_out_get_capwap_timers(struct conn *conn,struct cw_action_out * a)
{
struct mbag_item * m = mbag_get(conn->config,CW_ITEM_CAPWAP_TIMERS);
if (m)
return m;
return mbag_set_word(conn->config,CW_ITEM_CAPWAP_TIMERS,CAPWAP_MAX_DISCOVERY_INTERVAL<<8 | CAPWAP_ECHO_INTERVAL);
}

View File

@ -42,6 +42,13 @@ int capwap_out_wtp_descriptor(struct conn *conn, struct cw_action_out *a, uint8_
i = mbag_get(mbag,CW_ITEM_WTP_HARDWARE_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_WTP_HARDWARE_VERSION,i->data);
if (bstrv_get_vendor_id(i->data)){
d += cw_put_dword(d, 0);
d += cw_put_word(d, CW_SUBELEM_WTP_HARDWARE_VERSION);
d += cw_put_word(d, bstrv_len(i->data));
d += cw_put_data(d, bstrv_data(i->data), bstrv_len(i->data));
}
}
else {
cw_log(LOG_ERR, "Can't send Hardware Version in WTP Descriptor, not set.");

View File

@ -20,5 +20,6 @@ extern struct mbag_item * capwap_out_get_session_id(struct conn *conn,struct cw_
extern struct mbag_item * capwap_out_get_idle_timeout(struct conn *conn,struct cw_action_out * a);
extern struct mbag_item * capwap_out_get_capwap_timers(struct conn *conn,struct cw_action_out * a);
#endif