Hello!
Why is it called MPLS, when we call all other configuration switches CONFIG_something? I thought CONFIG_XXX relates to protocol support and general features is defined like IPV6, without any prefix.
IPV6 is a rather special case, in the retrospect I think it should have got the CONFIG_ prefix, too.
Calling this beast "vpn" without further clarification is going to be confusing -- people (even those experienced in networking) usually do not associate "vpn" with "MPLS" implicitly. Better choose a more descriptive name. Well, VPN prefix is heavily used in rfc 4364, for example. I'm a bit out of ideas. "mplsvpnv4" is more specific, of course, but a bit long.
Maybe keep the name, but explain it in a comment.
| + unsigned int addr_type; /* Type of adresses stored in fib (IPv46, VPNv46, MPLS, etc..)*/ | + unsigned int addr_size; /* size of address specified in entry */ | + unsigned int addr_off; /* value of data offset to be set in fib_node */
I did not understand anything from the latter two comments.
What is specified in an entry? An address? Or the size itself? It specifies size of address data used in particular fib (e.g. addr_size = sizeof(ip_addr)).
s/size of address specified in entry/Size of address data/ ?
OK.
Offset of which data? Address data from the previous comment.
s/value of data offset to be set in fib_node/Address data offset in fib_node/ ?
You should explain that it is an offset from the start of the structure.
Instead of that, set f->hash_f during initialization of the FIB according to the type of addresses used. Thanks, as a result: If we do hash_f setting in FIB init and assume non-IP users to set their own hashing function fib_hash can be changed to simple:
#define fib_hash(f, a) (f)->hash_f(a)
Yes. Have a nice fortnight -- Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth