Re: reading routing table

2008-09-18 Thread Julian Elischer
Bruce M. Simpson wrote: Debarshi Ray wrote: ... By the way, would you want someone to implement 'show' support for FreeBSD's route implementation? I can give it a go now. :-) For sure, we'd be very happy to see a patch like that. Many thanks BMS and don't forget the same patch for netst

Re: reading routing table

2008-09-18 Thread Bruce M. Simpson
Debarshi Ray wrote: ... By the way, would you want someone to implement 'show' support for FreeBSD's route implementation? I can give it a go now. :-) For sure, we'd be very happy to see a patch like that. Many thanks BMS ___ freebsd-net@freebsd.o

Re: reading routing table

2008-09-18 Thread Debarshi Ray
So I got something working for FreeBSD now: http://rishi.fedorapeople.org/gnu/inetutils-1.5.tar.gz I have been using a combination of sysctl and PF_ROUTE to retrieve the routing table, much like the approach taken by the NetBSD implementation. Support for modifying the routing table is yet to be i

Re: how to read dynamic data structures from the kernel (was Re: reading routing table)

2008-09-02 Thread Julian Elischer
Robert Watson wrote: On Tue, 2 Sep 2008, Luigi Rizzo wrote: The real problem is that these data structures are dynamic and potentially large, so the following approach (used e.g. in ipfw) enter kernel; get shared lock on the structure; navigate through the structure and make a li

Re: how to read dynamic data structures from the kernel (was Re: reading routing table)

2008-09-02 Thread Luigi Rizzo
On Tue, Sep 02, 2008 at 10:02:10PM +0100, Robert Watson wrote: > > On Tue, 2 Sep 2008, Luigi Rizzo wrote: > > >The real problem is that these data structures are dynamic and potentially > >large, so the following approach (used e.g. in ipfw) > > > > enter kernel; > > get shared lock on t

Re: how to read dynamic data structures from the kernel (was Re: reading routing table)

2008-09-02 Thread Robert Watson
On Tue, 2 Sep 2008, Luigi Rizzo wrote: The real problem is that these data structures are dynamic and potentially large, so the following approach (used e.g. in ipfw) enter kernel; get shared lock on the structure; navigate through the structure and make a linearized c

Re: how to read dynamic data structures from the kernel (was Re: reading routing table)

2008-09-02 Thread Bruce M. Simpson
Luigi Rizzo wrote: do you know if any of the *BSD kernels implements some good mechanism to access a dynamic kernel data structure (e.g. the routing tree/trie, or even a list or hash table) without the flaws of the two approaches i indicate above ? Hahaha. I ran into an isomorphic problem wi

how to read dynamic data structures from the kernel (was Re: reading routing table)

2008-09-02 Thread Luigi Rizzo
in the (short so far) thread which i am hijacking, the issue came out of what is a good mechanism for reading the route table from the kernel, since FreeBSD currently uses /dev/kmem and this is not always available/easy to use with dynamically changing data structures. The routing table is only on

Re: reading routing table

2008-09-02 Thread Robert Watson
On Tue, 2 Sep 2008, Debarshi Ray wrote: unfortunatly netstat -rn uses /dev/kmem Yes. I also found that FreeBSD's route(8) implementation does not have an equivalent of 'netstat -r'. NetBSD and GNU/Linux implementations have such an option. Any reason for this? Is it because you did not want

Re: reading routing table

2008-09-02 Thread Debarshi Ray
> unfortunatly netstat -rn uses /dev/kmem Yes. I also found that FreeBSD's route(8) implementation does not have an equivalent of 'netstat -r'. NetBSD and GNU/Linux implementations have such an option. Any reason for this? Is it because you did not want to muck with /dev/kmem in route(8) and wante

Re: reading routing table

2008-09-02 Thread Julian Elischer
Bruce M. Simpson wrote: Debarshi Ray wrote: ... I was going through the FreeBSD and NetBSD documentation and the FreeBSD sources of netstat and route. I was suprised to see that while NetBSD's route implementation has a 'show' command, FreeBSD does not offer any such thing. Moreover it seems tha

Re: reading routing table

2008-09-01 Thread Debarshi Ray
> Why don't you just use XORP's FEA code? > It already does all this under a BSD-type license. Nice stuff. However, it looks like a full blown routing platform. In that case it would be easier to re-write those portions using the relevant set of APIs. Happy hacking, Debarshi _

Re: reading routing table

2008-09-01 Thread Bruce M. Simpson
Debarshi Ray wrote: Why don't you just use XORP's FEA code? It already does all this under a BSD-type license. I was not aware of it. What does it do? Is it portable across other OSes or is it *BSD specific? XORP's FEA process is responsible for talking to the underlying forwarding p

Re: reading routing table

2008-09-01 Thread Debarshi Ray
> Why don't you just use XORP's FEA code? > It already does all this under a BSD-type license. I was not aware of it. What does it do? Is it portable across other OSes or is it *BSD specific? Thanks, Debarshi ___ freebsd-net@freebsd.org mailing list htt

Re: reading routing table

2008-09-01 Thread Debarshi Ray
> You want 'netstat -rn' to dump them, this is a very common command which > should be present in a number of online resources on using and administering > FreeBSD so I am somewhat surprised that you didn't find it. I know about netstat. I did mention having gone through its implementation. :-) Wh

Re: reading routing table

2008-09-01 Thread Bruce M. Simpson
Debarshi Ray wrote: ... I was going through the FreeBSD and NetBSD documentation and the FreeBSD sources of netstat and route. I was suprised to see that while NetBSD's route implementation has a 'show' command, FreeBSD does not offer any such thing. Moreover it seems that one can not read the en

Re: reading routing table

2008-09-01 Thread Bruce M. Simpson
Debarshi Ray wrote: I am implementing a library/utility which basically encompasses the features of the traditional route utilities and those of newer tools (like ip from iproute2), which are mostly specific to a particular kernel. The overpowering objective is to make the library/utility work un

reading routing table

2008-09-01 Thread Debarshi Ray
I am implementing a library/utility which basically encompasses the features of the traditional route utilities and those of newer tools (like ip from iproute2), which are mostly specific to a particular kernel. The overpowering objective is to make the library/utility work uniformly across all dif