wnj'ify for rights passing
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 28 May 1983 04:59:07 +0000 (20:59 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sat, 28 May 1983 04:59:07 +0000 (20:59 -0800)
SCCS-vsn: sys/sys/protosw.h 4.15
SCCS-vsn: sys/sys/socket.h 4.27
SCCS-vsn: sys/sys/un.h 5.2

usr/src/sys/sys/protosw.h
usr/src/sys/sys/socket.h
usr/src/sys/sys/un.h

index 27f7142..3101e89 100644 (file)
@@ -1,4 +1,4 @@
-/*     protosw.h       4.14    82/11/13        */
+/*     protosw.h       4.15    83/05/27        */
 
 /*
  * Protocol switch table.
 
 /*
  * Protocol switch table.
@@ -52,6 +52,7 @@ struct protosw {
 /* in the current implementation, PR_ADDR needs PR_ATOMIC to work */
 #define        PR_CONNREQUIRED 0x04            /* connection required by protocol */
 #define        PR_WANTRCVD     0x08            /* want PRU_RCVD calls */
 /* in the current implementation, PR_ADDR needs PR_ATOMIC to work */
 #define        PR_CONNREQUIRED 0x04            /* connection required by protocol */
 #define        PR_WANTRCVD     0x08            /* want PRU_RCVD calls */
+#define        PR_RIGHTS       0x10            /* passes capabilities */
 
 /*
  * The arguments to usrreq are:
 
 /*
  * The arguments to usrreq are:
index dc0da56..e973065 100644 (file)
@@ -1,71 +1,52 @@
-/*     socket.h        4.26    83/05/18        */
+/*     socket.h        4.27    83/05/27        */
 
 /*
 
 /*
- * Externally visible attributes of sockets.
+ * Definitions related to sockets: types, address families, options.
  */
 
 /*
  */
 
 /*
- * Socket types.
- *
- * The kernel implement these abstract (session-layer) socket
- * services, with extra protocol on top of network services
- * if necessary.
+ * Types
  */
 #define        SOCK_STREAM     1               /* stream socket */
 #define        SOCK_DGRAM      2               /* datagram socket */
 #define        SOCK_RAW        3               /* raw-protocol interface */
 #define        SOCK_RDM        4               /* reliably-delivered message */
  */
 #define        SOCK_STREAM     1               /* stream socket */
 #define        SOCK_DGRAM      2               /* datagram socket */
 #define        SOCK_RAW        3               /* raw-protocol interface */
 #define        SOCK_RDM        4               /* reliably-delivered message */
+#define        SOCK_SEQPACKET  5               /* sequenced packet stream */
 
 /*
  * Option flags per-socket.
  */
 #define        SO_DEBUG        0x01            /* turn on debugging info recording */
 
 /*
  * Option flags per-socket.
  */
 #define        SO_DEBUG        0x01            /* turn on debugging info recording */
-#define        SO_ACCEPTCONN   0x02            /* willing to accept connections */
-#define        SO_REUSEADDR    0x04            /* allow local address reuse (gag) */
+#define        SO_ACCEPTCONN   0x02            /* socket has had listen() */
+#define        SO_REUSEADDR    0x04            /* allow local address reuse */
 #define        SO_KEEPALIVE    0x08            /* keep connections alive */
 #define        SO_DONTROUTE    0x10            /* just use interface addresses */
 #define        SO_KEEPALIVE    0x08            /* keep connections alive */
 #define        SO_DONTROUTE    0x10            /* just use interface addresses */
-#define        SO_NEWFDONCONN  0x20            /* give new fd on connection */
+                               /* 0x20 was SO_NEWFDONCONN */
 #define        SO_USELOOPBACK  0x40            /* bypass hardware when possible */
 #define        SO_LINGER       0x80            /* linger on close if data present */
 #define        SO_DONTLINGER   (~SO_LINGER)    /* ~SO_LINGER */
 
 /*
 #define        SO_USELOOPBACK  0x40            /* bypass hardware when possible */
 #define        SO_LINGER       0x80            /* linger on close if data present */
 #define        SO_DONTLINGER   (~SO_LINGER)    /* ~SO_LINGER */
 
 /*
- * Generic socket protocol format.
- *
- * Each process is normally operating in a protocol family,
- * whose protocols are used unless the process specifies otherwise.
- * Most families supply protocols to the basic socket types.  When
- * protocols are not present in the family, the higher level (roughly
- * ISO session layer) code in the system layers on the protocols
- * to support the socket types.
+ * Address families.
  */
  */
-struct sockproto {
-       u_short sp_family;              /* protocol family */
-       u_short sp_protocol;            /* protocol within family */
-};
+#define        AF_UNSPEC       0               /* unspecified */
+#define        AF_UNIX         1               /* local to host (pipes, portals) */
+#define        AF_INET         2               /* internetwork: UDP, TCP, etc. */
+#define        AF_IMPLINK      3               /* arpanet imp addresses */
+#define        AF_PUP          4               /* pup protocols: e.g. BSP */
+#define        AF_CHAOS        5               /* mit CHAOS protocols */
+#define        AF_NS           6               /* XEROX NS protocols */
+#define        AF_NBS          7               /* nbs protocols */
+#define        AF_ECMA         8               /* european computer manufacturers */
+#define        AF_DATAKIT      9               /* datakit protocols */
+#define        AF_CCITT        10              /* CCITT protocols, X.25 etc */
+#define        AF_SNA          11              /* IBM SNA */
 
 
-#define        PF_UNSPEC       0               /* unspecified */
-#define        PF_UNIX         1               /* UNIX internal protocol */
-#define        PF_INET         2               /* internetwork: UDP, TCP, etc. */
-#define        PF_IMPLINK      3               /* imp link protocols */
-#define        PF_PUP          4               /* pup protocols: e.g. BSP */
-#define        PF_CHAOS        5               /* mit CHAOS protocols */
-#define        PF_OISCP        6               /* ois communication protocols */
-#define        PF_NBS          7               /* nbs protocols */
-#define        PF_ECMA         8               /* european computer manufacturers */
-#define        PF_DATAKIT      9               /* datakit protocols */
-#define        PF_CCITT        10              /* CCITT protocols, X.25 etc */
+#define        AF_MAX          12
 
 /*
 
 /*
- * Generic socket address format.
- *
- * Each process is also operating in an address family, whose
- * addresses are assigned unless otherwise requested.  The address
- * family used affects address properties: whether addresses are
- * externalized or internalized, location dependent or independent, etc.
- * The address can be defined directly if it fits in 14 bytes, or
- * a pointer and length can be given to variable length data.
- * We give these as two different structures to allow initialization.
+ * Structure used by kernel to store most
+ * addresses.
  */
 struct sockaddr {
        u_short sa_family;              /* address family */
  */
 struct sockaddr {
        u_short sa_family;              /* address family */
@@ -73,26 +54,56 @@ struct sockaddr {
 };
 
 /*
 };
 
 /*
- * The first few address families correspond to protocol
- * families.  Address families unrelated to protocol families
- * are also possible.
+ * Structure used by kernel to pass protocol
+ * information in raw sockets.
  */
  */
-#define        AF_UNSPEC       0               /* unspecified */
-#define        AF_UNIX         1               /* local to host (pipes, portals) */
-#define        AF_INET         2               /* internetwork: UDP, TCP, etc. */
-#define        AF_IMPLINK      3               /* arpanet imp addresses */
-#define        AF_PUP          4               /* pup protocols: e.g. BSP */
-#define        AF_CHAOS        5               /* mit CHAOS protocols */
-#define        AF_OISCP        6               /* ois communication protocols */
-#define        AF_NBS          7               /* nbs protocols */
-#define        AF_ECMA         8               /* european computer manufacturers */
-#define        AF_DATAKIT      9               /* datakit protocols */
-#define        AF_CCITT        10              /* CCITT protocols, X.25 etc */
+struct sockproto {
+       u_short sp_family;              /* address family */
+       u_short sp_protocol;            /* protocol */
+};
 
 
-#define        AF_MAX          11
+/*
+ * Protocol families, same as address families for now.
+ */
+#define        PF_UNSPEC       AF_UNSPEC
+#define        PF_UNIX         AF_UNIX
+#define        PF_INET         AF_INET
+#define        PF_IMPLINK      AF_IMPLINK
+#define        PF_PUP          AF_PUP
+#define        PF_CHAOS        AF_CHAOS
+#define        PF_NS           AF_NS
+#define        PF_NBS          AF_NBS
+#define        PF_ECMA         AF_ECMA
+#define        PF_DATAKIT      AF_DATAKIT
+#define        PF_CCITT        AF_CCITT
+#define        PF_SNA          AF_SNA
 
 
+#define        PF_MAX          12
+
+/*
+ * Level number for (get/set)sockopt() to apply to socket itself.
+ */
 #define        SOL_SOCKET      0xffff          /* options for socket level */
 
 #define        SOL_SOCKET      0xffff          /* options for socket level */
 
-#define        SOF_OOB         0x1             /* send/recv out-of-band data */
-#define        SOF_PREVIEW     0x2             /* look at data, but don't read */
-#define        SOF_DONTROUTE   0x4             /* send without routing data */
+/*
+ * Maximum queue length specifiable by listen.
+ */
+#define        SOMAXCONN       5
+
+/*
+ * Message header for recvmsg and sendmsg calls.
+ */
+struct msghdr {
+       caddr_t msg_name;               /* optional address */
+       int     msg_namelen;            /* size of address */
+       struct  iovec *msg_iov;         /* scatter/gather array */
+       int     msg_iovlen;             /* # elements in msg_iov */
+       caddr_t msg_accrights;          /* access rights sent/received */
+       int     msg_accrightslen;
+};
+
+#define        MSG_OOB         0x1             /* process out-of-band data */
+#define        MSG_PEEK        0x2             /* peek at incoming message */
+#define        MSG_DONTROUTE   0x4             /* send without using routing tables */
+
+#define        MSG_MAXIOVLEN   16
index 2fc6fc5..0d7831d 100644 (file)
@@ -1,4 +1,4 @@
-/*     un.h    5.1     82/08/02        */
+/*     un.h    5.2     83/05/27        */
 
 /*
  * Definitions for UNIX IPC domain.
 
 /*
  * Definitions for UNIX IPC domain.
@@ -7,3 +7,7 @@ struct  sockaddr_un {
        short   sun_family;             /* AF_UNIX */
        char    sun_path[14];           /* path name */
 };
        short   sun_family;             /* AF_UNIX */
        char    sun_path[14];           /* path name */
 };
+
+#ifdef KERNEL
+int    unp_discard();
+#endif