diff options
Diffstat (limited to 'openbsc/src/nat/bsc_nat_utils.c')
-rw-r--r-- | openbsc/src/nat/bsc_nat_utils.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index 6baa952e6..275ecb472 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -272,3 +272,17 @@ int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg, struct return 0; } } + +void bsc_parse_reg(void *ctx, regex_t *reg, char **imsi, int argc, const char **argv) +{ + if (*imsi) { + talloc_free(*imsi); + *imsi = NULL; + } + regfree(reg); + + if (argc > 0) { + *imsi = talloc_strdup(ctx, argv[0]); + regcomp(reg, argv[0], 0); + } +} |