[Olsr-dev] kill hna_chgestruct
Hannes Gredler
(spam-protected)
Mon Nov 26 12:41:07 CET 2007
looks good to me - nicely done ! /hannes
Bernd Petrovitsch wrote:
> List-Post: (spam-protected)
> On Wed, 2007-11-21 at 08:04 +0100, Hannes Gredler wrote:
>> On Wed, Nov 21, 2007 at 12:36:43AM +0100, Bernd Petrovitsch wrote:
> [...]
>> | Now that I'm stumbling over it: Find "struct ipc_net" in
>> src/olsr_cnf.h
>>
>> hmmm ... is only really used in ipc_check_allowed_ip() -
>> just replace address/mask in 'struct ipc_net' to 'struct olsr_ip_prefix'
>
> Obviously;-) Something like in the patch at
> http://bernd.petrovitsch.priv.at/olsr-ng/kill-netmasks.patch?
>
> Major Changes:
> - renamed "struct local_hna_entry" to "struct ip_prefix_list" since
> it is exactly that. Renamed the functions in src/local_hna_set.{c,h}
> in the same way.
> - each IPv4 and IPv6 function pairs in src/local_hna_set.{c,h} is
> called from the same place and have the same signature. So I
> condensed each of them.
> - Since we have only 3 functions left in src/local_hna_set.{c,h}
> and they are used for the configuration, the .h file is now part
> of src/olsr_cfg.h and the ,c file of src/cfgparser/olsrd_conf.c.
> - replaced "struct ipc_net" with "struct ip_prefix_list" since it
> serves the same purpose as the "struct ip_prefix_list"
> - replaced "struct ipc_host" with "struct ip_prefix_list" since it
> serves the same purpose as the "struct ip_prefix_list" and is
> just a special case. No need to duplicate code etc.
> - removed "union hna_netmask" from src/olsr_types since we use the
> prefix_len everywhere (and that is an olsr_u8_t in several other
> struct's).
> That implies changes and simplifications in the code handling
> them (since the IPv4 is similar to IPv6).
> - the config file parser now understands for IPv4 addresses also
> "/$prefix".
> - On the output side, the patch generates only "/$prefix" which
> kills code since it is the same as the IPv6 handling.
> - There are some netmask conversions left (mainly in the plugins)
> but that be cleaned up afterwards.
> - extracted ip{,4,6}{cmp,equal} and formatting functions from
> net_olsr.{c,h} into src/ipcalc.{c,h} since net_olsr.h became
> IMHO to much of a "put anything in there".
> - renamed "sockaddr_to_string()" to "sockaddr4_to_string()"
> since it is exactly that (unless I'm missing something).
>
> Minor Changes:
> - lib/httpinfo/src/admin_html.h contained just some variable
> definitions so it is now integrated in the only user:
> admin_interface.c
> - olsrd_dot_draw.c got rid of two indicator variables if
> a socket is valid or not. Since sockets may use "-1" as the
> "not open", "invalid" value, there is no need for two more
> ints.
> - and the dot_draw plugin is somewhat smaller and easier to read.
> - const'ified some functions
>
> A patched OLSRD is right now running on my home node. Let's see how well
> it is tomorrow.
>
> Any feedback appreciated!
>
> Bernd
More information about the Olsr-dev
mailing list