include: reorganize headers file to include/osmocom/[gsm|core]
This patch moves all GSM-specific definitions to include/osmocom/gsm.
Moreover, the headers in include/osmocore/ have been moved to
include/osmocom/core.
This has been proposed by Harald Welte and Sylvain Munaunt.
Tested with `make distcheck'.
Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
diff --git a/include/Makefile.am b/include/Makefile.am
index 185c696..3578a80 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1 +1 @@
-SUBDIRS = osmocom osmocore
+SUBDIRS = osmocom
diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am
index ec548fb..21f4f2d 100644
--- a/include/osmocom/Makefile.am
+++ b/include/osmocom/Makefile.am
@@ -1,5 +1,5 @@
if ENABLE_VTY
-SUBDIRS = vty codec crypt
+SUBDIRS = vty codec crypt gsm core
else
-SUBDIRS = codec crypt
+SUBDIRS = codec crypt gsm core
endif
diff --git a/include/osmocom/core/Makefile.am b/include/osmocom/core/Makefile.am
new file mode 100644
index 0000000..6109f47
--- /dev/null
+++ b/include/osmocom/core/Makefile.am
@@ -0,0 +1,12 @@
+osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h bits.h \
+ bitvec.h statistics.h utils.h \
+ gsmtap.h write_queue.h \
+ logging.h rate_ctr.h gsmtap_util.h \
+ plugin.h crc16.h panic.h process.h msgfile.h \
+ backtrace.h
+
+if ENABLE_TALLOC
+osmocore_HEADERS += talloc.h
+endif
+
+osmocoredir = $(includedir)/osmocom/core
diff --git a/include/osmocore/backtrace.h b/include/osmocom/core/backtrace.h
similarity index 100%
rename from include/osmocore/backtrace.h
rename to include/osmocom/core/backtrace.h
diff --git a/include/osmocore/bits.h b/include/osmocom/core/bits.h
similarity index 100%
rename from include/osmocore/bits.h
rename to include/osmocom/core/bits.h
diff --git a/include/osmocore/bitvec.h b/include/osmocom/core/bitvec.h
similarity index 100%
rename from include/osmocore/bitvec.h
rename to include/osmocom/core/bitvec.h
diff --git a/include/osmocore/crc16.h b/include/osmocom/core/crc16.h
similarity index 100%
rename from include/osmocore/crc16.h
rename to include/osmocom/core/crc16.h
diff --git a/include/osmocore/gsmtap.h b/include/osmocom/core/gsmtap.h
similarity index 100%
rename from include/osmocore/gsmtap.h
rename to include/osmocom/core/gsmtap.h
diff --git a/include/osmocore/gsmtap_util.h b/include/osmocom/core/gsmtap_util.h
similarity index 100%
rename from include/osmocore/gsmtap_util.h
rename to include/osmocom/core/gsmtap_util.h
diff --git a/include/osmocore/linuxlist.h b/include/osmocom/core/linuxlist.h
similarity index 100%
rename from include/osmocore/linuxlist.h
rename to include/osmocom/core/linuxlist.h
diff --git a/include/osmocore/logging.h b/include/osmocom/core/logging.h
similarity index 98%
rename from include/osmocore/logging.h
rename to include/osmocom/core/logging.h
index fd45844..db02940 100644
--- a/include/osmocore/logging.h
+++ b/include/osmocom/core/logging.h
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdint.h>
-#include <osmocore/linuxlist.h>
+#include <osmocom/core/linuxlist.h>
#define LOG_MAX_CATEGORY 32
#define LOG_MAX_CTX 8
diff --git a/include/osmocore/msgb.h b/include/osmocom/core/msgb.h
similarity index 97%
rename from include/osmocore/msgb.h
rename to include/osmocom/core/msgb.h
index c4f4430..57b5d7f 100644
--- a/include/osmocore/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -21,8 +21,8 @@
*/
#include <stdint.h>
-#include "linuxlist.h"
-#include "utils.h"
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/utils.h>
#define MSGB_DEBUG
@@ -62,7 +62,7 @@
extern void msgb_reset(struct msgb *m);
#ifdef MSGB_DEBUG
-#include <osmocore/panic.h>
+#include <osmocom/core/panic.h>
#define MSGB_ABORT(msg, fmt, args ...) do { \
osmo_panic("msgb(%p): " fmt, msg, ## args); \
} while(0)
diff --git a/include/osmocore/msgfile.h b/include/osmocom/core/msgfile.h
similarity index 100%
rename from include/osmocore/msgfile.h
rename to include/osmocom/core/msgfile.h
diff --git a/include/osmocore/panic.h b/include/osmocom/core/panic.h
similarity index 100%
rename from include/osmocore/panic.h
rename to include/osmocom/core/panic.h
diff --git a/include/osmocore/plugin.h b/include/osmocom/core/plugin.h
similarity index 100%
rename from include/osmocore/plugin.h
rename to include/osmocom/core/plugin.h
diff --git a/include/osmocore/process.h b/include/osmocom/core/process.h
similarity index 100%
rename from include/osmocore/process.h
rename to include/osmocom/core/process.h
diff --git a/include/osmocore/rate_ctr.h b/include/osmocom/core/rate_ctr.h
similarity index 97%
rename from include/osmocore/rate_ctr.h
rename to include/osmocom/core/rate_ctr.h
index f887d9a..dba573d 100644
--- a/include/osmocore/rate_ctr.h
+++ b/include/osmocom/core/rate_ctr.h
@@ -3,7 +3,7 @@
#include <stdint.h>
-#include <osmocore/linuxlist.h>
+#include <osmocom/core/linuxlist.h>
#define RATE_CTR_INTV_NUM 4
diff --git a/include/osmocore/select.h b/include/osmocom/core/select.h
similarity index 92%
rename from include/osmocore/select.h
rename to include/osmocom/core/select.h
index 2d8b3ec..5ca21c3 100644
--- a/include/osmocore/select.h
+++ b/include/osmocom/core/select.h
@@ -1,7 +1,7 @@
#ifndef _BSC_SELECT_H
#define _BSC_SELECT_H
-#include "linuxlist.h"
+#include <osmocom/core/linuxlist.h>
#define BSC_FD_READ 0x0001
#define BSC_FD_WRITE 0x0002
diff --git a/include/osmocore/signal.h b/include/osmocom/core/signal.h
similarity index 100%
rename from include/osmocore/signal.h
rename to include/osmocom/core/signal.h
diff --git a/include/osmocore/statistics.h b/include/osmocom/core/statistics.h
similarity index 100%
rename from include/osmocore/statistics.h
rename to include/osmocom/core/statistics.h
diff --git a/include/osmocore/talloc.h b/include/osmocom/core/talloc.h
similarity index 100%
rename from include/osmocore/talloc.h
rename to include/osmocom/core/talloc.h
diff --git a/include/osmocore/timer.h b/include/osmocom/core/timer.h
similarity index 97%
rename from include/osmocore/timer.h
rename to include/osmocom/core/timer.h
index fee888b..1966478 100644
--- a/include/osmocore/timer.h
+++ b/include/osmocom/core/timer.h
@@ -23,7 +23,7 @@
#include <sys/time.h>
-#include "linuxlist.h"
+#include <osmocom/core/linuxlist.h>
/**
* Timer management:
diff --git a/include/osmocore/utils.h b/include/osmocom/core/utils.h
similarity index 100%
rename from include/osmocore/utils.h
rename to include/osmocom/core/utils.h
diff --git a/include/osmocore/write_queue.h b/include/osmocom/core/write_queue.h
similarity index 100%
rename from include/osmocore/write_queue.h
rename to include/osmocom/core/write_queue.h
diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h
index 3e514ec..3051071 100644
--- a/include/osmocom/crypt/gprs_cipher.h
+++ b/include/osmocom/crypt/gprs_cipher.h
@@ -1,7 +1,7 @@
#ifndef _GPRS_CIPHER_H
#define _GPRS_CIPHER_H
-#include <osmocore/linuxlist.h>
+#include <osmocom/core/linuxlist.h>
#define GSM0464_CIPH_MAX_BLOCK 1523
diff --git a/include/osmocom/gsm/Makefile.am b/include/osmocom/gsm/Makefile.am
new file mode 100644
index 0000000..8685fc9
--- /dev/null
+++ b/include/osmocom/gsm/Makefile.am
@@ -0,0 +1,6 @@
+osmogsm_HEADERS = comp128.h gsm0808.h gsm48_ie.h mncc.h rxlev_stat.h \
+ gsm0480.h gsm48.h gsm_utils.h rsl.h tlv.h
+
+SUBDIRS = protocol
+
+osmogsmdir = $(includedir)/osmocom/gsm
diff --git a/include/osmocore/comp128.h b/include/osmocom/gsm/comp128.h
similarity index 100%
rename from include/osmocore/comp128.h
rename to include/osmocom/gsm/comp128.h
diff --git a/include/osmocore/gsm0480.h b/include/osmocom/gsm/gsm0480.h
similarity index 84%
rename from include/osmocore/gsm0480.h
rename to include/osmocom/gsm/gsm0480.h
index b504332..d6626d6 100644
--- a/include/osmocore/gsm0480.h
+++ b/include/osmocom/gsm/gsm0480.h
@@ -1,9 +1,9 @@
#ifndef gsm0480_h
#define gsm0480_h
-#include "msgb.h"
-#include "protocol/gsm_04_08.h"
-#include "protocol/gsm_04_80.h"
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+#include <osmocom/gsm/protocol/gsm_04_80.h>
#define MAX_LEN_USSD_STRING 31
diff --git a/include/osmocore/gsm0808.h b/include/osmocom/gsm/gsm0808.h
similarity index 100%
rename from include/osmocore/gsm0808.h
rename to include/osmocom/gsm/gsm0808.h
diff --git a/include/osmocore/gsm48.h b/include/osmocom/gsm/gsm48.h
similarity index 90%
rename from include/osmocore/gsm48.h
rename to include/osmocom/gsm/gsm48.h
index ffe0399..1e9403b 100644
--- a/include/osmocore/gsm48.h
+++ b/include/osmocom/gsm/gsm48.h
@@ -1,9 +1,9 @@
#ifndef _OSMOCORE_GSM48_H
#define _OSMOCORE_GSM48_H
-#include <osmocore/tlv.h>
-#include <osmocore/protocol/gsm_04_08.h>
-#include <osmocore/gsm48_ie.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
+#include <osmocom/gsm/gsm48_ie.h>
/* A parsed GPRS routing area */
struct gprs_ra_id {
diff --git a/include/osmocore/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h
similarity index 96%
rename from include/osmocore/gsm48_ie.h
rename to include/osmocom/gsm/gsm48_ie.h
index fa66159..f4fce25 100644
--- a/include/osmocore/gsm48_ie.h
+++ b/include/osmocom/gsm/gsm48_ie.h
@@ -5,10 +5,10 @@
#include <string.h>
#include <errno.h>
-#include <osmocore/msgb.h>
-#include <osmocore/tlv.h>
-#include <osmocore/mncc.h>
-#include <osmocore/protocol/gsm_04_08.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/gsm/mncc.h>
+#include <osmocom/gsm/protocol/gsm_04_08.h>
/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */
int gsm48_decode_bcd_number(char *output, int output_len,
diff --git a/include/osmocore/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
similarity index 100%
rename from include/osmocore/gsm_utils.h
rename to include/osmocom/gsm/gsm_utils.h
diff --git a/include/osmocore/mncc.h b/include/osmocom/gsm/mncc.h
similarity index 100%
rename from include/osmocore/mncc.h
rename to include/osmocom/gsm/mncc.h
diff --git a/include/osmocom/gsm/protocol/Makefile.am b/include/osmocom/gsm/protocol/Makefile.am
new file mode 100644
index 0000000..8483f10
--- /dev/null
+++ b/include/osmocom/gsm/protocol/Makefile.am
@@ -0,0 +1,6 @@
+osmogsm_proto_HEADERS = gsm_03_41.h \
+ gsm_04_08.h gsm_04_11.h gsm_04_12.h gsm_04_80.h \
+ gsm_08_08.h gsm_08_58.h \
+ gsm_12_21.h
+
+osmogsm_protodir = $(includedir)/osmocom/gsm/protocol
diff --git a/include/osmocore/protocol/gsm_03_41.h b/include/osmocom/gsm/protocol/gsm_03_41.h
similarity index 100%
rename from include/osmocore/protocol/gsm_03_41.h
rename to include/osmocom/gsm/protocol/gsm_03_41.h
diff --git a/include/osmocore/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
similarity index 100%
rename from include/osmocore/protocol/gsm_04_08.h
rename to include/osmocom/gsm/protocol/gsm_04_08.h
diff --git a/include/osmocore/protocol/gsm_04_11.h b/include/osmocom/gsm/protocol/gsm_04_11.h
similarity index 100%
rename from include/osmocore/protocol/gsm_04_11.h
rename to include/osmocom/gsm/protocol/gsm_04_11.h
diff --git a/include/osmocore/protocol/gsm_04_12.h b/include/osmocom/gsm/protocol/gsm_04_12.h
similarity index 100%
rename from include/osmocore/protocol/gsm_04_12.h
rename to include/osmocom/gsm/protocol/gsm_04_12.h
diff --git a/include/osmocore/protocol/gsm_04_80.h b/include/osmocom/gsm/protocol/gsm_04_80.h
similarity index 100%
rename from include/osmocore/protocol/gsm_04_80.h
rename to include/osmocom/gsm/protocol/gsm_04_80.h
diff --git a/include/osmocore/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h
similarity index 100%
rename from include/osmocore/protocol/gsm_08_08.h
rename to include/osmocom/gsm/protocol/gsm_08_08.h
diff --git a/include/osmocore/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h
similarity index 100%
rename from include/osmocore/protocol/gsm_08_58.h
rename to include/osmocom/gsm/protocol/gsm_08_58.h
diff --git a/include/osmocore/protocol/gsm_12_21.h b/include/osmocom/gsm/protocol/gsm_12_21.h
similarity index 99%
rename from include/osmocore/protocol/gsm_12_21.h
rename to include/osmocom/gsm/protocol/gsm_12_21.h
index 9cae45d..b8b00f3 100644
--- a/include/osmocore/protocol/gsm_12_21.h
+++ b/include/osmocom/gsm/protocol/gsm_12_21.h
@@ -24,7 +24,7 @@
*/
#include <stdint.h>
-#include <osmocore/tlv.h>
+#include <osmocom/gsm/tlv.h>
/* generic header in front of every OML message according to TS 08.59 */
struct abis_om_hdr {
diff --git a/include/osmocore/rsl.h b/include/osmocom/gsm/rsl.h
similarity index 94%
rename from include/osmocore/rsl.h
rename to include/osmocom/gsm/rsl.h
index 54d6703..7e46330 100644
--- a/include/osmocore/rsl.h
+++ b/include/osmocom/gsm/rsl.h
@@ -2,8 +2,8 @@
#define _OSMOCORE_RSL_H
#include <stdint.h>
-#include <osmocore/utils.h>
-#include <osmocore/protocol/gsm_08_58.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/gsm/protocol/gsm_08_58.h>
void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type);
diff --git a/include/osmocore/rxlev_stat.h b/include/osmocom/gsm/rxlev_stat.h
similarity index 100%
rename from include/osmocore/rxlev_stat.h
rename to include/osmocom/gsm/rxlev_stat.h
diff --git a/include/osmocore/tlv.h b/include/osmocom/gsm/tlv.h
similarity index 99%
rename from include/osmocore/tlv.h
rename to include/osmocom/gsm/tlv.h
index 7bda9f9..552af2b 100644
--- a/include/osmocore/tlv.h
+++ b/include/osmocom/gsm/tlv.h
@@ -4,7 +4,7 @@
#include <stdint.h>
#include <string.h>
-#include <osmocore/msgb.h>
+#include <osmocom/core/msgb.h>
/* Terminology / wording
tag length value (in bits)
diff --git a/include/osmocom/vty/telnet_interface.h b/include/osmocom/vty/telnet_interface.h
index 444e649..0c034e4 100644
--- a/include/osmocom/vty/telnet_interface.h
+++ b/include/osmocom/vty/telnet_interface.h
@@ -21,8 +21,8 @@
#ifndef TELNET_INTERFACE_H
#define TELNET_INTERFACE_H
-#include <osmocore/logging.h>
-#include <osmocore/select.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/select.h>
#include <osmocom/vty/vty.h>
diff --git a/include/osmocore/Makefile.am b/include/osmocore/Makefile.am
deleted file mode 100644
index b65589a..0000000
--- a/include/osmocore/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-osmocore_HEADERS = signal.h linuxlist.h timer.h select.h msgb.h bits.h \
- tlv.h bitvec.h comp128.h statistics.h gsm_utils.h utils.h \
- gsmtap.h write_queue.h rsl.h gsm48.h rxlev_stat.h mncc.h \
- gsm48_ie.h logging.h gsm0808.h rate_ctr.h gsmtap_util.h \
- plugin.h crc16.h panic.h process.h gsm0480.h msgfile.h \
- backtrace.h
-
-if ENABLE_TALLOC
-osmocore_HEADERS += talloc.h
-endif
-
-osmocoredir = $(includedir)/osmocore
-
-SUBDIRS = protocol
diff --git a/include/osmocore/protocol/Makefile.am b/include/osmocore/protocol/Makefile.am
deleted file mode 100644
index 03a4849..0000000
--- a/include/osmocore/protocol/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-osmocore_proto_HEADERS = gsm_03_41.h \
- gsm_04_08.h gsm_04_11.h gsm_04_12.h gsm_04_80.h \
- gsm_08_08.h gsm_08_58.h \
- gsm_12_21.h
-
-osmocore_protodir = $(includedir)/osmocore/protocol