ipaccess: Put our extensions to the protocol into the same enum
Rename NAT_IPAC_PROTO_MGCP to IPAC_PROTO_MGCP and place it in
the enum. We need to be prepared to change this number if IPA
is ever going to use it for something else.
diff --git a/openbsc/src/bsc/osmo_bsc_msc.c b/openbsc/src/bsc/osmo_bsc_msc.c
index 6644982..0bdb71f 100644
--- a/openbsc/src/bsc/osmo_bsc_msc.c
+++ b/openbsc/src/bsc/osmo_bsc_msc.c
@@ -68,7 +68,7 @@
}
mgcp->l2h = msgb_put(mgcp, ret);
- msc_queue_write(data->msc_con, mgcp, NAT_IPAC_PROTO_MGCP);
+ msc_queue_write(data->msc_con, mgcp, IPAC_PROTO_MGCP);
return 0;
}
@@ -225,7 +225,7 @@
}
} else if (hh->proto == IPAC_PROTO_SCCP) {
sccp_system_incoming(msg);
- } else if (hh->proto == NAT_IPAC_PROTO_MGCP) {
+ } else if (hh->proto == IPAC_PROTO_MGCP) {
mgcp_forward(data, msg);
}
diff --git a/openbsc/src/nat/bsc_filter.c b/openbsc/src/nat/bsc_filter.c
index e968fa2..9c09a83 100644
--- a/openbsc/src/nat/bsc_filter.c
+++ b/openbsc/src/nat/bsc_filter.c
@@ -70,7 +70,7 @@
{ IPAC_PROTO_SCCP, ALLOW_ANY, ALLOW_ANY, ALLOW_ANY, FILTER_TO_BOTH },
/* allow MGCP messages to both sides */
- { NAT_IPAC_PROTO_MGCP, ALLOW_ANY, ALLOW_ANY, ALLOW_ANY, FILTER_TO_BOTH },
+ { IPAC_PROTO_MGCP, ALLOW_ANY, ALLOW_ANY, ALLOW_ANY, FILTER_TO_BOTH },
};
struct bsc_nat_parsed *bsc_nat_parse(struct msgb *msg)
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index b84a262..750975f 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -23,6 +23,7 @@
#include <openbsc/bsc_nat_sccp.h>
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
+#include <openbsc/ipaccess.h>
#include <openbsc/mgcp.h>
#include <openbsc/mgcp_internal.h>
@@ -296,7 +297,7 @@
}
/* send the message and a fake MDCX to force sending of a dummy packet */
- bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP);
+ bsc_write(sccp->bsc, bsc_msg, IPAC_PROTO_MGCP);
bsc_mgcp_send_mdcx(sccp->bsc, sccp->bsc_endp, mgcp_endp);
return MGCP_POLICY_DEFER;
} else if (state == MGCP_ENDP_DLCX) {
@@ -305,7 +306,7 @@
bsc_mgcp_dlcx(sccp);
return MGCP_POLICY_CONT;
} else {
- bsc_write(sccp->bsc, bsc_msg, NAT_IPAC_PROTO_MGCP);
+ bsc_write(sccp->bsc, bsc_msg, IPAC_PROTO_MGCP);
return MGCP_POLICY_DEFER;
}
}
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index f5eca80..ded05c6 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -874,7 +874,7 @@
goto exit2;
break;
}
- } else if (parsed->ipa_proto == NAT_IPAC_PROTO_MGCP) {
+ } else if (parsed->ipa_proto == IPAC_PROTO_MGCP) {
bsc_mgcp_forward(bsc, msg);
goto exit2;
} else {
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 89d7d4b..4fda517 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -260,7 +260,7 @@
msg->l3h = msgb_put(msg, length);
memcpy(msg->l3h, data, length);
- return bsc_write(bsc, msg, NAT_IPAC_PROTO_MGCP);
+ return bsc_write(bsc, msg, IPAC_PROTO_MGCP);
}
int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int proto)