Code clean-up, more CAPWAP VM stuff.
FossilOrigin-Name: 46219e8d896fe0873fcbe0be66d57238e202c8d9628a6eca204126107b0f3356
This commit is contained in:
parent
5ef2f6739c
commit
e576d87990
@ -68,6 +68,7 @@ int readelem_discovery_type(struct conn *conn,struct cw_action * a,uint8_t *data
|
|||||||
cw_itemstore_set_byte(conn->itemstore,CW_ITEM_DISCOVERY_TYPE,*data);
|
cw_itemstore_set_byte(conn->itemstore,CW_ITEM_DISCOVERY_TYPE,*data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
int readelem_vendor_specific_payload(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
int readelem_vendor_specific_payload(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
||||||
{
|
{
|
||||||
cw_action_t as,*af;
|
cw_action_t as,*af;
|
||||||
@ -95,6 +96,8 @@ int readelem_vendor_specific_payload(struct conn *conn,struct cw_action * a,uint
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
int readelem_cisco_rad_name(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
int readelem_cisco_rad_name(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
||||||
{
|
{
|
||||||
@ -127,10 +130,10 @@ cw_action_t discovery_actions[] = {
|
|||||||
readelem_discovery_type,0 },
|
readelem_discovery_type,0 },
|
||||||
|
|
||||||
{ 0,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
{ 0,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_ELEM_VENDOR_SPECIFIC_PAYLOAD,
|
||||||
readelem_vendor_specific_payload,0 },
|
cw_in_vendor_specific_payload,0 },
|
||||||
|
|
||||||
{ CW_VENDOR_ID_CISCO,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_CISCO_RAD_NAME,
|
{ CW_VENDOR_ID_CISCO,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_CISCO_RAD_NAME,
|
||||||
readelem_cisco_rad_name,0 },
|
cw_in_wtp_name,0 },
|
||||||
|
|
||||||
|
|
||||||
{ 0,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_ELEM_WTP_BOARD_DATA},
|
{ 0,0,CW_STATE_DISCOVERY,CW_MSG_DISCOVERY_REQUEST, CW_ELEM_WTP_BOARD_DATA},
|
||||||
|
@ -166,6 +166,7 @@ CAPWAPOBJS= \
|
|||||||
capwap_state_strings.o \
|
capwap_state_strings.o \
|
||||||
itemstore.o \
|
itemstore.o \
|
||||||
cw_in_vendor_specific_payload.o \
|
cw_in_vendor_specific_payload.o \
|
||||||
|
cw_in_wtp_name.o \
|
||||||
|
|
||||||
|
|
||||||
#cw_ianavendoridtostr.o \
|
#cw_ianavendoridtostr.o \
|
||||||
|
@ -718,4 +718,9 @@ extern struct cw_strlist capwap_state_strings[];
|
|||||||
|
|
||||||
int cw_process_msg(struct conn * conn,uint8_t * rawmsg,int len);
|
int cw_process_msg(struct conn * conn,uint8_t * rawmsg,int len);
|
||||||
|
|
||||||
|
|
||||||
|
extern int cw_in_vendor_specific_payload(struct conn *conn,struct cw_action * a,uint8_t *data,int len);
|
||||||
|
extern int cw_in_wtp_name(struct conn *conn,struct cw_action * a,uint8_t *data,int len);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include <malloc.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "cw_action.h"
|
#include "cw_action.h"
|
||||||
|
@ -1,14 +1,27 @@
|
|||||||
|
#include "capwap.h"
|
||||||
|
#include "capwap_items.h"
|
||||||
|
#include "cw_log.h"
|
||||||
|
#include "itemstore.h"
|
||||||
|
|
||||||
|
|
||||||
int cw_in_wtp_name(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
int cw_in_wtp_name(struct conn *conn,struct cw_action * a,uint8_t *data,int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
printf("WTP Name: ");
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
printf("%c",data[i]);
|
printf("%c",data[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
if (len > 512){
|
||||||
|
cw_dbg(DBG_CW_RFC, "WTP Name too long, must not exceed 512, len is %d",len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cw_itemstore_set_strn(conn->itemstore,CW_ITEM_WTP_NAME,(const char*)data,len);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ int cw_itemstore_set_str(cw_itemstore_t s,uint32_t id,char *str)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cw_itemstore_set_strn(cw_itemstore_t s,uint32_t id,char *str,int n)
|
int cw_itemstore_set_strn(cw_itemstore_t s,uint32_t id,const char *str,int n)
|
||||||
{
|
{
|
||||||
struct cw_item *i = cw_item_create(s,id);
|
struct cw_item *i = cw_item_create(s,id);
|
||||||
if (!i)
|
if (!i)
|
||||||
|
@ -57,5 +57,7 @@ static inline struct cw_item * cw_itemstore_get(cw_itemstore_t s, uint32_t id)
|
|||||||
|
|
||||||
|
|
||||||
extern cw_itemstore_t cw_itemstore_create();
|
extern cw_itemstore_t cw_itemstore_create();
|
||||||
|
extern int cw_itemstore_set_strn(cw_itemstore_t s,uint32_t id,const char *str,int n);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user