BSD 4_4 release
[unix-history] / usr / src / sbin / ifconfig / ifconfig.c
index f36b62b..36560b9 100644 (file)
@@ -1,6 +1,6 @@
 /*
 /*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1983, 1993\n\
      The Regents of the University of California.  All rights reserved.\n";
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ifconfig.c 5.1 (Berkeley) 2/28/91";
+static char sccsid[] = "@(#)ifconfig.c 8.1 (Berkeley) 6/5/93";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -86,7 +86,7 @@ extern        int errno;
 
 int    setifflags(), setifaddr(), setifdstaddr(), setifnetmask();
 int    setifmetric(), setifbroadaddr(), setifipdst();
 
 int    setifflags(), setifaddr(), setifdstaddr(), setifnetmask();
 int    setifmetric(), setifbroadaddr(), setifipdst();
-int    notealias(), setsnpaoffset(), setnsellength();
+int    notealias(), setsnpaoffset(), setnsellength(), notrailers();
 
 #define        NEXTARG         0xffffff
 
 
 #define        NEXTARG         0xffffff
 
@@ -97,8 +97,8 @@ struct        cmd {
 } cmds[] = {
        { "up",         IFF_UP,         setifflags } ,
        { "down",       -IFF_UP,        setifflags },
 } cmds[] = {
        { "up",         IFF_UP,         setifflags } ,
        { "down",       -IFF_UP,        setifflags },
-       { "trailers",   -IFF_NOTRAILERS,setifflags },
-       { "-trailers",  IFF_NOTRAILERS, setifflags },
+       { "trailers",   -1,             notrailers },
+       { "-trailers",  1,              notrailers },
        { "arp",        -IFF_NOARP,     setifflags },
        { "-arp",       IFF_NOARP,      setifflags },
        { "debug",      IFF_DEBUG,      setifflags },
        { "arp",        -IFF_NOARP,     setifflags },
        { "-arp",       IFF_NOARP,      setifflags },
        { "debug",      IFF_DEBUG,      setifflags },
@@ -117,12 +117,12 @@ struct    cmd {
        { "ipdst",      NEXTARG,        setifipdst },
        { "snpaoffset", NEXTARG,        setsnpaoffset },
        { "nsellength", NEXTARG,        setnsellength },
        { "ipdst",      NEXTARG,        setifipdst },
        { "snpaoffset", NEXTARG,        setsnpaoffset },
        { "nsellength", NEXTARG,        setnsellength },
-       { "llc0",       IFF_LLC0,       setifflags } ,
-       { "-llc0",      -IFF_LLC0,      setifflags } ,
-       { "llc1",       IFF_LLC1,       setifflags } ,
-       { "-llc1",      -IFF_LLC1,      setifflags } ,
-       { "llc2",       IFF_LLC2,       setifflags } ,
-       { "-llc2",      -IFF_LLC2,      setifflags } ,
+       { "link0",      IFF_LINK0,      setifflags } ,
+       { "-link0",     -IFF_LINK0,     setifflags } ,
+       { "link1",      IFF_LINK1,      setifflags } ,
+       { "-link1",     -IFF_LINK1,     setifflags } ,
+       { "link2",      IFF_LINK2,      setifflags } ,
+       { "-link2",     -IFF_LINK2,     setifflags } ,
        { 0,            0,              setifaddr },
        { 0,            0,              setifdstaddr },
 };
        { 0,            0,              setifaddr },
        { 0,            0,              setifdstaddr },
 };
@@ -167,13 +167,12 @@ main(argc, argv)
        register struct afswtch *rafp;
 
        if (argc < 2) {
        register struct afswtch *rafp;
 
        if (argc < 2) {
-               fprintf(stderr, "usage: ifconfig interface\n%s%s%s%s%s%s",
+               fprintf(stderr, "usage: ifconfig interface\n%s%s%s%s%s",
                    "\t[ af [ address [ dest_addr ] ] [ up ] [ down ]",
                            "[ netmask mask ] ]\n",
                    "\t[ metric n ]\n",
                    "\t[ af [ address [ dest_addr ] ] [ up ] [ down ]",
                            "[ netmask mask ] ]\n",
                    "\t[ metric n ]\n",
-                   "\t[ trailers | -trailers ]\n",
                    "\t[ arp | -arp ]\n",
                    "\t[ arp | -arp ]\n",
-                   "\t[ llc0 | -llc0 ] [ llc1 | -llc1 ] [ llc2 | -llc2 ] \n");
+                   "\t[ link0 | -link0 ] [ link1 | -link1 ] [ link2 | -link2 ] \n");
                exit(1);
        }
        argc--, argv++;
                exit(1);
        }
        argc--, argv++;
@@ -312,6 +311,14 @@ notealias(addr, param)
                clearaddr = 0;
 }
 
                clearaddr = 0;
 }
 
+/*ARGSUSED*/
+notrailers(vname, value)
+       char *vname;
+       int value;
+{
+       printf("Note: trailers are no longer sent, but always received\n");
+}
+
 /*ARGSUSED*/
 setifdstaddr(addr, param)
        char *addr;
 /*ARGSUSED*/
 setifdstaddr(addr, param)
        char *addr;
@@ -358,7 +365,7 @@ setsnpaoffset(val)
 
 #define        IFFBITS \
 "\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6NOTRAILERS\7RUNNING\10NOARP\
 
 #define        IFFBITS \
 "\020\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5POINTOPOINT\6NOTRAILERS\7RUNNING\10NOARP\
-\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LLC0\16LLC1\16LLC2"
+\11PROMISC\12ALLMULTI\13OACTIVE\14SIMPLEX\15LINK0\16LINK1\17LINK2\20MULTICAST"
 
 /*
  * Print the status of the interface.  If an address family was
 
 /*
  * Print the status of the interface.  If an address family was