conn_send_message basically replaced by cw_send_msg
FossilOrigin-Name: 27d87ea004c5844ab6c10612df780fcc3c7cd0c016b0a21794641f0076c8a9c4
This commit is contained in:
parent
9f41845f67
commit
10ed1c6c75
@ -3,6 +3,7 @@
|
||||
#include "dbg.h"
|
||||
|
||||
#define CW_MODE_ZYXEL 7
|
||||
extern cw_send_msg(struct conn * conn,uint8_t * msg);
|
||||
|
||||
int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
||||
{
|
||||
@ -14,6 +15,7 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
||||
|
||||
cw_dbg_msg(DBG_MSG_OUT, conn,rawmsg, packetlen,(struct sockaddr*)&conn->addr);
|
||||
|
||||
|
||||
/* Zyxel doesn't count msg element length from
|
||||
behind seqnum */
|
||||
if (conn->capwap_mode == CW_MODE_ZYXEL){
|
||||
@ -28,7 +30,31 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
|
||||
hlen = cw_get_hdr_hlen(rawmsg)*4;
|
||||
|
||||
mtu = conn->mtu;
|
||||
mtu = 800;
|
||||
mtu = 440;
|
||||
mtu = mtu >> 3;
|
||||
mtu = mtu << 3;
|
||||
|
||||
printf("packetlenX = %d (%d)\n",packetlen,hlen);
|
||||
int offset = cw_get_hdr_msg_offset(rawmsg);
|
||||
return cw_send_msg(conn,rawmsg+offset);
|
||||
|
||||
|
||||
if (packetlen>mtu){
|
||||
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_F,1);
|
||||
cw_set_dword(ptr+4, conn->fragid<<16 | fragoffset<<3 );
|
||||
cw_dbg_pkt(DBG_PKT_OUT,conn,ptr,mtu,(struct sockaddr*)&conn->addr);
|
||||
if (conn->write(conn,ptr,mtu)<0)
|
||||
return -1;
|
||||
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_M,0);
|
||||
cw_set_hdr_flags(ptr,CAPWAP_FLAG_HDR_W,0);
|
||||
|
||||
fragoffset+=(mtu-hlen)/8;
|
||||
hlen = 8;
|
||||
ptr += mtu-hlen;
|
||||
packetlen-=mtu-hlen;
|
||||
memcpy(ptr,rawmsg,hlen);
|
||||
|
||||
}
|
||||
|
||||
while (packetlen>mtu){
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user