Pablo Neira Ayuso | 96e8128 | 2011-06-09 15:06:11 +0200 | [diff] [blame^] | 1 | #ifndef _OSMO_IPA_H_ |
| 2 | #define _OSMO_IPA_H_ |
| 3 | |
| 4 | #include <osmocom/core/linuxlist.h> |
| 5 | #include <osmocom/core/timer.h> |
| 6 | |
| 7 | enum 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 | |
| 14 | struct 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 | |
| 24 | struct ipa_link *ipa_client_link_create(void *ctx); |
| 25 | void ipa_client_link_destroy(struct ipa_link *link); |
| 26 | |
| 27 | int ipa_client_link_open(struct ipa_link *link); |
| 28 | void ipa_client_link_close(struct ipa_link *link); |
| 29 | |
| 30 | int ipa_msg_recv(int fd, struct msgb **rmsg); |
| 31 | |
| 32 | #endif |