Inital commit.

FossilOrigin-Name: d75cb1ce5121aed98afdd2dbd2548bea9c5875ddf5478776212db0f99da91b10
This commit is contained in:
7u83@mail.ru 2015-04-05 18:26:33 +00:00
parent ad25251444
commit a3f9db9d46
5 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include "action.h"
#include "capwap.h"
int cw_in_set_state_none(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len)
{
conn->capwap_state=CW_STATE_NONE;
return 1;
}
struct cw_item *cw_out_get_local(struct conn *conn, struct cw_action_out *a)
{
return cw_itemstore_get(conn->local, a->item_id);
}
struct cw_item *cw_out_get_remote(struct conn *conn, struct cw_action_out *a)
{
return cw_itemstore_get(conn->local, a->item_id);
}

9
src/capwap/cipwap.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef __CIPWAP_H
#define __CIPWAP_H
extern struct cw_str cipwap_strings_elem[];
#endif

View File

@ -0,0 +1,12 @@
#include "capwap.h"
#include "cipwap.h"
struct cw_str cipwap_strings_elem[] = {
{CW_ELEM_WTP_IPV4_IP_ADDRESS, "WTP IPv4 IP Address"},
{CW_ELEM_WTP_IPV6_IP_ADDRESS, "WTP IPv6 IP Address"},
{0,"Unknown Element"}
};

View File

@ -0,0 +1,40 @@
#include "cw_log.h"
#include "conn.h"
#include "itemstore.h"
#include "capwap_items.h"
#include "capwap.h"
int cw_out_cisco_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *dst)
{
uint8_t *d = dst+4;
struct cw_item * i;
i = cw_itemstore_get(conn->local,CW_ITEM_AC_STATUS);
if (!i) {
cw_log(LOG_ERR,"Can't send AC Descriptor, no AC Status Item found");
return 0;
}
d+=cw_put_ac_status(d ,(struct cw_ac_status*)(i->data));
i = cw_itemstore_get(conn->local,CW_ITEM_AC_SOFTWARE_VERSION);
if ( i ) {
d += cw_put_version(d,CW_SUBELEM_AC_SOFTWARE_VERSION,*((uint32_t*)(i->data)),i->data+4);
}
else {
cw_dbg(DBG_ELEM_ERR, "Can't send software version in AC descriptor, not set.");
}
int len = d-dst-4;
return len + cw_put_elem_hdr(dst,a->elem_id,len);
}

View File

@ -0,0 +1,10 @@
#include <time.h>
#include "capwap_cisco.h"
int cw_out_cisco_ap_timesync(struct conn *conn,struct cw_action_out * a,uint8_t *dst)
{
int l = cw_put_cisco_ap_timesync(dst+10,time(NULL),0);
return l + cw_put_elem_vendor_hdr(dst, a->vendor_id, a->elem_id, l);
}