callback handlers for msg start and end added.

FossilOrigin-Name: b8b0536080e3e4c2d9cc20b41c75484ec0ba94bf0e870a91b6cd3be2dc67cfd7
This commit is contained in:
7u83@mail.ru 2016-03-27 02:40:36 +00:00
parent 22f8a12a92
commit a3f5796a8f
1 changed files with 15 additions and 9 deletions

View File

@ -31,8 +31,6 @@
#include "fragman.h"
#include "cwmsg.h"
//#include "wtpinfo.h"
#include "action.h"
@ -42,6 +40,9 @@
#include "mbag.h"
#include "mod.h"
struct cw_action_in;
#define CONN_MAX_MSG_LENGTH 65536
/**
@ -120,11 +121,15 @@ struct conn {
int (*recv_packet) (struct conn *, uint8_t *, int);
int (*recv_packet_peek) (struct conn *, uint8_t *, int);
int (*send_packet) (struct conn *, const uint8_t *, int);
int (*send_data_packet) (struct conn *, const uint8_t *, int);
int (*readfrom) (struct conn *, uint8_t *, int, struct sockaddr_storage *);
int (*read) (struct conn *, uint8_t *, int);
int (*write) (struct conn *, const uint8_t *, int);
int (*write_data) (struct conn *, const uint8_t *, int);
/* optional packet queue */
uint8_t **q;
int qsize;
@ -154,7 +159,6 @@ struct conn {
uint8_t dtls_cookie[8];
int dtls_verify_peer;
int dtls_mtu;
uint8_t dtls_buffer[2048];
@ -182,11 +186,6 @@ struct conn {
int strict_capwap;
int strict_hdr;
/*
int (*request_handler) (void *);
void *request_handler_param;
*/
int (*process_packet)(struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
int (*process_message)(struct conn *conn, uint8_t * rawmsg, int rawlen,
@ -196,6 +195,13 @@ struct conn {
int detected;
void * mods;
int (*msg_start)(struct conn *conn,struct cw_action_in *a,uint8_t*data,int len,struct sockaddr *from);
int (*msg_end)(struct conn *conn,struct cw_action_in *a,uint8_t*elem,int len,struct sockaddr *from);
// void (*actions_registered)(struct conn *conn);
};
@ -286,4 +292,4 @@ int cw_read_from(struct conn * conn);
#endif /* __CONLIST_H */
#endif /* __CONN_H */