aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 09:05:05 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-06 09:07:07 +0800
commit5b2726e6b5eae3402f08bb5effad65226df93b7b (patch)
treea215dcbb0306c7bcd9ac009693b71812a135f907 /openbsc
parentb84b5f61ac36b6814fdc385d2b1eb8fc32659372 (diff)
nat: Keep the state (CRCX,MDCX,DLCX) of the operation..
This will allow to have additional debug information and to use the state inside the forwarding code.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h2
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 6ca22373e..5f746f237 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -121,6 +121,8 @@ struct bsc_config {
* BSCs point of view of endpoints
*/
struct bsc_endpoint {
+ /* the operation that is carried out */
+ int transaction_state;
/* the pending transaction id */
char *transaction_id;
/* the bsc we are talking to */
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 17c4bbfa5..6644c5e63 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -94,6 +94,7 @@ static void bsc_mgcp_free_endpoint(struct bsc_nat *nat, int i)
nat->bsc_endpoints[i].transaction_id = NULL;
}
+ nat->bsc_endpoints[i].transaction_state = 0;
nat->bsc_endpoints[i].bsc = NULL;
}
@@ -202,6 +203,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c
endpoint, bsc_endp->transaction_id);
talloc_free(bsc_endp->transaction_id);
bsc_endp->transaction_id = NULL;
+ bsc_endp->transaction_state = 0;
}
bsc_endp->bsc = NULL;
@@ -237,6 +239,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c
bsc_endp->transaction_id = talloc_strdup(nat, transaction_id);
+ bsc_endp->transaction_state = state;
bsc_endp->bsc = sccp->bsc;
/* we need to update some bits */
@@ -325,6 +328,7 @@ void bsc_mgcp_forward(struct bsc_connection *bsc, struct msgb *msg)
/* free some stuff */
talloc_free(bsc_endp->transaction_id);
bsc_endp->transaction_id = NULL;
+ bsc_endp->transaction_state = 0;
/*
* rewrite the information. In case the endpoint was deleted