1 /**
2  * @file bfcp.h Internal interface to Binary Floor Control Protocol (BFCP)
3  *
4  * Copyright (C) 2010 Creytiv.com
5  */
6 
7 struct bfcp_strans {
8 	enum bfcp_prim prim;
9 	uint32_t confid;
10 	uint16_t tid;
11 	uint16_t userid;
12 };
13 
14 struct bfcp_conn {
15 	struct bfcp_strans st;
16 	struct list ctransl;
17 	struct tmr tmr1;
18 	struct tmr tmr2;
19 	struct udp_sock *us;
20 	struct mbuf *mb;
21 	bfcp_recv_h *recvh;
22 	void *arg;
23 	enum bfcp_transp tp;
24 	unsigned txc;
25 	uint16_t tid;
26 };
27 
28 
29 /* attributes */
30 int bfcp_attrs_decode(struct list *attrl, struct mbuf *mb, size_t len,
31 		      struct bfcp_unknown_attr *uma);
32 struct bfcp_attr *bfcp_attrs_find(const struct list *attrl,
33 				  enum bfcp_attrib type);
34 struct bfcp_attr *bfcp_attrs_apply(const struct list *attrl,
35 				   bfcp_attr_h *h, void *arg);
36 int bfcp_attrs_print(struct re_printf *pf, const struct list *attrl,
37 		     unsigned level);
38 
39 
40 /* connection */
41 int bfcp_send(struct bfcp_conn *bc, const struct sa *dst, struct mbuf *mb);
42 
43 
44 /* request */
45 bool bfcp_handle_response(struct bfcp_conn *bc, const struct bfcp_msg *msg);
46 int  bfcp_vrequest(struct bfcp_conn *bc, const struct sa *dst, uint8_t ver,
47 		   enum bfcp_prim prim, uint32_t confid, uint16_t userid,
48 		   bfcp_resp_h *resph, void *arg, unsigned attrc, va_list *ap);
49