diff --git a/include/re_bfcp.h b/include/re_bfcp.h index 35ed009..549eb8c 100644 --- a/include/re_bfcp.h +++ b/include/re_bfcp.h @@ -5,6 +5,12 @@ */ +/** BFCP Versions */ +enum { + BFCP_VER1 = 1, + BFCP_VER2 = 2, +}; + /** BFCP Primitives */ enum bfcp_prim { BFCP_FLOOR_REQUEST = 1, @@ -257,13 +263,13 @@ int bfcp_listen(struct bfcp_conn **bcp, enum bfcp_transp tp, struct sa *laddr, /* request */ -int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, bfcp_resp_h *resph, void *arg, unsigned attrc, ...); /* notify */ -int bfcp_notify(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_notify(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, unsigned attrc, ...); diff --git a/src/bfcp/bfcp.h b/src/bfcp/bfcp.h index dae0785..7e76e0d 100644 --- a/src/bfcp/bfcp.h +++ b/src/bfcp/bfcp.h @@ -4,12 +4,6 @@ * Copyright (C) 2010 Creytiv.com */ -enum { - BFCP_VER1 = 1, - BFCP_VER2 = 2, -}; - - struct bfcp_strans { enum bfcp_prim prim; uint32_t confid; @@ -49,6 +43,6 @@ int bfcp_send(struct bfcp_conn *bc, const struct sa *dst, struct mbuf *mb); /* request */ bool bfcp_handle_response(struct bfcp_conn *bc, const struct bfcp_msg *msg); -int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, bfcp_resp_h *resph, void *arg, unsigned attrc, va_list *ap); diff --git a/src/bfcp/reply.c b/src/bfcp/reply.c index fb73ad7..321429c 100644 --- a/src/bfcp/reply.c +++ b/src/bfcp/reply.c @@ -55,7 +55,7 @@ int bfcp_reply(struct bfcp_conn *bc, const struct bfcp_msg *req, return ENOMEM; va_start(ap, attrc); - err = bfcp_msg_vencode(bc->mb, BFCP_VER2, true, prim, req->confid, + err = bfcp_msg_vencode(bc->mb, req->ver, true, prim, req->confid, req->tid, req->userid, attrc, &ap); va_end(ap); diff --git a/src/bfcp/request.c b/src/bfcp/request.c index d2b5764..cfe066e 100644 --- a/src/bfcp/request.c +++ b/src/bfcp/request.c @@ -140,7 +140,7 @@ bool bfcp_handle_response(struct bfcp_conn *bc, const struct bfcp_msg *msg) } -int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, bfcp_resp_h *resph, void *arg, unsigned attrc, va_list *ap) { @@ -170,7 +170,7 @@ int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, goto out; } - err = bfcp_msg_vencode(ct->mb, BFCP_VER2, false, prim, confid, ct->tid, + err = bfcp_msg_vencode(ct->mb, ver, false, prim, confid, ct->tid, userid, attrc, ap); if (err) goto out; @@ -202,6 +202,7 @@ int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, * * @param bc BFCP connection * @param dst Destination address + * @param ver BFCP Version * @param prim BFCP Primitive * @param confid Conference ID * @param userid User ID @@ -211,7 +212,7 @@ int bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, * * @return 0 if success, otherwise errorcode */ -int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, bfcp_resp_h *resph, void *arg, unsigned attrc, ...) { @@ -219,7 +220,7 @@ int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, int err; va_start(ap, attrc); - err = bfcp_vrequest(bc, dst, prim, confid, userid, resph, arg, + err = bfcp_vrequest(bc, dst, ver, prim, confid, userid, resph, arg, attrc, &ap); va_end(ap); @@ -232,6 +233,7 @@ int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, * * @param bc BFCP connection * @param dst Destination address + * @param ver BFCP Version * @param prim BFCP Primitive * @param confid Conference ID * @param userid User ID @@ -239,7 +241,7 @@ int bfcp_request(struct bfcp_conn *bc, const struct sa *dst, * * @return 0 if success, otherwise errorcode */ -int bfcp_notify(struct bfcp_conn *bc, const struct sa *dst, +int bfcp_notify(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver, enum bfcp_prim prim, uint32_t confid, uint16_t userid, unsigned attrc, ...) { @@ -247,7 +249,7 @@ int bfcp_notify(struct bfcp_conn *bc, const struct sa *dst, int err; va_start(ap, attrc); - err = bfcp_vrequest(bc, dst, prim, confid, userid, NULL, NULL, + err = bfcp_vrequest(bc, dst, ver, prim, confid, userid, NULL, NULL, attrc, &ap); va_end(ap);