diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-05 17:39:22 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-05 17:39:22 +0800 |
commit | 7faf692cb762a81a6ce63b674cc1711e4ea39b21 (patch) | |
tree | f8b1c3e1e71d42f8fb3f140772d805cad407b934 | |
parent | 0cf25d5154d7c25383257f933d975ad3db91a9ff (diff) |
bsc_msc_ip: Make the ping/pong timeouts configurable
Take the timeouts from the struct.
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 2 | ||||
-rw-r--r-- | openbsc/src/bsc_msc_ip.c | 4 | ||||
-rw-r--r-- | openbsc/src/gsm_data.c | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index b671688be..20ea235e9 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -673,6 +673,8 @@ struct gsm_network { char *bsc_token; char *msc_ip; int msc_port; + int ping_timeout; + int pong_timeout; }; #define SMS_HDR_SIZE 128 diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index 2e364ab0b..0bb2d42b8 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -906,10 +906,10 @@ static void msc_ping_timeout_cb(void *data) send_ping(); /* send another ping in 20 seconds */ - bsc_schedule_timer(&msc_ping_timeout, 20, 0); + bsc_schedule_timer(&msc_ping_timeout, bsc_gsmnet->ping_timeout, 0); /* also start a pong timer */ - bsc_schedule_timer(&msc_pong_timeout, 5, 0); + bsc_schedule_timer(&msc_pong_timeout, bsc_gsmnet->pong_timeout, 0); } static void msc_connection_connected(struct bsc_msc_connection *con) diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c index bf6c0cb3e..0ac7041be 100644 --- a/openbsc/src/gsm_data.c +++ b/openbsc/src/gsm_data.c @@ -300,6 +300,8 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c net->msc_ip = talloc_strdup(net, "127.0.0.1"); net->msc_port = 5000; + net->ping_timeout = 20; + net->pong_timeout = 5; return net; } |