From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 17 19:05:23 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A41316A4DD for ; Thu, 17 Aug 2006 19:05:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id C315343D4C for ; Thu, 17 Aug 2006 19:05:22 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 6814746CFB; Thu, 17 Aug 2006 15:05:21 -0400 (EDT) Date: Thu, 17 Aug 2006 20:05:21 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Shriek In-Reply-To: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> Message-ID: <20060817200357.C45647@fledge.watson.org> References: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Is it possible to trace the routing socket messages going from the kernel to a particular daemon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Aug 2006 19:05:23 -0000 On Thu, 17 Aug 2006, Shriek wrote: > Is it possible that we can add some loadable module into the kernel to get a > pid of a daemon-process and then somehow trace routing socket messages > coming in / going out from the kernel to that particular daemon ? The thing > why I am in need of this is that there are two daemons , one daemon is > responsible for configuring the interfaces ...and the second is actually > awaiting the updates from the kernel ( that it should send in case it sees > that there is a change in the ifstate for the interface ---IFD update) ... > any resources / material would be of great help.Thanks and regards. This won't give you exactly what you want, but if you don't know about it already, you probably will find it useful. "route monitor" monitors routing socket messages generated by the kernel, and includes the pid of the process they are destined for. It doesn't include messages sent to the kernel. As an exampl: TTY 1: peppercorn# route monitor got message of size 200 on Thu Aug 17 20:03:20 2006 RTM_GET: Report Metrics: len 200, pid: 784, seq 1, errno 0, flags: locks: inits: sockaddrs: default 192.168.100.1 default fxp0:0.3.47.d3.46.47 192.168.100.198 TTY 2 after running route monitor on the first tty: peppercorn:~> route -n get www.watson.org route to: 209.31.154.41 destination: default mask: default gateway: 192.168.100.1 interface: fxp0 flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0