blob: de1d70f1cd8dac347d68726d3835c6a6e587ac89 [file] [log] [blame]
Pablo Neira Ayuso96e81282011-06-09 15:06:11 +02001#ifndef _OSMO_IPA_H_
2#define _OSMO_IPA_H_
3
4#include <osmocom/core/linuxlist.h>
5#include <osmocom/core/timer.h>
6
7enum ipa_link_state {
8 IPA_LINK_STATE_NONE = 0,
9 IPA_LINK_STATE_CONNECTING = 1,
10 IPA_LINK_STATE_CONNECTED = 2,
11 IPA_LINK_STATE_MAX
12};
13
14struct ipa_link {
15 struct e1inp_line *line;
16 struct osmo_fd ofd;
17 struct llist_head tx_queue;
18 struct osmo_timer_list timer;
19 enum ipa_link_state state;
20 struct sockaddr_in addr;
21 int (*process)(struct ipa_link *link, struct msgb *msg);
22};
23
24struct ipa_link *ipa_client_link_create(void *ctx);
25void ipa_client_link_destroy(struct ipa_link *link);
26
27int ipa_client_link_open(struct ipa_link *link);
28void ipa_client_link_close(struct ipa_link *link);
29
30int ipa_msg_recv(int fd, struct msgb **rmsg);
31
32#endif