3 #include <netinet/in.h>
4 #include <osmocom/core/select.h>
6 struct mcast_server_sock
{
7 struct osmo_fd osmo_fd
;
10 struct mcast_client_sock
{
11 struct osmo_fd osmo_fd
;
14 struct mcast_bidir_sock
{
15 struct mcast_server_sock
*tx_sock
;
16 struct mcast_client_sock
*rx_sock
;
19 struct mcast_bidir_sock
*mcast_bidir_sock_setup(
20 void *ctx
, char* tx_mcast_group
, int tx_mcast_port
,
21 char* rx_mcast_group
, int rx_mcast_port
, int loopback
,
22 int (*fd_rx_cb
)(struct osmo_fd
*ofd
, unsigned int what
),
25 struct mcast_server_sock
*mcast_server_sock_setup(void *ctx
,
29 struct mcast_client_sock
*mcast_client_sock_setup(
30 void *ctx
, char* mcast_group
, int mcast_port
,
31 int (*fd_rx_cb
)(struct osmo_fd
*ofd
, unsigned int what
),
33 int mcast_client_sock_rx(struct mcast_client_sock
*client_sock
, void* buf
,
35 int mcast_server_sock_tx(struct mcast_server_sock
*serv_sock
, void* data
,
37 int mcast_bidir_sock_tx(struct mcast_bidir_sock
*bidir_sock
, void* data
,
39 int mcast_bidir_sock_rx(struct mcast_bidir_sock
*bidir_sock
, void* buf
,
41 void mcast_client_sock_close(struct mcast_client_sock
* client_sock
);
42 void mcast_server_sock_close(struct mcast_server_sock
* server_sock
);
43 void mcast_bidir_sock_close(struct mcast_bidir_sock
* bidir_sock
);