diff options
-rw-r--r-- | include/osmocom/hlr/db.h | 1 | ||||
-rw-r--r-- | src/db.c | 1 | ||||
-rw-r--r-- | src/db_hlr.c | 2 | ||||
-rw-r--r-- | src/hlr_vty_subscr.c | 5 | ||||
-rw-r--r-- | tests/test_nodes.vty | 2 |
5 files changed, 8 insertions, 3 deletions
diff --git a/include/osmocom/hlr/db.h b/include/osmocom/hlr/db.h index f70df83..a771409 100644 --- a/include/osmocom/hlr/db.h +++ b/include/osmocom/hlr/db.h @@ -12,6 +12,7 @@ enum stmt_idx { DB_STMT_SEL_ALL_ORDER_LAST_SEEN, DB_STMT_SEL_FILTER_MSISDN, DB_STMT_SEL_FILTER_IMSI, + DB_STMT_SEL_FILTER_IMEI, DB_STMT_SEL_FILTER_CS, DB_STMT_SEL_FILTER_PS, DB_STMT_SEL_BY_IMSI, @@ -56,6 +56,7 @@ static const char *stmt_sql[] = { "WHERE last_lu_seen IS NOT NULL ORDER BY last_lu_seen;", [DB_STMT_SEL_FILTER_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE msisdn LIKE $search ORDER BY msisdn", [DB_STMT_SEL_FILTER_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi LIKE $search ORDER BY imsi", + [DB_STMT_SEL_FILTER_IMEI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imei LIKE $search ORDER BY imei", [DB_STMT_SEL_FILTER_CS] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE nam_cs = $search ORDER BY last_lu_seen", [DB_STMT_SEL_FILTER_PS] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE nam_ps = $search ORDER BY last_lu_seen", [DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE imsi = ?", diff --git a/src/db_hlr.c b/src/db_hlr.c index a4c467e..e88b5fc 100644 --- a/src/db_hlr.c +++ b/src/db_hlr.c @@ -648,6 +648,8 @@ int db_subscrs_get(struct db_context *dbc, const char *filter_type, const char * if (!filter_type) { stmt = dbc->stmt[DB_STMT_SEL_ALL]; + } else if (strcmp(filter_type, "imei") == 0) { + stmt = dbc->stmt[DB_STMT_SEL_FILTER_IMEI]; } else if (strcmp(filter_type, "imsi") == 0) { stmt = dbc->stmt[DB_STMT_SEL_FILTER_IMSI]; } else if (strcmp(filter_type, "msisdn") == 0) { diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index ad16045..82e0043 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -256,7 +256,7 @@ static int get_subscrs(struct vty *vty, const char *filter_type, const char *fil #define SUBSCRS_SHOW_HELP "Show all subscribers (with filter possibility)\n" #define SUBSCR_ID "(imsi|msisdn|id|imei) IDENT" -#define SUBSCR_FILTER "(imsi|msisdn) FILTER" +#define SUBSCR_FILTER "(imei|imsi|msisdn) FILTER" #define SUBSCR_ID_HELP \ "Identify subscriber by IMSI\n" \ @@ -307,7 +307,8 @@ DEFUN(show_subscriber_filtered, show_subscriber_filtered_cmd, "show subscribers " SUBSCR_FILTER, SHOW_STR SUBSCRS_SHOW_HELP - "Filter Subscribers by IMSI\n" "Filter Subscribers by MSISDN\n" "String to match in msisdn or imsi\n") + "Filter Subscribers by IMEI\n" "Filter Subscribers by IMSI\n" "Filter Subscribers by MSISDN\n" + "String to match in imei, imsi or msisdn\n") { const char *filter_type = argv[0]; const char *filter = argv[1]; diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index cce5703..bebe9a0 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -14,7 +14,7 @@ OsmoHLR> list ... show gsup-connections show subscribers all - show subscribers (imsi|msisdn) FILTER + show subscribers (imei|imsi|msisdn) FILTER show subscribers (cs|ps) (on|off) show subscribers last-seen subscriber (imsi|msisdn|id|imei) IDENT show |