add IP type-of-service without gettos (at least for now)
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 28 Jun 1990 08:07:58 +0000 (00:07 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 28 Jun 1990 08:07:58 +0000 (00:07 -0800)
SCCS-vsn: libexec/telnetd/telnetd.c 5.44
SCCS-vsn: libexec/telnetd/defs.h 5.7
SCCS-vsn: libexec/telnetd/Makefile 5.9

usr/src/libexec/telnetd/Makefile
usr/src/libexec/telnetd/defs.h
usr/src/libexec/telnetd/telnetd.c

index 5baa4d7..40ba8cd 100644 (file)
@@ -1,7 +1,6 @@
-#      @(#)Makefile    5.8 (Berkeley) %G%
+#      @(#)Makefile    5.9 (Berkeley) %G%
 
 PROG=  telnetd
 
 PROG=  telnetd
-CFLAGS+=-DNEED_GETTOS
 SRCS=  get_date.c gettytab.c global.c slc.c state.c sys_term.c telnetd.c \
        termstat.c utility.c
 DPADD= ${LIBUTIL} ${LIBTERM}
 SRCS=  get_date.c gettytab.c global.c slc.c state.c sys_term.c telnetd.c \
        termstat.c utility.c
 DPADD= ${LIBUTIL} ${LIBTERM}
index 11e56be..b33b31c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)defs.h      5.6 (Berkeley) %G%
+ *     @(#)defs.h      5.7 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -42,6 +42,8 @@
 #include <sys/ioctl.h>
 
 #include <netinet/in.h>
 #include <sys/ioctl.h>
 
 #include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
 
 #include <arpa/telnet.h>
 
 
 #include <arpa/telnet.h>
 
index fb7bcf7..3817f94 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)telnetd.c  5.43 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c  5.44 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "telnetd.h"
 #endif /* not lint */
 
 #include "telnetd.h"
@@ -36,36 +36,16 @@ int lowpty = 0, highpty;    /* low, high pty numbers */
 int debug = 0;
 char *progname;
 
 int debug = 0;
 char *progname;
 
-#if    defined(IP_TOS) && defined(NEED_GETTOS)
-struct tosent {
-       char    *t_name;        /* name */
-       char    **t_aliases;    /* alias list */
-       char    *t_proto;       /* protocol */
-       int     t_tos;          /* Type Of Service bits */
-};
-
-struct tosent *
-gettosbyname(name, proto)
-char *name, *proto;
-{
-       static struct tosent te;
-       static char *aliasp = 0;
-
-       te.t_name = name;
-       te.t_aliases = &aliasp;
-       te.t_proto = proto;
-       te.t_tos = 020; /* Low Delay bit */
-       return(&te);
-}
-#endif
-
 main(argc, argv)
        char *argv[];
 {
        struct sockaddr_in from;
        int on = 1, fromlen;
 #ifdef IP_TOS
 main(argc, argv)
        char *argv[];
 {
        struct sockaddr_in from;
        int on = 1, fromlen;
 #ifdef IP_TOS
+       int tos;
+#ifdef CRAY
        struct tosent *tp;
        struct tosent *tp;
+#endif
 #endif /* IP_TOS */
 
        pfrontp = pbackp = ptyobuf;
 #endif /* IP_TOS */
 
        pfrontp = pbackp = ptyobuf;
@@ -214,8 +194,13 @@ top:
        }
 
 #ifdef IP_TOS
        }
 
 #ifdef IP_TOS
-       if ((tp = gettosbyname("telnet", "tcp")) &&
-           (setsockopt(0, IPPROTO_IP, IP_TOS, &tp->t_tos, sizeof(int)) < 0))
+#ifdef CRAY
+       if (tp = gettosbyname("telnet", "tcp"))
+               tos = tp->t_tos;
+       else
+#endif /* CRAY */
+       tos = IPTOS_LOWDELAY;
+       if (setsockopt(0, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0)
                syslog(LOG_WARNING, "setsockopt (IP_TOS): %m");
 #endif /* IP_TOS */
        net = 0;
                syslog(LOG_WARNING, "setsockopt (IP_TOS): %m");
 #endif /* IP_TOS */
        net = 0;