[Olsr-cvs] olsrd-current/src/cfgparser oparse.y, 1.34, 1.35 olsrd_conf.h, 1.14, 1.15 olsrd_conf.c, 1.58, 1.59

Bernd Petrovitsch (spam-protected)
Sun Nov 4 00:21:29 CET 2007


Update of /cvsroot/olsrd/olsrd-current/src/cfgparser
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17552/src/cfgparser

Modified Files:
	oparse.y olsrd_conf.h olsrd_conf.c 
Log Message:
Killed "struct olsrd_config *cnf" in src/cfgparser/olsrd_conf.h and replaced
it's usage with "olsr_cnf" from src/defs.h.
Serious cleanup: olsrd_get_default_cnf() does no longer initialize the global
"cnf" variable" but uses a local one which is returned as before. And
olsrd_parse_cnf() does no longer return the global variable it is working on.


Index: olsrd_conf.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** olsrd_conf.h	30 Oct 2007 09:19:22 -0000	1.14
--- olsrd_conf.h	3 Nov 2007 23:21:27 -0000	1.15
***************
*** 52,57 ****
  extern int current_line;
  
- extern struct olsrd_config *cnf;
- 
  struct conf_token
  {
--- 52,55 ----

Index: olsrd_conf.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** olsrd_conf.c	30 Oct 2007 09:19:22 -0000	1.58
--- olsrd_conf.c	3 Nov 2007 23:21:27 -0000	1.59
***************
*** 52,55 ****
--- 52,56 ----
  #include "olsrd_conf.h"
  #include "olsr_cfg.h"
+ #include "defs.h"
  
  
***************
*** 60,64 ****
  
  int current_line;
- struct olsrd_config *cnf;
  
  #ifdef MAKEBIN
--- 61,64 ----
***************
*** 102,106 ****
  #endif
  
! struct olsrd_config *
  olsrd_parse_cnf(const char *filename)
  {
--- 102,106 ----
  #endif
  
! int
  olsrd_parse_cnf(const char *filename)
  {
***************
*** 109,119 ****
  
    /* Initialize the global varibles - oparse.y needs it there */
!   cnf = malloc(sizeof(struct olsrd_config));
!   if (cnf == NULL) {
      fprintf(stderr, "Out of memory %s\n", __func__);
!     return NULL;
    }
  
!   set_default_cnf(cnf);
  
    printf("Parsing file: \"%s\"\n", filename);
--- 109,119 ----
  
    /* Initialize the global varibles - oparse.y needs it there */
!   olsr_cnf = malloc(sizeof(*olsr_cnf));
!   if (olsr_cnf == NULL) {
      fprintf(stderr, "Out of memory %s\n", __func__);
!     return 1;
    }
  
!   set_default_cnf(olsr_cnf);
  
    printf("Parsing file: \"%s\"\n", filename);
***************
*** 123,128 ****
      fprintf(stderr, "Cannot open configuration file '%s': %s.\n",
              filename, strerror(errno));
!     free(cnf);
!     return NULL;
    }
  
--- 123,129 ----
      fprintf(stderr, "Cannot open configuration file '%s': %s.\n",
              filename, strerror(errno));
!     olsrd_free_cnf(olsr_cnf);
!     olsr_cnf = NULL;
!     return 1;
    }
  
***************
*** 131,140 ****
    fclose(yyin);
    if (rc != 0) {
!     olsrd_free_cnf(cnf);
!     return NULL;
    }
  
    /* Reverse the queue (added by user request) */
!   in = cnf->interfaces;
    new_ifqueue = NULL;
  
--- 132,142 ----
    fclose(yyin);
    if (rc != 0) {
!     olsrd_free_cnf(olsr_cnf);
!     olsr_cnf = NULL;
!     return 1;
    }
  
    /* Reverse the queue (added by user request) */
!   in = olsr_cnf->interfaces;
    new_ifqueue = NULL;
  
***************
*** 147,153 ****
    }
  
!   cnf->interfaces = new_ifqueue;
  
!   for (in = cnf->interfaces; in != NULL; in = in->next) {
        /* set various stuff */
        in->configured = OLSR_FALSE;
--- 149,155 ----
    }
  
!   olsr_cnf->interfaces = new_ifqueue;
  
!   for (in = olsr_cnf->interfaces; in != NULL; in = in->next) {
        /* set various stuff */
        in->configured = OLSR_FALSE;
***************
*** 155,159 ****
        in->host_emul = OLSR_FALSE;
    }
!   return cnf;
  }
  
--- 157,161 ----
        in->host_emul = OLSR_FALSE;
    }
!   return 0;
  }
  
***************
*** 411,424 ****
  olsrd_get_default_cnf(void)
  {
!   cnf = malloc(sizeof(struct olsrd_config));
!   if (cnf == NULL)
!     {
!       fprintf(stderr, "Out of memory %s\n", __func__);
!       return NULL;
!     }
! 
!   set_default_cnf(cnf);
  
!   return cnf;
  }
  
--- 413,424 ----
  olsrd_get_default_cnf(void)
  {
!   struct olsrd_config *c = malloc(sizeof(struct olsrd_config));
!   if (c == NULL) {
!     fprintf(stderr, "Out of memory %s\n", __func__);
!     return NULL;
!   }
  
!   set_default_cnf(c);
!   return c;
  }
  
***************
*** 429,433 ****
  set_default_cnf(struct olsrd_config *cnf)
  {
!     memset(cnf, 0, sizeof(struct olsrd_config));
      
      cnf->debug_level = DEF_DEBUGLVL;
--- 429,433 ----
  set_default_cnf(struct olsrd_config *cnf)
  {
!     memset(cnf, 0, sizeof(*cnf));
      
      cnf->debug_level = DEF_DEBUGLVL;
***************
*** 478,499 ****
  get_default_if_config(void)
  {
-   struct if_config_options *io = malloc(sizeof(struct if_config_options));
    struct in6_addr in6;
  
!   if(io == NULL)
!     {
!       fprintf(stderr, "Out of memory %s\n", __func__);
!       return NULL;
!     }
  
!   memset(io, 0, sizeof(struct if_config_options));
  
    io->ipv6_addrtype = 1; /* XXX - FixMe */
  
    inet_pton(AF_INET6, OLSR_IPV6_MCAST_SITE_LOCAL, &in6);
!   memcpy(&io->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
  
    inet_pton(AF_INET6, OLSR_IPV6_MCAST_GLOBAL, &in6);
!   memcpy(&io->ipv6_multi_glbl.v6, &in6, sizeof(struct in6_addr));
  
    io->lq_mult = NULL;
--- 478,498 ----
  get_default_if_config(void)
  {
    struct in6_addr in6;
+   struct if_config_options *io = malloc(sizeof(*io));
  
!   if(io == NULL) {
!     fprintf(stderr, "Out of memory %s\n", __func__);
!     return NULL;
!   }
  
!   memset(io, 0, sizeof(*io));
  
    io->ipv6_addrtype = 1; /* XXX - FixMe */
  
    inet_pton(AF_INET6, OLSR_IPV6_MCAST_SITE_LOCAL, &in6);
!   io->ipv6_multi_site.v6 = in6;
  
    inet_pton(AF_INET6, OLSR_IPV6_MCAST_GLOBAL, &in6);
!   io->ipv6_multi_glbl.v6 = in6;
  
    io->lq_mult = NULL;

Index: oparse.y
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oparse.y,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** oparse.y	13 Sep 2007 16:08:13 -0000	1.34
--- oparse.y	3 Nov 2007 23:21:27 -0000	1.35
***************
*** 53,56 ****
--- 53,57 ----
  
  #include "olsrd_conf.h"
+ #include "../defs.h"
  
  #define PARSER_DEBUG 0
***************
*** 76,80 ****
    int i;
    struct olsr_if *walker;
-   struct olsr_lq_mult *mult;
  
  #if PARSER_DEBUG > 0
--- 77,80 ----
***************
*** 84,109 ****
  #endif
  
!   memset(&addr, 0, sizeof (union olsr_ip_addr));
  
    if(ip_addr_arg != NULL &&
!      inet_pton(cnf->ip_version, ip_addr_arg->string, &addr) < 0)
!   {
      fprintf(stderr, "Cannot parse IP address %s.\n", ip_addr_arg->string);
      return -1;
    }
  
!   walker = cnf->interfaces;
! 
!   for (i = 0; i < ifs_in_curr_cfg; i++)
!   {
!     mult = malloc(sizeof (struct olsr_lq_mult));
  
!     if (mult == NULL)
!     {
        fprintf(stderr, "Out of memory (LQ multiplier).\n");
        return -1;
      }
  
!     memcpy(&mult->addr, &addr, sizeof (union olsr_ip_addr));
      mult->val = mult_arg->floating;
  
--- 84,105 ----
  #endif
  
!   memset(&addr, 0, sizeof(addr));
  
    if(ip_addr_arg != NULL &&
!      inet_pton(olsr_cnf->ip_version, ip_addr_arg->string, &addr) < 0) {
      fprintf(stderr, "Cannot parse IP address %s.\n", ip_addr_arg->string);
      return -1;
    }
  
!   walker = olsr_cnf->interfaces;
  
!   for (i = 0; i < ifs_in_curr_cfg; i++) {
!     struct olsr_lq_mult *mult = malloc(sizeof(*mult));
!     if (mult == NULL) {
        fprintf(stderr, "Out of memory (LQ multiplier).\n");
        return -1;
      }
  
!     mult->addr = addr;
      mult->val = mult_arg->floating;
  
***************
*** 114,119 ****
    }
  
!   if (ip_addr_arg != NULL)
!   {
      free(ip_addr_arg->string);
      free(ip_addr_arg);
--- 110,114 ----
    }
  
!   if (ip_addr_arg != NULL) {
      free(ip_addr_arg->string);
      free(ip_addr_arg);
***************
*** 296,306 ****
  ;
  
- 
  imaxipc: TOK_MAXIPC TOK_INTEGER
  {
!   cnf->ipc_connections = $2->integer;
! 
!   cnf->open_ipc = cnf->ipc_connections ? OLSR_TRUE : OLSR_FALSE;
! 
    free($2);
  }
--- 291,298 ----
  ;
  
  imaxipc: TOK_MAXIPC TOK_INTEGER
  {
!   olsr_cnf->ipc_connections = $2->integer;
!   olsr_cnf->open_ipc = olsr_cnf->ipc_connections ? OLSR_TRUE : OLSR_FALSE;
    free($2);
  }
***************
*** 320,328 ****
      }
  
!   ipch = malloc(sizeof(struct ipc_host));
    ipch->host.v4 = in.s_addr;
  
!   ipch->next = cnf->ipc_hosts;
!   cnf->ipc_hosts = ipch;
  
    free($2->string);
--- 312,320 ----
      }
  
!   ipch = malloc(sizeof(*ipch));
    ipch->host.v4 = in.s_addr;
  
!   ipch->next = olsr_cnf->ipc_hosts;
!   olsr_cnf->ipc_hosts = ipch;
  
    free($2->string);
***************
*** 351,360 ****
      }
  
!   ipcn = malloc(sizeof(struct ipc_net));
    ipcn->net.v4 = in1.s_addr;
    ipcn->mask.v4 = in2.s_addr;
  
!   ipcn->next = cnf->ipc_nets;
!   cnf->ipc_nets = ipcn;
  
    free($2->string);
--- 343,352 ----
      }
  
!   ipcn = malloc(sizeof(*ipcn));
    ipcn->net.v4 = in1.s_addr;
    ipcn->mask.v4 = in2.s_addr;
  
!   ipcn->next = olsr_cnf->ipc_nets;
!   olsr_cnf->ipc_nets = ipcn;
  
    free($2->string);
***************
*** 369,373 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("Fixed willingness: %d\n", $2->integer);
--- 361,365 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("Fixed willingness: %d\n", $2->integer);
***************
*** 390,394 ****
    struct in_addr in;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv4 broadcast: %s\n", $2->string);
--- 382,386 ----
    struct in_addr in;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv4 broadcast: %s\n", $2->string);
***************
*** 416,420 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    if($2->boolean)
--- 408,412 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    if($2->boolean)
***************
*** 447,451 ****
    struct in6_addr in6;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv6 site-local multicast: %s\n", $2->string);
--- 439,443 ----
    struct in6_addr in6;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv6 site-local multicast: %s\n", $2->string);
***************
*** 459,463 ****
    while(ifcnt)
      {
!       memcpy(&ifs->cnf->ipv6_multi_site.v6, &in6, sizeof(struct in6_addr));
        
        ifs = ifs->next;
--- 451,455 ----
    while(ifcnt)
      {
!       ifs->cnf->ipv6_multi_site.v6 = in6;
        
        ifs = ifs->next;
***************
*** 476,480 ****
    struct in6_addr in6;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv6 global multicast: %s\n", $2->string);
--- 468,472 ----
    struct in6_addr in6;
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tIPv6 global multicast: %s\n", $2->string);
***************
*** 502,506 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHELLO interval: %0.2f\n", $2->floating);
--- 494,498 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHELLO interval: %0.2f\n", $2->floating);
***************
*** 520,524 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHELLO validity: %0.2f\n", $2->floating);
--- 512,516 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHELLO validity: %0.2f\n", $2->floating);
***************
*** 538,542 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tTC interval: %0.2f\n", $2->floating);
--- 530,534 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tTC interval: %0.2f\n", $2->floating);
***************
*** 555,559 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
    
    PARSER_DEBUG_PRINTF("\tTC validity: %0.2f\n", $2->floating);
--- 547,551 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
    
    PARSER_DEBUG_PRINTF("\tTC validity: %0.2f\n", $2->floating);
***************
*** 572,576 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
  
--- 564,568 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
  
***************
*** 590,594 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tMID validity: %0.2f\n", $2->floating);
--- 582,586 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tMID validity: %0.2f\n", $2->floating);
***************
*** 607,611 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
    
    PARSER_DEBUG_PRINTF("\tHNA interval: %0.2f\n", $2->floating);
--- 599,603 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
    
    PARSER_DEBUG_PRINTF("\tHNA interval: %0.2f\n", $2->floating);
***************
*** 624,628 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHNA validity: %0.2f\n", $2->floating);
--- 616,620 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tHNA validity: %0.2f\n", $2->floating);
***************
*** 641,645 ****
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tAutodetect changes: %s\n", $2->boolean ? "YES" : "NO");
--- 633,637 ----
  {
    int ifcnt = ifs_in_curr_cfg;
!   struct olsr_if *ifs = olsr_cnf->interfaces;
  
    PARSER_DEBUG_PRINTF("\tAutodetect changes: %s\n", $2->boolean ? "YES" : "NO");
***************
*** 679,684 ****
  {
  
!   cnf->debug_level = $2->integer;
!   PARSER_DEBUG_PRINTF("Debug level: %d\n", cnf->debug_level);
    free($2);
  }
--- 671,676 ----
  {
  
!   olsr_cnf->debug_level = $2->integer;
!   PARSER_DEBUG_PRINTF("Debug level: %d\n", olsr_cnf->debug_level);
    free($2);
  }
***************
*** 689,695 ****
  {
    if($2->integer == 4)
!     cnf->ip_version = AF_INET;
    else if($2->integer == 6)
!     cnf->ip_version = AF_INET6;
    else
      {
--- 681,687 ----
  {
    if($2->integer == 4)
!     olsr_cnf->ip_version = AF_INET;
    else if($2->integer == 6)
!     olsr_cnf->ip_version = AF_INET6;
    else
      {
***************
*** 706,710 ****
  ihna4entry:     TOK_IP4_ADDR TOK_IP4_ADDR
  {
!   struct hna4_entry *h = malloc(sizeof(struct hna4_entry));
    struct in_addr in;
  
--- 698,702 ----
  ihna4entry:     TOK_IP4_ADDR TOK_IP4_ADDR
  {
!   struct hna4_entry *h = malloc(sizeof(*h));
    struct in_addr in;
  
***************
*** 731,736 ****
    h->net.v4 &= h->netmask.v4;
    /* Queue */
!   h->next = cnf->hna4_entries;
!   cnf->hna4_entries = h;
  
    free($1->string);
--- 723,728 ----
    h->net.v4 &= h->netmask.v4;
    /* Queue */
!   h->next = olsr_cnf->hna4_entries;
!   olsr_cnf->hna4_entries = h;
  
    free($1->string);
***************
*** 744,748 ****
  ihna6entry:     TOK_IP6_ADDR TOK_INTEGER
  {
!   struct hna6_entry *h = malloc(sizeof(struct hna6_entry));
    struct in6_addr in6;
  
--- 736,740 ----
  ihna6entry:     TOK_IP6_ADDR TOK_INTEGER
  {
!   struct hna6_entry *h = malloc(sizeof(*h));
    struct in6_addr in6;
  
***************
*** 760,764 ****
        return -1;
      }
!   memcpy(&h->net, &in6, sizeof(struct in6_addr));
  
    if($2->integer > 128)
--- 752,756 ----
        return -1;
      }
!   h->net.v6 = in6;
  
    if($2->integer > 128)
***************
*** 770,775 ****
    h->prefix_len = $2->integer;
    /* Queue */
!   h->next = cnf->hna6_entries;
!   cnf->hna6_entries = h;
  
    free($1->string);
--- 762,767 ----
    h->prefix_len = $2->integer;
    /* Queue */
!   h->next = olsr_cnf->hna6_entries;
!   olsr_cnf->hna6_entries = h;
  
    free($1->string);
***************
*** 789,793 ****
  ifnick: TOK_STRING
  {
!   struct olsr_if *in = malloc(sizeof(struct olsr_if));
    
    if(in == NULL)
--- 781,785 ----
  ifnick: TOK_STRING
  {
!   struct olsr_if *in = malloc(sizeof(*in));
    
    if(in == NULL)
***************
*** 808,813 ****
  
    /* Queue */
!   in->next = cnf->interfaces;
!   cnf->interfaces = in;
  
    ifs_in_curr_cfg++;
--- 800,805 ----
  
    /* Queue */
!   in->next = olsr_cnf->interfaces;
!   olsr_cnf->interfaces = in;
  
    ifs_in_curr_cfg++;
***************
*** 821,825 ****
    PARSER_DEBUG_PRINTF("Noint set to %d\n", $2->boolean);
  
!   cnf->allow_no_interfaces = $2->boolean;
  
    free($2);
--- 813,817 ----
    PARSER_DEBUG_PRINTF("Noint set to %d\n", $2->boolean);
  
!   olsr_cnf->allow_no_interfaces = $2->boolean;
  
    free($2);
***************
*** 830,834 ****
  {
    PARSER_DEBUG_PRINTF("TOS: %d\n", $2->integer);
!   cnf->tos = $2->integer;
  
    free($2);
--- 822,826 ----
  {
    PARSER_DEBUG_PRINTF("TOS: %d\n", $2->integer);
!   olsr_cnf->tos = $2->integer;
  
    free($2);
***************
*** 840,844 ****
  {
    if(PARSER_DEBUG) printf("RtTable: %d\n", $2->integer);
!   cnf->rttable = $2->integer;
  
    free($2);
--- 832,836 ----
  {
    if(PARSER_DEBUG) printf("RtTable: %d\n", $2->integer);
!   olsr_cnf->rttable = $2->integer;
  
    free($2);
***************
*** 849,856 ****
  awillingness: TOK_WILLINGNESS TOK_INTEGER
  {
!   cnf->willingness_auto = OLSR_FALSE;
  
    PARSER_DEBUG_PRINTF("Willingness: %d\n", $2->integer);
!   cnf->willingness = $2->integer;
  
    free($2);
--- 841,848 ----
  awillingness: TOK_WILLINGNESS TOK_INTEGER
  {
!   olsr_cnf->willingness_auto = OLSR_FALSE;
  
    PARSER_DEBUG_PRINTF("Willingness: %d\n", $2->integer);
!   olsr_cnf->willingness = $2->integer;
  
    free($2);
***************
*** 863,868 ****
  busehyst: TOK_USEHYST TOK_BOOLEAN
  {
!   cnf->use_hysteresis = $2->boolean;
!   if(cnf->use_hysteresis)
      {
        PARSER_DEBUG_PRINTF("Hysteresis enabled\n");
--- 855,860 ----
  busehyst: TOK_USEHYST TOK_BOOLEAN
  {
!   olsr_cnf->use_hysteresis = $2->boolean;
!   if(olsr_cnf->use_hysteresis)
      {
        PARSER_DEBUG_PRINTF("Hysteresis enabled\n");
***************
*** 880,884 ****
  fhystscale: TOK_HYSTSCALE TOK_FLOAT
  {
!   cnf->hysteresis_param.scaling = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis Scaling: %0.2f\n", $2->floating);
    free($2);
--- 872,876 ----
  fhystscale: TOK_HYSTSCALE TOK_FLOAT
  {
!   olsr_cnf->hysteresis_param.scaling = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis Scaling: %0.2f\n", $2->floating);
    free($2);
***************
*** 889,893 ****
  fhystupper: TOK_HYSTUPPER TOK_FLOAT
  {
!   cnf->hysteresis_param.thr_high = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis UpperThr: %0.2f\n", $2->floating);
    free($2);
--- 881,885 ----
  fhystupper: TOK_HYSTUPPER TOK_FLOAT
  {
!   olsr_cnf->hysteresis_param.thr_high = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis UpperThr: %0.2f\n", $2->floating);
    free($2);
***************
*** 898,902 ****
  fhystlower: TOK_HYSTLOWER TOK_FLOAT
  {
!   cnf->hysteresis_param.thr_low = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis LowerThr: %0.2f\n", $2->floating);
    free($2);
--- 890,894 ----
  fhystlower: TOK_HYSTLOWER TOK_FLOAT
  {
!   olsr_cnf->hysteresis_param.thr_low = $2->floating;
    PARSER_DEBUG_PRINTF("Hysteresis LowerThr: %0.2f\n", $2->floating);
    free($2);
***************
*** 907,911 ****
  {
    PARSER_DEBUG_PRINTF("Pollrate %0.2f\n", $2->floating);
!   cnf->pollrate = $2->floating;
  
    free($2);
--- 899,903 ----
  {
    PARSER_DEBUG_PRINTF("Pollrate %0.2f\n", $2->floating);
!   olsr_cnf->pollrate = $2->floating;
  
    free($2);
***************
*** 916,920 ****
  {
    PARSER_DEBUG_PRINTF("NIC Changes Pollrate %0.2f\n", $2->floating);
!   cnf->nic_chgs_pollrate = $2->floating;
  
    free($2);
--- 908,912 ----
  {
    PARSER_DEBUG_PRINTF("NIC Changes Pollrate %0.2f\n", $2->floating);
!   olsr_cnf->nic_chgs_pollrate = $2->floating;
  
    free($2);
***************
*** 925,929 ****
  {
    PARSER_DEBUG_PRINTF("TC redundancy %d\n", $2->integer);
!   cnf->tc_redundancy = $2->integer;
    free($2);
  }
--- 917,921 ----
  {
    PARSER_DEBUG_PRINTF("TC redundancy %d\n", $2->integer);
!   olsr_cnf->tc_redundancy = $2->integer;
    free($2);
  }
***************
*** 933,937 ****
  {
    PARSER_DEBUG_PRINTF("MPR coverage %d\n", $2->integer);
!   cnf->mpr_coverage = $2->integer;
    free($2);
  }
--- 925,929 ----
  {
    PARSER_DEBUG_PRINTF("MPR coverage %d\n", $2->integer);
!   olsr_cnf->mpr_coverage = $2->integer;
    free($2);
  }
***************
*** 941,945 ****
  {
    PARSER_DEBUG_PRINTF("Link quality level %d\n", $2->integer);
!   cnf->lq_level = $2->integer;
    free($2);
  }
--- 933,937 ----
  {
    PARSER_DEBUG_PRINTF("Link quality level %d\n", $2->integer);
!   olsr_cnf->lq_level = $2->integer;
    free($2);
  }
***************
*** 949,953 ****
  {
    PARSER_DEBUG_PRINTF("Link quality fish eye %d\n", $2->integer);
!   cnf->lq_fish = $2->integer;
    free($2);
  }
--- 941,945 ----
  {
    PARSER_DEBUG_PRINTF("Link quality fish eye %d\n", $2->integer);
!   olsr_cnf->lq_fish = $2->integer;
    free($2);
  }
***************
*** 957,962 ****
  {
    PARSER_DEBUG_PRINTF("Link quality dijkstra limit %d, %0.2f\n", $2->integer, $3->floating);
!   cnf->lq_dlimit = $2->integer;
!   cnf->lq_dinter = $3->floating;
    free($2);
  }
--- 949,954 ----
  {
    PARSER_DEBUG_PRINTF("Link quality dijkstra limit %d, %0.2f\n", $2->integer, $3->floating);
!   olsr_cnf->lq_dlimit = $2->integer;
!   olsr_cnf->lq_dinter = $3->floating;
    free($2);
  }
***************
*** 966,970 ****
  {
    PARSER_DEBUG_PRINTF("Link quality window size %d\n", $2->integer);
!   cnf->lq_wsize = $2->integer;
    free($2);
  }
--- 958,962 ----
  {
    PARSER_DEBUG_PRINTF("Link quality window size %d\n", $2->integer);
!   olsr_cnf->lq_wsize = $2->integer;
    free($2);
  }
***************
*** 973,979 ****
  bclear_screen: TOK_CLEAR_SCREEN TOK_BOOLEAN
  {
!   cnf->clear_screen = $2->boolean;
  
!   PARSER_DEBUG_PRINTF("Clear screen %s\n", cnf->clear_screen ? "enabled" : "disabled");
  
    free($2);
--- 965,971 ----
  bclear_screen: TOK_CLEAR_SCREEN TOK_BOOLEAN
  {
!   olsr_cnf->clear_screen = $2->boolean;
  
!   PARSER_DEBUG_PRINTF("Clear screen %s\n", olsr_cnf->clear_screen ? "enabled" : "disabled");
  
    free($2);
***************
*** 983,987 ****
  plblock: TOK_PLUGIN TOK_STRING
  {
!   struct plugin_entry *pe = malloc(sizeof(struct plugin_entry));
    
    if(pe == NULL)
--- 975,979 ----
  plblock: TOK_PLUGIN TOK_STRING
  {
!   struct plugin_entry *pe = malloc(sizeof(*pe));
    
    if(pe == NULL)
***************
*** 998,1003 ****
  
    /* Queue */
!   pe->next = cnf->plugins;
!   cnf->plugins = pe;
  
    free($2);
--- 990,995 ----
  
    /* Queue */
!   pe->next = olsr_cnf->plugins;
!   olsr_cnf->plugins = pe;
  
    free($2);
***************
*** 1007,1011 ****
  plparam: TOK_PLPARAM TOK_STRING TOK_STRING
  {
!   struct plugin_param *pp = malloc(sizeof(struct plugin_param));
    
    if(pp == NULL)
--- 999,1003 ----
  plparam: TOK_PLPARAM TOK_STRING TOK_STRING
  {
!   struct plugin_param *pp = malloc(sizeof(*pp));
    
    if(pp == NULL)
***************
*** 1021,1026 ****
  
    /* Queue */
!   pp->next = cnf->plugins->params;
!   cnf->plugins->params = pp;
  
    free($2);
--- 1013,1018 ----
  
    /* Queue */
!   pp->next = olsr_cnf->plugins->params;
!   olsr_cnf->plugins->params = pp;
  
    free($2);





More information about the Olsr-cvs mailing list