From dee0bcc8e9c010a8643c71ac251f0a9560ac22ac Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Mon, 28 Dec 2020 18:07:27 +0100 Subject: gbproxy: Add config option to name an SGSN This is useful for logging and configuration to identify an SGSN by name Change-Id: I2a3410dd9bebb242957e13a63ed70e447204203c Related: SYS#5115, OS#4472 --- include/osmocom/sgsn/gb_proxy.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/osmocom/sgsn/gb_proxy.h') diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h index 8654d1096..dd45c2f89 100644 --- a/include/osmocom/sgsn/gb_proxy.h +++ b/include/osmocom/sgsn/gb_proxy.h @@ -149,6 +149,9 @@ struct gbproxy_sgsn { /* The NSE belonging to this SGSN */ struct gbproxy_nse *nse; + /* Name of the SGSN */ + char *name; + /* Pool configuration for the sgsn (only valid if sgsn_facing == true) */ struct { bool allow_attach; @@ -176,7 +179,7 @@ struct gbproxy_sgsn { LOGPCELL_CAT(CELL, DGPRS, LEVEL, FMT, ## ARGS) #define LOGPSGSN_CAT(SGSN, SUBSYS, LEVEL, FMT, ARGS...) \ - LOGP(SUBSYS, LEVEL, "NSE(%05u)-SGSN " FMT, (SGSN)->nse->nsei, ## ARGS) + LOGP(SUBSYS, LEVEL, "NSE(%05u)-SGSN(%s) " FMT, (SGSN)->nse->nsei, (SGSN)->name, ## ARGS) #define LOGPSGSN(SGSN, LEVEL, FMT, ARGS...) \ LOGPSGSN_CAT(SGSN, DGPRS, LEVEL, FMT, ## ARGS) @@ -224,8 +227,9 @@ struct gbproxy_nse *gbproxy_nse_by_nsei(struct gbproxy_config *cfg, uint16_t nse struct gbproxy_nse *gbproxy_nse_by_nsei_or_new(struct gbproxy_config *cfg, uint16_t nsei, bool sgsn_facing); /* SGSN handling */ -struct gbproxy_sgsn *gbproxy_sgsn_alloc(struct gbproxy_config *cfg, uint16_t nsei); +struct gbproxy_sgsn *gbproxy_sgsn_alloc(struct gbproxy_config *cfg, uint16_t nsei, const char *name); void gbproxy_sgsn_free(struct gbproxy_sgsn *sgsn); +struct gbproxy_sgsn *gbproxy_sgsn_by_name(struct gbproxy_config *cfg, const char *name); struct gbproxy_sgsn *gbproxy_sgsn_by_nsei(struct gbproxy_config *cfg, uint16_t nsei); struct gbproxy_sgsn *gbproxy_sgsn_by_nsei_or_new(struct gbproxy_config *cfg, uint16_t nsei); struct gbproxy_sgsn *gbproxy_sgsn_by_nri(struct gbproxy_config *cfg, uint16_t nri, bool *null_nri); -- cgit v1.2.3