From owner-freebsd-hackers Wed Apr 3 19:27:03 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA17761 for hackers-outgoing; Wed, 3 Apr 1996 19:27:03 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA17749 for ; Wed, 3 Apr 1996 19:26:56 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id NAA21196; Thu, 4 Apr 1996 13:25:35 +1000 Date: Thu, 4 Apr 1996 13:25:35 +1000 From: Bruce Evans Message-Id: <199604040325.NAA21196@godzilla.zeta.org.au> To: jgreco@brasil.moneng.mei.com, phk@critter.tfs.com Subject: Re: SO_KEEPALIVE - New feature patch enclosed. Cc: hackers@FreeBSD.ORG Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >It seems to work for me. I warn you now, though, I'm no kernel hacker. It's much easier to control the variable in -current. For integer variables it takes one line. Something like: SYSCTL_INT(_net_inet_tcp, OID_AUTO, foo, CTLFLAG_RW, &foo, 0, ""); >*** /usr/src/sys/netinet/tcp_var.h.fcs Sat Jul 29 18:16:53 1995 >--- /usr/src/sys/netinet/tcp_var.h Tue Apr 2 22:41:01 1996 >*************** >*** 300,306 **** > #define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ > #define TCPCTL_SENDSPACE 8 /* send buffer space */ > #define TCPCTL_RECVSPACE 9 /* receive buffer space */ >! #define TCPCTL_MAXID 10 > > #define TCPCTL_NAMES { \ > { 0, 0 }, \ >--- 300,307 ---- > #define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ > #define TCPCTL_SENDSPACE 8 /* send buffer space */ > #define TCPCTL_RECVSPACE 9 /* receive buffer space */ >! #define TCPCTL_DO_KEEPALIVE 10 /* do keepalive's by default */ >! #define TCPCTL_MAXID 11 > > #define TCPCTL_NAMES { \ > { 0, 0 }, \ OID_AUTO avoids the braindamaged MAXID stuff at the cost of not providing a numeric id for programs to use. The name has to be looked up as a string. This is all that is necessary using sysctl(8). Bruce