From owner-freebsd-stable@FreeBSD.ORG Tue Nov 30 02:35:44 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D12816A4CE for ; Tue, 30 Nov 2004 02:35:44 +0000 (GMT) Received: from electra.cse.Buffalo.EDU (electra.cse.Buffalo.EDU [128.205.32.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4A7543D1D for ; Tue, 30 Nov 2004 02:35:43 +0000 (GMT) (envelope-from kensmith@cse.Buffalo.EDU) Received: from electra.cse.Buffalo.EDU (kensmith@localhost [127.0.0.1]) iAU2ZhIo002001; Mon, 29 Nov 2004 21:35:43 -0500 (EST) Received: (from kensmith@localhost) by electra.cse.Buffalo.EDU (8.12.10/8.12.9/Submit) id iAU2Zg57002000; Mon, 29 Nov 2004 21:35:42 -0500 (EST) Date: Mon, 29 Nov 2004 21:35:42 -0500 From: Ken Smith To: Mark McWiggins Message-ID: <20041130023542.GA390@electra.cse.Buffalo.EDU> References: <62A29338972397468405C79C4FE13C3B013DDDD4@ex1.messagegate.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62A29338972397468405C79C4FE13C3B013DDDD4@ex1.messagegate.local> User-Agent: Mutt/1.4.1i cc: freebsd-stable@freebsd.org Subject: Re: Need source to TCP/IP 'connect()' X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2004 02:35:44 -0000 On Mon, Nov 29, 2004 at 06:06:22PM -0800, Mark McWiggins wrote: > Can someone point me to (or send) the BSD source to the TCP/IP > 'connect()' function? > > I looked through the hierarchy and couldn't find it quickly. > > > > I need a hacked version to work the way Nmap does just sending SYN and > then quitting > > to verify that an application is still running but not do a full > connection, which causes the > > app to misbehave. > > Thanks in advance for any help you can offer. When 'fishing' for stuff in the kernel source code I find the tags files kind of useful. In a kernel build directory (e.g. I usually use src/sys/i386/compile/GENERIC on a 5.X machine, after config-ing GENERIC) after doing a 'make depend' you can do 'make tags'. It will usually fail once it starts to process the modules because it can't find 'gtags' but by then it's already built what is most useful. Once the tags file is built in the kernel build directory you can do something like: vi -t connect and it will start up vi with the cursor at the beginning of that function. It's not perfect (sometimes it can't find a function) but for the most part it works OK. In this case it found connect() in /usr/src/sys/kern/uipc_syscalls.c (I was using a RELENG_5 source tree). -- Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel |