aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_vty.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 15:20:27 +0800
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 15:58:02 +0800
commita5a6da46a0b22d5c7695774c6c7eb26856bc6488 (patch)
tree1d87411b72b90c5a95e637e2c2cfb99cc44727ad /openbsc/src/gprs/sgsn_vty.c
parent39c430ee2929f0671203974db11dfdd4ff4841cb (diff)
sgsn: Allow to specify the DNS servers that should be used
If no server is specified the default list will be used. This allows to separate the servers for the local network and GRX from each other.
Diffstat (limited to 'openbsc/src/gprs/sgsn_vty.c')
-rw-r--r--openbsc/src/gprs/sgsn_vty.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 65b5a39e1..70d299b42 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -128,6 +128,7 @@ static int config_write_sgsn(struct vty *vty)
struct sgsn_ggsn_ctx *gctx;
struct imsi_acl_entry *acl;
struct apn_ctx *actx;
+ struct ares_addr_node *server;
vty_out(vty, "sgsn%s", VTY_NEWLINE);
@@ -147,6 +148,9 @@ static int config_write_sgsn(struct vty *vty)
if (sgsn->cfg.dynamic_lookup)
vty_out(vty, " ggsn dynamic%s", VTY_NEWLINE);
+ for (server = sgsn->ares_servers; server; server = server->next)
+ vty_out(vty, " grx-dns-add %s%s", inet_ntoa(server->addr.addr4), VTY_NEWLINE);
+
vty_out(vty, " auth-policy %s%s",
get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy),
VTY_NEWLINE);
@@ -250,6 +254,19 @@ DEFUN(cfg_ggsn_dynamic_lookup, cfg_ggsn_dynamic_lookup_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_grx_ggsn, cfg_grx_ggsn_cmd,
+ "grx-dns-add A.B.C.D",
+ "Add DNS server\nIPv4 address\n")
+{
+ struct ares_addr_node *node = talloc_zero(tall_bsc_ctx, struct ares_addr_node);
+ node->family = AF_INET;
+ inet_aton(argv[0], &node->addr.addr4);
+
+ node->next = sgsn->ares_servers;
+ sgsn->ares_servers = node;
+ return CMD_SUCCESS;
+}
+
#define APN_STR "Configure the information per APN\n"
#define APN_GW_STR "The APN gateway name optionally prefixed by '*' (wildcard)\n"
@@ -893,6 +910,7 @@ int sgsn_vty_init(void)
install_element(SGSN_NODE, &cfg_no_cdr_filename_cmd);
install_element(SGSN_NODE, &cfg_cdr_interval_cmd);
install_element(SGSN_NODE, &cfg_ggsn_dynamic_lookup_cmd);
+ install_element(SGSN_NODE, &cfg_grx_ggsn_cmd);
return 0;
}