summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r--usr.sbin/ppp/defs.c30
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;
+}
OpenPOWER on IntegriCloud