From 6fbb9cf860dcd415df0a3cf4b38439566960e8fd Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 7 Jun 2006 13:09:04 +0000 Subject: [PATCH] Update comments in struct protosw to reflect changing times: - Between 1996 and 1997, wollman eliminated pr_usrreq() and replaced it with direct function pointers. Update comment to reflect these changes. - In 2003, I added pru_sosetlabel(). Update comment to reflect this change. MFC after: 1 week --- sys/sys/protosw.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 760aa7e41090..fbc7e04c0999 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -128,7 +128,13 @@ struct protosw { #define PR_LASTHDR 0x40 /* enforce ipsec policy; last header */ /* - * The arguments to usrreq are: + * In earlier BSD network stacks, a single pr_usrreq() function pointer was + * invoked with an operation number indicating what operation was desired. + * 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, @@ -186,10 +192,8 @@ 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. + * If the ordering here looks odd, that's because it's alphabetical. These + * should eventually be merged back into struct protosw. * * Some fields initialized to defaults if they are NULL. * See uipc_domain.c:net_init_domain() @@ -224,7 +228,7 @@ struct pr_usrreqs { int (*pru_sockaddr)(struct socket *so, struct sockaddr **nam); /* - * These three added later, so they are out of order. They are used + * These four 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