Date: Thu, 17 Aug 2006 20:05:21 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Shriek <shriek.007@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Is it possible to trace the routing socket messages going from the kernel to a particular daemon Message-ID: <20060817200357.C45647@fledge.watson.org> In-Reply-To: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com> References: <3ce33f6c0608170606o2f8542fcn15355a5afe3307a5@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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:<UP,GATEWAY,DONE,STATIC> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 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: <UP,GATEWAY,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060817200357.C45647>