path: root/openbsc/include/openbsc
diff options
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-26 12:14:37 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-26 12:14:37 +0100
commit135a45c833d48e7ddcae973ac1d772ad277a56c1 (patch)
tree4a041a6a0511500cf3963cd3b01f2beef231cacf /openbsc/include/openbsc
parent1a3d9dbabf94f0138b5eee1f5bde8d9fe8a4bf96 (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/openbsc')
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 *);