Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jan 2009 11:02:17 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r186809 - head/sys/sys
Message-ID:  <200901061102.n06B2HST028840@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jan  6 11:02:17 2009
New Revision: 186809
URL: http://svn.freebsd.org/changeset/base/186809

Log:
  Further cleanup protosw.h:
  - Remove unused typedefs to avoid confusion and ease in merging
    ip6protosw with protosw.
  - Correct a few comments.
  - Remove most of a comment about usrreq. [1]
  - Use tabs instead of spaces for consistency.
  
  Submitted by:	rwatson [1]
  Reviewed by:	rwatson
  MFC after:	3 weeks

Modified:
  head/sys/sys/protosw.h

Modified: head/sys/sys/protosw.h
==============================================================================
--- head/sys/sys/protosw.h	Tue Jan  6 09:03:02 2009	(r186808)
+++ head/sys/sys/protosw.h	Tue Jan  6 11:02:17 2009	(r186809)
@@ -66,9 +66,7 @@ struct sockopt;
 /* USE THESE FOR YOUR PROTOTYPES ! */
 typedef void	pr_input_t (struct mbuf *, int);
 typedef int	pr_input6_t (struct mbuf **, int*, int);  /* XXX FIX THIS */
-typedef void	pr_in_input_t (struct mbuf *, int, int); /* XXX FIX THIS */
 typedef int	pr_output_t (struct mbuf *, struct socket *);
-typedef int	pr_in_output_t (struct mbuf *, struct socket *, struct sockaddr *);
 typedef void	pr_ctlinput_t (int, struct sockaddr *, void *);
 typedef int	pr_ctloutput_t (struct socket *, struct sockopt *);
 typedef	void	pr_init_t (void);
@@ -76,9 +74,6 @@ typedef	void	pr_fasttimo_t (void);
 typedef	void	pr_slowtimo_t (void);
 typedef	void	pr_drain_t (void);
 
-typedef int	pr_usrreq_t(struct socket *, int, struct mbuf *,
-			     struct mbuf *, struct mbuf *, struct thread *);
-
 struct protosw {
 	short	pr_type;		/* socket type used for */
 	struct	domain *pr_domain;	/* domain protocol a member of */
@@ -95,7 +90,7 @@ struct protosw {
 	pr_slowtimo_t *pr_slowtimo;	/* slow timeout (500ms) */
 	pr_drain_t *pr_drain;		/* flush any excess space possible */
 
-	struct	pr_usrreqs *pr_usrreqs;	/* supersedes pr_usrreq() */
+	struct	pr_usrreqs *pr_usrreqs;	/* user-protocol hook */
 };
 /*#endif*/
 
@@ -131,17 +126,6 @@ struct protosw {
  * We now provide individual function pointers which protocols can implement,
  * which offers a number of benefits (such as type checking for arguments).
  * These older constants are still present in order to support TCP debugging.
- *
- * The arguments to usrreq were:
- *	(*protosw[].pr_usrreq)(up, req, m, nam, opt);
- * where up is a (struct socket *), req is one of these requests,
- * m is an optional mbuf chain containing a message,
- * nam is an optional mbuf chain containing an address,
- * and opt is a pointer to a socketopt structure or nil.
- * The protocol is responsible for disposal of the mbuf chain m,
- * the caller is responsible for any space held by nam and opt.
- * A non-zero return from usrreq gives an
- * UNIX error number which should be passed to higher level software.
  */
 #define	PRU_ATTACH		0	/* attach protocol to up */
 #define	PRU_DETACH		1	/* detach protocol from up */
@@ -170,8 +154,8 @@ struct protosw {
 #define PRU_SEND_EOF		22	/* send and close */
 #define	PRU_SOSETLABEL		23	/* MAC label change */
 #define	PRU_CLOSE		24	/* socket close */
-#define PRU_FLUSH       25 /* flush the socket */
-#define PRU_NREQ		25
+#define	PRU_FLUSH		25	/* flush the socket */
+#define	PRU_NREQ		25
 
 #ifdef PRUREQUESTS
 const char *prurequests[] = {
@@ -181,7 +165,7 @@ const char *prurequests[] = {
 	"SENSE",	"RCVOOB",	"SENDOOB",	"SOCKADDR",
 	"PEERADDR",	"CONNECT2",	"FASTTIMO",	"SLOWTIMO",
 	"PROTORCV",	"PROTOSEND",	"SEND_EOF",	"SOSETLABEL",
-	"CLOSE", 	"FLUSH",
+	"CLOSE",	"FLUSH",
 };
 #endif
 
@@ -327,7 +311,7 @@ char	*prcrequests[] = {
  * The protocol is responsible for disposal of the mbuf chain *optval
  * if supplied,
  * the caller is responsible for any space held by *optval, when returned.
- * A non-zero return from usrreq gives an
+ * A non-zero return from ctloutput gives an
  * UNIX error number which should be passed to higher level software.
  */
 #define	PRCO_GETOPT	0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901061102.n06B2HST028840>