Inital commit.

FossilOrigin-Name: 1a715d985c04893cb1a005842d55345e11b33581b628dc436c049da29c281e18
This commit is contained in:
7u83@mail.ru 2015-04-13 08:58:28 +00:00
parent ae01999dcf
commit 29cc65862b
1 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,67 @@
#include "capwap.h"
#include "intavltree.h"
#include "dbg.h"
#include "log.h"
#include "capwap_items.h"
#include "bstr.h"
#include "sock.h" //tube
cw_get_wtp_name(struct conn *conn,struct sockaddr *addr)
{
}
int cw_set_capwap_mode(struct conn *conn,int mode)
{
cw_dbg(DBG_INFO,"Setting CAPWAP mode to %d for %s",mode,sock_addr2str(&conn->addr));
conn->capwap_mode_out=mode;
}
int cw_detect_capwap(struct conn *conn)
{
cw_itemstore_t is = conn->incomming;
cw_item_t * item = cw_itemstore_get(is,CW_ITEM_WTP_SOFTWARE_VERSION);
if (item) {
vendorstr_t s = item->data;
uint32_t v = vendorstr_get_vendor_id(s);
switch(v) {
case CW_VENDOR_ID_CISCO:
cw_set_capwap_mode(conn,CW_MODE_CISCO);
break;
default:
cw_set_capwap_mode(conn,CW_MODE_STD);
break;
}
}
return 0;
}
int cw_in_check_cipwap_join_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len,struct sockaddr *from)
{
int rc = cw_in_check_join_req(conn,a,data,len,from);
if ( rc==0 ) {
cw_detect_capwap(conn);
}
return rc;
}