[Olsr-cvs] olsrd-current/lib/dyn_gw_plain/src olsrd_dyn_gw_plain.c, 1.6, 1.7
Bernd Petrovitsch
(spam-protected)
Thu Nov 29 01:49:43 CET 2007
- Previous message: [Olsr-cvs] olsrd-current/src ipcalc.c, NONE, 1.1 ipcalc.h, NONE, 1.1 build_msg.c, 1.39, 1.40 duplicate_set.c, 1.19, 1.20 hna_set.c, 1.25, 1.26 hna_set.h, 1.16, 1.17 hysteresis.c, 1.22, 1.23 interfaces.c, 1.37, 1.38 ipc_frontend.c, 1.40, 1.41 link_set.c, 1.77, 1.78 lq_avl.c, 1.17, 1.18 lq_packet.c, 1.32, 1.33 lq_route.c, 1.60, 1.61 main.c, 1.105, 1.106 mid_set.c, 1.24, 1.25 mpr.c, 1.20, 1.21 mpr_selector_set.c, 1.20, 1.21 neighbor_table.c, 1.35, 1.36 net_olsr.c, 1.36, 1.37 net_olsr.h, 1.18, 1.19 olsr_cfg.h, 1.39, 1.40 olsr_types.h, 1.12, 1.13 packet.c, 1.26, 1.27 packet.h, 1.18, 1.19 parser.c, 1.37, 1.38 print_packet.c, 1.13, 1.14 process_package.c, 1.46, 1.47 process_routes.c, 1.40, 1.41 rebuild_packet.c, 1.25, 1.26 routing_table.c, 1.35, 1.36 tc_set.c, 1.37, 1.38 two_hop_neighbor_table.c, 1.20, 1.21 local_hna_set.c, 1.16, NONE local_hna_set.h, 1.12, NONE
- Next message: [Olsr-cvs] olsrd-current/lib/httpinfo/src admin_interface.c, 1.12, 1.13 olsrd_httpinfo.c, 1.87, 1.88 admin_html.h, 1.5, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16024/lib/dyn_gw_plain/src
Modified Files:
olsrd_dyn_gw_plain.c
Log Message:
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
Index: olsrd_dyn_gw_plain.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain/src/olsrd_dyn_gw_plain.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** olsrd_dyn_gw_plain.c 8 Nov 2007 22:47:40 -0000 1.6
--- olsrd_dyn_gw_plain.c 29 Nov 2007 00:49:40 -0000 1.7
***************
*** 38,46 ****
*/
- #include "olsr_types.h"
#include "olsrd_dyn_gw_plain.h"
#include "scheduler.h"
#include "olsr.h"
! #include "local_hna_set.h"
#include <stdio.h>
#include <string.h>
--- 38,47 ----
*/
#include "olsrd_dyn_gw_plain.h"
+ #include "olsr_types.h"
+ #include "ipcalc.h"
#include "scheduler.h"
#include "olsr.h"
!
#include <stdio.h>
#include <string.h>
***************
*** 90,94 ****
/* Remove all local Inet HNA entries */
! while(remove_local_hna4_entry(&gw_net, &gw_netmask)) {
olsr_printf(DEBUGLEV, "HNA Internet gateway deleted\n");
}
--- 91,95 ----
/* Remove all local Inet HNA entries */
! while(ip_prefix_list_remove(&olsr_cnf->hna_entries, &gw_net, olsr_netmask_to_prefix(&gw_netmask))) {
olsr_printf(DEBUGLEV, "HNA Internet gateway deleted\n");
}
***************
*** 176,185 ****
if (1 == res && 0 == has_inet_gateway) {
olsr_printf(DEBUGLEV, "Adding OLSR local HNA entry for Internet\n");
! add_local_hna4_entry(&gw_net, &gw_netmask);
has_inet_gateway = 1;
}
else if (0 == res && 1 == has_inet_gateway) {
/* Remove all local Inet HNA entries */
! while(remove_local_hna4_entry(&gw_net, &gw_netmask)) {
olsr_printf(DEBUGLEV, "Removing OLSR local HNA entry for Internet\n");
}
--- 177,186 ----
if (1 == res && 0 == has_inet_gateway) {
olsr_printf(DEBUGLEV, "Adding OLSR local HNA entry for Internet\n");
! ip_prefix_list_add(&olsr_cnf->hna_entries, &gw_net, olsr_netmask_to_prefix(&gw_netmask));
has_inet_gateway = 1;
}
else if (0 == res && 1 == has_inet_gateway) {
/* Remove all local Inet HNA entries */
! while(ip_prefix_list_remove(&olsr_cnf->hna_entries, &gw_net, olsr_netmask_to_prefix(&gw_netmask))) {
olsr_printf(DEBUGLEV, "Removing OLSR local HNA entry for Internet\n");
}
- Previous message: [Olsr-cvs] olsrd-current/src ipcalc.c, NONE, 1.1 ipcalc.h, NONE, 1.1 build_msg.c, 1.39, 1.40 duplicate_set.c, 1.19, 1.20 hna_set.c, 1.25, 1.26 hna_set.h, 1.16, 1.17 hysteresis.c, 1.22, 1.23 interfaces.c, 1.37, 1.38 ipc_frontend.c, 1.40, 1.41 link_set.c, 1.77, 1.78 lq_avl.c, 1.17, 1.18 lq_packet.c, 1.32, 1.33 lq_route.c, 1.60, 1.61 main.c, 1.105, 1.106 mid_set.c, 1.24, 1.25 mpr.c, 1.20, 1.21 mpr_selector_set.c, 1.20, 1.21 neighbor_table.c, 1.35, 1.36 net_olsr.c, 1.36, 1.37 net_olsr.h, 1.18, 1.19 olsr_cfg.h, 1.39, 1.40 olsr_types.h, 1.12, 1.13 packet.c, 1.26, 1.27 packet.h, 1.18, 1.19 parser.c, 1.37, 1.38 print_packet.c, 1.13, 1.14 process_package.c, 1.46, 1.47 process_routes.c, 1.40, 1.41 rebuild_packet.c, 1.25, 1.26 routing_table.c, 1.35, 1.36 tc_set.c, 1.37, 1.38 two_hop_neighbor_table.c, 1.20, 1.21 local_hna_set.c, 1.16, NONE local_hna_set.h, 1.12, NONE
- Next message: [Olsr-cvs] olsrd-current/lib/httpinfo/src admin_interface.c, 1.12, 1.13 olsrd_httpinfo.c, 1.87, 1.88 admin_html.h, 1.5, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Olsr-cvs
mailing list