[Olsr-cvs] olsrd-current/src/cfgparser cfgfile_gen.c,1.14,1.15

Bernd Petrovitsch (spam-protected)
Wed Dec 12 23:05:55 CET 2007


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

Modified Files:
	cfgfile_gen.c 
Log Message:
* do not generate netmasks and fixed up some comments

Index: cfgfile_gen.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/cfgfile_gen.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** cfgfile_gen.c	2 Dec 2007 19:00:28 -0000	1.14
--- cfgfile_gen.c	12 Dec 2007 22:05:53 -0000	1.15
***************
*** 84,88 ****
    fprintf(fd, "# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
!   /* HNA IPv4 */
    fprintf(fd, "# HNA IPv%1$d routes\n# syntax: netaddr netmask\n\nHna1$d {\n", cnf->ip_version == AF_INET ? 4 : 6);
    while(h) {
--- 84,88 ----
    fprintf(fd, "# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
!   /* 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);
    while(h) {
***************
*** 287,296 ****
  	      while (mult != NULL)
  		{
! 		  inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf,
! 			    sizeof (ipv6_buf));
! 		  
! 		  fprintf(fd, "    LinkQualityMult\t%s %0.2f\n",
! 			  ipv6_buf, mult->val);
! 		  
  		  mult = mult->next;
  		}
--- 287,291 ----
  	      while (mult != NULL)
  		{
! 		  fprintf(fd, "    LinkQualityMult\t%s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof(ipv6_buf)), mult->val);
  		  mult = mult->next;
  		}
***************
*** 372,387 ****
    WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
!   /* HNA IPv4 and 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);
    while(h) {
      struct ipaddr_str strbuf;
!     WRITE_TO_BUF("    %s ", olsr_ip_to_string(&strbuf, &h->net.prefix));
!     if (cnf->ip_version == AF_INET) {
!       union olsr_ip_addr ip_addr;
!       olsr_prefix_to_netmask(&ip_addr, h->net.prefix_len);
!       WRITE_TO_BUF("%s\n", olsr_ip_to_string(&strbuf, &ip_addr));
!     } else {
!       WRITE_TO_BUF("%d\n", h->net.prefix_len);
!     }
      h = h->next;
    }
--- 367,375 ----
    WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t%d\n\n", cnf->ip_version == AF_INET ? 4 : 6);
  
!   /* 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);
    while(h) {
      struct ipaddr_str strbuf;
!     WRITE_TO_BUF("    %s/%d\n", olsr_ip_to_string(&strbuf, &h->net.prefix), h->net.prefix_len);
      h = h->next;
    }
***************
*** 588,596 ****
  	      while (mult != NULL)
  		{
! 		  inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf,
! 			    sizeof (ipv6_buf));
! 		  
! 		  WRITE_TO_BUF("    LinkQualityMult\t%s %0.2f\n", ipv6_buf, mult->val);
! 		  
  		  mult = mult->next;
  		}
--- 576,580 ----
  	      while (mult != NULL)
  		{
! 		  WRITE_TO_BUF("    LinkQualityMult\t%s %0.2f\n", inet_ntop(cnf->ip_version, &mult->addr, ipv6_buf, sizeof (ipv6_buf)), mult->val);
  		  mult = mult->next;
  		}





More information about the Olsr-cvs mailing list