Re: Shell backends



On Sat, 2005-10-22 at 23:57 +0200, Jakub Piotr Clapa wrote:
> I've searched the archives but failed to find any discussions about that 
> matter. Sorry if this is a stupid question. :-)
> 
> Is there any specific reason for using C instead of shell scripts (or 
> any other scripts; it's just the interface -- C functions vs. calling 
> external apps -- that matters) in the backends? I'm asking about it 
> because writing and making small changes in shell scripts is probably a 
> lot easier than modifying and recompiling C code and all of the network 
> managing code in most distros is already sh based.

All these calls should eventually move to using libnl
(http://people.suug.ch/~tgr/libnl/ ).  I've already done a patch to move
some of the ioctl calls to libnl and it works fairly well.

nm_system_device_flush_routes
nm_system_device_flush_routes_with_iface
nm_system_device_add_default_route_via_device
nm_system_device_add_default_route_via_device_with_iface
nm_system_device_add_route_via_device_with_iface
nm_system_device_has_active_routes
nm_system_device_flush_addresses
nm_system_device_flush_addresses_with_iface
nm_system_enable_loopback
nm_system_flush_loopback_routes
nm_system_delete_default_route
nm_system_flush_arp_cache
nm_system_device_add_ip6_link_address

All these calls should hook directly into the kernel using Netlink
sockets to do their work, rather than calling system().  At the time,
there was no libnl yet, and calling /sbin/ip was the easiest way to get
things done.  But obviously not the best way.

Using libnl will allow us to be much more flexible when manipulating the
routing table, plus then we have fewer external dependencies.  These are
both problems with external shell scripts that we can avoid.

Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]