[Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.h, 1.13, 1.14 nameservice.c, 1.31, 1.32

Bernd Petrovitsch (spam-protected)
Fri Oct 5 22:24:49 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25511/lib/nameservice/src

Modified Files:
	nameservice.h nameservice.c 
Log Message:
cleanups:
* localized a global buffer
* made local functions "static"
* const'ified parameters


Index: nameservice.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** nameservice.h	5 Sep 2007 16:11:10 -0000	1.13
--- nameservice.h	5 Oct 2007 20:24:47 -0000	1.14
***************
*** 121,125 ****
  
  struct name_entry*
! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip);
  
  struct name_entry*
--- 121,125 ----
  
  struct name_entry*
! add_name_to_list(struct name_entry *my_list, const char *value, int type, const union olsr_ip_addr *ip);
  
  struct name_entry*

Index: nameservice.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** nameservice.c	17 Sep 2007 22:24:22 -0000	1.31
--- nameservice.c	5 Oct 2007 20:24:47 -0000	1.32
***************
*** 64,70 ****
  
  
- /* send buffer: huge */
- static char buffer[10240];
- 
  /* config parameters */
  static char my_hosts_file[MAX_FILE + 1];
--- 64,67 ----
***************
*** 77,81 ****
  static char latlon_in_file[MAX_FILE + 1];
  static char my_latlon_file[MAX_FILE + 1];
! float my_lat = 0.0, my_lon = 0.0;
  
  /* the databases (using hashing)
--- 74,78 ----
  static char latlon_in_file[MAX_FILE + 1];
  static char my_latlon_file[MAX_FILE + 1];
! static float my_lat = 0.0, my_lon = 0.0;
  
  /* the databases (using hashing)
***************
*** 85,111 ****
   * are store in a linked list (without hashing)
   * */
! struct db_entry* list[HASHSIZE];
! struct name_entry *my_names = NULL;
! olsr_bool name_table_changed = OLSR_TRUE;
  
! struct db_entry* service_list[HASHSIZE];
! struct name_entry *my_services = NULL;
! olsr_bool service_table_changed = OLSR_TRUE;
  
! struct db_entry* forwarder_list[HASHSIZE];
! struct name_entry *my_forwarders = NULL;
! olsr_bool forwarder_table_changed = OLSR_TRUE;
  
! struct db_entry* latlon_list[HASHSIZE];
! olsr_bool latlon_table_changed = OLSR_TRUE;
  
  /* regular expression to be matched by valid hostnames, compiled in name_init() */
! regex_t regex_t_name;
! regmatch_t regmatch_t_name;
  
  /* regular expression to be matched by valid service_lines, compiled in name_init() */
! regex_t regex_t_service;
! int pmatch_service = 10;
! regmatch_t regmatch_t_service[10];
  
  /**
--- 82,108 ----
   * are store in a linked list (without hashing)
   * */
! static struct db_entry* list[HASHSIZE];
! static struct name_entry *my_names = NULL;
! static olsr_bool name_table_changed = OLSR_TRUE;
  
! static struct db_entry* service_list[HASHSIZE];
! static struct name_entry *my_services = NULL;
! static olsr_bool service_table_changed = OLSR_TRUE;
  
! static struct db_entry* forwarder_list[HASHSIZE];
! static struct name_entry *my_forwarders = NULL;
! static olsr_bool forwarder_table_changed = OLSR_TRUE;
  
! static struct db_entry* latlon_list[HASHSIZE];
! static olsr_bool latlon_table_changed = OLSR_TRUE;
  
  /* regular expression to be matched by valid hostnames, compiled in name_init() */
! static regex_t regex_t_name;
! static regmatch_t regmatch_t_name;
  
  /* regular expression to be matched by valid service_lines, compiled in name_init() */
! static regex_t regex_t_service;
! static int pmatch_service = 10;
! static regmatch_t regmatch_t_service[10];
  
  /**
***************
*** 269,273 ****
   */
  struct name_entry* 
! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip) 
  {
  	struct name_entry *tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list");
--- 266,270 ----
   */
  struct name_entry* 
! add_name_to_list(struct name_entry *my_list, const char *value, int type, const union olsr_ip_addr *ip) 
  {
  	struct name_entry *tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list");
***************
*** 552,556 ****
  olsr_event(void *foo __attribute__((unused)))
  {
! 	union olsr_message *message = (union olsr_message*)buffer;
  	struct interface *ifn;
  	int namesize;
--- 549,555 ----
  olsr_event(void *foo __attribute__((unused)))
  {
!     /* send buffer: huge */
!     char buffer[10240];
!     union olsr_message *message = (union olsr_message *)buffer;
  	struct interface *ifn;
  	int namesize;





More information about the Olsr-cvs mailing list