summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-06-23 20:42:19 +0200
committerPablo Neira Ayuso2011-06-23 22:15:22 +0200
commitaf3fed9213666c8fa68ba3a153aa17577df97649 (patch)
tree67fd199d17674d99b80851cc3a8e0cd79a1ddd03 /src
parentipa: add ipa_server_peer infrastructure (diff)
downloadlibosmo-abis-af3fed9213666c8fa68ba3a153aa17577df97649.tar.gz
libosmo-abis-af3fed9213666c8fa68ba3a153aa17577df97649.tar.xz
libosmo-abis-af3fed9213666c8fa68ba3a153aa17577df97649.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/input/ipa.c15
1 files changed, 15 insertions, 0 deletions
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;
+}