diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-12 00:33:38 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-12 00:33:38 +0800 |
commit | 9c9ef7796aa6848529a7f2c06928f5efc46b07ed (patch) | |
tree | 2aa67d31c23a1319e3fd1ef9ca4b70fa9faab1cf /openbsc/src/nat | |
parent | 49fcc8fc90e3a3608a44b77b2619bb275a4d559b (diff) |
nat: Store the creation time of a sccp connection.
Generate it when creating the connection but also when
reusing an existing connection.
Diffstat (limited to 'openbsc/src/nat')
-rw-r--r-- | openbsc/src/nat/bsc_sccp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_sccp.c b/openbsc/src/nat/bsc_sccp.c index ebe108604..f9ddd64fb 100644 --- a/openbsc/src/nat/bsc_sccp.c +++ b/openbsc/src/nat/bsc_sccp.c @@ -28,6 +28,7 @@ #include <osmocore/talloc.h> #include <string.h> +#include <time.h> static int equal(struct sccp_source_reference *ref1, struct sccp_source_reference *ref2) { @@ -101,6 +102,7 @@ int create_sccp_src_ref(struct bsc_connection *bsc, struct msgb *msg, struct bsc talloc_free(conn); return -1; } else { + clock_gettime(CLOCK_MONOTONIC, &conn->creation_time); bsc_mgcp_dlcx(conn); return 0; } @@ -114,6 +116,7 @@ int create_sccp_src_ref(struct bsc_connection *bsc, struct msgb *msg, struct bsc } conn->bsc = bsc; + clock_gettime(CLOCK_MONOTONIC, &conn->creation_time); conn->real_ref = *parsed->src_local_ref; if (assign_src_local_reference(&conn->patched_ref, bsc->nat) != 0) { LOGP(DNAT, LOGL_ERROR, "Failed to assign a ref.\n"); |