diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-13 12:38:35 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-13 12:38:35 +0800 |
commit | c9b7d74a087fa136629ab1419df5af199dce5ec2 (patch) | |
tree | 18cd351f5fa363b4950119ce98ef931a1b3fff06 /openbsc/src/chan_alloc.c | |
parent | 42a4e9a52de0576aa293f0a3fe085e91480d488d (diff) |
channel: Keep track on when a channel got allocated.
This can help to detect 'stale' channels in a network.
Diffstat (limited to 'openbsc/src/chan_alloc.c')
-rw-r--r-- | openbsc/src/chan_alloc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c index 623069ff0..c6d4e9bcc 100644 --- a/openbsc/src/chan_alloc.c +++ b/openbsc/src/chan_alloc.c @@ -25,6 +25,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <time.h> #include <openbsc/gsm_data.h> #include <openbsc/chan_alloc.h> @@ -287,6 +288,9 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, memset(&lchan->conn, 0, sizeof(lchan->conn)); lchan->conn.lchan = lchan; lchan->conn.bts = lchan->ts->trx->bts; + + /* set the alloc time */ + gettimeofday(&lchan->alloc_time, NULL); } else { struct challoc_signal_data sig; sig.bts = bts; |