[Olsr-cvs] olsrd-current/src build_msg.c, 1.33, 1.34 defs.h, 1.56, 1.57 duplicate_set.c, 1.13, 1.14 generate_msg.c, 1.24, 1.25 hashing.c, 1.10, 1.11 hna_set.c, 1.17, 1.18 hysteresis.h, 1.8, 1.9 interfaces.c, 1.29, 1.30 interfaces.h, 1.38, 1.39 ipc_frontend.c, 1.28, 1.29 ipc_frontend.h, 1.12, 1.13 link_set.c, 1.66, 1.67 local_hna_set.c, 1.12, 1.13 log.h, 1.5, 1.6 main.c, 1.93, 1.94 mid_set.c, 1.17, 1.18 mpr.c, 1.15, 1.16 mpr_selector_set.c, 1.15, 1.16 neighbor_table.c, 1.30, 1.31 net_olsr.c, 1.20, 1.21 net_olsr.h, 1.7, 1.8 olsr.c, 1.50, 1.51 olsr.h, 1.25, 1.26 olsr_types.h, 1.5, 1.6 olsrd_plugin.h, 1.1, 1.2 parser.c, 1.32, 1.33 plugin_loader.c, 1.23, 1.24 process_package.c, 1.38, 1.39 process_routes.c, 1.30, 1.31 routing_table.c, 1.25, 1.26 scheduler.c, 1.37, 1.38 scheduler.h, 1.12, 1.13 socket_parser.c, 1.23, 1.24 tc_set.c, 1.24, 1.25 two_hop_neighbor_table.c, 1.16, 1.17
Bernd Petrovitsch
(spam-protected)
Fri Apr 20 15:46:07 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30814/src
Modified Files:
build_msg.c defs.h duplicate_set.c generate_msg.c hashing.c
hna_set.c hysteresis.h interfaces.c interfaces.h
ipc_frontend.c ipc_frontend.h link_set.c local_hna_set.c log.h
main.c mid_set.c mpr.c mpr_selector_set.c neighbor_table.c
net_olsr.c net_olsr.h olsr.c olsr.h olsr_types.h
olsrd_plugin.h parser.c plugin_loader.c process_package.c
process_routes.c routing_table.c scheduler.c scheduler.h
socket_parser.c tc_set.c two_hop_neighbor_table.c
Log Message:
cleanup, 1. step (to get some local changes away):
* killed lots of warnings
* added __attribure__((unused)) and __attribure__((format(printf, ..., ...)))
* added "const"
* moved declarations of static functions into .c files
* added "static" declarations
* removed all "inline" declarations. Usually the compiler knows better anyways.
* removed emtpy "return" statements at the end of functions
* localized declarations
* avoided unnecessary data copies
* removed lots of empty lines
There is much more to do.
Index: ipc_frontend.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** ipc_frontend.c 7 Jan 2006 08:16:20 -0000 1.28
--- ipc_frontend.c 20 Apr 2007 13:46:04 -0000 1.29
***************
*** 66,69 ****
--- 66,79 ----
#endif
+ static int ipc_sock = -1;
+ static int ipc_conn = -1;
+
+ static int
+ ipc_send_all_routes(int fd);
+
+ static int
+ ipc_send_net_info(int fd);
+
+
/**
*Create the socket to use for IPC to the
***************
*** 73,77 ****
*/
int
! ipc_init()
{
//int flags;
--- 83,87 ----
*/
int
! ipc_init(void)
{
//int flags;
***************
*** 139,143 ****
addrlen = sizeof (struct sockaddr_in);
! if ((ipc_connection = accept(ipc_sock, (struct sockaddr *) &pin, &addrlen)) == -1)
{
perror("IPC accept");
--- 149,153 ----
addrlen = sizeof (struct sockaddr_in);
! if ((ipc_conn = accept(fd, (struct sockaddr *) &pin, &addrlen)) == -1)
{
perror("IPC accept");
***************
*** 151,156 ****
{
ipc_active = OLSR_TRUE;
! ipc_send_net_info();
! ipc_send_all_routes();
OLSR_PRINTF(1, "Connection from %s\n",addr)
}
--- 161,166 ----
{
ipc_active = OLSR_TRUE;
! ipc_send_net_info(ipc_conn);
! ipc_send_all_routes(ipc_conn);
OLSR_PRINTF(1, "Connection from %s\n",addr)
}
***************
*** 159,163 ****
OLSR_PRINTF(1, "Front end-connection from foregin host(%s) not allowed!\n", addr)
olsr_syslog(OLSR_LOG_ERR, "OLSR: Front end-connection from foregin host(%s) not allowed!\n", addr);
! close(ipc_connection);
}
}
--- 169,173 ----
OLSR_PRINTF(1, "Front end-connection from foregin host(%s) not allowed!\n", addr)
olsr_syslog(OLSR_LOG_ERR, "OLSR: Front end-connection from foregin host(%s) not allowed!\n", addr);
! CLOSE(ipc_conn);
}
}
***************
*** 201,205 ****
*/
int
! ipc_input(int sock)
{
/*
--- 211,215 ----
*/
int
! ipc_input(int sock __attribute__((unused)))
{
/*
***************
*** 229,233 ****
*/
void
! frontend_msgparser(union olsr_message *msg, struct interface *in_if, union olsr_ip_addr *from_addr)
{
int size;
--- 239,243 ----
*/
void
! frontend_msgparser(union olsr_message *msg, struct interface *in_if __attribute__((unused)), union olsr_ip_addr *from_addr __attribute__((unused)))
{
int size;
***************
*** 241,248 ****
size = ntohs(msg->v6.olsr_msgsize);
! if (send(ipc_connection, (void *)msg, size, MSG_NOSIGNAL) < 0)
{
OLSR_PRINTF(1, "(OUTPUT)IPC connection lost!\n")
! close(ipc_connection);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
--- 251,258 ----
size = ntohs(msg->v6.olsr_msgsize);
! if (send(ipc_conn, (void *)msg, size, MSG_NOSIGNAL) < 0)
{
OLSR_PRINTF(1, "(OUTPUT)IPC connection lost!\n")
! CLOSE(ipc_conn);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
***************
*** 309,316 ****
*/
! if (send(ipc_connection, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! close(ipc_connection);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
--- 319,326 ----
*/
! if (send(ipc_conn, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! CLOSE(ipc_conn);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
***************
*** 323,328 ****
! int
! ipc_send_all_routes()
{
struct rt_entry *destination;
--- 333,338 ----
! static int
! ipc_send_all_routes(int fd)
{
struct rt_entry *destination;
***************
*** 371,378 ****
tmp = (char *) &packet;
! if (send(ipc_connection, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! close(ipc_connection);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
--- 381,388 ----
tmp = (char *) &packet;
! if (send(fd, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! CLOSE(ipc_conn);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
***************
*** 416,423 ****
tmp = (char *) &packet;
! if (send(ipc_connection, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! close(ipc_connection);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
--- 426,433 ----
tmp = (char *) &packet;
! if (send(ipc_conn, tmp, IPC_PACK_SIZE, MSG_NOSIGNAL) < 0) // MSG_NOSIGNAL to avoid sigpipe
{
OLSR_PRINTF(1, "(RT_ENTRY)IPC connection lost!\n")
! CLOSE(ipc_conn);
//olsr_cnf->open_ipc = 0;
ipc_active = OLSR_FALSE;
***************
*** 441,446 ****
*@return negative on error
*/
! int
! ipc_send_net_info()
{
struct ipc_net_msg *net_msg;
--- 451,456 ----
*@return negative on error
*/
! static int
! ipc_send_net_info(int fd)
{
struct ipc_net_msg *net_msg;
***************
*** 519,526 ****
! if (send(ipc_connection, (char *)net_msg, sizeof(struct ipc_net_msg), MSG_NOSIGNAL) < 0)
{
OLSR_PRINTF(1, "(NETINFO)IPC connection lost!\n")
! close(ipc_connection);
//olsr_cnf->open_ipc = 0;
return -1;
--- 529,536 ----
! if (send(fd, (char *)net_msg, sizeof(struct ipc_net_msg), MSG_NOSIGNAL) < 0)
{
OLSR_PRINTF(1, "(NETINFO)IPC connection lost!\n")
! CLOSE(ipc_conn);
//olsr_cnf->open_ipc = 0;
return -1;
***************
*** 534,542 ****
int
! shutdown_ipc()
{
OLSR_PRINTF(1, "Shutting down IPC...\n")
! close(ipc_sock);
! close(ipc_connection);
return 1;
--- 544,552 ----
int
! shutdown_ipc(void)
{
OLSR_PRINTF(1, "Shutting down IPC...\n")
! CLOSE(ipc_sock);
! CLOSE(ipc_conn);
return 1;
Index: ipc_frontend.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ipc_frontend.h 21 Nov 2004 11:28:56 -0000 1.12
--- ipc_frontend.h 20 Apr 2007 13:46:04 -0000 1.13
***************
*** 99,104 ****
- int ipc_connection;
- int ipc_sock;
olsr_bool ipc_active;
--- 99,102 ----
***************
*** 109,115 ****
ipc_accept(int);
- int
- ipc_send_all_routes(void);
-
void
frontend_msgparser(union olsr_message *, struct interface *, union olsr_ip_addr *);
--- 107,110 ----
Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** hna_set.c 29 May 2005 12:47:45 -0000 1.17
--- hna_set.c 20 Apr 2007 13:46:04 -0000 1.18
***************
*** 53,57 ****
*/
int
! olsr_init_hna_set()
{
--- 53,57 ----
*/
int
! olsr_init_hna_set(void)
{
***************
*** 266,270 ****
*/
void
! olsr_time_out_hna_set(void *foo)
{
int index;
--- 266,270 ----
*/
void
! olsr_time_out_hna_set(void *foo __attribute__((unused)))
{
int index;
***************
*** 320,324 ****
*/
void
! olsr_print_hna_set()
{
int index;
--- 320,324 ----
*/
void
! olsr_print_hna_set(void)
{
int index;
Index: generate_msg.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/generate_msg.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** generate_msg.c 7 Jan 2006 08:16:20 -0000 1.24
--- generate_msg.c 20 Apr 2007 13:46:04 -0000 1.25
***************
*** 122,126 ****
void
! generate_stdout_pulse(void *foo)
{
if(olsr_cnf->debug_level == 0)
--- 122,126 ----
void
! generate_stdout_pulse(void *foo __attribute__((unused)))
{
if(olsr_cnf->debug_level == 0)
Index: two_hop_neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** two_hop_neighbor_table.c 29 May 2005 12:47:46 -0000 1.16
--- two_hop_neighbor_table.c 20 Apr 2007 13:46:04 -0000 1.17
***************
*** 55,59 ****
*/
int
! olsr_init_two_hop_table()
{
int index;
--- 55,59 ----
*/
int
! olsr_init_two_hop_table(void)
{
int index;
***************
*** 243,247 ****
*/
void
! olsr_print_two_hop_neighbor_table()
{
int i;
--- 243,247 ----
*/
void
! olsr_print_two_hop_neighbor_table(void)
{
int i;
Index: interfaces.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** interfaces.h 10 Feb 2007 19:59:51 -0000 1.38
--- interfaces.h 20 Apr 2007 13:46:04 -0000 1.39
***************
*** 112,116 ****
struct olsr_netbuf
{
! olsr_u8_t *buff;/* Pointer to the allocated buffer */
int bufsize; /* Size of the buffer */
int maxsize; /* Max bytes of payload that can be added to the buffer */
--- 112,116 ----
struct olsr_netbuf
{
! olsr_u8_t *buff; /* Pointer to the allocated buffer */
int bufsize; /* Size of the buffer */
int maxsize; /* Max bytes of payload that can be added to the buffer */
Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** link_set.c 10 Feb 2007 19:27:32 -0000 1.66
--- link_set.c 20 Apr 2007 13:46:04 -0000 1.67
***************
*** 80,84 ****
clock_t
! get_hold_time_neighbor()
{
return hold_time_neighbor;
--- 80,84 ----
clock_t
! get_hold_time_neighbor(void)
{
return hold_time_neighbor;
***************
*** 86,90 ****
struct link_entry *
! get_link_set()
{
return link_set;
--- 86,90 ----
struct link_entry *
! get_link_set(void)
{
return link_set;
***************
*** 92,96 ****
void
! olsr_init_link_set()
{
--- 92,96 ----
void
! olsr_init_link_set(void)
{
***************
*** 820,824 ****
*/
static void
! olsr_time_out_link_set()
{
--- 820,824 ----
*/
static void
! olsr_time_out_link_set(void)
{
***************
*** 897,901 ****
*/
static void
! olsr_time_out_hysteresis()
{
struct link_entry *tmp_link_set;
--- 897,901 ----
*/
static void
! olsr_time_out_hysteresis(void)
{
struct link_entry *tmp_link_set;
***************
*** 1139,1143 ****
}
! static void olsr_time_out_packet_loss()
{
struct link_entry *walker;
--- 1139,1143 ----
}
! static void olsr_time_out_packet_loss(void)
{
struct link_entry *walker;
***************
*** 1168,1172 ****
}
! void olsr_update_dijkstra_link_qualities()
{
struct link_entry *walker;
--- 1168,1172 ----
}
! void olsr_update_dijkstra_link_qualities(void)
{
struct link_entry *walker;
Index: hashing.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hashing.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** hashing.c 31 Jan 2007 12:36:50 -0000 1.10
--- hashing.c 20 Apr 2007 13:46:04 -0000 1.11
***************
*** 40,44 ****
*/
-
#include "olsr_protocol.h"
#include "hashing.h"
--- 40,43 ----
Index: process_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** process_routes.c 31 Jan 2007 12:36:50 -0000 1.30
--- process_routes.c 20 Apr 2007 13:46:04 -0000 1.31
***************
*** 149,153 ****
void
! olsr_init_export_route()
{
olsr_addroute_add_function(&olsr_ioctl_add_route, AF_INET);
--- 149,153 ----
void
! olsr_init_export_route(void)
{
olsr_addroute_add_function(&olsr_ioctl_add_route, AF_INET);
***************
*** 212,216 ****
int
! olsr_init_old_table()
{
int index;
--- 212,216 ----
int
! olsr_init_old_table(void)
{
int index;
***************
*** 239,250 ****
olsr_find_up_route(struct rt_entry *dst, struct rt_entry *table)
{
! struct rt_entry *destination;
! olsr_u32_t hash;
!
! hash = olsr_hashing(&dst->rt_dst);
! for(destination = table[hash].next;
! destination != &table[hash];
! destination = destination->next)
{
//printf("Checking %s hc: %d ", olsr_ip_to_string(&dst->rt_dst), dst->rt_metric);
--- 239,246 ----
olsr_find_up_route(struct rt_entry *dst, struct rt_entry *table)
{
! struct rt_entry *destination;
! const olsr_u32_t hash = olsr_hashing(&dst->rt_dst);
! for(destination = table[hash].next; destination != &table[hash]; destination = destination->next)
{
//printf("Checking %s hc: %d ", olsr_ip_to_string(&dst->rt_dst), dst->rt_metric);
***************
*** 264,270 ****
}
}
-
return 0;
-
}
--- 260,264 ----
***************
*** 319,340 ****
*/
int
! olsr_delete_all_kernel_routes()
{
! struct destination_n *delete_kernel_list = NULL;
! struct destination_n *tmp = NULL;
! union olsr_ip_addr *tmp_addr;
OLSR_PRINTF(1, "Deleting all routes...\n")
-
delete_kernel_list = olsr_build_update_list(hna_routes, old_hna);
-
- tmp = delete_kernel_list;
-
OLSR_PRINTF(1, "HNA list:\n")
! while(tmp)
{
! tmp_addr = &tmp->destination->rt_dst;
OLSR_PRINTF(1, "Dest: %s\n", olsr_ip_to_string(tmp_addr))
- tmp = tmp->next;
}
--- 313,328 ----
*/
int
! olsr_delete_all_kernel_routes(void)
{
! struct destination_n *delete_kernel_list;
! struct destination_n *tmp;
OLSR_PRINTF(1, "Deleting all routes...\n")
delete_kernel_list = olsr_build_update_list(hna_routes, old_hna);
OLSR_PRINTF(1, "HNA list:\n")
! for(tmp = delete_kernel_list;tmp;tmp = tmp->next)
{
! union olsr_ip_addr *tmp_addr = &tmp->destination->rt_dst;
OLSR_PRINTF(1, "Dest: %s\n", olsr_ip_to_string(tmp_addr))
}
***************
*** 343,358 ****
delete_kernel_list = olsr_build_update_list(routingtable,old_routes);
- tmp = delete_kernel_list;
-
OLSR_PRINTF(1, "Route list:\n")
! while(tmp)
{
! tmp_addr = &tmp->destination->rt_dst;
! OLSR_PRINTF(1, "Dest: %s\n", olsr_ip_to_string(tmp_addr))
! tmp = tmp->next;
}
-
olsr_delete_routes_from_kernel(delete_kernel_list);
-
return 1;
}
--- 331,341 ----
delete_kernel_list = olsr_build_update_list(routingtable,old_routes);
OLSR_PRINTF(1, "Route list:\n")
! for(tmp = delete_kernel_list;tmp;tmp = tmp->next)
{
! union olsr_ip_addr *tmp_addr = &tmp->destination->rt_dst;
! OLSR_PRINTF(1, "Dest: %s\n", olsr_ip_to_string(tmp_addr))
}
olsr_delete_routes_from_kernel(delete_kernel_list);
return 1;
}
***************
*** 366,373 ****
*/
void
! olsr_update_kernel_routes()
{
! struct destination_n *delete_kernel_list = NULL;
! struct destination_n *add_kernel_list = NULL;
OLSR_PRINTF(3, "Updating kernel routes...\n")
--- 349,356 ----
*/
void
! olsr_update_kernel_routes(void)
{
! struct destination_n *delete_kernel_list;
! struct destination_n *add_kernel_list;
OLSR_PRINTF(3, "Updating kernel routes...\n")
***************
*** 388,400 ****
*/
void
! olsr_update_kernel_hna_routes()
{
! struct destination_n *delete_kernel_list = NULL;
! //struct destination_n *delete_kernel_list2;
! struct destination_n *add_kernel_list = NULL;
OLSR_PRINTF(3, "Updating kernel HNA routes...\n")
-
delete_kernel_list = olsr_build_update_list(old_hna, hna_routes);
add_kernel_list = olsr_build_update_list(hna_routes, old_hna);
--- 371,381 ----
*/
void
! olsr_update_kernel_hna_routes(void)
{
! struct destination_n *delete_kernel_list;
! struct destination_n *add_kernel_list;
OLSR_PRINTF(3, "Updating kernel HNA routes...\n")
delete_kernel_list = olsr_build_update_list(old_hna, hna_routes);
add_kernel_list = olsr_build_update_list(hna_routes, old_hna);
Index: neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** neighbor_table.c 7 Jan 2006 08:16:20 -0000 1.30
--- neighbor_table.c 20 Apr 2007 13:46:04 -0000 1.31
***************
*** 57,66 ****
void
! olsr_init_neighbor_table()
{
int i;
olsr_register_timeout_function(&olsr_time_out_neighborhood_tables);
-
for(i = 0; i < HASHSIZE; i++)
{
--- 57,65 ----
void
! olsr_init_neighbor_table(void)
{
int i;
olsr_register_timeout_function(&olsr_time_out_neighborhood_tables);
for(i = 0; i < HASHSIZE; i++)
{
***************
*** 438,466 ****
}
-
-
-
-
void
! olsr_time_out_neighborhood_tables()
{
! olsr_u8_t index;
for(index=0;index<HASHSIZE;index++)
{
! struct neighbor_entry *entry = neighbortable[index].next;
!
! while(entry != &neighbortable[index])
{
olsr_time_out_two_hop_neighbors(entry);
- entry = entry->next;
}
}
}
-
-
-
-
/**
*Prints the registered neighbors and two hop neighbors
--- 437,455 ----
}
void
! olsr_time_out_neighborhood_tables(void)
{
! olsr_u8_t index;
for(index=0;index<HASHSIZE;index++)
{
! struct neighbor_entry *entry;
! for(entry = neighbortable[index].next; entry != &neighbortable[index]; entry = entry->next)
{
olsr_time_out_two_hop_neighbors(entry);
}
}
}
/**
*Prints the registered neighbors and two hop neighbors
***************
*** 470,474 ****
*/
void
! olsr_print_neighbor_table()
{
int i;
--- 459,463 ----
*/
void
! olsr_print_neighbor_table(void)
{
int i;
***************
*** 482,518 ****
if (olsr_cnf->ip_version == AF_INET)
! {
! OLSR_PRINTF(1, "IP address LQ NLQ SYM MPR MPRS will\n")
! fstr = "%-15s %5.3f %5.3f %s %s %s %d\n";
! }
!
else
! {
! OLSR_PRINTF(1, "IP address LQ NLQ SYM MPR MPRS will\n")
! fstr = "%-39s %5.3f %5.3f %s %s %s %d\n";
! }
for (i = 0; i < HASHSIZE; i++)
{
struct neighbor_entry *neigh;
! for(neigh = neighbortable[i].next; neigh != &neighbortable[i];
! neigh = neigh->next)
{
! struct link_entry *link =
! get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! double best_lq, inv_best_lq;
!
! if(!link)
! continue;
!
! best_lq = link->neigh_link_quality;
! inv_best_lq = link->loss_link_quality;
! OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr),
! inv_best_lq, best_lq,
! (neigh->status == SYM) ? "YES " : "NO ",
! neigh->is_mpr ? "YES " : "NO ",
! olsr_lookup_mprs_set(&neigh->neighbor_main_addr) == NULL ? "NO " : "YES ",
! neigh->willingness)
}
}
--- 471,502 ----
if (olsr_cnf->ip_version == AF_INET)
! {
! OLSR_PRINTF(1, "IP address LQ NLQ SYM MPR MPRS will\n")
! fstr = "%-15s %5.3f %5.3f %s %s %s %d\n";
! }
else
! {
! OLSR_PRINTF(1, "IP address LQ NLQ SYM MPR MPRS will\n")
! fstr = "%-39s %5.3f %5.3f %s %s %s %d\n";
! }
for (i = 0; i < HASHSIZE; i++)
{
struct neighbor_entry *neigh;
! for(neigh = neighbortable[i].next; neigh != &neighbortable[i]; neigh = neigh->next)
{
! struct link_entry *link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! if(link)
! {
! double best_lq = link->neigh_link_quality;
! double inv_best_lq = link->loss_link_quality;
! OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr),
! inv_best_lq, best_lq,
! (neigh->status == SYM) ? "YES " : "NO ",
! neigh->is_mpr ? "YES " : "NO ",
! olsr_lookup_mprs_set(&neigh->neighbor_main_addr) == NULL ? "NO " : "YES ",
! neigh->willingness)
! }
}
}
Index: interfaces.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** interfaces.c 17 Apr 2006 18:31:09 -0000 1.29
--- interfaces.c 20 Apr 2007 13:46:04 -0000 1.30
***************
*** 73,77 ****
*/
int
! ifinit()
{
struct olsr_if *tmp_if;
--- 73,77 ----
*/
int
! ifinit(void)
{
struct olsr_if *tmp_if;
***************
*** 124,128 ****
olsr_u32_t
! get_if_property_id()
{
return if_property_id++;
--- 124,128 ----
olsr_u32_t
! get_if_property_id(void)
{
return if_property_id++;
Index: olsrd_plugin.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsrd_plugin.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** olsrd_plugin.h 29 May 2005 12:47:45 -0000 1.1
--- olsrd_plugin.h 20 Apr 2007 13:46:04 -0000 1.2
***************
*** 49,52 ****
--- 49,59 ----
****************************************************************************/
+ #if 1
+ /* We hide them from the compiler here to allow the plugins itself to declare them
+ * as they also implement them if we activate -Wredundant-decls.
+ * Normally we leave it seen so that we enforce a check by the compiler if they are
+ * identical.
+ */
+
/**
* Plugin interface version
***************
*** 71,75 ****
int
olsrd_plugin_init(void);
!
#endif
--- 78,82 ----
int
olsrd_plugin_init(void);
! #endif
#endif
Index: olsr_types.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_types.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** olsr_types.h 31 Jan 2007 12:36:50 -0000 1.5
--- olsr_types.h 20 Apr 2007 13:46:04 -0000 1.6
***************
*** 93,96 ****
--- 93,99 ----
union olsr_ip_addr
{
+ /*
+ struct in_addr v4;
+ */
olsr_u32_t v4;
olsr_u8_t v4x[4];
Index: socket_parser.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** socket_parser.c 29 May 2005 12:47:45 -0000 1.23
--- socket_parser.c 20 Apr 2007 13:46:04 -0000 1.24
***************
*** 158,166 ****
void
! poll_sockets()
{
int n;
struct olsr_socket_entry *olsr_sockets;
- static struct tms tms_buf;
/* If there are no registered sockets we
--- 158,165 ----
void
! poll_sockets(void)
{
int n;
struct olsr_socket_entry *olsr_sockets;
/* If there are no registered sockets we
***************
*** 173,181 ****
/* Adding file-descriptors to FD set */
! olsr_sockets = olsr_socket_entries;
! while(olsr_sockets)
{
! FD_SET(olsr_sockets->fd, &ibits);
! olsr_sockets = olsr_sockets->next;
}
--- 172,179 ----
/* Adding file-descriptors to FD set */
!
! for(olsr_sockets = olsr_socket_entries; olsr_sockets; olsr_sockets = olsr_sockets->next)
{
! FD_SET(olsr_sockets->fd, &ibits);
}
***************
*** 198,213 ****
/* Update time since this is much used by the parsing functions */
gettimeofday(&now, NULL);
! now_times = times(&tms_buf);
! olsr_sockets = olsr_socket_entries;
! while(olsr_sockets)
{
if(FD_ISSET(olsr_sockets->fd, &ibits))
- {
olsr_sockets->process_function(olsr_sockets->fd);
! }
! olsr_sockets = olsr_sockets->next;
! }
!
}
--- 196,206 ----
/* Update time since this is much used by the parsing functions */
gettimeofday(&now, NULL);
! now_times = times(NULL);
! for(olsr_sockets = olsr_socket_entries;olsr_sockets;olsr_sockets = olsr_sockets->next)
{
if(FD_ISSET(olsr_sockets->fd, &ibits))
olsr_sockets->process_function(olsr_sockets->fd);
! }
}
Index: duplicate_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/duplicate_set.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** duplicate_set.c 31 Jan 2007 12:36:50 -0000 1.13
--- duplicate_set.c 20 Apr 2007 13:46:04 -0000 1.14
***************
*** 58,62 ****
*/
void
! olsr_init_duplicate_table()
{
int i;
--- 58,62 ----
*/
void
! olsr_init_duplicate_table(void)
{
int i;
***************
*** 226,230 ****
void
! olsr_time_out_duplicate_table(void *foo)
{
int i;
--- 226,230 ----
void
! olsr_time_out_duplicate_table(void *foo __attribute__((unused)))
{
int i;
***************
*** 345,356 ****
}
-
-
-
-
-
-
void
! olsr_print_duplicate_table()
{
int i;
--- 345,350 ----
}
void
! olsr_print_duplicate_table(void)
{
int i;
***************
*** 371,375 ****
}
}
! printf("\n");
}
--- 365,369 ----
}
}
! printf("\n");
}
Index: local_hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** local_hna_set.c 10 Feb 2007 19:27:32 -0000 1.12
--- local_hna_set.c 20 Apr 2007 13:46:04 -0000 1.13
***************
*** 107,113 ****
remove_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len)
{
! struct hna6_entry *h6 = olsr_cnf->hna6_entries, *h6prev = NULL;
! while(h6)
{
if((memcmp(net, &h6->net, olsr_cnf->ipsize) == 0) &&
--- 107,113 ----
remove_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len)
{
! struct hna6_entry *h6, *h6prev = NULL;
! for(h6 = olsr_cnf->hna6_entries; h6; h6 = h6->next)
{
if((memcmp(net, &h6->net, olsr_cnf->ipsize) == 0) &&
***************
*** 124,130 ****
}
h6prev = h6;
- h6 = h6->next;
}
-
return 0;
}
--- 124,128 ----
***************
*** 172,188 ****
int
! check_inet_gw()
{
- struct hna4_entry *h4 = olsr_cnf->hna4_entries;
-
if(olsr_cnf->ip_version == AF_INET)
{
! while(h4)
{
if(h4->netmask.v4 == 0 && h4->net.v4 == 0)
return 1;
- h4 = h4->next;
}
- return 0;
}
return 0;
--- 170,183 ----
int
! check_inet_gw(void)
{
if(olsr_cnf->ip_version == AF_INET)
{
! struct hna4_entry *h4;
! for(h4 = olsr_cnf->hna4_entries; h4; h4 = h4->next)
{
if(h4->netmask.v4 == 0 && h4->net.v4 == 0)
return 1;
}
}
return 0;
Index: plugin_loader.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** plugin_loader.c 29 May 2005 12:47:45 -0000 1.23
--- plugin_loader.c 20 Apr 2007 13:46:04 -0000 1.24
***************
*** 61,74 ****
*/
int
! olsr_load_plugins()
{
! struct plugin_entry *entry;
! int loaded;
!
! entry = olsr_cnf->plugins;
! loaded = 0;
!
OLSR_PRINTF(1, "Loading plugins...\n\n")
-
while(entry)
{
--- 61,69 ----
*/
int
! olsr_load_plugins(void)
{
! struct plugin_entry *entry = olsr_cnf->plugins;
! int loaded = 0;
OLSR_PRINTF(1, "Loading plugins...\n\n")
while(entry)
{
***************
*** 76,80 ****
OLSR_PRINTF(1, "-- PLUGIN LOADING FAILED! --\n\n")
else
! loaded ++;
entry = entry->next;
--- 71,75 ----
OLSR_PRINTF(1, "-- PLUGIN LOADING FAILED! --\n\n")
else
! loaded++;
entry = entry->next;
***************
*** 208,221 ****
init_olsr_plugin(struct olsr_plugin *entry)
{
- struct plugin_param *params = entry->params;
- int retval;
-
if(entry->register_param)
{
OLSR_PRINTF(1, "Sending parameters...\n")
! while(params)
{
OLSR_PRINTF(1, "\"%s\"/\"%s\"... ", params->key, params->value)
! if((retval = entry->register_param(params->key, params->value)) < 0)
{
fprintf(stderr, "\nFatal error in plugin parameter \"%s\"/\"%s\"\n", params->key, params->value);
--- 203,215 ----
init_olsr_plugin(struct olsr_plugin *entry)
{
if(entry->register_param)
{
+ struct plugin_param *params;
OLSR_PRINTF(1, "Sending parameters...\n")
! for(params = entry->params;params;params = params->next)
{
+ int retval = entry->register_param(params->key, params->value);
OLSR_PRINTF(1, "\"%s\"/\"%s\"... ", params->key, params->value)
! if(retval < 0)
{
fprintf(stderr, "\nFatal error in plugin parameter \"%s\"/\"%s\"\n", params->key, params->value);
***************
*** 223,228 ****
}
OLSR_PRINTF(1, "%s\n", retval == 0 ? "FAILED" : "OK")
-
- params = params->next;
}
}
--- 217,220 ----
***************
*** 237,250 ****
*/
void
! olsr_close_plugins()
{
struct olsr_plugin *entry;
OLSR_PRINTF(1, "Closing plugins...\n")
! for(entry = olsr_plugins;
! entry != NULL ;
! entry = entry->next)
! {
dlclose(entry->dlhandle);
- }
}
--- 229,238 ----
*/
void
! olsr_close_plugins(void)
{
struct olsr_plugin *entry;
OLSR_PRINTF(1, "Closing plugins...\n")
! for(entry = olsr_plugins; entry != NULL; entry = entry->next)
dlclose(entry->dlhandle);
}
Index: net_olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** net_olsr.h 10 Feb 2007 19:59:51 -0000 1.7
--- net_olsr.h 20 Apr 2007 13:46:04 -0000 1.8
***************
*** 94,105 ****
sockaddr_to_string(struct sockaddr *);
! char *
! ip_to_string(olsr_u32_t *);
! char *
! ip6_to_string(struct in6_addr *);
! char *
! olsr_ip_to_string(union olsr_ip_addr *);
int
--- 94,105 ----
sockaddr_to_string(struct sockaddr *);
! const char *
! ip_to_string(const olsr_u32_t *);
! const char *
! ip6_to_string(const struct in6_addr *);
! const char *
! olsr_ip_to_string(const union olsr_ip_addr *);
int
Index: hysteresis.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hysteresis.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** hysteresis.h 14 Dec 2006 11:29:19 -0000 1.8
--- hysteresis.h 20 Apr 2007 13:46:04 -0000 1.9
***************
*** 39,44 ****
* $Id$
*/
-
-
#ifndef _OLSR_HYSTERESIS
#define _OLSR_HYSTERESIS
--- 39,42 ----
***************
*** 46,55 ****
#include "link_set.h"
!
!
! inline float
olsr_hyst_calc_stability(float);
! inline int
olsr_process_hysteresis(struct link_entry *);
--- 44,51 ----
#include "link_set.h"
! float
olsr_hyst_calc_stability(float);
! int
olsr_process_hysteresis(struct link_entry *);
Index: defs.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** defs.h 2 Apr 2007 09:40:48 -0000 1.56
--- defs.h 20 Apr 2007 13:46:04 -0000 1.57
***************
*** 75,81 ****
/* Debug helper macro */
#ifdef DEBUG
! #define olsr_debug(lvl,format,args...) \
OLSR_PRINTF(lvl, "%s (%s:%d): ", __func__, __FILE__, __LINE__); \
! OLSR_PRINTF(lvl, format, ##args);
#endif
--- 75,82 ----
/* Debug helper macro */
#ifdef DEBUG
! #define olsr_debug(lvl,format,args...) do { \
OLSR_PRINTF(lvl, "%s (%s:%d): ", __func__, __FILE__, __LINE__); \
! OLSR_PRINTF(lvl, format, ##args); \
! } while (0)
#endif
***************
*** 102,105 ****
--- 103,108 ----
+ #define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x)))
+
/*
* Queueing macros
***************
*** 119,122 ****
--- 122,127 ----
+ #define CLOSE(fd) do { close(fd); (fd) = -1;} while (0)
+
/*
* Global olsrd configuragtion
***************
*** 149,155 ****
int
- ipc_send_net_info(void);
-
- int
ipc_route_send_rtentry(union olsr_ip_addr*, union olsr_ip_addr *, int, int, char *);
--- 154,157 ----
Index: process_package.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** process_package.c 10 Feb 2007 19:27:32 -0000 1.38
--- process_package.c 20 Apr 2007 13:46:04 -0000 1.39
***************
*** 61,65 ****
*/
void
! olsr_init_package_process()
{
if (olsr_cnf->lq_level == 0)
--- 61,65 ----
*/
void
! olsr_init_package_process(void)
{
if (olsr_cnf->lq_level == 0)
***************
*** 82,100 ****
union olsr_ip_addr *from_addr)
{
- struct link_entry *link;
struct neighbor_entry *neighbor;
- struct hello_neighbor *walker;
- double saved_lq;
- double rel_lq;
/*
* Update link status
*/
! link = update_link_entry(&in_if->ip_addr, from_addr, message, in_if);
if (olsr_cnf->lq_level > 0)
{
// just in case our neighbor has changed its HELLO interval
-
olsr_update_packet_loss_hello_int(link, message->htime);
--- 82,98 ----
union olsr_ip_addr *from_addr)
{
struct neighbor_entry *neighbor;
/*
* Update link status
*/
! struct link_entry *link = update_link_entry(&in_if->ip_addr, from_addr, message, in_if);
if (olsr_cnf->lq_level > 0)
{
+ double saved_lq;
+ double rel_lq;
+ struct hello_neighbor *walker;
// just in case our neighbor has changed its HELLO interval
olsr_update_packet_loss_hello_int(link, message->htime);
Index: mid_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** mid_set.c 10 Feb 2007 19:27:32 -0000 1.17
--- mid_set.c 20 Apr 2007 13:46:04 -0000 1.18
***************
*** 61,65 ****
int
! olsr_init_mid_set()
{
int index;
--- 61,65 ----
int
! olsr_init_mid_set(void)
{
int index;
***************
*** 462,466 ****
*/
void
! olsr_time_out_mid_set(void *foo)
{
int index;
--- 462,466 ----
*/
void
! olsr_time_out_mid_set(void *foo __attribute__((unused)))
{
int index;
***************
*** 528,534 ****
*/
void
! olsr_print_mid_set()
{
-
int index;
--- 528,533 ----
*/
void
! olsr_print_mid_set(void)
{
int index;
***************
*** 539,553 ****
struct mid_entry *tmp_list = mid_set[index].next;
/*Traverse MID list*/
! for(tmp_list = mid_set[index].next;
! tmp_list != &mid_set[index];
! tmp_list = tmp_list->next)
{
! struct mid_address *tmp_addr = tmp_list->aliases;
!
OLSR_PRINTF(1, "%s: ", olsr_ip_to_string(&tmp_list->main_addr))
! while(tmp_addr)
{
OLSR_PRINTF(1, " %s ", olsr_ip_to_string(&tmp_addr->alias))
- tmp_addr = tmp_addr->next_alias;
}
OLSR_PRINTF(1, "\n")
--- 538,549 ----
struct mid_entry *tmp_list = mid_set[index].next;
/*Traverse MID list*/
! for(tmp_list = mid_set[index].next; tmp_list != &mid_set[index]; tmp_list = tmp_list->next)
{
! struct mid_address *tmp_addr;
!
OLSR_PRINTF(1, "%s: ", olsr_ip_to_string(&tmp_list->main_addr))
! for(tmp_addr = tmp_list->aliases;tmp_addr;tmp_addr = tmp_addr->next_alias)
{
OLSR_PRINTF(1, " %s ", olsr_ip_to_string(&tmp_addr->alias))
}
OLSR_PRINTF(1, "\n")
Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** net_olsr.c 20 Apr 2007 10:38:01 -0000 1.20
--- net_olsr.c 20 Apr 2007 13:46:04 -0000 1.21
***************
*** 78,83 ****
static struct ptf *ptf_list;
- static char ipv6_buf[100]; /* for address coversion */
-
static struct deny_address_entry *deny_entries;
--- 78,81 ----
***************
*** 105,114 ****
init_net(void)
{
- union olsr_ip_addr addr;
- int i;
-
/* Block invalid addresses */
if(olsr_cnf->ip_version == AF_INET)
{
/* IPv4 */
for(i = 0; deny_ipv4_defaults[i] != NULL; i++)
--- 103,111 ----
init_net(void)
{
/* Block invalid addresses */
if(olsr_cnf->ip_version == AF_INET)
{
+ union olsr_ip_addr addr;
+ int i;
/* IPv4 */
for(i = 0; deny_ipv4_defaults[i] != NULL; i++)
***************
*** 125,128 ****
--- 122,127 ----
else
{
+ union olsr_ip_addr addr;
+ int i;
/* IPv6 */
for(i = 0; deny_ipv6_defaults[i] != NULL; i++)
***************
*** 418,426 ****
*Call possible packet transform functions registered by plugins
*/
! tmp_ptf_list = ptf_list;
! while(tmp_ptf_list != NULL)
{
tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending);
- tmp_ptf_list = tmp_ptf_list->next;
}
--- 417,423 ----
*Call possible packet transform functions registered by plugins
*/
! for (tmp_ptf_list = ptf_list; tmp_ptf_list != NULL; tmp_ptf_list = tmp_ptf_list->next)
{
tmp_ptf_list->function(ifp->netbuf.buff, &ifp->netbuf.pending);
}
***************
*** 586,593 ****
*/
! char *
! ip_to_string(olsr_u32_t *address)
{
-
struct in_addr in;
in.s_addr=*address;
--- 583,589 ----
*/
! const char *
! ip_to_string(const olsr_u32_t *address)
{
struct in_addr in;
in.s_addr=*address;
***************
*** 596,602 ****
}
-
-
-
/**
*Converts the 32bit olsr_u32_t datatype to
--- 592,595 ----
***************
*** 609,642 ****
*/
! char *
! ip6_to_string(struct in6_addr *addr6)
{
! return (char *)inet_ntop(AF_INET6, addr6, ipv6_buf, sizeof(ipv6_buf));
}
! char *
! olsr_ip_to_string(union olsr_ip_addr *addr)
{
static int index = 0;
! static char buff[4][100];
! char *ret;
! struct in_addr in;
if(olsr_cnf->ip_version == AF_INET)
{
! in.s_addr=addr->v4;
! ret = inet_ntoa(in);
}
else
{
/* IPv6 */
! ret = (char *)inet_ntop(AF_INET6, &addr->v6, ipv6_buf, sizeof(ipv6_buf));
}
-
- strncpy(buff[index], ret, 100);
-
- ret = buff[index];
-
index = (index + 1) & 3;
--- 602,635 ----
*/
! const char *
! ip6_to_string(const struct in6_addr *addr6)
{
! static char ipv6_buf[INET6_ADDRSTRLEN]; /* for address coversion */
! return inet_ntop(AF_INET6, addr6, ipv6_buf, sizeof(ipv6_buf));
}
! const char *
! olsr_ip_to_string(const union olsr_ip_addr *addr)
{
static int index = 0;
! static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN];
! const char *ret;
if(olsr_cnf->ip_version == AF_INET)
{
! #if 0
! struct in_addr in;
! in.s_addr = addr->v4;
! ret = inet_ntop(AF_INET, &in, buff[index], sizeof(buff[index]));
! #else
! ret = inet_ntop(AF_INET, &addr->v6, buff[index], sizeof(buff[index]));
! #endif
}
else
{
/* IPv6 */
! ret = inet_ntop(AF_INET6, &addr->v6, buff[index], sizeof(buff[index]));
}
index = (index + 1) & 3;
Index: build_msg.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/build_msg.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** build_msg.c 14 Dec 2006 11:29:19 -0000 1.33
--- build_msg.c 20 Apr 2007 13:46:04 -0000 1.34
***************
*** 40,44 ****
*/
-
#include "defs.h"
#include "olsr.h"
--- 40,43 ----
***************
*** 114,118 ****
*/
clock_t
! get_empty_tc_timer()
{
return send_empty_tc;
--- 113,117 ----
*/
clock_t
! get_empty_tc_timer(void)
{
return send_empty_tc;
Index: routing_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** routing_table.c 10 Feb 2007 19:27:32 -0000 1.25
--- routing_table.c 20 Apr 2007 13:46:04 -0000 1.26
***************
*** 49,52 ****
--- 49,53 ----
#include "olsr.h"
#include "link_set.h"
+ #include "routing_table.h"
***************
*** 83,90 ****
*/
int
! olsr_init_routing_table()
{
int index;
-
/*
*The hna routes hash will almost always
--- 84,90 ----
*/
int
! olsr_init_routing_table(void)
{
int index;
/*
*The hna routes hash will almost always
***************
*** 117,123 ****
struct rt_entry *rt_table;
! olsr_u32_t hash;
!
! hash = olsr_hashing(dst);
for(rt_table = routingtable[hash].next;
--- 117,121 ----
struct rt_entry *rt_table;
! olsr_u32_t hash = olsr_hashing(dst);
for(rt_table = routingtable[hash].next;
***************
*** 127,134 ****
if (COMP_IP(&rt_table->rt_dst, dst))
{
! return(rt_table);
}
}
! return(NULL);
}
--- 125,132 ----
if (COMP_IP(&rt_table->rt_dst, dst))
{
! return rt_table;
}
}
! return NULL;
}
***************
*** 250,256 ****
*/
static int
! olsr_fill_routing_table_with_neighbors()
{
! olsr_u8_t index;
#ifdef DEBUG
--- 248,254 ----
*/
static int
! olsr_fill_routing_table_with_neighbors(void)
{
! int index;
#ifdef DEBUG
***************
*** 261,270 ****
{
struct neighbor_entry *neighbor;
-
for(neighbor = neighbortable[index].next;
neighbor != &neighbortable[index];
neighbor=neighbor->next)
{
-
if(neighbor->status == SYM)
{
--- 259,266 ----
***************
*** 278,284 ****
COPY_IP(&addrs.alias, &neighbor->neighbor_main_addr);
addrs.next_alias = mid_lookup_aliases(&neighbor->neighbor_main_addr);
- addrs2 = &addrs;
! while(addrs2!=NULL)
{
struct link_entry *link = get_best_link_to_neighbor(&addrs2->alias);
--- 274,279 ----
COPY_IP(&addrs.alias, &neighbor->neighbor_main_addr);
addrs.next_alias = mid_lookup_aliases(&neighbor->neighbor_main_addr);
! for(addrs2 = &addrs;addrs2!=NULL;addrs2 = addrs2->next_alias)
{
struct link_entry *link = get_best_link_to_neighbor(&addrs2->alias);
***************
*** 299,310 ****
}
}
-
- addrs2 = addrs2->next_alias;
}
}
}
}
-
-
return 1;
}
--- 294,301 ----
***************
*** 343,350 ****
static struct destination_n *
! olsr_fill_routing_table_with_two_hop_neighbors()
{
struct destination_n *list_destination_n=NULL;
! olsr_u8_t index;
//printf("FILL ROUTING TABLE WITH TWO HOP NEIGHBORS\n");
--- 334,341 ----
static struct destination_n *
! olsr_fill_routing_table_with_two_hop_neighbors(void)
{
struct destination_n *list_destination_n=NULL;
! int index;
//printf("FILL ROUTING TABLE WITH TWO HOP NEIGHBORS\n");
***************
*** 393,399 ****
COPY_IP(&addrs.alias, n2_addr);
addrs.next_alias = mid_lookup_aliases(n2_addr);
- addrsp = &addrs;
! while(addrsp!=NULL)
{
struct link_entry *link = get_best_link_to_neighbor(&neighbor->neighbor_main_addr);
--- 384,389 ----
COPY_IP(&addrs.alias, n2_addr);
addrs.next_alias = mid_lookup_aliases(n2_addr);
! for(addrsp = &addrs; addrsp; addrsp = addrsp->next_alias)
{
struct link_entry *link = get_best_link_to_neighbor(&neighbor->neighbor_main_addr);
***************
*** 403,407 ****
if(link)
{
! struct interface *iface = link->if_name ? if_ifwithname(link->if_name) :
if_ifwithaddr(&link->local_iface_addr);
if(iface)
--- 393,397 ----
if(link)
{
! struct interface *iface = link->if_name ? if_ifwithname(link->if_name) :
if_ifwithaddr(&link->local_iface_addr);
if(iface)
***************
*** 416,442 ****
if(new_route_entry != NULL)
{
! struct destination_n *list_destination_tmp;
! list_destination_tmp = olsr_malloc(sizeof(struct destination_n),
! "Fill rt table 2 hop tmp");
!
! list_destination_tmp->destination = new_route_entry;
! list_destination_tmp->next = list_destination_n;
! list_destination_n = list_destination_tmp;
}
}
}
- addrsp = addrsp->next_alias;
}
}
! }
!
}
-
return list_destination_n;
}
-
-
-
/**
*Recalculate the routing table
--- 406,424 ----
if(new_route_entry != NULL)
{
! struct destination_n *tmp = olsr_malloc(sizeof(struct destination_n),
! "Fill rt table 2 hop tmp");
! tmp->destination = new_route_entry;
! tmp->next = list_destination_n;
! list_destination_n = tmp;
}
}
}
}
}
! }
}
return list_destination_n;
}
/**
*Recalculate the routing table
***************
*** 445,451 ****
*/
void
! olsr_calculate_routing_table()
{
! struct destination_n *list_destination_n_1 = NULL;
olsr_move_route_table(routingtable, old_routes);
--- 427,433 ----
*/
void
! olsr_calculate_routing_table(void)
{
! struct destination_n *list_destination_n_1;
olsr_move_route_table(routingtable, old_routes);
***************
*** 454,460 ****
olsr_fill_routing_table_with_neighbors();
/* Add two hop enighbors - now they are the "outer rim" */
list_destination_n_1 = olsr_fill_routing_table_with_two_hop_neighbors();
!
! while(list_destination_n_1!=NULL)
{
/* List_destination_n_1 holds the "outer rim" */
--- 436,442 ----
olsr_fill_routing_table_with_neighbors();
/* Add two hop enighbors - now they are the "outer rim" */
+
list_destination_n_1 = olsr_fill_routing_table_with_two_hop_neighbors();
! while(list_destination_n_1)
{
/* List_destination_n_1 holds the "outer rim" */
***************
*** 644,650 ****
*/
void
! olsr_calculate_hna_routes()
{
! olsr_u32_t index;
#ifdef DEBUG
--- 626,632 ----
*/
void
! olsr_calculate_hna_routes(void)
{
! int index;
#ifdef DEBUG
***************
*** 654,658 ****
olsr_move_route_table(hna_routes, old_hna);
-
for(index=0;index<HASHSIZE;index++)
{
--- 636,639 ----
***************
*** 675,687 ****
/* If no route to gateway - skip */
if((tmp_rt = olsr_lookup_routing_table(&tmp_hna->A_gateway_addr)) == NULL)
- {
continue;
- }
/* If there exists a better or equal entry - skip */
if(olsr_check_for_higher_quality(hna_routes, tmp_net, tmp_rt->rt_etx) != NULL)
- {
continue;
- }
/* If we find an entry with lower quality we just edit it */
--- 656,664 ----
***************
*** 745,749 ****
olsr_free_routing_table(old_hna);
-
}
--- 722,725 ----
***************
*** 760,769 ****
olsr_print_routing_table(struct rt_entry *table)
{
!
! olsr_u8_t index;
printf("ROUTING TABLE\n");
printf("DESTINATION\tNEXT HOP\tHOPCNT\tINTERFACE\n");
! for(index=0;index<HASHSIZE;index++)
{
struct rt_entry *destination;
--- 736,744 ----
olsr_print_routing_table(struct rt_entry *table)
{
! int index;
printf("ROUTING TABLE\n");
printf("DESTINATION\tNEXT HOP\tHOPCNT\tINTERFACE\n");
! for(index = 0; index < HASHSIZE; index++)
{
struct rt_entry *destination;
***************
*** 780,786 ****
}
}
-
-
-
-
-
--- 755,756 ----
Index: olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** olsr.h 31 Jan 2007 12:36:50 -0000 1.25
--- olsr.h 20 Apr 2007 13:46:04 -0000 1.26
***************
*** 61,65 ****
init_msg_seqno(void);
! inline olsr_u16_t
get_msg_seqno(void);
--- 61,65 ----
init_msg_seqno(void);
! olsr_u16_t
get_msg_seqno(void);
***************
*** 102,106 ****
int
! olsr_printf(int, char *, ...);
#endif
--- 102,106 ----
int
! olsr_printf(int, char *, ...) __attribute__((format(printf,2,3)));
#endif
Index: main.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** main.c 20 Apr 2007 10:38:01 -0000 1.93
--- main.c 20 Apr 2007 13:46:04 -0000 1.94
***************
*** 70,74 ****
#else
static void
! olsr_shutdown(int);
#endif
--- 70,74 ----
#else
static void
! olsr_shutdown(int) __attribute__((noreturn));
#endif
***************
*** 77,81 ****
*/
void
! olsr_reconfigure(int);
static void
--- 77,81 ----
*/
void
! olsr_reconfigure(int) __attribute__((noreturn));
static void
***************
*** 408,414 ****
scheduler();
/* Like we're ever going to reach this ;-) */
return 1;
-
} /* main */
--- 408,416 ----
scheduler();
+ /* Stop the compiler from complaining */
+ (void)copyright_string;
+
/* Like we're ever going to reach this ;-) */
return 1;
} /* main */
***************
*** 422,426 ****
#ifndef WIN32
void
! olsr_reconfigure(int signal)
{
if(!fork())
--- 424,428 ----
#ifndef WIN32
void
! olsr_reconfigure(int signal __attribute__((unused)))
{
if(!fork())
***************
*** 503,518 ****
*/
static void
! print_usage()
{
! fprintf(stderr, "An error occured somewhere between your keyboard and your chair!\n");
! fprintf(stderr, "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n");
! fprintf(stderr, " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n");
! fprintf(stderr, " [-lql <LQ level>] [-lqw <LQ winsize>]\n");
! fprintf(stderr, " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n");
! fprintf(stderr, " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n");
! fprintf(stderr, " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n");
! fprintf(stderr, " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>] \n");
! fprintf(stderr, " [-lql <LQ level>] [-lqw <LQ winsize>]\n");
}
--- 505,521 ----
*/
static void
! print_usage(void)
{
! fprintf(stderr,
! "An error occured somwhere between your keyboard and your chair!\n"
! "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
! " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
! " [-lql <LQ level>] [-lqw <LQ winsize>]\n"
! " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
! " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
! " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
! " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n"
! " [-lql <LQ level>] [-lqw <LQ winsize>]\n");
}
Index: olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** olsr.c 4 Feb 2007 22:47:45 -0000 1.50
--- olsr.c 20 Apr 2007 13:46:04 -0000 1.51
***************
*** 89,93 ****
*/
void
! init_msg_seqno()
{
message_seqno = random() & 0xFFFF;
--- 89,93 ----
*/
void
! init_msg_seqno(void)
{
message_seqno = random() & 0xFFFF;
***************
*** 99,104 ****
*@return the seqno
*/
! inline olsr_u16_t
! get_msg_seqno()
{
return message_seqno++;
--- 99,104 ----
*@return the seqno
*/
! olsr_u16_t
! get_msg_seqno(void)
{
return message_seqno++;
***************
*** 130,136 ****
*/
void
! olsr_process_changes()
{
-
struct pcf *tmp_pc_list;
--- 130,135 ----
*/
void
! olsr_process_changes(void)
{
struct pcf *tmp_pc_list;
***************
*** 256,262 ****
*/
void
! olsr_init_tables()
! {
!
changes_topology = OLSR_FALSE;
changes_neighborhood = OLSR_FALSE;
--- 255,260 ----
*/
void
! olsr_init_tables(void)
! {
changes_topology = OLSR_FALSE;
changes_neighborhood = OLSR_FALSE;
***************
*** 291,303 ****
/* Initialize HNA set */
! olsr_init_hna_set();
!
}
-
-
-
-
-
/**
*Check if a message is to be forwarded and forward
--- 289,295 ----
/* Initialize HNA set */
! olsr_init_hna_set();
}
/**
*Check if a message is to be forwarded and forward
***************
*** 332,340 ****
/* Lookup sender address */
! if(!(src = mid_lookup_main_addr(from_addr)))
src = from_addr;
!
! if(NULL == (neighbor=olsr_lookup_neighbor_table(src)))
return 0;
--- 324,333 ----
/* Lookup sender address */
! src = mid_lookup_main_addr(from_addr);
! if(!src)
src = from_addr;
! neighbor=olsr_lookup_neighbor_table(src);
! if(!neighbor)
return 0;
***************
*** 355,359 ****
}
-
/* Treat TTL hopcnt */
if(olsr_cnf->ip_version == AF_INET)
--- 348,351 ----
***************
*** 370,381 ****
}
-
-
/* Update dup forwarded */
olsr_set_dup_forward(originator, seqno);
/* Update packet data */
-
-
msgsize = ntohs(m->v4.olsr_msgsize);
--- 362,369 ----
***************
*** 400,407 ****
olsr_syslog(OLSR_LOG_ERR, "Received message to big to be forwarded on %s(%d bytes)!", ifn->int_name, msgsize);
}
-
}
}
-
else
{
--- 388,393 ----
***************
*** 416,422 ****
}
}
-
return 1;
-
}
--- 402,406 ----
***************
*** 432,442 ****
ifn->fwdtimer = GET_TIMESTAMP(jitter*1000);
-
}
-
-
void
! olsr_init_willingness()
{
if(olsr_cnf->willingness_auto)
--- 416,423 ----
ifn->fwdtimer = GET_TIMESTAMP(jitter*1000);
}
void
! olsr_init_willingness(void)
{
if(olsr_cnf->willingness_auto)
***************
*** 446,454 ****
void
! olsr_update_willingness(void *foo)
{
! int tmp_will;
!
! tmp_will = olsr_cnf->willingness;
/* Re-calculate willingness */
--- 427,433 ----
void
! olsr_update_willingness(void *foo __attribute__((unused)))
{
! int tmp_will = olsr_cnf->willingness;
/* Re-calculate willingness */
***************
*** 471,475 ****
olsr_u8_t
! olsr_calculate_willingness()
{
struct olsr_apm_info ainfo;
--- 450,454 ----
olsr_u8_t
! olsr_calculate_willingness(void)
{
struct olsr_apm_info ainfo;
***************
*** 625,640 ****
olsr_printf(int loglevel, char *format, ...)
{
- va_list arglist;
-
if((loglevel <= olsr_cnf->debug_level) && debug_handle)
{
va_start(arglist, format);
-
vfprintf(debug_handle, format, arglist);
-
va_end(arglist);
}
-
-
return 0;
}
--- 604,614 ----
olsr_printf(int loglevel, char *format, ...)
{
if((loglevel <= olsr_cnf->debug_level) && debug_handle)
{
+ va_list arglist;
va_start(arglist, format);
vfprintf(debug_handle, format, arglist);
va_end(arglist);
}
return 0;
}
Index: mpr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mpr.c 7 Jan 2006 08:16:20 -0000 1.15
--- mpr.c 20 Apr 2007 13:46:04 -0000 1.16
***************
*** 277,292 ****
*/
static void
! olsr_clear_mprs()
{
olsr_u32_t index;
- struct neighbor_entry *a_neighbor;
- struct neighbor_2_list_entry *two_hop_list;
for (index=0;index<HASHSIZE;index++)
{
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
a_neighbor = a_neighbor->next)
{
/* Clear MPR selection */
if(a_neighbor->is_mpr)
--- 277,292 ----
*/
static void
! olsr_clear_mprs(void)
{
olsr_u32_t index;
for (index=0;index<HASHSIZE;index++)
{
+ struct neighbor_entry *a_neighbor;
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
a_neighbor = a_neighbor->next)
{
+ struct neighbor_2_list_entry *two_hop_list;
/* Clear MPR selection */
if(a_neighbor->is_mpr)
***************
*** 305,309 ****
}
}
-
}
--- 305,308 ----
***************
*** 315,322 ****
*/
static int
! olsr_check_mpr_changes()
{
olsr_u32_t index;
- struct neighbor_entry *a_neighbor;
int retval;
--- 314,320 ----
*/
static int
! olsr_check_mpr_changes(void)
{
olsr_u32_t index;
int retval;
***************
*** 325,328 ****
--- 323,327 ----
for (index=0;index<HASHSIZE;index++)
{
+ struct neighbor_entry *a_neighbor;
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
***************
*** 347,357 ****
*/
static void
! olsr_clear_two_hop_processed()
{
- struct neighbor_2_entry *neighbor_2;
int index;
for(index=0;index<HASHSIZE;index++)
{
for(neighbor_2 = two_hop_neighbortable[index].next;
neighbor_2 != &two_hop_neighbortable[index];
--- 346,356 ----
*/
static void
! olsr_clear_two_hop_processed(void)
{
int index;
for(index=0;index<HASHSIZE;index++)
{
+ struct neighbor_2_entry *neighbor_2;
for(neighbor_2 = two_hop_neighbortable[index].next;
neighbor_2 != &two_hop_neighbortable[index];
***************
*** 370,386 ****
*/
static olsr_u16_t
! olsr_calculate_two_hop_neighbors()
{
olsr_u8_t index;
! struct neighbor_entry *a_neighbor, *dup_neighbor;
! olsr_u16_t count, n_count, sum;
! struct neighbor_2_list_entry *twohop_neighbors;
!
! //dup_neighbor = NULL;
- n_count = 0;
- count = 0;
- sum = 0;
-
/* Clear 2 hop neighs */
olsr_clear_two_hop_processed();
--- 369,377 ----
*/
static olsr_u16_t
! olsr_calculate_two_hop_neighbors(void)
{
olsr_u8_t index;
! olsr_u16_t sum = 0;
/* Clear 2 hop neighs */
olsr_clear_two_hop_processed();
***************
*** 388,399 ****
for(index=0;index<HASHSIZE;index++)
{
! for(a_neighbor = neighbortable[index].next;
! a_neighbor != &neighbortable[index];
! a_neighbor = a_neighbor->next)
{
! count = 0;
! n_count = 0;
!
! if(a_neighbor->status == NOT_SYM)
{
a_neighbor->neighbor_2_nocov = count;
--- 379,389 ----
for(index=0;index<HASHSIZE;index++)
{
! struct neighbor_entry *a_neighbor;
! for(a_neighbor = neighbortable[index].next; a_neighbor != &neighbortable[index]; a_neighbor = a_neighbor->next)
{
! struct neighbor_2_list_entry *twohop_neighbors;
! olsr_u16_t count = 0;
! olsr_u16_t n_count = 0;
! if(a_neighbor->status == NOT_SYM)
{
a_neighbor->neighbor_2_nocov = count;
***************
*** 406,411 ****
{
//printf("\tChecking %s....", olsr_ip_to_string(&twohop_neighbors->neighbor_2->neighbor_2_addr));
!
! dup_neighbor = olsr_lookup_neighbor_table(&twohop_neighbors->neighbor_2->neighbor_2_addr);
if((dup_neighbor == NULL) || (dup_neighbor->status != SYM))
--- 396,400 ----
{
//printf("\tChecking %s....", olsr_ip_to_string(&twohop_neighbors->neighbor_2->neighbor_2_addr));
! struct neighbor_entry *dup_neighbor = olsr_lookup_neighbor_table(&twohop_neighbors->neighbor_2->neighbor_2_addr);
if((dup_neighbor == NULL) || (dup_neighbor->status != SYM))
***************
*** 437,448 ****
*/
static olsr_u16_t
! add_will_always_nodes()
{
!
olsr_u8_t index;
- struct neighbor_entry *a_neighbor;
- olsr_u16_t count;
-
- count = 0;
//printf("\nAdding WILL ALWAYS nodes....\n");
--- 426,433 ----
*/
static olsr_u16_t
! add_will_always_nodes(void)
{
! olsr_u16_t count = 0;
olsr_u8_t index;
//printf("\nAdding WILL ALWAYS nodes....\n");
***************
*** 450,453 ****
--- 435,439 ----
for(index=0;index<HASHSIZE;index++)
{
+ struct neighbor_entry *a_neighbor;
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
***************
*** 473,484 ****
*/
void
! olsr_calculate_mpr()
! {
!
! olsr_u16_t two_hop_covered_count=0;
! olsr_u16_t two_hop_count=0;
! struct neighbor_2_list_entry *two_hop_list=NULL;
! struct neighbor_2_list_entry *tmp;
! struct neighbor_entry *mprs;
int i;
--- 459,466 ----
*/
void
! olsr_calculate_mpr(void)
! {
! olsr_u16_t two_hop_covered_count;
! olsr_u16_t two_hop_count;
int i;
***************
*** 486,492 ****
olsr_clear_mprs();
-
two_hop_count = olsr_calculate_two_hop_neighbors();
-
two_hop_covered_count += add_will_always_nodes();
--- 468,472 ----
***************
*** 497,504 ****
for(i = WILL_ALWAYS - 1; i > WILL_NEVER; i--)
{
! two_hop_list = olsr_find_2_hop_neighbors_with_1_link(i);
while(two_hop_list != NULL)
{
//printf("CHOSEN FROM 1 LINK\n");
if(!two_hop_list->neighbor_2->neighbor_2_nblist.next->neighbor->is_mpr)
--- 477,486 ----
for(i = WILL_ALWAYS - 1; i > WILL_NEVER; i--)
{
! struct neighbor_entry *mprs;
! struct neighbor_2_list_entry *two_hop_list = olsr_find_2_hop_neighbors_with_1_link(i);
while(two_hop_list != NULL)
{
+ struct neighbor_2_list_entry *tmp;
//printf("CHOSEN FROM 1 LINK\n");
if(!two_hop_list->neighbor_2->neighbor_2_nblist.next->neighbor->is_mpr)
***************
*** 558,566 ****
*/
static void
! olsr_optimize_mpr_set()
{
! int i, remove, index;
! struct neighbor_2_list_entry *two_hop_list;
! struct neighbor_entry *a_neighbor, *dup_neighbor;
//printf("\n**MPR OPTIMIZING**\n\n");
--- 540,546 ----
*/
static void
! olsr_optimize_mpr_set(void)
{
! int i, remove;
//printf("\n**MPR OPTIMIZING**\n\n");
***************
*** 568,575 ****
for(i = WILL_NEVER + 1; i < WILL_ALWAYS; i++)
{
!
for(index=0;index<HASHSIZE;index++)
{
!
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
--- 548,555 ----
for(i = WILL_NEVER + 1; i < WILL_ALWAYS; i++)
{
! int index;
for(index=0;index<HASHSIZE;index++)
{
! struct neighbor_entry *a_neighbor;
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
***************
*** 582,585 ****
--- 562,566 ----
if(a_neighbor->is_mpr)
{
+ struct neighbor_2_list_entry *two_hop_list;
//printf("\tChecking %s\n", olsr_ip_to_string(&a_neighbor->neighbor_main_addr));
remove = 1;
***************
*** 590,594 ****
{
! dup_neighbor = olsr_lookup_neighbor_table(&two_hop_list->neighbor_2->neighbor_2_addr);
if((dup_neighbor != NULL) && (dup_neighbor->status != NOT_SYM))
--- 571,575 ----
{
! const struct neighbor_entry * const dup_neighbor = olsr_lookup_neighbor_table(&two_hop_list->neighbor_2->neighbor_2_addr);
if((dup_neighbor != NULL) && (dup_neighbor->status != NOT_SYM))
***************
*** 606,619 ****
a_neighbor->is_mpr = OLSR_FALSE;
}
-
-
}
}
-
}
-
-
}
-
}
--- 587,594 ----
***************
*** 621,628 ****
void
! olsr_print_mpr_set()
{
! int index;
! struct neighbor_entry *a_neighbor;
OLSR_PRINTF(1, "MPR SET: ")
--- 596,602 ----
void
! olsr_print_mpr_set(void)
{
! int index;
OLSR_PRINTF(1, "MPR SET: ")
***************
*** 630,638 ****
for(index=0;index<HASHSIZE;index++)
{
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
a_neighbor = a_neighbor->next)
{
-
/*
* Remove MPR settings
--- 604,612 ----
for(index=0;index<HASHSIZE;index++)
{
+ struct neighbor_entry *a_neighbor;
for(a_neighbor = neighbortable[index].next;
a_neighbor != &neighbortable[index];
a_neighbor = a_neighbor->next)
{
/*
* Remove MPR settings
***************
*** 642,647 ****
}
}
-
OLSR_PRINTF(1, "\n")
-
}
--- 616,619 ----
Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** tc_set.c 7 Jan 2006 08:16:20 -0000 1.24
--- tc_set.c 20 Apr 2007 13:46:04 -0000 1.25
***************
*** 56,60 ****
int
! olsr_init_tc()
{
int index;
--- 56,60 ----
int
! olsr_init_tc(void)
{
int index;
***************
*** 365,373 ****
}
-
-
-
-
-
/**
* Time out entries
--- 365,368 ----
***************
*** 377,397 ****
void
! olsr_time_out_tc_set()
{
! int index, deleted;
! struct tc_entry *entry, *entry2;
! struct topo_dst *dst_entry, *dst_to_delete;
!
for(index=0;index<HASHSIZE;index++)
{
/* For all TC entries */
! entry = tc_table[index].next;
while(entry != &tc_table[index])
{
//printf("INDEX: %d\n", index);
/* For all destination entries of that TC entry */
! deleted = 0;
! dst_entry = entry->destinations.next;
while(dst_entry != &entry->destinations)
{
--- 372,390 ----
void
! olsr_time_out_tc_set(void)
{
! int index;
for(index=0;index<HASHSIZE;index++)
{
/* For all TC entries */
! struct tc_entry *entry = tc_table[index].next;
while(entry != &tc_table[index])
{
+ struct tc_entry *entry2;
//printf("INDEX: %d\n", index);
/* For all destination entries of that TC entry */
! int deleted = 0;
! struct topo_dst *dst_entry = entry->destinations.next;
while(dst_entry != &entry->destinations)
{
***************
*** 399,402 ****
--- 392,396 ----
if(TIMED_OUT(dst_entry->T_time))
{
+ struct topo_dst *dst_to_delete;
deleted = 1;
/* Dequeue */
***************
*** 421,426 ****
}
}
-
- return;
}
--- 415,418 ----
***************
*** 430,438 ****
*/
int
! olsr_print_tc_table()
{
int i;
- struct tc_entry *entry;
- struct topo_dst *dst_entry;
char *fstr;
float etx;
--- 422,428 ----
*/
int
! olsr_print_tc_table(void)
{
int i;
char *fstr;
float etx;
***************
*** 445,489 ****
if (olsr_cnf->ip_version == AF_INET)
! {
! OLSR_PRINTF(1, "Source IP addr Dest IP addr LQ ILQ ETX\n")
! fstr = "%-15s %-15s %5.3f %5.3f %.2f\n";
! }
!
else
! {
! OLSR_PRINTF(1, "Source IP addr Dest IP addr LQ ILQ ETX\n")
! fstr = "%-30s%-30s %5.3f %5.3f %.2f\n";
! }
for (i = 0; i < HASHSIZE; i++)
- {
- entry = tc_table[i].next;
-
- while (entry != &tc_table[i])
{
! dst_entry = entry->destinations.next;
!
! while(dst_entry != &entry->destinations)
! {
! if (dst_entry->link_quality < MIN_LINK_QUALITY ||
! dst_entry->inverse_link_quality < MIN_LINK_QUALITY)
! etx = 0.0;
!
! else
! etx = 1.0 / (dst_entry->link_quality *
! dst_entry->inverse_link_quality);
!
! OLSR_PRINTF(1, fstr, olsr_ip_to_string(&entry->T_last_addr),
! olsr_ip_to_string(&dst_entry->T_dest_addr),
! dst_entry->link_quality, dst_entry->inverse_link_quality,
! etx)
!
! dst_entry = dst_entry->next;
! }
! entry = entry->next;
}
- }
-
return 1;
}
--- 435,469 ----
if (olsr_cnf->ip_version == AF_INET)
! {
! OLSR_PRINTF(1, "Source IP addr Dest IP addr LQ ILQ ETX\n")
! fstr = "%-15s %-15s %5.3f %5.3f %.2f\n";
! }
else
! {
! OLSR_PRINTF(1, "Source IP addr Dest IP addr LQ ILQ ETX\n")
! fstr = "%-30s%-30s %5.3f %5.3f %.2f\n";
! }
for (i = 0; i < HASHSIZE; i++)
{
! struct tc_entry *entry;
! for(entry = tc_table[i].next;entry != &tc_table[i];entry = entry->next)
! {
! struct topo_dst *dst_entry;
! for(dst_entry = entry->destinations.next;dst_entry != &entry->destinations;dst_entry = dst_entry->next)
! {
! if (dst_entry->link_quality < MIN_LINK_QUALITY ||
! dst_entry->inverse_link_quality < MIN_LINK_QUALITY)
! etx = 0.0;
! else
! etx = 1.0 / (dst_entry->link_quality * dst_entry->inverse_link_quality);
! OLSR_PRINTF(1, fstr, olsr_ip_to_string(&entry->T_last_addr),
! olsr_ip_to_string(&dst_entry->T_dest_addr),
! dst_entry->link_quality, dst_entry->inverse_link_quality,
! etx)
! }
! }
}
return 1;
}
Index: mpr_selector_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** mpr_selector_set.c 7 Jan 2006 08:16:20 -0000 1.15
--- mpr_selector_set.c 20 Apr 2007 13:46:04 -0000 1.16
***************
*** 56,60 ****
int
! olsr_init_mprs_set()
{
OLSR_PRINTF(5, "MPRS: Init\n")
--- 56,60 ----
int
! olsr_init_mprs_set(void)
{
OLSR_PRINTF(5, "MPRS: Init\n")
***************
*** 66,70 ****
mprs_list.next = &mprs_list;
mprs_list.prev = &mprs_list;
-
return 1;
--- 66,69 ----
***************
*** 73,77 ****
olsr_u16_t
! get_local_ansn()
{
return ansn;
--- 72,76 ----
olsr_u16_t
! get_local_ansn(void)
{
return ansn;
***************
*** 79,83 ****
void
! increase_local_ansn()
{
ansn++;
--- 78,82 ----
void
! increase_local_ansn(void)
{
ansn++;
***************
*** 89,93 ****
*/
olsr_bool
! olsr_is_mpr()
{
return ((mprs_list.next == &mprs_list) ? OLSR_FALSE : OLSR_TRUE);
--- 88,92 ----
*/
olsr_bool
! olsr_is_mpr(void)
{
return ((mprs_list.next == &mprs_list) ? OLSR_FALSE : OLSR_TRUE);
***************
*** 196,203 ****
}
-
-
-
-
/**
*Time out MPR selector entries
--- 195,198 ----
***************
*** 206,218 ****
*/
void
! olsr_time_out_mprs_set()
{
! struct mpr_selector *mprs;
!
! mprs = mprs_list.next;
while(mprs != &mprs_list)
{
-
if(TIMED_OUT(mprs->MS_time))
{
--- 201,210 ----
*/
void
! olsr_time_out_mprs_set(void)
{
! struct mpr_selector *mprs = mprs_list.next;
while(mprs != &mprs_list)
{
if(TIMED_OUT(mprs->MS_time))
{
***************
*** 232,256 ****
mprs = mprs->next;
}
-
}
-
-
/**
*Print the current MPR selector set to STDOUT
*/
void
! olsr_print_mprs_set()
{
struct mpr_selector *mprs;
-
-
- mprs = mprs_list.next;
OLSR_PRINTF(1, "MPR SELECTORS: ")
! while(mprs != &mprs_list)
{
OLSR_PRINTF(1, "%s ", olsr_ip_to_string(&mprs->MS_main_addr))
- mprs = mprs->next;
}
OLSR_PRINTF(1, "\n")
--- 224,241 ----
mprs = mprs->next;
}
}
/**
*Print the current MPR selector set to STDOUT
*/
void
! olsr_print_mprs_set(void)
{
struct mpr_selector *mprs;
OLSR_PRINTF(1, "MPR SELECTORS: ")
! for(mprs = mprs_list.next; mprs != &mprs_list; mprs = mprs->next)
{
OLSR_PRINTF(1, "%s ", olsr_ip_to_string(&mprs->MS_main_addr))
}
OLSR_PRINTF(1, "\n")
Index: parser.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/parser.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** parser.c 31 Jan 2007 12:36:50 -0000 1.32
--- parser.c 20 Apr 2007 13:46:04 -0000 1.33
***************
*** 88,92 ****
*/
void
! olsr_init_parser()
{
OLSR_PRINTF(3, "Initializing parser...\n")
--- 88,92 ----
*/
void
! olsr_init_parser(void)
{
OLSR_PRINTF(3, "Initializing parser...\n")
Index: scheduler.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** scheduler.c 31 Jan 2007 12:36:50 -0000 1.37
--- scheduler.c 20 Apr 2007 13:46:04 -0000 1.38
***************
*** 78,82 ****
static void
! trigger_dijkstra(void *dummy)
{
OLSR_PRINTF(3, "Triggering Dijkstra\n");
--- 78,82 ----
static void
! trigger_dijkstra(void *foo __attribute__((unused)))
{
OLSR_PRINTF(3, "Triggering Dijkstra\n");
***************
*** 99,103 ****
void
! scheduler()
{
struct timespec remainder_spec;
--- 99,103 ----
void
! scheduler(void)
{
struct timespec remainder_spec;
***************
*** 139,143 ****
for(;;)
{
-
/* Update now_times */
now_times = times(&tms_buf);
--- 139,142 ----
***************
*** 315,319 ****
/*
*
! *@param initial how long utnil the first generation
*@param trigger pointer to a boolean indicating that
*this function should be triggered immediatley
--- 314,318 ----
/*
*
! *@param initial how long until the first generation
*@param trigger pointer to a boolean indicating that
*this function should be triggered immediatley
***************
*** 323,327 ****
void *par,
float interval,
! float initial,
olsr_u8_t *trigger)
{
--- 322,326 ----
void *par,
float interval,
! float initial __attribute__((unused)),
olsr_u8_t *trigger)
{
Index: log.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/log.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** log.h 21 Nov 2004 11:28:56 -0000 1.5
--- log.h 20 Apr 2007 13:46:04 -0000 1.6
***************
*** 56,60 ****
void
! olsr_syslog(int level, char *format, ...);
--- 56,60 ----
void
! olsr_syslog(int level, char *format, ...) __attribute__((format(printf,2,3)));
Index: scheduler.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** scheduler.h 7 Jan 2006 08:16:20 -0000 1.12
--- scheduler.h 20 Apr 2007 13:46:04 -0000 1.13
***************
*** 85,89 ****
void
! scheduler(void);
#endif
--- 85,89 ----
void
! scheduler(void) __attribute__((noreturn));
#endif
More information about the Olsr-cvs
mailing list