aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/bsc_nat.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-01 08:21:33 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:10 +0800
commita0df82d48d5d79d5851a0910e237fcfb892e148f (patch)
tree4e8d420fb405c5db7003cb37a08a73bff575a686 /openbsc/include/openbsc/bsc_nat.h
parent76c83548635fd0c30c16d5c1b38e5ed946720684 (diff)
nat: Handle CRCX/MDCX/DLCX at the nat
* Forward a rewritten msg to the BSS. We change the IP and port to point to the NAT instead of the core network. We also keep track of the BSC and the transacition id. * Handle the case where we have not found a SCCP connection and need to send a response ourselves.
Diffstat (limited to 'openbsc/include/openbsc/bsc_nat.h')
-rw-r--r--openbsc/include/openbsc/bsc_nat.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 068ef68fb..e41849652 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -127,6 +127,16 @@ struct bsc_config {
};
/**
+ * BSCs point of view of endpoints
+ */
+struct bsc_endpoint {
+ /* the pending transaction id */
+ char *transaction_id;
+ /* the bsc we are talking to */
+ struct bsc_connection *bsc;
+};
+
+/**
* the structure of the "nat" network
*/
struct bsc_nat {
@@ -143,6 +153,9 @@ struct bsc_nat {
/* MGCP config */
struct mgcp_config *mgcp_cfg;
struct write_queue mgcp_queue;
+ struct msgb *mgcp_msg;
+
+ struct bsc_endpoint *bsc_endpoints;
};
/* create and init the structures */
@@ -177,9 +190,11 @@ struct sccp_connections *patch_sccp_src_ref_to_msc(struct msgb *, struct bsc_nat
/**
* MGCP/Audio handling
*/
+int bsc_write_mgcp_msg(struct bsc_connection *bsc, struct msgb *msg);
int bsc_write_mgcp(struct bsc_connection *bsc, const u_int8_t *data, unsigned int length);
int bsc_mgcp_assign(struct sccp_connections *, struct msgb *msg);
void bsc_mgcp_clear(struct sccp_connections *);
+void bsc_mgcp_free_endpoint(struct bsc_nat *nat, int);
void bsc_mgcp_free_endpoints(struct bsc_nat *nat);
int bsc_mgcp_init(struct bsc_nat *nat);