aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-virtual/osmo_mcast_sock.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-virtual/osmo_mcast_sock.h')
-rw-r--r--src/osmo-bts-virtual/osmo_mcast_sock.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/osmo-bts-virtual/osmo_mcast_sock.h b/src/osmo-bts-virtual/osmo_mcast_sock.h
index aa2013c6..5f68415b 100644
--- a/src/osmo-bts-virtual/osmo_mcast_sock.h
+++ b/src/osmo-bts-virtual/osmo_mcast_sock.h
@@ -4,26 +4,20 @@
#include <stdint.h>
#include <netinet/in.h>
#include <osmocom/core/select.h>
+#include <osmocom/core/osmo_io.h>
struct mcast_bidir_sock {
- struct osmo_fd tx_ofd;
- struct osmo_fd rx_ofd;
+ struct osmo_io_fd *tx_iofd;
+ struct osmo_io_fd *rx_iofd;
+ void (*read_cb)(int rc, struct msgb *msg, void *data);
+ void *data;
};
-struct mcast_bidir_sock *mcast_bidir_sock_setup(void *ctx,
- const char *tx_mcast_group, uint16_t tx_mcast_port,
- const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback,
- int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what),
- void *osmo_fd_data);
+struct mcast_bidir_sock *
+mcast_bidir_sock_setup(void *ctx, const char *tx_mcast_group, uint16_t tx_mcast_port,
+ const char *rx_mcast_group, uint16_t rx_mcast_port, bool loopback,
+ void (*read_cb)(int rc, struct msgb *msg, void *data),
+ void *data);
-int mcast_server_sock_setup(struct osmo_fd *ofd, const char *tx_mcast_group,
- uint16_t tx_mcast_port, bool loopback);
-
-int mcast_client_sock_setup(struct osmo_fd *ofd, const char *mcast_group, uint16_t mcast_port,
- int (*fd_rx_cb)(struct osmo_fd *ofd, unsigned int what),
- void *osmo_fd_data);
-
-int mcast_bidir_sock_tx(struct mcast_bidir_sock *bidir_sock, const uint8_t *data, unsigned int data_len);
-int mcast_bidir_sock_rx(struct mcast_bidir_sock *bidir_sock, uint8_t *buf, unsigned int buf_len);
+int mcast_bidir_sock_tx_msg(struct mcast_bidir_sock *bidir_sock, struct msgb *msg);
void mcast_bidir_sock_close(struct mcast_bidir_sock* bidir_sock);
-