-#ifdef PRUREQUESTS
-char *prurequests[] = {
- "ATTACH", "DETACH", "BIND", "LISTEN",
- "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
- "RCVD", "SEND", "ABORT", "CONTROL",
- "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
- "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
- "PROTORCV", "PROTOSEND",
- "SEND_EOF",
-};
-#endif
-
-#ifdef KERNEL /* users shouldn't see this decl */
-
-struct ifnet;
-struct stat;
-struct ucred;
-struct uio;
-
-/*
- * If the ordering here looks odd, that's because it's alphabetical.
- * Having this structure separated out from the main protoswitch is allegedly
- * a big (12 cycles per call) lose on high-end CPUs. We will eventually
- * migrate this stuff back into the main structure.
- */
-struct pr_usrreqs {
- int (*pru_abort) __P((struct socket *so));
- int (*pru_accept) __P((struct socket *so, struct sockaddr **nam));
- int (*pru_attach) __P((struct socket *so, int proto,
- struct proc *p));
- int (*pru_bind) __P((struct socket *so, struct sockaddr *nam,
- struct proc *p));
- int (*pru_connect) __P((struct socket *so, struct sockaddr *nam,
- struct proc *p));
- int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
- int (*pru_control) __P((struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp, struct proc *p));
- int (*pru_detach) __P((struct socket *so));
- int (*pru_disconnect) __P((struct socket *so));
- int (*pru_listen) __P((struct socket *so, struct proc *p));
- int (*pru_peeraddr) __P((struct socket *so,
- struct sockaddr **nam));
- int (*pru_rcvd) __P((struct socket *so, int flags));
- int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
- int flags));
- int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
- struct sockaddr *addr, struct mbuf *control,
- struct proc *p));
-#define PRUS_OOB 0x1
-#define PRUS_EOF 0x2
-#define PRUS_MORETOCOME 0x4
- int (*pru_sense) __P((struct socket *so, struct stat *sb));
- int (*pru_shutdown) __P((struct socket *so));
- int (*pru_sockaddr) __P((struct socket *so,
- struct sockaddr **nam));
-
- /*
- * These three added later, so they are out of order. They are used
- * for shortcutting (fast path input/output) in some protocols.
- * XXX - that's a lie, they are not implemented yet
- * Rather than calling sosend() etc. directly, calls are made
- * through these entry points. For protocols which still use
- * the generic code, these just point to those routines.
- */
- int (*pru_sosend) __P((struct socket *so, struct sockaddr *addr,
- struct uio *uio, struct mbuf *top,
- struct mbuf *control, int flags));
- int (*pru_soreceive) __P((struct socket *so,
- struct sockaddr **paddr,
- struct uio *uio, struct mbuf **mp0,
- struct mbuf **controlp, int *flagsp));
- int (*pru_sopoll) __P((struct socket *so, int events,
- struct ucred *cred, void *));
-};
-
-extern int pru_abort_notsupp(struct socket *so);
-extern int pru_accept_notsupp(struct socket *so, struct sockaddr **nam);
-extern int pru_attach_notsupp(struct socket *so, int proto,
- struct proc *p);
-extern int pru_bind_notsupp(struct socket *so, struct sockaddr *nam,
- struct proc *p);
-extern int pru_connect_notsupp(struct socket *so, struct sockaddr *nam,
- struct proc *p);
-extern int pru_connect2_notsupp(struct socket *so1, struct socket *so2);
-extern int pru_control_notsupp(struct socket *so, u_long cmd, caddr_t data,
- struct ifnet *ifp, struct proc *p);
-extern int pru_detach_notsupp(struct socket *so);
-extern int pru_disconnect_notsupp(struct socket *so);
-extern int pru_listen_notsupp(struct socket *so, struct proc *p);
-extern int pru_peeraddr_notsupp(struct socket *so,
- struct sockaddr **nam);
-extern int pru_rcvd_notsupp(struct socket *so, int flags);
-extern int pru_rcvoob_notsupp(struct socket *so, struct mbuf *m,
- int flags);
-extern int pru_send_notsupp(struct socket *so, int flags, struct mbuf *m,
- struct sockaddr *addr, struct mbuf *control,
- struct proc *p);
-extern int pru_sense_null(struct socket *so, struct stat *sb);
-extern int pru_shutdown_notsupp(struct socket *so);
-extern int pru_sockaddr_notsupp(struct socket *so,
- struct sockaddr **nam);
-extern int pru_sosend_notsupp(struct socket *so, struct sockaddr *addr,
- struct uio *uio, struct mbuf *top,
- struct mbuf *control, int flags);
-extern int pru_soreceive_notsupp(struct socket *so,
- struct sockaddr **paddr,
- struct uio *uio, struct mbuf **mp0,
- struct mbuf **controlp, int *flagsp);
-extern int pru_sopoll_notsupp(struct socket *so, int events,
- struct ucred *cred);
-
-
-#endif /* KERNEL */
-
-/*
- * The arguments to the ctlinput routine are
- * (*protosw[].pr_ctlinput)(cmd, sa, arg);
- * where cmd is one of the commands below, sa is a pointer to a sockaddr,
- * and arg is a `void *' argument used within a protocol family.
- */
-#define PRC_IFDOWN 0 /* interface transition */
-#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
-#define PRC_IFUP 2 /* interface has come back up */
-#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
-#define PRC_QUENCH 4 /* some one said to slow down */
-#define PRC_MSGSIZE 5 /* message size forced drop */
-#define PRC_HOSTDEAD 6 /* host appears to be down */
-#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
-#define PRC_UNREACH_NET 8 /* no route to network */
-#define PRC_UNREACH_HOST 9 /* no route to host */
-#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
-#define PRC_UNREACH_PORT 11 /* bad port # */
-/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
-#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
-#define PRC_REDIRECT_NET 14 /* net routing redirect */
-#define PRC_REDIRECT_HOST 15 /* host routing redirect */
-#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
-#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
-#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
-#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
-#define PRC_PARAMPROB 20 /* header incorrect */
-#define PRC_UNREACH_ADMIN_PROHIB 21 /* packet administrativly prohibited */
-
-#define PRC_NCMDS 22
-
-#define PRC_IS_REDIRECT(cmd) \
- ((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)