Allow setting NBNS.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-02-24 11:24:14 +01:00
parent d52e71b21b
commit d06de0c46b
7 changed files with 29 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
.TH ocserv 1 "22 Feb 2013" "0.0.1" "User Commands"
.TH ocserv 1 "24 Feb 2013" "0.0.1" "User Commands"
.\"
.\" DO NOT EDIT THIS FILE (ocserv-args.man)
.\"
.\" It has been AutoGen-ed February 22, 2013 at 07:35:41 PM by AutoGen 5.16
.\" It has been AutoGen-ed February 24, 2013 at 11:24:04 AM by AutoGen 5.16
.\" From the definitions ../src/ocserv-args.def.tmp
.\" and the template file agman-cmd.tpl
.\"
@@ -265,14 +265,20 @@ device = vpns
# The pool of addresses that leases will be given from.
ipv4\-network = 192.168.1.0
ipv4\-netmask = 255.255.255.0
.sp
# The DNS advertized server
# Use the keywork local to advertize the local P\-t\-P address as DNS server
# ipv4\-dns = 192.168.2.1
ipv4\-dns = local
.sp
# The NBNS server (if any)
#ipv4\-nbns = 192.168.2.3
.sp
# The same, but for IPv6.
#ipv6\-address =
#ipv6\-mask =
#ipv6\-dns =
#ipv6\-nbns =
.sp
# Unset to assign the default MTU of the device
# mtu =

View File

@@ -201,6 +201,9 @@ unsigned j;
READ_STRING("ipv6-netmask", config->network.ipv6_netmask, 0);
READ_STRING("ipv6-dns", config->network.ipv6_dns, 0);
READ_STRING("ipv4-nbns", config->network.ipv4_nbns, 0);
READ_STRING("ipv6-nbns", config->network.ipv6_nbns, 0);
READ_MULTI_LINE("route", config->network.routes, config->network.routes_size, 0);
}

View File

@@ -2,7 +2,7 @@
*
* DO NOT EDIT THIS FILE (ocserv-args.c)
*
* It has been AutoGen-ed February 22, 2013 at 07:35:35 PM by AutoGen 5.16
* It has been AutoGen-ed February 24, 2013 at 11:23:54 AM by AutoGen 5.16
* From the definitions ocserv-args.def
* and the template file options
*

View File

@@ -181,14 +181,20 @@ device = vpns
# The pool of addresses that leases will be given from.
ipv4-network = 192.168.1.0
ipv4-netmask = 255.255.255.0
# The DNS advertized server
# Use the keywork local to advertize the local P-t-P address as DNS server
# ipv4-dns = 192.168.2.1
ipv4-dns = local
# The NBNS server (if any)
#ipv4-nbns = 192.168.2.3
# The same, but for IPv6.
#ipv6-address =
#ipv6-mask =
#ipv6-dns =
#ipv6-nbns =
# Unset to assign the default MTU of the device
# mtu =

View File

@@ -2,7 +2,7 @@
*
* DO NOT EDIT THIS FILE (ocserv-args.h)
*
* It has been AutoGen-ed February 22, 2013 at 07:35:35 PM by AutoGen 5.16
* It has been AutoGen-ed February 24, 2013 at 11:23:54 AM by AutoGen 5.16
* From the definitions ocserv-args.def
* and the template file options
*

View File

@@ -46,6 +46,8 @@ struct vpn_st {
char *ipv6_local; /* local IPv6 address */
char *ipv4_dns;
char *ipv6_dns;
char *ipv4_nbns;
char *ipv6_nbns;
unsigned int mtu;
char **routes;
unsigned int routes_size;

View File

@@ -652,6 +652,10 @@ unsigned mtu_overhead, tls_mtu = 0;
ret = tls_printf(ws->session, "X-CSTP-DNS: %s\r\n", vinfo.ipv4_dns);
SEND_ERR(ret);
}
if (vinfo.ipv4_nbns) {
ret = tls_printf(ws->session, "X-CSTP-NBNS: %s\r\n", vinfo.ipv4_nbns);
SEND_ERR(ret);
}
}
if (vinfo.ipv6) {
@@ -667,6 +671,10 @@ unsigned mtu_overhead, tls_mtu = 0;
ret = tls_printf(ws->session, "X-CSTP-DNS: %s\r\n", vinfo.ipv6_dns);
SEND_ERR(ret);
}
if (vinfo.ipv6_nbns) {
ret = tls_printf(ws->session, "X-CSTP-NBNS: %s\r\n", vinfo.ipv6_nbns);
SEND_ERR(ret);
}
}
for (i=0;i<vinfo.routes_size;i++) {