Re: IP4Config and routes



On Wed, 2009-12-16 at 12:40 +0000, Daniel Drake wrote:
> Hi,
> 
> Ad-hoc networking is broken in Sugar because no route is created for
> multicast packets - this means the collaboration features do not work.
> 
> I can see that I can specify routes in the IP4Config object (hence we
> could modify Sugar to fix this) but the only documentation I can find
> is:
> 
> 	Routes - aau - (read)
> 	Tuples of IPv4 route/prefix/next-hop/metric.

http://live.gnome.org/NetworkManager

which leads you to:

http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html

"Array of IPv4 route structures. Each IPv4 route structure is composed
of 4 32-bit values; the first being the destination IPv4 network or
address (network byte order), the second the destination network or
address prefix (1 - 32), the third being the next-hop (network byte
order) if any, and the fourth being the route metric. For the 'auto'
method, given IP routes are appended to those returned by automatic
configuration. Routes cannot be used with the 'shared' or 'link-local'
methods as there is no upstream network."

If I need to expand on that, please let me know and I'll update the
docs.

> I'm not too knowledgeable about routing tables and the language I speak
> is the one that "route -n" returns, basically I want a route of:
> 	destination=224.0.0.0
> 	gateway=0.0.0.0
> 	genmask=240.0.0.0
> 	flags=U
> 	metric=0
> 
> I guess next-hop is gateway, and metric is metric, but I'm a bit stuck
> on "route" and "prefix"

route == destination
prefix = "Genmask" from /sbin/route but as a CIDR prefix, not a subnet
mask

> Can anyone help me convert those values into ones that NM understands,
> or point me at some existing code which uses this functionality?

Lot of the internal NM code does this; internally NM uses

GSList *nm_utils_ip4_routes_from_gvalue (const GValue *value);
void nm_utils_ip4_routes_to_gvalue (GSList *list, GValue *value);

to get translate the 'routes' key into something it can use.

Dan



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