nat: Fix compilation with nat not being enabled.

common_vty.c was including bsc_nat.h which tried to
get the sccp/sccp_types.h which is not required to be
installed. Move all structs using/embedding SCCP structures
into the bsc_nat_sccp.h and include. This should fix
the compilation.
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index e55a83c..234a47c 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -10,7 +10,7 @@
 		crc24.h gprs_bssgp.h gprs_llc.h gprs_ns.h gprs_gmm.h \
 		gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
 		gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
-		osmo_bsc_rf.h osmo_bsc.h network_listen.h
+		osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h
 
 openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h
 openbscdir = $(includedir)/openbsc
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 32628d6..140fa68 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -25,7 +25,6 @@
 #include "mgcp.h"
 
 #include <sys/types.h>
-#include <sccp/sccp_types.h>
 
 #include <osmocore/select.h>
 #include <osmocore/msgb.h>
@@ -41,6 +40,8 @@
 
 #define NAT_IPAC_PROTO_MGCP	0xfc
 
+struct sccp_connections;
+struct bsc_nat_parsed;
 struct bsc_nat;
 
 enum {
@@ -53,39 +54,6 @@
 };
 
 /*
- * For the NAT we will need to analyze and later patch
- * the received message. This would require us to parse
- * the IPA and SCCP header twice. Instead of doing this
- * we will have one analyze structure and have the patching
- * and filter operate on the same structure.
- */
-struct bsc_nat_parsed {
-	/* ip access prototype */
-	int ipa_proto;
-
-	/* source local reference */
-	struct sccp_source_reference *src_local_ref;
-
-	/* destination local reference */
-	struct sccp_source_reference *dest_local_ref;
-
-	/* called ssn number */
-	int called_ssn;
-
-	/* calling ssn number */
-	int calling_ssn;
-
-	/* sccp message type */
-	int sccp_type;
-
-	/* bssap type, e.g. 0 for BSS Management */
-	int bssap;
-
-	/* the gsm0808 message type */
-	int gsm_type;
-};
-
-/*
  * Per BSC data structure
  */
 struct bsc_connection {
@@ -111,35 +79,6 @@
 	struct bsc_nat *nat;
 };
 
-/*
- * Per SCCP source local reference patch table. It needs to
- * be updated on new SCCP connections, connection confirm and reject,
- * and on the loss of the BSC connection.
- */
-struct sccp_connections {
-	struct llist_head list_entry;
-
-	struct bsc_connection *bsc;
-	struct bsc_msc_connection *msc_con;
-
-	struct sccp_source_reference real_ref;
-	struct sccp_source_reference patched_ref;
-	struct sccp_source_reference remote_ref;
-	int has_remote_ref;
-
-	/* status */
-	int con_type;
-	int con_local;
-
-	/* GSM audio handling. That is 32 * multiplex + ts */
-	int crcx;
-	int msc_timeslot;
-	int bsc_timeslot;
-
-	/* timeout handling */
-	struct timespec creation_time;
-};
-
 /**
  * Stats per BSC
  */
diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/openbsc/include/openbsc/bsc_nat_sccp.h
new file mode 100644
index 0000000..0a06a87
--- /dev/null
+++ b/openbsc/include/openbsc/bsc_nat_sccp.h
@@ -0,0 +1,92 @@
+/* NAT utilities using SCCP types */
+/*
+ * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef BSC_NAT_SCCP_H
+#define BSC_NAT_SCCP_H
+
+#include <sys/types.h>
+#include <sccp/sccp_types.h>
+
+/*
+ * For the NAT we will need to analyze and later patch
+ * the received message. This would require us to parse
+ * the IPA and SCCP header twice. Instead of doing this
+ * we will have one analyze structure and have the patching
+ * and filter operate on the same structure.
+ */
+struct bsc_nat_parsed {
+	/* ip access prototype */
+	int ipa_proto;
+
+	/* source local reference */
+	struct sccp_source_reference *src_local_ref;
+
+	/* destination local reference */
+	struct sccp_source_reference *dest_local_ref;
+
+	/* called ssn number */
+	int called_ssn;
+
+	/* calling ssn number */
+	int calling_ssn;
+
+	/* sccp message type */
+	int sccp_type;
+
+	/* bssap type, e.g. 0 for BSS Management */
+	int bssap;
+
+	/* the gsm0808 message type */
+	int gsm_type;
+};
+
+/*
+ * Per SCCP source local reference patch table. It needs to
+ * be updated on new SCCP connections, connection confirm and reject,
+ * and on the loss of the BSC connection.
+ */
+struct sccp_connections {
+	struct llist_head list_entry;
+
+	struct bsc_connection *bsc;
+	struct bsc_msc_connection *msc_con;
+
+	struct sccp_source_reference real_ref;
+	struct sccp_source_reference patched_ref;
+	struct sccp_source_reference remote_ref;
+	int has_remote_ref;
+
+	/* status */
+	int con_type;
+	int con_local;
+
+	/* GSM audio handling. That is 32 * multiplex + ts */
+	int crcx;
+	int msc_timeslot;
+	int bsc_timeslot;
+
+	/* timeout handling */
+	struct timespec creation_time;
+};
+
+
+#endif
diff --git a/openbsc/src/nat/bsc_filter.c b/openbsc/src/nat/bsc_filter.c
index 8f79f00..3e92abd 100644
--- a/openbsc/src/nat/bsc_filter.c
+++ b/openbsc/src/nat/bsc_filter.c
@@ -22,6 +22,7 @@
  */
 
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 #include <openbsc/ipaccess.h>
 #include <openbsc/debug.h>
 
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 32d988e..00b7d6d 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -20,6 +20,7 @@
  */
 
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 #include <openbsc/gsm_data.h>
 #include <openbsc/debug.h>
 #include <openbsc/mgcp.h>
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 0a37193..b47d7ce 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -39,6 +39,7 @@
 #include <openbsc/debug.h>
 #include <openbsc/bsc_msc.h>
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 #include <openbsc/ipaccess.h>
 #include <openbsc/abis_nm.h>
 #include <openbsc/vty.h>
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 5418dc1..bb5ee94 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -23,6 +23,7 @@
  */
 
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 #include <openbsc/bsc_msc.h>
 #include <openbsc/gsm_data.h>
 #include <openbsc/debug.h>
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c
index 0345360..b173463 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -21,6 +21,7 @@
 
 #include <openbsc/vty.h>
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 #include <openbsc/bsc_msc.h>
 #include <openbsc/gsm_04_08.h>
 #include <openbsc/mgcp.h>
diff --git a/openbsc/src/nat/bsc_sccp.c b/openbsc/src/nat/bsc_sccp.c
index 33ab51d..f67e4ad 100644
--- a/openbsc/src/nat/bsc_sccp.c
+++ b/openbsc/src/nat/bsc_sccp.c
@@ -22,6 +22,7 @@
 
 #include <openbsc/debug.h>
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 
 #include <sccp/sccp.h>
 
diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c
index 1b45014..524daf0 100644
--- a/openbsc/tests/bsc-nat/bsc_nat_test.c
+++ b/openbsc/tests/bsc-nat/bsc_nat_test.c
@@ -26,6 +26,7 @@
 #include <openbsc/debug.h>
 #include <openbsc/gsm_data.h>
 #include <openbsc/bsc_nat.h>
+#include <openbsc/bsc_nat_sccp.h>
 
 #include <osmocore/talloc.h>