[Olsr-cvs] olsrd-current/src/cfgparser oscan.lex, 1.28, 1.29 oparse.y, 1.42, 1.43 cfgfile_gen.c, 1.15, 1.16

Bernd Petrovitsch (spam-protected)
Wed Dec 12 23:39:38 CET 2007


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

Modified Files:
	oscan.lex oparse.y cfgfile_gen.c 
Log Message:
added configuration file support for "flat fib metrics".


Index: oparse.y
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oparse.y,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** oparse.y	12 Dec 2007 21:50:40 -0000	1.42
--- oparse.y	12 Dec 2007 22:39:36 -0000	1.43
***************
*** 177,180 ****
--- 177,181 ----
  %token TOK_WILLINGNESS
  %token TOK_IPCCON
+ %token TOK_FIBMETRIC
  %token TOK_USEHYST
  %token TOK_HYSTSCALE
***************
*** 227,230 ****
--- 228,232 ----
  stmt:       idebug
            | iipversion
+           | fibmetric
            | bnoint
            | atos
***************
*** 716,719 ****
--- 718,738 ----
  ;
  
+ fibmetric:    TOK_FIBMETRIC TOK_STRING
+ {
+   PARSER_DEBUG_PRINTF("FIBMetric: %d\n", $2->string);
+   if (strcmp($2->string, CFG_FIBM_FLAT) == 0) {
+       olsr_cnf->flat_fib_metric = OLSR_TRUE;
+   } else if (strcmp($2->string, CFG_FIBM_CORRECT) == 0) {
+       olsr_cnf->flat_fib_metric = OLSR_FALSE;
+   } else {
+     fprintf(stderr, "FIBMetric must be \"%s\" or \"%s\"!\n", CFG_FIBM_FLAT, CFG_FIBM_CORRECT);
+     YYABORT;
+   }
+   free($1);
+   free($2->string);
+   free($2);
+ }
+ ;
+ 
  ihna4entry:     TOK_IP4_ADDR TOK_IP4_ADDR
  {

Index: oscan.lex
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oscan.lex,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** oscan.lex	29 Nov 2007 00:49:40 -0000	1.28
--- oscan.lex	12 Dec 2007 22:39:36 -0000	1.29
***************
*** 324,327 ****
--- 324,332 ----
  }
  
+ "FIBMetric" {
+     yylval = NULL;
+     return TOK_FIBMETRIC;
+ }
+ 
  "UseHysteresis" {
      yylval = NULL;

Index: cfgfile_gen.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/cfgfile_gen.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** cfgfile_gen.c	12 Dec 2007 22:05:53 -0000	1.15
--- cfgfile_gen.c	12 Dec 2007 22:39:36 -0000	1.16
***************
*** 84,87 ****
--- 84,90 ----
    fprintf(fd, "# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
+   /* IP version */
+   fprintf(fd, "# FIBMetric (\"%s\" or \"%s\")\n\nFIBMetric\t\"%s\"\n\n", CFG_FIBM_FLAT, CFG_FIBM_CORRECT, cnf->flat_fib_metric ? CFG_FIBM_FLAT : CFG_FIBM_CORRECT);
+ 
    /* HNA IPv4/IPv6 */
    fprintf(fd, "# HNA IPv%1$d routes\n# syntax: netaddr netmask\n\nHna1$d {\n", cnf->ip_version == AF_INET ? 4 : 6);
***************
*** 192,196 ****
            while(pp)
              {
!               fprintf(fd, "    PlParam \"%s\" \"%s\"\n", pp->key, pp->value);
                pp = pp->next;
              }
--- 195,199 ----
            while(pp)
              {
!               fprintf(fd, "    PlParam \"%s\"\t\"%s\"\n", pp->key, pp->value);
                pp = pp->next;
              }
***************
*** 367,370 ****
--- 370,376 ----
    WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
+   /* IP version */
+   WRITE_TO_BUF("# FIBMetric (\"%s\" or \"%s\")\n\nFIBMetric\t\"%s\"\n\n", CFG_FIBM_FLAT, CFG_FIBM_CORRECT, cnf->flat_fib_metric ? CFG_FIBM_FLAT : CFG_FIBM_CORRECT);
+ 
    /* HNA IPv4/IPv6 */
    WRITE_TO_BUF("# HNA IPv%1$d routes\n# syntax: netaddr netmask\n\nHna%1$d {\n", cnf->ip_version == AF_INET ? 4 : 6);
***************
*** 470,474 ****
            while(pp)
              {
!               WRITE_TO_BUF("    PlParam \"%s\" \"%s\"\n", pp->key, pp->value);
                pp = pp->next;
              }
--- 476,480 ----
            while(pp)
              {
!               WRITE_TO_BUF("    PlParam \"%s\"\t\"%s\"\n", pp->key, pp->value);
                pp = pp->next;
              }





More information about the Olsr-cvs mailing list