aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/abis/ipa.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-06-23 14:07:47 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2011-06-23 14:07:47 +0200
commit6af9b61a48f39de7181c0c902e6351fc4929dab2 (patch)
tree2e3d7ab6a15b43918fe8788519dcf551df070fca /include/osmocom/abis/ipa.h
parente009f4a009e028fbd041e8731e75c4c39d52cdd1 (diff)
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/osmocom/abis/ipa.h')
-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,