mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr.git
synced 2025-11-03 05:33:28 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4b4548589 | ||
|
|
bb7d5b2a61 | ||
|
|
1a71e73fdc | ||
|
|
bb8591dfab |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -86,3 +86,5 @@ contrib/osmo-hlr.spec
|
||||
/debian/osmo-mslookup-utils/
|
||||
/debian/*.log
|
||||
/debian/*.substvars
|
||||
|
||||
include/osmocom/*/version.h
|
||||
|
||||
10
debian/changelog
vendored
10
debian/changelog
vendored
@@ -1,3 +1,13 @@
|
||||
osmo-hlr (1.9.1) unstable; urgency=medium
|
||||
|
||||
[ Pau Espin Pedrol ]
|
||||
* Drop use of deprecated vty is_config_node() cb
|
||||
|
||||
[ Oliver Smith ]
|
||||
* db: flush after changing schema version
|
||||
|
||||
-- Oliver Smith <osmith@sysmocom.de> Wed, 02 Apr 2025 15:12:35 +0200
|
||||
|
||||
osmo-hlr (1.9.0) unstable; urgency=medium
|
||||
|
||||
[ Vadim Yanitskiy ]
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
SUBDIRS = osmocom
|
||||
|
||||
osmocom/%/version.h: osmocom/%/version.h.tpl
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@)
|
||||
$(AM_V_GEN)sed \
|
||||
-e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \
|
||||
-e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \
|
||||
-e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \
|
||||
-e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \
|
||||
$< > $@
|
||||
|
||||
nobase_include_HEADERS = \
|
||||
osmocom/gsupclient/cni_peer_id.h \
|
||||
osmocom/gsupclient/gsup_client.h \
|
||||
osmocom/gsupclient/gsup_client_mux.h \
|
||||
osmocom/gsupclient/gsup_req.h \
|
||||
osmocom/gsupclient/version.h \
|
||||
osmocom/mslookup/mdns.h \
|
||||
osmocom/mslookup/mdns_sock.h \
|
||||
osmocom/mslookup/mslookup_client_fake.h \
|
||||
osmocom/mslookup/mslookup_client.h \
|
||||
osmocom/mslookup/mslookup_client_mdns.h \
|
||||
osmocom/mslookup/mslookup.h \
|
||||
osmocom/mslookup/version.h \
|
||||
$(NULL)
|
||||
|
||||
16
include/osmocom/gsupclient/version.h.tpl
Normal file
16
include/osmocom/gsupclient/version.h.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION {{VERSION}}
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION_STR "{{VERSION}}"
|
||||
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION_MAJOR {{VERSION_MAJOR}}
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION_MINOR {{VERSION_MINOR}}
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION_PATCH {{VERSION_PATCH}}
|
||||
|
||||
#define LIBOSMO_GSUP_CLIENT_VERSION_GREATER_EQUAL(major, minor, patch) \
|
||||
(LIBOSMO_GSUP_CLIENT_VERSION_MAJOR > (major) || \
|
||||
(LIBOSMO_GSUP_CLIENT_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_GSUP_CLIENT_VERSION_MINOR > (minor)) || \
|
||||
(LIBOSMO_GSUP_CLIENT_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_GSUP_CLIENT_VERSION_MINOR == (minor) && \
|
||||
LIBOSMO_GSUP_CLIENT_VERSION_PATCH >= (patch)))
|
||||
@@ -48,7 +48,6 @@ enum hlr_vty_node {
|
||||
#define A38_COMP128_KEY_LEN 16
|
||||
#define MILENAGE_KEY_LEN 16
|
||||
|
||||
int hlr_vty_is_config_node(struct vty *vty, int node);
|
||||
int hlr_vty_go_parent(struct vty *vty);
|
||||
void hlr_vty_init(void *hlr_ctx);
|
||||
void dgsm_vty_init(void);
|
||||
|
||||
16
include/osmocom/mslookup/version.h.tpl
Normal file
16
include/osmocom/mslookup/version.h.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#define LIBOSMO_MSLOOKUP_VERSION {{VERSION}}
|
||||
#define LIBOSMO_MSLOOKUP_VERSION_STR "{{VERSION}}"
|
||||
|
||||
#define LIBOSMO_MSLOOKUP_VERSION_MAJOR {{VERSION_MAJOR}}
|
||||
#define LIBOSMO_MSLOOKUP_VERSION_MINOR {{VERSION_MINOR}}
|
||||
#define LIBOSMO_MSLOOKUP_VERSION_PATCH {{VERSION_PATCH}}
|
||||
|
||||
#define LIBOSMO_MSLOOKUP_VERSION_GREATER_EQUAL(major, minor, patch) \
|
||||
(LIBOSMO_MSLOOKUP_VERSION_MAJOR > (major) || \
|
||||
(LIBOSMO_MSLOOKUP_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_MSLOOKUP_VERSION_MINOR > (minor)) || \
|
||||
(LIBOSMO_MSLOOKUP_VERSION_MAJOR == (major) && \
|
||||
LIBOSMO_MSLOOKUP_VERSION_MINOR == (minor) && \
|
||||
LIBOSMO_MSLOOKUP_VERSION_PATCH >= (patch)))
|
||||
9
src/db.c
9
src/db.c
@@ -595,6 +595,7 @@ struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logg
|
||||
int rc;
|
||||
bool has_sqlite_config_sqllog = false;
|
||||
int version;
|
||||
bool version_changed = false;
|
||||
|
||||
LOGP(DDB, LOGL_NOTICE, "using database: %s\n", fname);
|
||||
LOGP(DDB, LOGL_INFO, "Compiled against SQLite3 lib version %s\n", SQLITE_VERSION);
|
||||
@@ -672,6 +673,7 @@ struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logg
|
||||
goto out_free;
|
||||
}
|
||||
version = CURRENT_SCHEMA_VERSION;
|
||||
version_changed = true;
|
||||
}
|
||||
|
||||
LOGP(DDB, LOGL_NOTICE, "Database '%s' has HLR DB schema version %d\n", dbc->fname, version);
|
||||
@@ -686,6 +688,7 @@ struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logg
|
||||
}
|
||||
LOGP(DDB, LOGL_NOTICE, "Database '%s' has been upgraded to HLR DB schema version %d\n",
|
||||
dbc->fname, version+1);
|
||||
version_changed = true;
|
||||
}
|
||||
|
||||
if (version != CURRENT_SCHEMA_VERSION) {
|
||||
@@ -702,6 +705,12 @@ struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logg
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
/* Flush the cache after changing the version, to make the scenario
|
||||
* less likely that after an unclean shutdown the DB gets restored
|
||||
* with the right table layout but wrong version (SYS#7394). */
|
||||
if (version_changed)
|
||||
sqlite3_db_cacheflush(dbc->db);
|
||||
|
||||
/* prepare all SQL statements */
|
||||
for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) {
|
||||
rc = sqlite3_prepare_v2(dbc->db, stmt_sql[i], -1,
|
||||
|
||||
@@ -754,7 +754,6 @@ static struct vty_app_info vty_info = {
|
||||
.name = "OsmoHLR",
|
||||
.version = PACKAGE_VERSION,
|
||||
.copyright = vlr_copyright,
|
||||
.is_config_node = hlr_vty_is_config_node,
|
||||
.go_parent_cb = hlr_vty_go_parent,
|
||||
};
|
||||
|
||||
|
||||
@@ -881,18 +881,6 @@ int hlr_vty_go_parent(struct vty *vty)
|
||||
return vty->node;
|
||||
}
|
||||
|
||||
int hlr_vty_is_config_node(struct vty *vty, int node)
|
||||
{
|
||||
switch (node) {
|
||||
/* add items that are not config */
|
||||
case CONFIG_NODE:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
void hlr_vty_init(void *hlr_ctx)
|
||||
{
|
||||
cfg_reject_cause_cmd.string =
|
||||
|
||||
Reference in New Issue
Block a user