summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pppd/options.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-03-01 19:29:44 +0000
committerphk <phk@FreeBSD.org>1996-03-01 19:29:44 +0000
commit8bc36c3dbc3c59e9d8632ddda344652ff44d3ec1 (patch)
tree1c9cbef7f7c1e9feb2933a403aacaa972df34957 /usr.sbin/pppd/options.c
parent0d3859fc4832bd1d80625f81b97b1e37cc44bb93 (diff)
downloadFreeBSD-src-8bc36c3dbc3c59e9d8632ddda344652ff44d3ec1.zip
FreeBSD-src-8bc36c3dbc3c59e9d8632ddda344652ff44d3ec1.tar.gz
Use libmd.
Add support for negotiating (more like "informing peer") about DNS. Various cleanup of warnings.
Diffstat (limited to 'usr.sbin/pppd/options.c')
-rw-r--r--usr.sbin/pppd/options.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c
index 6bea932..8ed6ff0 100644
--- a/usr.sbin/pppd/options.c
+++ b/usr.sbin/pppd/options.c
@@ -18,7 +18,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: options.c,v 1.7 1995/10/31 21:29:25 peter Exp $";
+static char rcsid[] = "$Id: options.c,v 1.8 1995/11/04 10:44:22 peter Exp $";
#endif
#include <stdio.h>
@@ -69,6 +69,8 @@ int crtscts = 0; /* Use hardware flow control */
int modem = 1; /* Use modem control lines */
int inspeed = 0; /* Input/Output speed requested */
u_int32_t netmask = 0; /* IP netmask to set on interface */
+u_int32_t dns1 = 0; /* Primary DNS server */
+u_int32_t dns2 = 0; /* Secondary DNS server */
int lockflag = 0; /* Create lock file to lock the serial dev */
int nodetach = 0; /* Don't detach from controlling tty */
char *connector = NULL; /* Script to establish physical link */
@@ -125,6 +127,8 @@ static int setconnector __P((char **));
static int setdisconnector __P((char **));
static int setdomain __P((char **));
static int setnetmask __P((char **));
+static int setdns1 __P((char **));
+static int setdns2 __P((char **));
static int setcrtscts __P((void));
static int setnocrtscts __P((void));
static int setxonxoff __P((void));
@@ -213,6 +217,8 @@ static struct cmd {
{"mru", 1, setmru}, /* Set MRU value for negotiation */
{"mtu", 1, setmtu}, /* Set our MTU */
{"netmask", 1, setnetmask}, /* set netmask */
+ {"dns1", 1, setdns1}, /* set Primary Domain Name Server */
+ {"dns2", 1, setdns2}, /* set Secondary Domain Name Server */
{"passive", 0, setpassive}, /* Set passive mode */
{"silent", 0, setsilent}, /* Set silent mode */
{"modem", 0, setmodem}, /* Use modem control lines */
@@ -1402,6 +1408,44 @@ setnetmask(argv)
return (1);
}
+
+/*
+ * setdns1 - set the primary dns.
+ */
+static int
+setdns1(argv)
+ char **argv;
+{
+ struct in_addr mask;
+
+ if ((inet_aton(*argv, &mask) < 0)) {
+ fprintf(stderr, "Invalid dns1 %s\n", *argv);
+ return (0);
+ }
+
+ dns1 = mask.s_addr;
+ return (1);
+}
+
+
+/*
+ * setdns2 - set the secondary dns.
+ */
+static int
+setdns2(argv)
+ char **argv;
+{
+ struct in_addr mask;
+
+ if ((inet_aton(*argv, &mask) < 0)) {
+ fprintf(stderr, "Invalid dns2 %s\n", *argv);
+ return (0);
+ }
+
+ dns2 = mask.s_addr;
+ return (1);
+}
+
static int
setcrtscts()
{
OpenPOWER on IntegriCloud