Index: cpukit/ChangeLog
===================================================================
--- cpukit/ChangeLog	(revision bfa87f3058e8adb85fa93550dd8fd1439b96d818)
+++ cpukit/ChangeLog	(revision d589e7527909a3120021572e24a9d86bdfb4c7d9)
@@ -1,2 +1,8 @@
+2004-04-26	Ralf Corsepius <ralf_corsepius@rtems.org>
+
+	* libnetworking/netinet/igmp_var.h: Cosmetic updates from FreeBSD.
+	* libnetworking/sys/sysctl.h: Update from FreeBSD.
+	* libnetworking/sys/socketvar.h: Update from FreeBSD.
+
 2004-04-24	Ralf Corsepius <ralf_corsepius@rtems.org>
 
Index: cpukit/libnetworking/netinet/igmp_var.h
===================================================================
--- cpukit/libnetworking/netinet/igmp_var.h	(revision bfa87f3058e8adb85fa93550dd8fd1439b96d818)
+++ cpukit/libnetworking/netinet/igmp_var.h	(revision d589e7527909a3120021572e24a9d86bdfb4c7d9)
@@ -15,8 +15,4 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
@@ -36,5 +32,5 @@
  *
  *	from: @(#)igmp_var.h	8.1 (Berkeley) 7/19/93
- * $FreeBSD: src/sys/netinet/igmp_var.h,v 1.19 2002/03/19 21:25:46 alfred Exp $
+ * $FreeBSD: src/sys/netinet/igmp_var.h,v 1.20 2004/04/07 20:46:13 imp Exp $
  */
 
@@ -109,4 +105,3 @@
 	{ "stats", CTLTYPE_STRUCT }, \
 }
-
 #endif
Index: cpukit/libnetworking/sys/socketvar.h
===================================================================
--- cpukit/libnetworking/sys/socketvar.h	(revision bfa87f3058e8adb85fa93550dd8fd1439b96d818)
+++ cpukit/libnetworking/sys/socketvar.h	(revision d589e7527909a3120021572e24a9d86bdfb4c7d9)
@@ -1,2 +1,4 @@
+/* $Id$ */
+
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -32,5 +34,5 @@
  *
  *	@(#)socketvar.h	8.3 (Berkeley) 2/19/95
- * $Id$
+ * $FreeBSD: src/sys/sys/socketvar.h,v 1.110 2004/03/01 03:14:23 rwatson Exp $
  */
 
@@ -52,5 +54,5 @@
 	short	so_linger;		/* time to linger while closing */
 	short	so_state;		/* internal state flags SS_*, below */
-	caddr_t	so_pcb;			/* protocol control block */
+	void 	*so_pcb;		/* protocol control block */
 	struct	protosw *so_proto;	/* protocol handle */
 /*
@@ -73,5 +75,5 @@
 					   connections */
 	short	so_qlimit;		/* max number queued connections */
-	u_long	so_timeo;		/* connection timeout */
+	short	so_timeo;		/* connection timeout */
 	u_short	so_error;		/* error affecting connection */
 	pid_t	so_pgid;		/* pgid for signals */
@@ -81,13 +83,13 @@
  */
 	struct	sockbuf {
-		u_long	sb_cc;		/* actual chars in buffer */
-		u_long	sb_hiwat;	/* max actual char count */
-		u_long	sb_mbcnt;	/* chars of mbufs used */
-		u_long	sb_mbmax;	/* max chars of mbufs to use */
-		long	sb_lowat;	/* low water mark */
+		u_int	sb_cc;		/* actual chars in buffer */
+		u_int	sb_hiwat;	/* max actual char count */
+		u_int	sb_mbcnt;	/* chars of mbufs used */
+		u_int	sb_mbmax;	/* max chars of mbufs to use */
+		int	sb_lowat;	/* low water mark */
 		struct	mbuf *sb_mb;	/* the mbuf chain */
 		struct	selinfo sb_sel;	/* process selecting read/write */
 		short	sb_flags;	/* flags, see below */
-		u_long	sb_timeo;	/* timeout for read/write */
+		int	sb_timeo;	/* timeout for read/write */
 		void	(*sb_wakeup) __P((struct socket *, caddr_t));
 		caddr_t	sb_wakeuparg;	/* arg for above */
@@ -103,6 +105,6 @@
 
 	caddr_t	so_tpcb;		/* Wisc. protocol control block XXX */
-	void	(*so_upcall) __P((struct socket *so, caddr_t arg, int waitf));
-	caddr_t	so_upcallarg;		/* Arg for above */
+	void	(*so_upcall)(struct socket *, void *arg, int);
+	void 	*so_upcallarg;		/* Arg for above */
 	uid_t	so_uid;			/* who opened the socket */
 };
@@ -215,66 +217,66 @@
  * File operations on sockets.
  */
-int	soo_ioctl __P((struct file *fp, int cmd, caddr_t data,
-	    struct proc *p));
-int	soo_select __P((struct file *fp, int which, struct proc *p));
-int	soo_stat __P((struct socket *so, struct stat *ub));
+int	soo_ioctl(struct file *fp, int cmd, caddr_t data,
+	    struct proc *p);
+int	soo_select(struct file *fp, int which, struct proc *p);
+int	soo_stat(struct socket *so, struct stat *ub);
 
 /*
  * From uipc_socket and friends
  */
-int	getsock __P((struct filedesc *fdp, int fdes, struct file **fpp));
-int	sockargs __P((struct mbuf **mp, caddr_t buf, int buflen, int type));
-void	sbappend __P((struct sockbuf *sb, struct mbuf *m));
-int	sbappendaddr __P((struct sockbuf *sb, struct sockaddr *asa,
-	    struct mbuf *m0, struct mbuf *control));
-int	sbappendcontrol __P((struct sockbuf *sb, struct mbuf *m0,
-	    struct mbuf *control));
-void	sbappendrecord __P((struct sockbuf *sb, struct mbuf *m0));
-void	sbcheck __P((struct sockbuf *sb));
-void	sbcompress __P((struct sockbuf *sb, struct mbuf *m, struct mbuf *n));
+int	getsock(struct filedesc *fdp, int fdes, struct file **fpp);
+int	sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type);
+void	sbappend(struct sockbuf *sb, struct mbuf *m);
+int	sbappendaddr(struct sockbuf *sb, struct sockaddr *asa,
+	    struct mbuf *m0, struct mbuf *control);
+int	sbappendcontrol(struct sockbuf *sb, struct mbuf *m0,
+	    struct mbuf *control);
+void	sbappendrecord(struct sockbuf *sb, struct mbuf *m0);
+void	sbcheck(struct sockbuf *sb);
+void	sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n);
 struct mbuf *
-	sbcreatecontrol __P((caddr_t p, int size, int type, int level));
-void	sbdrop __P((struct sockbuf *sb, int len));
-void	sbdroprecord __P((struct sockbuf *sb));
-void	sbflush __P((struct sockbuf *sb));
-void	sbinsertoob __P((struct sockbuf *sb, struct mbuf *m0));
-void	sbrelease __P((struct sockbuf *sb));
-int	sbreserve __P((struct sockbuf *sb, u_long cc));
-int	sbwait __P((struct sockbuf *sb));
-int	sb_lock __P((struct sockbuf *sb));
-int	soabort __P((struct socket *so));
-int	soaccept __P((struct socket *so, struct mbuf *nam));
-int	sobind __P((struct socket *so, struct mbuf *nam));
-void	socantrcvmore __P((struct socket *so));
-void	socantsendmore __P((struct socket *so));
-int	soclose __P((struct socket *so));
-int	soconnect __P((struct socket *so, struct mbuf *nam));
-int	soconnect2 __P((struct socket *so1, struct socket *so2));
-int	socreate __P((int dom, struct socket **aso, int type, int proto,
-	    struct proc *p));
-int	sodisconnect __P((struct socket *so));
-void	sofree __P((struct socket *so));
-int	sogetopt __P((struct socket *so, int level, int optname,
-	    struct mbuf **mp));
-void	sohasoutofband __P((struct socket *so));
-void	soisconnected __P((struct socket *so));
-void	soisconnecting __P((struct socket *so));
-void	soisdisconnected __P((struct socket *so));
-void	soisdisconnecting __P((struct socket *so));
-int	solisten __P((struct socket *so, int backlog));
+	sbcreatecontrol(caddr_t p, int size, int type, int level);
+void	sbdrop(struct sockbuf *sb, int len);
+void	sbdroprecord(struct sockbuf *sb);
+void	sbflush(struct sockbuf *sb);
+void	sbinsertoob(struct sockbuf *sb, struct mbuf *m0);
+void	sbrelease(struct sockbuf *sb);
+int	sbreserve(struct sockbuf *sb, u_long cc);
+int	sbwait(struct sockbuf *sb);
+int	sb_lock(struct sockbuf *sb);
+int	soabort(struct socket *so);
+int	soaccept(struct socket *so, struct mbuf *nam);
+int	sobind(struct socket *so, struct mbuf *nam);
+void	socantrcvmore(struct socket *so);
+void	socantsendmore(struct socket *so);
+int	soclose(struct socket *so);
+int	soconnect(struct socket *so, struct mbuf *nam);
+int	soconnect2(struct socket *so1, struct socket *so2);
+int	socreate(int dom, struct socket **aso, int type, int proto,
+	    struct proc *p);
+int	sodisconnect(struct socket *so);
+void	sofree(struct socket *so);
+int	sogetopt(struct socket *so, int level, int optname,
+	    struct mbuf **mp);
+void	sohasoutofband(struct socket *so);
+void	soisconnected(struct socket *so);
+void	soisconnecting(struct socket *so);
+void	soisdisconnected(struct socket *so);
+void	soisdisconnecting(struct socket *so);
+int	solisten(struct socket *so, int backlog);
 struct socket *
-	sodropablereq __P((struct socket *head));
+	sodropablereq(struct socket *head);
 struct socket *
-	sonewconn1 __P((struct socket *head, int connstatus));
-int	soreceive __P((struct socket *so, struct mbuf **paddr, struct uio *uio,
-	    struct mbuf **mp0, struct mbuf **controlp, int *flagsp));
-int	soreserve __P((struct socket *so, u_long sndcc, u_long rcvcc));
-void	sorflush __P((struct socket *so));
-int	sosend __P((struct socket *so, struct mbuf *addr, struct uio *uio,
-	    struct mbuf *top, struct mbuf *control, int flags));
-int	sosetopt __P((struct socket *so, int level, int optname,
-	    struct mbuf *m0));
-int	soshutdown __P((struct socket *so, int how));
-void	sowakeup __P((struct socket *so, struct sockbuf *sb));
+	sonewconn1(struct socket *head, int connstatus);
+int	soreceive(struct socket *so, struct mbuf **paddr, struct uio *uio,
+	    struct mbuf **mp0, struct mbuf **controlp, int *flagsp);
+int	soreserve(struct socket *so, u_long sndcc, u_long rcvcc);
+void	sorflush(struct socket *so);
+int	sosend(struct socket *so, struct mbuf *addr, struct uio *uio,
+	    struct mbuf *top, struct mbuf *control, int flags);
+int	sosetopt(struct socket *so, int level, int optname,
+	    struct mbuf *m0);
+int	soshutdown(struct socket *so, int how);
+void	sowakeup(struct socket *so, struct sockbuf *sb);
 #endif /* _KERNEL */
 
Index: cpukit/libnetworking/sys/sysctl.h
===================================================================
--- cpukit/libnetworking/sys/sysctl.h	(revision bfa87f3058e8adb85fa93550dd8fd1439b96d818)
+++ cpukit/libnetworking/sys/sysctl.h	(revision d589e7527909a3120021572e24a9d86bdfb4c7d9)
@@ -14,8 +14,4 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
@@ -35,5 +31,5 @@
  *
  *	@(#)sysctl.h	8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/sys/sys/sysctl.h,v 1.110 2002/10/20 22:48:08 phk Exp $
+ * $FreeBSD: src/sys/sys/sysctl.h,v 1.128 2004/04/07 04:19:49 imp Exp $
  */
 
@@ -53,5 +49,5 @@
  */
 
-#define CTL_MAXNAME	12	/* largest number of components supported */
+#define CTL_MAXNAME	24	/* largest number of components supported */
 
 /*
@@ -60,5 +56,5 @@
  * levels defined below it, or it is a leaf of some particular
  * type given below. Each sysctl level defines a set of name/type
- * pairs to be used by sysctl(1) in manipulating the subsystem.
+ * pairs to be used by sysctl(8) in manipulating the subsystem.
  */
 struct ctlname {
@@ -87,4 +83,17 @@
 #define CTLFLAG_DYN	0x02000000	/* Dynamic oid - can be freed */
 #define CTLFLAG_SKIP	0x01000000	/* Skip this sysctl when listing */
+#define CTLMASK_SECURE	0x00F00000	/* Secure level */
+#define CTLFLAG_TUN	0x00080000	/* Tunable variable */
+#define CTLFLAG_RDTUN	(CTLFLAG_RD|CTLFLAG_TUN)
+
+/*
+ * Secure level.   Note that CTLFLAG_SECURE == CTLFLAG_SECURE1.  
+ *
+ * Secure when the securelevel is raised to at least N.
+ */
+#define CTLSHIFT_SECURE	20
+#define CTLFLAG_SECURE1	(CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE))
+#define CTLFLAG_SECURE2	(CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE))
+#define CTLFLAG_SECURE3	(CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE))
 
 /*
@@ -127,4 +136,5 @@
 	size_t		newidx;
 	int		(*newfunc)(struct sysctl_req *, void *, size_t);
+	size_t		validlen;
 };
 
@@ -184,4 +194,7 @@
 TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 
+#define SYSCTL_NODE_CHILDREN(parent, name) \
+	sysctl_##parent##_##name##_children
+
 /* This constructs a "raw" MIB oid. */
 #define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \
@@ -196,7 +209,7 @@
 /* This constructs a node from which other oids can hang. */
 #define SYSCTL_NODE(parent, nbr, name, access, handler, descr)		    \
-	struct sysctl_oid_list sysctl_##parent##_##name##_children;	    \
+	struct sysctl_oid_list SYSCTL_NODE_CHILDREN(parent, name);	    \
 	SYSCTL_OID(parent, nbr, name, CTLTYPE_NODE|(access),		    \
-		   (void*)&sysctl_##parent##_##name##_children, 0, handler, \
+		   (void*)&SYSCTL_NODE_CHILDREN(parent, name), 0, handler, \
 		   "N", descr)
 
@@ -241,5 +254,5 @@
 	ptr, 0, sysctl_handle_long, "L", descr)
 
-/* Oid for a long.  The pointer must be non NULL. */
+/* Oid for an unsigned long.  The pointer must be non NULL. */
 #define SYSCTL_ULONG(parent, nbr, name, access, ptr, val, descr) \
 	SYSCTL_OID(parent, nbr, name, CTLTYPE_ULONG|(access), \
@@ -404,4 +417,10 @@
 #define	KERN_PROC_RUID		6	/* by real uid */
 #define	KERN_PROC_ARGS		7	/* get/set arguments/proctitle */
+#define	KERN_PROC_PROC		8	/* only return procs */
+#define	KERN_PROC_SV_NAME	9	/* get syscall vector name */
+#define	KERN_PROC_INC_THREAD	0x10	/*
+					 * modifier for pid, pgrp, tty,
+					 * uid, ruid, and proc
+					 */
 
 /*
@@ -573,4 +592,5 @@
 extern char	osrelease[];
 extern char	ostype[];
+extern char	kern_ident[];
 
 /* Dynamic oid handling */
@@ -580,4 +600,6 @@
 		int (*handler) (SYSCTL_HANDLER_ARGS),
 		const char *fmt, const char *descr);
+int	sysctl_move_oid(struct sysctl_oid *oidp,
+		struct sysctl_oid_list *parent);
 int	sysctl_remove_oid(struct sysctl_oid *oidp, int del, int recurse);
 int	sysctl_ctx_init(struct sysctl_ctx_list *clist);
@@ -601,5 +623,5 @@
 int	sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
 			int *nindx, struct sysctl_req *req);
-void	sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
+int	sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
 
 #else	/* !_KERNEL */
