summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso2011-06-23 14:07:47 +0200
committerPablo Neira Ayuso2011-06-23 14:07:47 +0200
commit6af9b61a48f39de7181c0c902e6351fc4929dab2 (patch)
tree2e3d7ab6a15b43918fe8788519dcf551df070fca /include
parentipa: extend ipa_*link_create() to take one generic data pointer (diff)
downloadlibosmo-abis-6af9b61a48f39de7181c0c902e6351fc4929dab2.tar.gz
libosmo-abis-6af9b61a48f39de7181c0c902e6351fc4929dab2.tar.xz
libosmo-abis-6af9b61a48f39de7181c0c902e6351fc4929dab2.zip
ipa: add ipa_server_peer infrastructure
This patch adds the ipa_server_peer abstraction which provide helpers for the accept path of ipa_server_link.
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/abis/ipa.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index 1ed4871..91afd01 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -8,7 +8,6 @@
struct ipa_server_link {
struct e1inp_line *line;
struct osmo_fd ofd;
- struct llist_head tx_queue;
const char *addr;
uint16_t port;
int (*accept_cb)(struct ipa_server_link *link, int fd);
@@ -21,6 +20,17 @@ void ipa_server_link_destroy(struct ipa_server_link *link);
int ipa_server_link_open(struct ipa_server_link *link);
void ipa_server_link_close(struct ipa_server_link *link);
+struct ipa_server_peer {
+ struct ipa_server_link *server;
+ struct osmo_fd ofd;
+ struct llist_head tx_queue;
+ int (*cb)(struct ipa_server_peer *peer, struct msgb *msg);
+ void *data;
+};
+
+struct ipa_server_peer *ipa_server_peer_create(void *ctx, struct ipa_server_link *link, int fd, int (*cb)(struct ipa_server_peer *peer, struct msgb *msg), void *data);
+void ipa_server_peer_destroy(struct ipa_server_peer *peer);
+
enum ipa_client_link_state {
IPA_CLIENT_LINK_STATE_NONE = 0,
IPA_CLIENT_LINK_STATE_CONNECTING = 1,