Deleted cwmsg.h
This commit is contained in:
parent
6a64e28982
commit
3a8159320f
@ -25,20 +25,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
static int write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len)
|
||||
{
|
||||
if (handler->vendor)
|
||||
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
|
||||
|
||||
return len + cw_put_elem_hdr(dst, handler->id, len);
|
||||
}
|
||||
|
||||
static int header_len(struct cw_ElemHandler * handler)
|
||||
{
|
||||
return handler->vendor ? 10 : 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a message to a buffer
|
||||
* This functions assumes, that a message header is
|
||||
@ -190,13 +176,9 @@ void cw_conn_init(struct cw_Conn * conn)
|
||||
// conn->capwap_mode = 0;
|
||||
conn->strict_capwap=1;
|
||||
|
||||
|
||||
|
||||
conn->process_packet=conn_process_packet;
|
||||
conn->process_message=process_message;
|
||||
|
||||
conn->write_header = write_header;
|
||||
conn->header_len = header_len;
|
||||
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "fragman.h"
|
||||
#include "cwmsg.h"
|
||||
//#include "cwmsg.h"
|
||||
|
||||
|
||||
|
||||
@ -78,21 +78,6 @@ struct cw_Conn {
|
||||
mavl_t local_cfg;
|
||||
mavl_t global_cfg;
|
||||
|
||||
int (*write_header)(struct cw_ElemHandler * handler, uint8_t * dst, int len);
|
||||
int (*header_len)(struct cw_ElemHandler *handler);
|
||||
|
||||
/* mbag_t outgoing;
|
||||
mbag_t incomming;
|
||||
mbag_t remote;
|
||||
mbag_t local;
|
||||
|
||||
mbag_t radios;
|
||||
mbag_t radios_upd;
|
||||
mbag_t config;
|
||||
mbag_t config_upd;
|
||||
*/
|
||||
|
||||
/* uint8_t session_id[16];*/
|
||||
bstr16_t session_id;
|
||||
|
||||
|
||||
@ -114,7 +99,6 @@ struct cw_Conn {
|
||||
of the protocoll */
|
||||
|
||||
|
||||
struct cw_MsgSet * msgset;
|
||||
|
||||
|
||||
uint8_t capwap_prevstate;
|
||||
@ -136,8 +120,8 @@ struct cw_Conn {
|
||||
int last_message_id_received;
|
||||
|
||||
|
||||
struct cwmsg req_msg;
|
||||
struct cwmsg resp_msg;
|
||||
// struct cwmsg req_msg;
|
||||
// struct cwmsg resp_msg;
|
||||
|
||||
/** Buffer for outgoing request messages */
|
||||
uint8_t req_buffer[CONN_MAX_MSG_LENGTH];
|
||||
@ -235,19 +219,15 @@ struct cw_Conn {
|
||||
|
||||
|
||||
int detected;
|
||||
struct cw_MsgSet * msgset;
|
||||
void (*setup_complete)(struct cw_Conn *conn);
|
||||
|
||||
// void * mods;
|
||||
|
||||
|
||||
/*
|
||||
int (*msg_start)(struct cw_Conn*conn,struct cw_action_in *a,uint8_t*data,int len,struct sockaddr *from);
|
||||
int (*msg_end)(struct cw_Conn*conn,struct cw_action_in *a,uint8_t*elem,int len,struct sockaddr *from);
|
||||
|
||||
int (*elem_end)(struct cw_Conn*conn,struct cw_action_in *a,int afrc,uint8_t*elem,int len,struct sockaddr *from);
|
||||
|
||||
/*
|
||||
// void (*actions_registered)(struct cw_Conn*conn);
|
||||
*/
|
||||
*/
|
||||
|
||||
};
|
||||
typedef struct cw_Conn cw_Conn_t;
|
||||
@ -262,7 +242,7 @@ struct cw_Conn* cw_conn_create(int sock, struct sockaddr *addr, int qsize);
|
||||
struct cw_Conn* conn_create_noq(int sock, struct sockaddr *addr);
|
||||
|
||||
|
||||
extern int conn_send_cwmsg(struct cw_Conn*conn, struct cwmsg *cwmsg);
|
||||
//extern int conn_send_cwmsg(struct cw_Conn*conn, struct cwmsg *cwmsg);
|
||||
|
||||
/*
|
||||
//extern int conn_process_packet(struct cw_Conn*conn, uint8_t * packet, int len,
|
||||
@ -287,7 +267,7 @@ extern int conn_q_recv_packet_peek(struct cw_Conn*conn, uint8_t * buffer, int le
|
||||
extern int conn_recv_packet(struct cw_Conn*conn, uint8_t * buf, int len);
|
||||
extern int conn_recv_packet_peek(struct cw_Conn*conn, uint8_t * buf, int len);
|
||||
|
||||
extern int conn_send_response(struct cw_Conn*conn, struct cwmsg *cwmsg, int seqnum);
|
||||
//extern int conn_send_response(struct cw_Conn*conn, struct cwmsg *cwmsg, int seqnum);
|
||||
extern struct cwrmsg *conn_get_response(struct cw_Conn*conn);
|
||||
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
This file is part of libcapwap.
|
||||
|
||||
libcapwap is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
libcapwap is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief conn_init
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "conn.h"
|
||||
#include "capwap.h"
|
||||
#include "cw.h"
|
||||
|
||||
/*
|
||||
static int write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len)
|
||||
{
|
||||
if (handler->vendor)
|
||||
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
|
||||
|
||||
return len + cw_put_elem_hdr(dst, handler->id, len);
|
||||
}
|
||||
|
||||
static int header_len(struct cw_ElemHandler * handler)
|
||||
{
|
||||
return handler->vendor ? 10 : 4;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Basic initialization of a conn object
|
||||
* @param conn conn object to initialize
|
||||
*/
|
||||
void conn_init(struct cw_Conn * conn)
|
||||
{
|
||||
memset(conn,0,sizeof(struct cw_Conn ));
|
||||
conn->retransmit_interval=CAPWAP_RETRANSMIT_INTERVAL;
|
||||
conn->max_retransmit=CAPWAP_MAX_RETRANSMIT;
|
||||
conn->wait_dtls=CAPWAP_WAIT_DTLS;
|
||||
conn->wait_join=CAPWAP_WAIT_JOIN;
|
||||
conn->mtu_discovery=1;
|
||||
// conn->capwap_mode = 0;
|
||||
conn->strict_capwap=1;
|
||||
|
||||
|
||||
|
||||
conn->process_packet=conn_process_packet;
|
||||
conn->process_message=process_message;
|
||||
/*
|
||||
conn->write_header = write_header;
|
||||
conn->header_len = header_len;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
@ -502,9 +502,9 @@ int process_message(struct cw_Conn *conn, uint8_t * rawmsg, int rawlen,
|
||||
|
||||
|
||||
if (cw_get_hdr_msg_type(conn->resp_buffer) - 1 != type) {
|
||||
cw_dbg(DBG_MSG_ERR,
|
||||
/* cw_dbg(DBG_MSG_ERR,
|
||||
"No cached response for retransmission, request seqnum=%d,in cache=%d",
|
||||
s2, conn->resp_msg.type);
|
||||
s2, conn->resp_msg.type);*/
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
#ifndef __CWMSG_H
|
||||
#define __CWMSG_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "radioinfo.h"
|
||||
|
||||
struct cwmsg{
|
||||
uint8_t * buffer;
|
||||
uint8_t * trnsprthdr;
|
||||
uint8_t * ctrlhdr;
|
||||
uint8_t * msgelems;
|
||||
int pos;
|
||||
int flags;
|
||||
int hlen;
|
||||
int rid;
|
||||
int seqnum;
|
||||
int type;
|
||||
int capwap_mode;
|
||||
};
|
||||
|
||||
struct conn;
|
||||
|
||||
/*
|
||||
extern void cwmsg_init(struct cwmsg * cwmsg, uint8_t *buffer, int type, int seqnum, struct radioinfo * radioinfo);
|
||||
//int cwmsg_send(struct cwmsg * cwmsg, int seqnum, int rid, struct conn * conn);
|
||||
//
|
||||
extern void cwmsg_addelem(struct cwmsg *msg,int type, const uint8_t *elem, int len);
|
||||
extern void cwmsg_vaddelem(struct cwmsg *msg,int type, ...);
|
||||
|
||||
//extern void cwmsg_addelem_ac_descriptor(struct cwmsg *msg,struct ac_info * acinfo,struct wtpinfo * wtpinfo);
|
||||
extern void cwmsg_addelem_ac_timestamp(struct cwmsg *msg);
|
||||
|
||||
|
||||
extern void cwmsg_init_echo_request(struct cwmsg * cwmsg,uint8_t *buffer,struct conn * conn, struct radioinfo * radioinfo);
|
||||
extern void cwmsg_addelem_mtu_discovery_padding(struct cwmsg * msg, struct conn* conn);
|
||||
extern void cwmsg_addelem_image_identifier(struct cwmsg *msg,uint32_t vendor_id,uint8_t *img, int len);
|
||||
|
||||
//extern void cwmsg_addelem_radio_operational_state(struct cwmsg * cwmsg, struct radioinfo * ri);
|
||||
|
||||
extern void cwmsg_addelem_vendor_cisco_mwar_addr(struct cwmsg *msg, struct conn *conn);
|
||||
*/
|
||||
|
||||
#endif
|
@ -86,7 +86,7 @@ struct cw_MsgDef{
|
||||
|
||||
|
||||
struct cw_ElemDef * elements;
|
||||
int (*preprocess)(struct conn * conn);
|
||||
int (*preprocess)(struct cw_Conn * conn);
|
||||
// int (*postprocess)(struct conn * conn);
|
||||
int (*postprocess)(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len);
|
||||
|
||||
@ -105,7 +105,7 @@ struct cw_MsgData{
|
||||
mlist_t elements_list;
|
||||
mlist_t mand_keys; /**< Keys of mandatory elements */
|
||||
|
||||
int (*preprocess)(struct conn * conn);
|
||||
int (*preprocess)(struct cw_Conn * conn);
|
||||
//int (*postprocess)(struct conn * conn);
|
||||
int (*postprocess)(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len);
|
||||
/* uint8_t next_state;*/
|
||||
|
Loading…
Reference in New Issue
Block a user