From 6af9b61a48f39de7181c0c902e6351fc4929dab2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 23 Jun 2011 14:07:47 +0200 Subject: 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. --- include/osmocom/abis/ipa.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/osmocom/abis/ipa.h') 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, -- cgit v1.2.3-55-g7522