mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-01 04:23:56 +00:00
channel: Keep track on when a channel got allocated.
This can help to detect 'stale' channels in a network.
This commit is contained in:
@@ -288,6 +288,9 @@ struct gsm_lchan {
|
|||||||
|
|
||||||
/* release reason */
|
/* release reason */
|
||||||
u_int8_t release_reason;
|
u_int8_t release_reason;
|
||||||
|
|
||||||
|
/* timestamp */
|
||||||
|
struct timeval alloc_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gsm_e1_subslot {
|
struct gsm_e1_subslot {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <openbsc/gsm_data.h>
|
#include <openbsc/gsm_data.h>
|
||||||
#include <openbsc/chan_alloc.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));
|
memset(&lchan->conn, 0, sizeof(lchan->conn));
|
||||||
lchan->conn.lchan = lchan;
|
lchan->conn.lchan = lchan;
|
||||||
lchan->conn.bts = lchan->ts->trx->bts;
|
lchan->conn.bts = lchan->ts->trx->bts;
|
||||||
|
|
||||||
|
/* set the alloc time */
|
||||||
|
gettimeofday(&lchan->alloc_time, NULL);
|
||||||
} else {
|
} else {
|
||||||
struct challoc_signal_data sig;
|
struct challoc_signal_data sig;
|
||||||
sig.bts = bts;
|
sig.bts = bts;
|
||||||
|
|||||||
Reference in New Issue
Block a user