diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-05 14:39:44 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-05 14:39:44 +0800 |
commit | 20ee312d5c127594966f6c55e760709c48a35faa (patch) | |
tree | 202a2fa8da9e149be4ed87d68275aca94e65d9fe /openbsc | |
parent | bec411b9db360e8cc8676aedf591e6564506c0ef (diff) |
nat: Create a method to determine if any MSC is connected.
In the future we will have multiple MSC connections so we will
need to figure if any of them is active.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/bsc_nat.h | 2 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 2 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_nat_utils.c | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index c5a9258f6..11d1f233d 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -338,4 +338,6 @@ void bsc_nat_acc_lst_delete(struct bsc_nat_acc_lst *lst); struct bsc_nat_acc_lst_entry *bsc_nat_acc_lst_entry_create(struct bsc_nat_acc_lst *); +int bsc_nat_msc_is_connected(struct bsc_nat *nat); + #endif diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 7c4a03d4b..ef3f9a965 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -883,7 +883,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what) /* * if we are not connected to a msc... just close the socket */ - if (!nat->msc_con->is_connected) { + if (!bsc_nat_msc_is_connected(nat)) { LOGP(DNAT, LOGL_NOTICE, "Disconnecting BSC due lack of MSC connection.\n"); close(fd); return 0; diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index a96cd019d..39de81738 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -23,6 +23,7 @@ */ #include <openbsc/bsc_nat.h> +#include <openbsc/bsc_msc.h> #include <openbsc/gsm_data.h> #include <openbsc/debug.h> #include <openbsc/ipaccess.h> @@ -508,3 +509,8 @@ struct bsc_nat_acc_lst_entry *bsc_nat_acc_lst_entry_create(struct bsc_nat_acc_ls llist_add_tail(&entry->list, &lst->fltr_list); return entry; } + +int bsc_nat_msc_is_connected(struct bsc_nat *nat) +{ + return nat->msc_con->is_connected; +} |