diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-15 18:47:29 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-15 20:24:08 +0800 |
commit | baf2abe4c4e31be9321d5e89a58bf87e3226e45e (patch) | |
tree | 6410406f4760a5a3b82785f152825a221444d773 /openbsc/include | |
parent | 6c0a04e19611448bf03ce2c90694ce8ad2cfb1d2 (diff) |
msc: Create a real interface for BSC MSC and start handling reconnects
Create a BSC<->MSC interface and use it for the BSC MSC IP and the
BSC NAT to reduce code duplication on handling reconnects to the MSC
and cleaning up the local state. The code is only partially tested
and will contain bugs. Currently both the BSC and the NAT will just
exit on connection loss and this way have the current behavior.
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/bsc_msc.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/bsc_msc.h b/openbsc/include/openbsc/bsc_msc.h index 49fe68cdc..29ce065d1 100644 --- a/openbsc/include/openbsc/bsc_msc.h +++ b/openbsc/include/openbsc/bsc_msc.h @@ -23,8 +23,24 @@ #ifndef BSC_MSC_H #define BSC_MSC_H -#include <osmocore/select.h> +#include <osmocore/write_queue.h> +#include <osmocore/timer.h> -int connect_to_msc(struct bsc_fd *fd, const char *ip, int port); +struct bsc_msc_connection { + struct write_queue write_queue; + int is_connected; + const char *ip; + int port; + + void (*connection_loss) (struct bsc_msc_connection *); + void (*connected) (struct bsc_msc_connection *); + struct timer_list reconnect_timer; +}; + +struct bsc_msc_connection *bsc_msc_create(const char *ip, int port); +int bsc_msc_connect(struct bsc_msc_connection *); +void bsc_msc_schedule_connect(struct bsc_msc_connection *); + +void bsc_msc_lost(struct bsc_msc_connection *); #endif |