From a3f5796a8f3cc9b069588d700756c109abc715a0 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 27 Mar 2016 02:40:36 +0000 Subject: [PATCH] callback handlers for msg start and end added. FossilOrigin-Name: b8b0536080e3e4c2d9cc20b41c75484ec0ba94bf0e870a91b6cd3be2dc67cfd7 --- src/cw/conn.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/cw/conn.h b/src/cw/conn.h index 0dacc31d..eef3755e 100644 --- a/src/cw/conn.h +++ b/src/cw/conn.h @@ -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 */