From af3fed9213666c8fa68ba3a153aa17577df97649 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 23 Jun 2011 20:42:19 +0200 Subject: ipa: add ipa_*_send() to transmit messages This patch adds ipa_*_send() functions to transmit messages using the new A-bis over IP infrastructure. This patch completes the transmission path support for the A-bis over IP infrastructure. --- src/input/ipa.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/input/ipa.c b/src/input/ipa.c index 6a2022e..0cd2540 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -199,6 +199,7 @@ ipa_client_link_create(void *ctx, struct e1inp_line *line, ipa_link->cb = cb; ipa_link->line = line; ipa_link->data = data; + INIT_LLIST_HEAD(&ipa_link->tx_queue); return ipa_link; } @@ -242,6 +243,12 @@ static void ipa_link_timer_cb(void *data) } } +void ipa_client_link_send(struct ipa_client_link *link, struct msgb *msg) +{ + msgb_enqueue(&link->tx_queue, msg); + link->ofd.when |= BSC_FD_WRITE; +} + int ipa_server_fd_cb(struct osmo_fd *ofd, unsigned int what) { int ret; @@ -401,6 +408,8 @@ ipa_server_peer_create(void *ctx, struct ipa_server_link *link, int fd, peer->ofd.when = BSC_FD_READ; peer->cb = cb; peer->data = data; + INIT_LLIST_HEAD(&peer->tx_queue); + if (osmo_fd_register(&peer->ofd) < 0) { LOGP(DINP, LOGL_ERROR, "could not register FD\n"); talloc_free(peer); @@ -415,3 +424,9 @@ void ipa_server_peer_destroy(struct ipa_server_peer *peer) osmo_fd_unregister(&peer->ofd); talloc_free(peer); } + +void ipa_server_peer_send(struct ipa_server_peer *peer, struct msgb *msg) +{ + msgb_enqueue(&peer->tx_queue, msg); + peer->ofd.when |= BSC_FD_WRITE; +} -- cgit v1.2.3-55-g7522