2018-07-23 12:25:33 +00:00
|
|
|
SUBDIRS = gsupclient
|
|
|
|
|
2016-12-10 23:27:48 +00:00
|
|
|
AM_CFLAGS = \
|
|
|
|
-Wall \
|
|
|
|
$(LIBOSMOCORE_CFLAGS) \
|
|
|
|
$(LIBOSMOGSM_CFLAGS) \
|
|
|
|
$(LIBOSMOVTY_CFLAGS) \
|
2017-03-02 11:12:00 +00:00
|
|
|
$(LIBOSMOCTRL_CFLAGS) \
|
2016-12-10 23:27:48 +00:00
|
|
|
$(LIBOSMOABIS_CFLAGS) \
|
|
|
|
$(SQLITE3_CFLAGS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2018-07-28 20:00:08 +00:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|
|
|
$(NULL)
|
|
|
|
|
2016-12-10 23:27:48 +00:00
|
|
|
EXTRA_DIST = \
|
|
|
|
populate_hlr_db.pl \
|
2018-12-04 13:13:47 +00:00
|
|
|
db_sql2c.sed \
|
2016-12-10 23:27:48 +00:00
|
|
|
$(NULL)
|
|
|
|
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
BUILT_SOURCES = \
|
|
|
|
db_bootstrap.h \
|
|
|
|
$(NULL)
|
|
|
|
CLEANFILES = $(BUILT_SOURCES)
|
|
|
|
|
2016-12-10 23:27:48 +00:00
|
|
|
noinst_HEADERS = \
|
|
|
|
auc.h \
|
|
|
|
db.h \
|
2017-03-02 11:00:19 +00:00
|
|
|
hlr.h \
|
2017-02-14 15:53:04 +00:00
|
|
|
luop.h \
|
2016-12-10 23:27:48 +00:00
|
|
|
gsup_router.h \
|
|
|
|
gsup_server.h \
|
|
|
|
logging.h \
|
|
|
|
rand.h \
|
2017-03-02 11:12:00 +00:00
|
|
|
ctrl.h \
|
2017-01-30 22:30:26 +00:00
|
|
|
hlr_vty.h \
|
2017-10-06 00:59:54 +00:00
|
|
|
hlr_vty_subscr.h \
|
2018-06-15 20:04:28 +00:00
|
|
|
hlr_ussd.h \
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
db_bootstrap.h \
|
2016-12-10 23:27:48 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
bin_PROGRAMS = \
|
|
|
|
osmo-hlr \
|
2017-10-24 21:26:53 +00:00
|
|
|
osmo-hlr-db-tool \
|
2018-07-28 20:00:08 +00:00
|
|
|
osmo-euse-demo \
|
2016-12-12 16:34:25 +00:00
|
|
|
$(NULL)
|
|
|
|
|
2016-12-10 23:27:48 +00:00
|
|
|
osmo_hlr_SOURCES = \
|
|
|
|
auc.c \
|
2017-03-02 11:12:00 +00:00
|
|
|
ctrl.c \
|
2016-12-10 23:27:48 +00:00
|
|
|
db.c \
|
2017-02-14 15:53:04 +00:00
|
|
|
luop.c \
|
2016-12-10 23:27:48 +00:00
|
|
|
db_auc.c \
|
|
|
|
db_hlr.c \
|
|
|
|
gsup_router.c \
|
|
|
|
gsup_server.c \
|
|
|
|
hlr.c \
|
|
|
|
logging.c \
|
|
|
|
rand_urandom.c \
|
2017-01-30 22:30:26 +00:00
|
|
|
hlr_vty.c \
|
2017-10-06 00:59:54 +00:00
|
|
|
hlr_vty_subscr.c \
|
2018-05-04 14:06:32 +00:00
|
|
|
gsup_send.c \
|
2018-06-15 20:04:28 +00:00
|
|
|
hlr_ussd.c \
|
2016-12-10 23:27:48 +00:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
osmo_hlr_LDADD = \
|
|
|
|
$(LIBOSMOCORE_LIBS) \
|
|
|
|
$(LIBOSMOGSM_LIBS) \
|
|
|
|
$(LIBOSMOVTY_LIBS) \
|
2017-03-02 11:12:00 +00:00
|
|
|
$(LIBOSMOCTRL_LIBS) \
|
2016-12-10 23:27:48 +00:00
|
|
|
$(LIBOSMOABIS_LIBS) \
|
|
|
|
$(SQLITE3_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2017-10-24 21:26:53 +00:00
|
|
|
osmo_hlr_db_tool_SOURCES = \
|
|
|
|
hlr_db_tool.c \
|
|
|
|
db.c \
|
|
|
|
db_hlr.c \
|
|
|
|
logging.c \
|
|
|
|
rand_urandom.c \
|
|
|
|
dbd_decode_binary.c \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
osmo_hlr_db_tool_LDADD = \
|
|
|
|
$(LIBOSMOCORE_LIBS) \
|
|
|
|
$(LIBOSMOGSM_LIBS) \
|
|
|
|
$(SQLITE3_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2016-12-10 23:27:48 +00:00
|
|
|
db_test_SOURCES = \
|
|
|
|
auc.c \
|
|
|
|
db.c \
|
|
|
|
db_auc.c \
|
|
|
|
db_test.c \
|
|
|
|
logging.c \
|
|
|
|
rand_fake.c \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
db_test_LDADD = \
|
|
|
|
$(LIBOSMOCORE_LIBS) \
|
|
|
|
$(LIBOSMOGSM_LIBS) \
|
|
|
|
$(SQLITE3_LIBS) \
|
|
|
|
$(NULL)
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
|
2018-07-28 20:00:08 +00:00
|
|
|
osmo_euse_demo_SOURCES = \
|
|
|
|
osmo-euse-demo.c \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
osmo_euse_demo_LDADD = \
|
|
|
|
$(top_builddir)/src/gsupclient/libosmo-gsup-client.la \
|
|
|
|
$(LIBOSMOCORE_LIBS) \
|
|
|
|
$(LIBOSMOGSM_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql
|
|
|
|
|
2018-12-04 13:13:47 +00:00
|
|
|
db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_sql2c.sed
|
|
|
|
echo "/* DO NOT EDIT THIS FILE. It is generated from files in osmo-hlr.git/sql/ */" > "$@"
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
echo "#pragma once" >> "$@"
|
|
|
|
echo "static const char *stmt_bootstrap_sql[] = {" >> "$@"
|
|
|
|
cat "$(BOOTSTRAP_SQL)" \
|
2018-12-04 13:13:47 +00:00
|
|
|
| sed -f "$(srcdir)/db_sql2c.sed" \
|
automatically create db tables on osmo-hlr invocation
If a database file is missing, osmo-hlr creates it, as is the default sqlite3
API behavior -- before this patch, that db file is created, but lacks useful
tables. Actually also create initial tables in it, as osmo-nitb did.
In effect, the 'vty-test' target in tests/Makefile.am no longer needs to create
a database manually. (The 'ctrl-test' still does, because it also wants to add
subscriber data on top of the bare tables.)
Note: it could be desirable to bail if the desired database file does not
exist. That is however a different semantic from this patch; this is not
changing the fact that a db file is created, this just creates a usable one.
Note: I am about to add osmo-hlr-db-tool to do database migration from
osmo-nitb. For that, it is desirable to bootstrap a usable database, which is
the core reason for this patch.
Don't plainly duplicate hlr.sql to .c, but create db_bootstrap.h as a
BUILT_SOURCE from reading in sql/hlr.sql and mangling via sed to a list of SQL
statement strings. On each db_open(), run this bootstrap sequence.
In sql/hlr.sql, these tweaks are necessary:
* Add 'IF NOT EXISTS' to 'CREATE TABLE', so that the bootstrap sequence can be
run on an already bootstrapped db.
* Drop the final comment at the bottom, which ended up being an empty SQL
statement and causing sqlite3 API errors, seemed to have no purpose anyway.
Note: by composing the statement strings as multiline and including the SQL
comments, sqlite3 actually retains the comments contained in table definitions
and prints them back during 'sqlite3 hlr.db .dump'.
Change-Id: If77dbbfe1af3e66aaec91cb6295b687f37678636
2017-10-24 21:26:27 +00:00
|
|
|
>> "$@"
|
|
|
|
echo "};" >> "$@"
|