Commits

ripencc committed 2a5fe3b

IS-657 fix compilation warnings and memory leaks

Comments (0)

Files changed (12)

 /* The library will be compiled with IPv6 support */
 #undef BGPDUMP_HAVE_IPV6
 
+/* Define if libbzip2 not present */
+#undef DONT_HAVE_BZ2
+
+/* Define if libz not present */
+#undef DONT_HAVE_GZ
+
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #undef HAVE_ARPA_INET_H
 
 /* Define to 1 if you have the `inet_ntoa' function. */
 #undef HAVE_INET_NTOA
 
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+#undef HAVE_LIBBZ2
+
 /* Define to 1 if you have the `nsl' library (-lnsl). */
 #undef HAVE_LIBNSL
 
 
 /* Define if system headers do not define u_int8_t */
 #undef u_int8_t
-
-/* Define if libbzip2 not present */
-#undef DONT_HAVE_BZ2
-
-/* Define if libz not present */
-#undef DONT_HAVE_GZ
 #include <arpa/inet.h>
 #include <stdbool.h>
 
-void process(BGPDUMP_ENTRY *entry);
-void show_attr(attributes_t *attr);
-void show_prefixes(int count,struct prefix *prefix);
-void table_line_announce_1(int mode,struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
-void table_line_announce(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
-void table_line_withdraw(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
-void table_line_mrtd_route(int mode,BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry, int timetype);
-void table_line_dump_v2_prefix(int mode,BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry,int timetype);
+static void process(BGPDUMP_ENTRY *entry);
+static void show_attr(attributes_t *attr);
+static void show_prefixes(int count,struct prefix *prefix);
+static void table_line_announce_1(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
+static void table_line_announce(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
+static void table_line_withdraw(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
+static void table_line_mrtd_route(BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry);
+static void table_line_dump_v2_prefix(BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry);
 
 #ifdef BGPDUMP_HAVE_IPV6
     void show_prefixes6(int count,struct prefix *prefix);
-    void table_line_withdraw6(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
-    void table_line_announce6(int mode,struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
+    static void table_line_withdraw6(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
+    static void table_line_announce6(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
 #endif
 
 
 Usage: bgpdump [-m|-M] [-t dump|-t change] [-O <output-file>] <input-file>\n\
 bgpdump translates binary MRT files (possibly compressed) into readable output\n\
 Output mode:\n\
-    -H         multi-line human-readable output (the default)\n\
-    -m         output in one-line machine readable format 1\n\
-    -M         output in one-line machine readable format 2\n\
+    -H         multi-line, human-readable (the default)\n\
+    -m         one-line per entry with unix timestamps\n\
+    -M         one-line per entry with human readable timestamps\n\
+    (there are other differences between -m and -M)\n\
 \n\
 Common options:\n\
     -O <file>  output to <file> instead of STDOUT\n\
     -T         run unit tests and exit\n\
 \n";
 
+extern char *optarg;
+extern int optind;
+
 int main(int argc, char *argv[]) {
     
-    BGPDUMP *my_dump;
-    BGPDUMP_ENTRY *my_entry=NULL;
-    extern char *optarg;
     char c;
-    extern int optind;
     int fd;
     bool usage_error = false;
     bool use_syslog = true;
     argv += optind;
     
     if(use_syslog) {
-        info("logging to syslog");
+        debug("logging to syslog");
         log_to_syslog();
     }
     
         exit(1);        
     }
 
-    if(argc>=1 && argv[0] != NULL) {
-        my_dump=bgpdump_open_dump(argv[0]);
-    }
+    BGPDUMP *my_dump = bgpdump_open_dump(argv[0]);
     
     do {
-	my_entry=bgpdump_read_next(my_dump);
-	if(my_entry!=NULL) {
+        BGPDUMP_ENTRY *my_entry = bgpdump_read_next(my_dump);
+	if(my_entry) {
 	    process(my_entry);
 	    bgpdump_free_mem(my_entry);
 	}
 
     bgpdump_close_dump(my_dump);
     
- return 0;
+    return 0;
 }
 
-char *bgp_state_name[] = {
+const char *bgp_state_name[] = {
 	"Unknown",
 	"Idle",
 	"Connect",
 	"Established",
 	NULL
 };
-void time2str(struct tm* time,char *time_str)
-{
-	char tmp_str[10];
 
-	if (time->tm_mon+1<10)
-		sprintf(tmp_str,"0%d/",time->tm_mon+1);
-	else
-		sprintf(tmp_str,"%d/",time->tm_mon+1);
-	strcpy(time_str,tmp_str);
-	
-	if (time->tm_mday<10)
-		sprintf(tmp_str,"0%d/",time->tm_mday);
-	else
-		sprintf(tmp_str,"%d/",time->tm_mday);
-	strcat(time_str,tmp_str);
-	
-	if (time->tm_year%100 <10)
-		sprintf(tmp_str,"0%d ",time->tm_year%100);
-	else
-		sprintf(tmp_str,"%d ",time->tm_year%100);
-	strcat(time_str,tmp_str);
-	
-	if (time->tm_hour<10)
-		sprintf(tmp_str,"0%d:",time->tm_hour);
-	else
-		sprintf(tmp_str,"%d:",time->tm_hour);
-	strcat(time_str,tmp_str);
-	
-	if (time->tm_min<10)
-		sprintf(tmp_str,"0%d:",time->tm_min);
-	else
-		sprintf(tmp_str,"%d:",time->tm_min);
-	strcat(time_str,tmp_str);
-	
-	if (time->tm_sec <10)
-		sprintf(tmp_str,"0%d",time->tm_sec);
-	else
-		sprintf(tmp_str,"%d",time->tm_sec);
-	strcat(time_str,tmp_str);
-
-}
 void process(BGPDUMP_ENTRY *entry) {
 
-	struct tm *time;
+	struct tm *date;
 	char time_str[128];
 	char time_str2[128];
 	char time_str_fixed[128];
     char prefix[BGPDUMP_ADDRSTRLEN];  
 	
-	time=gmtime(&entry->time);
-	time2str(time,time_str);	
-	time2str(time,time_str_fixed);	
+	date=gmtime(&entry->time);
+	time2str(date,time_str);	
+	time2str(date,time_str_fixed);	
 	if (mode==0)
 	{
 		printf("TIME: %s\n", time_str);
 	     }
 	     else if (mode ==1 || mode ==2) // -m -M
 	     {
-	        table_line_mrtd_route(mode,&entry->body.mrtd_table_dump,entry,timetype);	     
+	        table_line_mrtd_route(&entry->body.mrtd_table_dump,entry);	     
 	     }
 	    break;
 
 				if (e->entries[i].attr && e->entries[i].attr->len)
 			    	show_attr(e->entries[i].attr);
 			}
-		} else if (mode ==1 || mode ==2) { // -m -M
-	        table_line_dump_v2_prefix(mode,&entry->body.mrtd_table_dump_v2_prefix,entry,timetype);	     
+		} else if (mode==1 || mode==2) { // -m -M
+                    table_line_dump_v2_prefix(&entry->body.mrtd_table_dump_v2_prefix,entry);	     
 		}
 	    break;
 	    
 				    	show_attr(entry->attr);
 				if (entry->body.zebra_message.cut_bytes)
 				{
-					u_int16_t cutted,index;
+					u_int16_t cutted,idx;
 					u_int8_t buf[128];
 					
 					printf("   INCOMPLETE PACKET: %d bytes cutted\n",entry->body.zebra_message.cut_bytes);
 						buf[0]=entry->body.zebra_message.incomplete.orig_len;
 						memcpy(buf+1,&entry->body.zebra_message.incomplete.prefix.address,cutted-1);
 						
-						for (index=0;index<cutted;index++)
+						for (idx=0;idx<cutted;idx++)
 						{
-							if (buf[index]<0x10)
-								printf("0%x ",buf[index]);
+							if (buf[idx]<0x10)
+								printf("0%x ",buf[idx]);
 							else
-								printf("%x ",buf[index]);
+								printf("%x ",buf[idx]);
 						}
 					}
 					printf("\n");
 						printf("WITHDRAW\n");
 					if (entry->body.zebra_message.withdraw_count)
 			    			show_prefixes(entry->body.zebra_message.withdraw_count,entry->body.zebra_message.withdraw);
-				 	if (entry->attr->mp_info)
-					{
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri);
-					
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri);
 
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri);
+                                
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri);
+
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
 
 #ifdef BGPDUMP_HAVE_IPV6
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri);
-					
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri);
+                                
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri);
 
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
 #endif
-					}
 				}
 				if ( (entry->body.zebra_message.announce_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI))) 
 				{
 					printf("ANNOUNCE\n");
 			    		if (entry->body.zebra_message.announce_count)
 			    			show_prefixes(entry->body.zebra_message.announce_count,entry->body.zebra_message.announce);
-					if (entry->attr->mp_info)
-					{
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nlri);
-					
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nlri);
 
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
-							show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nlri);
+                                
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nlri);
+
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
 
 #ifdef BGPDUMP_HAVE_IPV6
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nlri);
-					
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nlri);
+                                
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nlri);
 
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
-							show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
 #endif					
-					}
 				}
 			   }
 			   else if (mode == 1  || mode == 2) //-m -M
 				if ((entry->body.zebra_message.withdraw_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)))
 				{
 
-					table_line_withdraw(mode,entry->body.zebra_message.withdraw,entry->body.zebra_message.withdraw_count,entry,time_str);
-					if (entry->attr->mp_info)
-					{
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
-							table_line_withdraw(mode,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
-							table_line_withdraw(mode,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
-						if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
-							table_line_withdraw(mode,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
+					table_line_withdraw(entry->body.zebra_message.withdraw,entry->body.zebra_message.withdraw_count,entry,time_str);
+
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
+                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
+
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
+                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
+                                        
+                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
 
 #ifdef BGPDUMP_HAVE_IPV6						
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
-							table_line_withdraw6(mode,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
-							table_line_withdraw6(mode,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
-						if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
-							table_line_withdraw6(mode,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
-#endif
-
-					}
-	
-				
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
+                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
+                                        
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
+                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
+                                        
+                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
+#endif	
+                        
 				}
 				if ( (entry->body.zebra_message.announce_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)))
 				{
-					table_line_announce(mode,entry->body.zebra_message.announce,entry->body.zebra_message.announce_count,entry,time_str);
-					if (entry->attr->mp_info)
-					{
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
-							table_line_announce_1(mode,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
-							table_line_announce_1(mode,entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
-						if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
-							table_line_announce_1(mode,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
+					table_line_announce(entry->body.zebra_message.announce,entry->body.zebra_message.announce_count,entry,time_str);
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
+                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
+                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
+                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
 #ifdef BGPDUMP_HAVE_IPV6						
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
-							table_line_announce6(mode,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
-							table_line_announce6(mode,entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
-						if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
-							table_line_announce6(mode,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
+                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
+                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
+                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
+                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
 #endif
-
-					}
 					
 				}  
 			   }
 
 					fmt_ipv6(entry->body.zebra_state_change.source_ip,prefix);
 					if (mode == 1)
-						printf("BGP4MP|%ld|STATE|%s|%s|%d|%d\n",entry->time,prefix,print_asn(entry->body.zebra_state_change.source_as),entry->body.zebra_state_change.old_state,entry->body.zebra_state_change.new_state);
+						printf("BGP4MP|%ld|STATE|%s|%s|%d|%d\n",
+                                                       entry->time,
+                                                       prefix,
+                                                       print_asn(entry->body.zebra_state_change.source_as),
+                                                       entry->body.zebra_state_change.old_state,
+                                                       entry->body.zebra_state_change.new_state);
 					else
-						printf("BGP4MP|%s|STATE|%s|%s|%d|%d\n",time_str,prefix,print_asn(entry->body.zebra_state_change.source_as),entry->body.zebra_state_change.old_state,entry->body.zebra_state_change.new_state);
+						printf("BGP4MP|%s|STATE|%s|%s|%d|%d\n",
+                                                       time_str,
+                                                       prefix,
+                                                       print_asn(entry->body.zebra_state_change.source_as),
+                                                       entry->body.zebra_state_change.old_state,
+                                                       entry->body.zebra_state_change.new_state);
 					break;
 #endif
 				case AFI_IP:
 				default:
 					if (mode == 1)
-						printf("BGP4MP|%ld|STATE|%s|%s|%d|%d\n",entry->time,inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),print_asn(entry->body.zebra_state_change.source_as),entry->body.zebra_state_change.old_state,entry->body.zebra_state_change.new_state);
+						printf("BGP4MP|%ld|STATE|%s|%s|%d|%d\n",
+                                                       entry->time,
+                                                       inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),
+                                                       print_asn(entry->body.zebra_state_change.source_as),
+                                                       entry->body.zebra_state_change.old_state,
+                                                       entry->body.zebra_state_change.new_state);
 					else
-						printf("BGP4MP|%s|STATE|%s|%s|%d|%d\n",time_str,inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),print_asn(entry->body.zebra_state_change.source_as),entry->body.zebra_state_change.old_state,entry->body.zebra_state_change.new_state);
+						printf("BGP4MP|%s|STATE|%s|%s|%d|%d\n",
+                                                       time_str,
+                                                       inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),
+                                                       print_asn(entry->body.zebra_state_change.source_as),
+                                                       entry->body.zebra_state_change.old_state,
+                                                       entry->body.zebra_state_change.new_state);
 					break;
 
 			}
 
 	    if (attr->unknown_num)
 	    {
-		    u_int32_t index,len;
+		    u_int32_t idx,len;
 		    u_char *p;
 		    
-		    for (index=0;index<attr->unknown_num;index++)
+		    for (idx=0;idx<attr->unknown_num;idx++)
 		    {
 			    printf("   UNKNOWN_ATTR :");
-			    p = attr->unknown[index].raw;
+			    p = attr->unknown[idx].raw;
 			    if(p[0] & BGP_ATTR_FLAG_EXTLEN) {
-				len = attr->unknown[index].real_len + 4;
+				len = attr->unknown[idx].real_len + 4;
 			    } else {
-				len = attr->unknown[index].real_len + 3;
+				len = attr->unknown[idx].real_len + 3;
 			    }
 
 			    while (len) {
 #endif
 
 
-void table_line_withdraw(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
+static void table_line_withdraw(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
 {
-	int index;
+	int idx;
 	char buf[128];
 	
-	for (index=0;index<count;index++)
+	for (idx=0;idx<count;idx++)
 	{
 		if (mode==1)
 		{
 			{
 #ifdef BGPDUMP_HAVE_IPV6
 			case AFI_IP6:
-				printf("BGP4MP|%ld|W|%s|%s|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),print_asn(entry->body.zebra_message.source_as));
+				printf("BGP4MP|%ld|W|%s|%s|",
+                                       entry->time,
+                                       fmt_ipv6(entry->body.zebra_message.source_ip,buf),
+                                       print_asn(entry->body.zebra_message.source_as));
 				break;
 #endif
 			case AFI_IP:
 			default:
-				printf("BGP4MP|%ld|W|%s|%s|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
+				printf("BGP4MP|%ld|W|%s|%s|",
+                                       entry->time,
+                                       inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),
+                                       print_asn(entry->body.zebra_message.source_as));
 				break;
 			}
-			printf("%s/%d\n",inet_ntoa(prefix[index].address.v4_addr),prefix[index].len);
+			printf("%s/%d\n",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len);
 		}
 		else
 		{
 			{
 #ifdef BGPDUMP_HAVE_IPV6
 			case AFI_IP6:
-				printf("BGP4MP|%s|W|%s|%s|",time_str,fmt_ipv6(entry->body.zebra_message.source_ip,buf),print_asn(entry->body.zebra_message.source_as));
+				printf("BGP4MP|%s|W|%s|%s|",
+                                       time_str,
+                                       fmt_ipv6(entry->body.zebra_message.source_ip,buf),
+                                       print_asn(entry->body.zebra_message.source_as));
 				break;
 #endif
 			case AFI_IP:
 			default:
-				printf("BGP4MP|%s|W|%s|%s|",time_str,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
+				printf("BGP4MP|%s|W|%s|%s|",
+                                       time_str,
+                                       inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),
+                                       print_asn(entry->body.zebra_message.source_as));
 				break;
 			}
-			printf("%s/%d\n",inet_ntoa(prefix[index].address.v4_addr),prefix[index].len);
+			printf("%s/%d\n",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len);
 		}
 		
 	}
 
 #ifdef BGPDUMP_HAVE_IPV6
 
-void table_line_withdraw6(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
+static void table_line_withdraw6(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
 {
-	int index;
+	int idx;
 	char buf[128];
 	char buf1[128];
 
-	for (index=0;index<count;index++)
+	for (idx=0;idx<count;idx++)
 	{
 		if (mode==1)
 		{
 			switch(entry->body.zebra_message.address_family)
 			{
 			case AFI_IP6:
-				printf("BGP4MP|%ld|W|%s|%s|%s/%d\n",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix[index].address,buf),prefix[index].len);
+				printf("BGP4MP|%ld|W|%s|%s|%s/%d\n",
+                                       entry->time,
+                                       fmt_ipv6(entry->body.zebra_message.source_ip,buf1),
+                                       print_asn(entry->body.zebra_message.source_as),
+                                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
 				break;
 			case AFI_IP:
 			default:
-				printf("BGP4MP|%ld|W|%s|%s|%s/%d\n",entry->time,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix[index].address,buf),prefix[index].len);
+				printf("BGP4MP|%ld|W|%s|%s|%s/%d\n",
+                                       entry->time,
+                                       fmt_ipv4(entry->body.zebra_message.source_ip,buf1),
+                                       print_asn(entry->body.zebra_message.source_as),
+                                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
 				break;
 			}
 		}	
 			switch(entry->body.zebra_message.address_family)
 			{
 			case AFI_IP6:
-				printf("BGP4MP|%s|W|%s|%s|%s/%d\n",time_str,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix[index].address,buf),prefix[index].len);
+				printf("BGP4MP|%s|W|%s|%s|%s/%d\n",
+                                       time_str,
+                                       fmt_ipv6(entry->body.zebra_message.source_ip,buf1),
+                                       print_asn(entry->body.zebra_message.source_as),
+                                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
 				break;
 			case AFI_IP:
 			default:
-				printf("BGP4MP|%s|W|%s|%s|%s/%d\n",time_str,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix[index].address,buf),prefix[index].len);
+				printf("BGP4MP|%s|W|%s|%s|%s/%d\n",
+                                       time_str,
+                                       fmt_ipv4(entry->body.zebra_message.source_ip,buf1),
+                                       print_asn(entry->body.zebra_message.source_as),
+                                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
 				break;
 			}
 		}
 }
 #endif
 
-void table_line_announce(int mode,struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
+static void table_line_announce(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
 {
-	int index  ;
+	int idx  ;
 	char buf[128];
 	//char buf1[128];
 	//char buf2[128];
 	else
 		sprintf(tmp2,"NAG");
 
-	for (index=0;index<count;index++)
+	for (idx=0;idx<count;idx++)
 	{
 		if (mode == 1)
 		{
 				printf("BGP4MP|%ld|A|%s|%s|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
 				break;
 			}
-			printf("%s/%d|%s|%s|",inet_ntoa(prefix[index].address.v4_addr),prefix[index].len,ATTR_ASPATH(entry->attr),tmp1);
+			printf("%s/%d|%s|%s|",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 		    npref=entry->attr->local_pref;
 	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
 	            npref=0;
 				printf("BGP4MP|%s|A|%s|%s|",time_str,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
 				break;
 			}
-			printf("%s/%d|%s|%s\n",inet_ntoa(prefix[index].address.v4_addr),prefix[index].len,ATTR_ASPATH(entry->attr),tmp1);
+			printf("%s/%d|%s|%s\n",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 				
 		}
 	}
 
 }
-void table_line_announce_1(int mode,struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
+static void table_line_announce_1(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
 {
-	int index  ;
+	int idx  ;
 	char buf[128];
 	//char buf1[128];
 	//char buf2[128];
 	else
 		sprintf(tmp2,"NAG");
 
-	for (index=0;index<count;index++)
+	for (idx=0;idx<count;idx++)
 	{
 		if (mode == 1)
 		{
 					printf("BGP4MP|%ld|A|%s|%s|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
 					break;
 				}
-				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[index].address.v4_addr),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1);
+				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 
 		    npref=entry->attr->local_pref;
 	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
 					printf("BGP4MP|%ld|A|%s|%s|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
 					break;
 				}
-				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[index].address.v4_addr),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1);
+				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 
 		    npref=entry->attr->local_pref;
 	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
 				printf("BGP4MP|%s|A|%s|%s|",time_str,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),print_asn(entry->body.zebra_message.source_as));
 				break;
 			}
-			printf("%s/%d|%s|%s\n",inet_ntoa(prefix->nlri[index].address.v4_addr),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1);
+			printf("%s/%d|%s|%s\n",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 				
 		}
 	}
 }
 
 #ifdef BGPDUMP_HAVE_IPV6
-void table_line_announce6(int mode,struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
+static void table_line_announce6(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
 {
-	int index  ;
+	int idx  ;
 	char buf[128];
 	char buf1[128];
 	char buf2[128];
 	else
 		sprintf(tmp2,"NAG");
 
-	for (index=0;index<count;index++)
+	for (idx=0;idx<count;idx++)
 	{
 		if (mode == 1)
 		{
 	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
 	            nmed=0;
 			    
-				printf("BGP4MP|%ld|A|%s|%s|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[index].address,buf2),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1,fmt_ipv6(prefix->nexthop,buf),npref,nmed);
+				printf("BGP4MP|%ld|A|%s|%s|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1,fmt_ipv6(prefix->nexthop,buf),npref,nmed);
 				break;
 			case AFI_IP:
 			default:
 	            nmed=0;
 			    
 			//printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),nprof,nmed);
-				printf("BGP4MP|%ld|A|%s|%s|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[index].address,buf2),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1,fmt_ipv6(prefix->nexthop,buf),npref,nmed);
+				printf("BGP4MP|%ld|A|%s|%s|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1,fmt_ipv6(prefix->nexthop,buf),npref,nmed);
 				break;
 			}
 			if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
 			switch(entry->body.zebra_message.address_family)
 			{
 			case AFI_IP6:
-				printf("BGP4MP|%s|A|%s|%s|%s/%d|%s|%s\n",time_str,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[index].address,buf),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1);
+				printf("BGP4MP|%s|A|%s|%s|%s/%d|%s|%s\n",time_str,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[idx].address,buf),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 				break;
 			case AFI_IP:
 			default:
-				printf("BGP4MP|%s|A|%s|%s|%s/%d|%s|%s\n",time_str,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[index].address,buf),prefix->nlri[index].len,ATTR_ASPATH(entry->attr),tmp1);
+				printf("BGP4MP|%s|A|%s|%s|%s/%d|%s|%s\n",time_str,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),print_asn(entry->body.zebra_message.source_as),fmt_ipv6(prefix->nlri[idx].address,buf),prefix->nlri[idx].len,ATTR_ASPATH(entry->attr),tmp1);
 				break;
 			}
 		}		
 #endif
 
 
-void table_line_mrtd_route(int mode,BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry,int timetype)
+static void table_line_mrtd_route(BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry)
 {
 	
-	struct tm *time = NULL;
+	struct tm *date = NULL;
 	char tmp1[20];
 	char tmp2[20];	
 	unsigned int npref;
 		else
 		{
                     if(timetype==0){
-                        time=gmtime(&entry->time);
+                        date=gmtime(&entry->time);
 		    }else if(timetype==1){
-			time=gmtime(&route->uptime);
+			date=gmtime(&route->uptime);
 		    }
-	            time2str(time,time_str);	
+	            time2str(date,time_str);	
 	 	    printf("TABLE_DUMP|%s|A|%s|%s|",time_str,peer,print_asn(route->peer_as));
 			printf("%s/%d|%s|%s\n",prefix,route->mask,ATTR_ASPATH(entry->attr),tmp1);
 				
     return "INCOMPLETE";
 }
 
-void table_line_dump_v2_prefix(int mode,BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry,int timetype)
+static void table_line_dump_v2_prefix(BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry)
 {
-    struct tm *time = NULL;
+    struct tm *date = NULL;
     unsigned int npref;
     unsigned int nmed;
     char  time_str[20];
         else
         {
             if(timetype==0){
-                time=gmtime(&entry->time);
+                date=gmtime(&entry->time);
             }else if(timetype==1){
                 time_t time_temp = (time_t)((e->entries[i]).originated_time);
-                time=gmtime(&time_temp);
+                date=gmtime(&time_temp);
             }
-            time2str(time,time_str);	
+            time2str(date,time_str);	
             printf("TABLE_DUMP_V2|%s|A|%s|%s|",time_str,peer,print_asn(e->entries[i].peer->peer_as));
             printf("%s/%d|%s|%s\n",prefix,e->prefix_length,aspath_str,origin);
             

bgpdump.xcodeproj/project.pbxproj

 /* Begin PBXBuildFile section */
 		4DA3ECA41237A8930007C28C /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DA3ECA31237A8930007C28C /* inet_ntop.c */; };
 		4DA3ECA51237A8930007C28C /* inet_ntop.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DA3ECA31237A8930007C28C /* inet_ntop.c */; };
+		4DD01F741243914100C66C04 /* bgpdump_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DD01F731243914100C66C04 /* bgpdump_lib.c */; };
+		4DD01F751243914100C66C04 /* bgpdump_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DD01F731243914100C66C04 /* bgpdump_lib.c */; };
 		4DF74766122D4E800092F3E2 /* bgpdump.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DF7475F122D4E800092F3E2 /* bgpdump.c */; };
 		4DF7479F122D52510092F3E2 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DF7477A122D51850092F3E2 /* libz.dylib */; };
 		4DF747A0122D525A0092F3E2 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DF7477C122D51990092F3E2 /* libbz2.dylib */; };
 		4DF747A4122D52900092F3E2 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DF7477A122D51850092F3E2 /* libz.dylib */; };
 		4DF747A5122D529D0092F3E2 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DF7477C122D51990092F3E2 /* libbz2.dylib */; };
-		4DF747A6122D52C30092F3E2 /* bgpdump_lib.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DF74759122D4E800092F3E2 /* bgpdump_lib.c */; };
 		4DF747A7122D52C30092F3E2 /* bgpdump_mstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DF7475B122D4E800092F3E2 /* bgpdump_mstream.c */; };
 		4DF747A8122D52C50092F3E2 /* cfile_tools.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DF74761122D4E800092F3E2 /* cfile_tools.c */; };
 		4DF74863122E52060092F3E2 /* util.c in Sources */ = {isa = PBXBuildFile; fileRef = 4DF74862122E52060092F3E2 /* util.c */; };
 
 /* Begin PBXFileReference section */
 		4DA3ECA31237A8930007C28C /* inet_ntop.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inet_ntop.c; sourceTree = "<group>"; };
+		4DD01F731243914100C66C04 /* bgpdump_lib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bgpdump_lib.c; sourceTree = "<group>"; };
 		4DF74757122D4E800092F3E2 /* bgpdump_attr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bgpdump_attr.h; sourceTree = "<group>"; };
 		4DF74758122D4E800092F3E2 /* bgpdump_formats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bgpdump_formats.h; sourceTree = "<group>"; };
-		4DF74759122D4E800092F3E2 /* bgpdump_lib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bgpdump_lib.c; sourceTree = "<group>"; };
 		4DF7475A122D4E800092F3E2 /* bgpdump_lib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bgpdump_lib.h; sourceTree = "<group>"; };
 		4DF7475B122D4E800092F3E2 /* bgpdump_mstream.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bgpdump_mstream.c; sourceTree = "<group>"; };
 		4DF7475C122D4E800092F3E2 /* bgpdump_mstream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bgpdump_mstream.h; sourceTree = "<group>"; };
 		08FB7795FE84155DC02AAC07 /* Source */ = {
 			isa = PBXGroup;
 			children = (
+				4DD01F731243914100C66C04 /* bgpdump_lib.c */,
 				4DA3ECA31237A8930007C28C /* inet_ntop.c */,
 				4DF74757122D4E800092F3E2 /* bgpdump_attr.h */,
 				4DF74758122D4E800092F3E2 /* bgpdump_formats.h */,
-				4DF74759122D4E800092F3E2 /* bgpdump_lib.c */,
 				4DF7475A122D4E800092F3E2 /* bgpdump_lib.h */,
 				4DF7475B122D4E800092F3E2 /* bgpdump_mstream.c */,
 				4DF7475C122D4E800092F3E2 /* bgpdump_mstream.h */,
 			files = (
 				4DF74865122E52060092F3E2 /* util.c in Sources */,
 				4DA3ECA51237A8930007C28C /* inet_ntop.c in Sources */,
+				4DD01F751243914100C66C04 /* bgpdump_lib.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 			buildActionMask = 2147483647;
 			files = (
 				4DF74766122D4E800092F3E2 /* bgpdump.c in Sources */,
-				4DF747A6122D52C30092F3E2 /* bgpdump_lib.c in Sources */,
 				4DF747A7122D52C30092F3E2 /* bgpdump_mstream.c in Sources */,
 				4DF747A8122D52C50092F3E2 /* cfile_tools.c in Sources */,
 				4DF74863122E52060092F3E2 /* util.c in Sources */,
 				4DA3ECA41237A8930007C28C /* inet_ntop.c in Sources */,
+				4DD01F741243914100C66C04 /* bgpdump_lib.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_MODEL_TUNING = G5;
 				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
-				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
 				INSTALL_PATH = /usr/local/bin;
 				PRODUCT_NAME = bgpdump;
 				RUN_CLANG_STATIC_ANALYZER = NO;
 				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_VERSION = "";
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = NO;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				PREBINDING = NO;
 				SDKROOT = macosx10.6;
+				WARNING_CFLAGS = (
+					"-Wmissing-prototypes",
+					"-Wall",
+					"-Wshadow",
+					"-Wreturn-type",
+				);
 			};
 			name = Debug;
 		};
 				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
 				SDKROOT = macosx10.6;
+				WARNING_CFLAGS = (
+					"-Wmissing-prototypes",
+					"-Wall",
+					"-Wshadow",
+					"-Wreturn-type",
+				);
 			};
 			name = Release;
 		};
   u_int32_t flag;
 
   /* Attributes. */
-  u_char 		origin;
+  int                   origin;
   struct in_addr 	nexthop;
   u_int32_t 		med;
   u_int32_t 		local_pref;
     return this_entry;
 }
 
-void bgpdump_free_mp_info(struct mp_info *info) {
+static void bgpdump_free_mp_info(struct mp_info *info) {
     u_int16_t afi;
     u_int8_t safi;
 
     switch(afi) {
 	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
 	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
-	    mstream_get_ipv4(s, &entry->body.mrtd_table_dump.prefix.v4_addr.s_addr);
+	    entry->body.mrtd_table_dump.prefix.v4_addr = mstream_get_ipv4(s);
 	    break;
 #ifdef BGPDUMP_HAVE_IPV6
 	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
     switch(afi) {
       case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
       case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
-	mstream_get_ipv4(s, &entry->body.mrtd_table_dump.peer_ip.v4_addr.s_addr);
+	entry->body.mrtd_table_dump.peer_ip.v4_addr = mstream_get_ipv4(s);
 	break;
 #ifdef BGPDUMP_HAVE_IPV6
       case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
 	t = table_dump_v2_peer_index_table;
 	t->entries = NULL;
 
-    mstream_get_ipv4(s,(uint32_t *)&t->local_bgp_id);
+    t->local_bgp_id = mstream_get_ipv4(s);
 
     mstream_getw(s,&view_name_len);
 	strcpy(t->view_name, "");
 
 	for(i=0; i < t->peer_count; i++) {
     	mstream_getc(s,&peertype);
+                t->entries[i].afi = AFI_IP;
 #ifdef BGPDUMP_HAVE_IPV6
 		if(peertype & BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AFI_IP6)
 			t->entries[i].afi = AFI_IP6;
-		else
 #endif
-			t->entries[i].afi = AFI_IP;
 
-    	mstream_get_ipv4(s,(uint32_t *)&t->entries[i].peer_bgp_id);
+                t->entries[i].peer_bgp_id = mstream_get_ipv4(s);
 
 		if(t->entries[i].afi == AFI_IP)
-			mstream_get_ipv4(s,&t->entries[i].peer_ip.v4_addr.s_addr);
+			t->entries[i].peer_ip.v4_addr = mstream_get_ipv4(s);
 #ifdef BGPDUMP_HAVE_IPV6
 		else
 			mstream_get(s, &t->entries[i].peer_ip.v6_addr.s6_addr, 16);
 		return 0;
 	    }
 
-	    mstream_get_ipv4(s,&entry->body.zebra_state_change.source_ip.v4_addr.s_addr);
-	    mstream_get_ipv4(s,&entry->body.zebra_state_change.destination_ip.v4_addr.s_addr);
+	    entry->body.zebra_state_change.source_ip.v4_addr = mstream_get_ipv4(s);
+	    entry->body.zebra_state_change.destination_ip.v4_addr = mstream_get_ipv4(s);
 	    break;
 #ifdef BGPDUMP_HAVE_IPV6
 	case AFI_IP6:
 
     switch(entry->body.zebra_message.address_family) {
 	case AFI_IP:
-	    mstream_get_ipv4(s,&entry->body.zebra_message.source_ip.v4_addr.s_addr);
-	    mstream_get_ipv4(s,&entry->body.zebra_message.destination_ip.v4_addr.s_addr);
+	    entry->body.zebra_message.source_ip.v4_addr = mstream_get_ipv4(s);
+	    entry->body.zebra_message.destination_ip.v4_addr = mstream_get_ipv4(s);
 	    mstream_get (s, marker, 16);
 	    break;
 #ifdef BGPDUMP_HAVE_IPV6
     mstream_getc(s, &entry->body.zebra_message.version);
     read_asn(s, &entry->body.zebra_message.my_as, asn_len);
     mstream_getw(s, &entry->body.zebra_message.hold_time);
-    mstream_get_ipv4(s, &entry->body.zebra_message.bgp_id.s_addr);
+    entry->body.zebra_message.bgp_id = mstream_get_ipv4(s);
     mstream_getc(s, &entry->body.zebra_message.opt_len);
 
     if(entry->body.zebra_message.opt_len) {
     return 0;
 }
 
-attributes_t *attr_init(struct mstream *s, int len) {
+static attributes_t *attr_init(struct mstream *s, int len) {
 
     attributes_t *attr = malloc(sizeof(struct attr));
     
     
     attr->len = len;
     attr->flag			= 0;
-    attr->origin			= -1;
-    attr->nexthop.s_addr		= INADDR_NONE;
+    attr->origin		= -1;
+    attr->nexthop.s_addr	= INADDR_NONE;
     attr->med			= -1;
     attr->local_pref		= -1;
     attr->aggregator_as		= -1;
-    attr->aggregator_addr.s_addr	= INADDR_NONE;
-    attr->weight			= -1;
+    attr->aggregator_addr.s_addr = INADDR_NONE;
+    attr->weight		= -1;
 
     attr->originator_id.s_addr	= -1;
     attr->cluster		= NULL;
     attr->aspath			= NULL;
     attr->community		= NULL;
     attr->transit		= NULL;
-    attr->mp_info		= NULL;
+    attr->mp_info		= calloc(1, sizeof(struct mp_info));;
 
     attr->unknown_num = 0;
     attr->unknown = NULL;
         
     switch(type) {
         case BGP_ATTR_MP_REACH_NLRI:
-            if(! attr->mp_info)
-                attr->mp_info = calloc(1, sizeof(struct mp_info));
             process_mp_announce(s, attr->mp_info, incomplete);
             break;
         case BGP_ATTR_MP_UNREACH_NLRI:
-            if(! attr->mp_info)
-                attr->mp_info = calloc(1, sizeof(struct mp_info));
             process_mp_withdraw(s, attr->mp_info, incomplete);
             break;
         case BGP_ATTR_ORIGIN:
-            mstream_getc(s,&attr->origin);
+            assert(attr->origin == -1);
+            attr->origin = mstream_getc(s, NULL);
             break;
         case BGP_ATTR_AS_PATH:
-            //FIXME assert(! attr->aspath);
+            assert(! attr->aspath);
             attr->aspath = create_aspath(len, asn_len);
             mstream_get(s, attr->aspath->data, len);
             process_attr_aspath_string(attr->aspath);
             break;
         case BGP_ATTR_NEXT_HOP:
-            mstream_get_ipv4(s,&attr->nexthop.s_addr);
+            assert(INADDR_NONE == attr->nexthop.s_addr);
+            attr->nexthop = mstream_get_ipv4(s);
             break;
         case BGP_ATTR_MULTI_EXIT_DISC:
+            assert(-1 == attr->med);
             mstream_getl(s,&attr->med);
             break;
         case BGP_ATTR_LOCAL_PREF:
+            assert(-1 == attr->local_pref);
             mstream_getl(s,&attr->local_pref);
             break;
         case BGP_ATTR_ATOMIC_AGGREGATE:
             break;
         case BGP_ATTR_AGGREGATOR:
+            assert(-1 == attr->new_aggregator_as);
             read_asn(s, &attr->aggregator_as, asn_len);
-            mstream_get_ipv4(s,&attr->aggregator_addr.s_addr);
+            attr->aggregator_addr = mstream_get_ipv4(s);
             break;
         case BGP_ATTR_COMMUNITIES:
-            //FIXME assert(! attr->community);
+            assert(! attr->community);
             attr->community		= malloc(sizeof(struct community));
             attr->community->size	= len / 4;
             attr->community->val	= malloc(len);
             process_attr_community_string(attr->community);
             break;
         case BGP_ATTR_NEW_AS_PATH:
-            //FIXME assert(! attr->new_aspath);
+            assert(! attr->new_aspath);
             attr->new_aspath = create_aspath(len, ASN32_LEN);
             mstream_get(s,attr->new_aspath->data, len);
             process_attr_aspath_string(attr->new_aspath);
             check_new_aspath(attr->new_aspath);
             break;
         case BGP_ATTR_NEW_AGGREGATOR:
+            assert(-1 == attr->new_aggregator_as);
             read_asn(s, &attr->new_aggregator_as, ASN32_LEN);
-            mstream_get_ipv4(s,&attr->new_aggregator_addr.s_addr);
+            attr->new_aggregator_addr = mstream_get_ipv4(s);
             break;
         case BGP_ATTR_ORIGINATOR_ID:
-            mstream_get_ipv4(s,&attr->originator_id.s_addr);
+            assert(INADDR_NONE == attr->originator_id.s_addr);
+            attr->originator_id = mstream_get_ipv4(s);
             break;
         case BGP_ATTR_CLUSTER_LIST:
-            //FIXME assert(! attr->cluster);
+            assert(! attr->cluster);
             attr->cluster		= malloc(sizeof(struct cluster_list));
             attr->cluster->length	= len/4;
             attr->cluster->list = malloc((attr->cluster->length) * sizeof(struct in_addr));
             
             int i; // cluster index
             for (i = 0; i < attr->cluster->length; i++)
-                mstream_get_ipv4(s,&attr->cluster->list[i].s_addr);
+                attr->cluster->list[i] = mstream_get_ipv4(s);
             break;
         default:
             process_unknown_attr(s, attr, flag, type, len);
 
     if(afi == AFI_IP) {
         assert(nlri->nexthop_len == 4);
-        nlri->nexthop.v4_addr.s_addr = mstream_get_ipv4(s, NULL);
+        nlri->nexthop.v4_addr = mstream_get_ipv4(s);
         return nlri;
     }
 
     return data;
 }
 
-u_int32_t mstream_get_ipv4(struct mstream *s, u_int32_t *d) {
-    u_int32_t data;
+struct in_addr mstream_get_ipv4(struct mstream *s) {
+    struct in_addr addr;
 
-    mstream_get(s, &data, sizeof(data));
-    if(d!=NULL) memcpy(d,&data,sizeof(data));
-    return data;
+    mstream_get(s, &addr.s_addr, 4);
+    return addr;
 }
 
 u_int32_t mstream_can_read(struct mstream *s) {
 u_char    mstream_getc(struct mstream *s, u_char *d);
 u_int16_t mstream_getw(struct mstream *s, u_int16_t *d);
 u_int32_t mstream_getl(struct mstream *s, u_int32_t *d);
-u_int32_t mstream_get_ipv4(struct mstream *s,  u_int32_t *d);
+struct in_addr mstream_get_ipv4(struct mstream *s);
 u_int32_t mstream_can_read(struct mstream *s);
 u_int32_t mstream_get (struct mstream *s, void *d, u_int32_t len);
 mstream_t mstream_copy(mstream_t *s, int len);
 #! /bin/sh
-# From configure.in Revision: 1.4 .
+# From configure.in Revision.
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for libbgpdump 1.4.1.
+# Generated by GNU Autoconf 2.61 for libbgpdump 1.4.1.
 #
 # Report bugs to <ris@ripe.net>.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
 
 # Support unset when possible.
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
+as_nl='
+'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
 PS4='+ '
 
 # NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
   as_have_required=no
 fi
 
-  if test $as_have_required = yes &&	 (eval ":
+  if test $as_have_required = yes && 	 (eval ":
 (as_func_return () {
   (exit \$1)
 }
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 
       if test "x$CONFIG_SHELL" != x; then
   for as_var in BASH_ENV ENV
-	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-	done
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
 
 
 test \$exitcode = 0") || {
   echo No shell found that supports shell functions.
-  echo Please tell bug-autoconf@gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
 }
 
 
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
 *)
   ECHO_N='-n';;
 esac
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-	test -d "$1/.";
+        test -d "$1/.";
       else
 	case $1 in
-	-*)set "./$1";;
+        -*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+RANLIB
+AR
+CPP
+GREP
+EGREP
 LIBOBJS
-EGREP
-GREP
-CPP
-AR
-RANLIB
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
+LTLIBOBJS'
 ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_ipv6
-'
       ac_precious_vars='build_alias
 host_alias
 target_alias
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; }
     ;;
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+  { echo "$as_me: error: missing argument to $ac_option" >&2
    { (exit 1); exit 1; }; }
 fi
 
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
-   { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
+# Be sure to have absolute directory names.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
 		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; }
 done
 
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+  { echo "$as_me: error: Working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
    { (exit 1); exit 1; }; }
 
 
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
 	pwd)`
 # When building in place, set srcdir=.
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
+			  [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
+			  [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/libbgpdump]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/libbgpdump]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
   cat <<\_ACEOF
 
 Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-ipv6          disable support for IPv6
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
 if $ac_init_version; then
   cat <<\_ACEOF
 libbgpdump configure 1.4.1
-generated by GNU Autoconf 2.63
+generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by libbgpdump $as_me 1.4.1, which was
-generated by GNU Autoconf 2.63.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  $as_echo "PATH: $as_dir"
+  echo "PATH: $as_dir"
 done
 IFS=$as_save_IFS
 
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      $as_echo "$ac_var='\''$ac_val'\''"
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
+	echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
       echo
     fi
     test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
 
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
+# Prefer explicitly selected file to automatically selected ones.
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  set x "$CONFIG_SITE"
 elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
 else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
 do
-  test "x$ac_site_file" = xNONE && continue
   if test -r "$ac_site_file"; then
-    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 ac_config_headers="$ac_config_headers bgpdump-config.h"
 
 
-CFLAGS="$CFLAGS -Wall -Wcast-align -Wsystem-headers -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -O3"
+CFLAGS="$CFLAGS -Wall -Wsystem-headers -Wno-format-y2k -Wno-sign-compare"
+CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow -Wcast-align -O3"
 
 # Checks for programs.
 ac_ext=c
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi