[Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_txtinfo.c,1.3,1.4

Bernd Petrovitsch (spam-protected)
Sun Apr 22 21:54:33 CEST 2007


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

Modified Files:
	olsrd_txtinfo.c 
Log Message:
* committed txtinfo patch by Jo-Philipp Wich <(spam-protected)>

Index: olsrd_txtinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_txtinfo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** olsrd_txtinfo.c	20 Apr 2007 13:46:04 -0000	1.3
--- olsrd_txtinfo.c	22 Apr 2007 19:54:31 -0000	1.4
***************
*** 114,117 ****
--- 114,120 ----
  ipc_print_hna(void);
  
+ static void
+ ipc_print_mid(void);
+ 
  #define TXT_IPC_BUFSIZE 256
  static int 
***************
*** 486,489 ****
--- 489,532 ----
  }
  
+ static void
+ ipc_print_mid(void)
+ {
+     olsr_u8_t index;
+     unsigned short is_first;
+     struct mid_entry *entry;
+     struct mid_address *alias;
+ 
+     ipc_sendf("Table: MID\nIP\tAliases\n");
+ 
+     /* MID */
+     for( index = 0; index < HASHSIZE; index++ )
+     {
+         entry = mid_set[index].next;
+ 
+         while( entry != &mid_set[index] )
+         {
+             ipc_sendf( olsr_ip_to_string( &entry->main_addr ) );
+             alias = entry->aliases;
+             is_first = 1;
+ 
+             while( alias )
+             {
+                 ipc_sendf( "%s%s",
+                     ( is_first ? "\t" : ";" ),
+                     olsr_ip_to_string( &alias->alias )
+                 );
+ 
+                 alias = alias->next_alias;
+                 is_first = 0;
+             }
+ 
+             entry = entry->next;
+             ipc_sendf("\n");
+         }
+     }
+ 
+ 	ipc_sendf("\n");
+ }
+ 
  
  static void 
***************
*** 506,509 ****
--- 549,555 ----
  	if (!neighonly) ipc_print_hna();
  
+  	/* mid */
+ 	if (!neighonly) ipc_print_mid();
+ 
  	/* routes */
  	if (!neighonly) ipc_print_routes();





More information about the Olsr-cvs mailing list