diff options
author | brian <brian@FreeBSD.org> | 1997-11-17 00:42:41 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-17 00:42:41 +0000 |
commit | 674fc92d54c1a0eadba4706ec31ac423c35adff7 (patch) | |
tree | f5eb6d98e8df8e08a811f9f51b592a74080e9a7d /usr.sbin/ppp/defs.c | |
parent | 5696a07f36cde36ef7955344c7b33fc5c7c57248 (diff) | |
download | FreeBSD-src-674fc92d54c1a0eadba4706ec31ac423c35adff7.zip FreeBSD-src-674fc92d54c1a0eadba4706ec31ac423c35adff7.tar.gz |
Add id strings to tun.[ch].
Don't try to open ppp.secret if we're never going to use it.
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r-- | usr.sbin/ppp/defs.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c index 3b4142f..fed64e9 100644 --- a/usr.sbin/ppp/defs.c +++ b/usr.sbin/ppp/defs.c @@ -1,11 +1,22 @@ /* - * $Id: defs.c,v 1.1 1997/10/26 01:02:30 brian Exp $ + * $Id: defs.c,v 1.2 1997/11/11 22:58:10 brian Exp $ */ +#include <sys/param.h> +#include <netinet/in.h> + +#include <errno.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "defs.h" +#include "mbuf.h" +#include "log.h" +#include "loadalias.h" +#include "command.h" +#include "vars.h" int mode = MODE_INTER; int BGFiledes[2] = { -1, -1 }; @@ -41,3 +52,20 @@ randinit() srandomdev(); } } + + +int +GetShortHost() +{ + char *p; + + if (gethostname(VarShortHost, sizeof(VarShortHost))) { + LogPrintf(LogERROR, "GetShortHost: gethostbyname: %s\n", strerror(errno)); + return 0; + } + + if ((p = strchr(VarShortHost, '.'))) + *p = '\0'; + + return 1; +} |