}
// originX.asn.cymru.com txtrec: ASN | Route | Country | Registry | Allocated
-char* split_txtrec(char *txtrec) {
- if (!txtrec)
+char* split_txtrec(char *txt_rec) {
+ if (!txt_rec)
return NULL;
if (iihash) {
#ifdef IIDEBUG
- syslog(LOG_INFO, "Malloc-tbl: %s", txtrec);
+ syslog(LOG_INFO, "Malloc-tbl: %s", txt_rec);
#endif
if (!(items = malloc(sizeof(*items)))) {
#ifdef IIDEBUG
- syslog(LOG_INFO, "Free-txt(%p)", txtrec);
+ syslog(LOG_INFO, "Free-txt(%p)", txt_rec);
#endif
- free(txtrec);
+ free(txt_rec);
return NULL;
}
}
- char* prev = txtrec;
+ char* prev = txt_rec;
char* next;
int i = 0, j;
}
-int longipstr( char *s, ip_t *dst, int af )
+int longipstr( char *s, ip_t *dst, int family )
{
#ifdef ENABLE_IPV6
- return inet_pton( af, s, dst );
+ return inet_pton( family, s, dst );
#else
return inet_aton( s, dst );
#endif
// XXX check if necessary/exported.
/* Resolve an IP address to a hostname. */
-struct hostent *addr2host( const char *addr, int af ) {
+struct hostent *addr2host( const char *addr, int family ) {
int len = 0;
- switch ( af ) {
+ switch ( family ) {
case AF_INET:
len = sizeof( struct in_addr );
break;
break;
#endif
}
- return gethostbyaddr( addr, len, af );
+ return gethostbyaddr( addr, len, family );
}
}
-gint Host_activate(GtkWidget *Entry, UNUSED gpointer data)
+gint Host_activate(GtkWidget *entry, UNUSED gpointer data)
{
struct hostent * addr;
- addr = dns_forward(gtk_entry_get_text(GTK_ENTRY(Entry)));
+ addr = dns_forward(gtk_entry_get_text(GTK_ENTRY(entry)));
if(addr) {
net_reopen(addr);
/* If we are "Paused" at this point it is usually because someone
entered a non-existing host. Therefore do the go-ahead... */
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( Pause_Button ) , 0);
} else {
- int pos = strlen(gtk_entry_get_text( GTK_ENTRY(Entry)));
+ int pos = strlen(gtk_entry_get_text( GTK_ENTRY(entry)));
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( Pause_Button ) , 1);
- gtk_editable_insert_text( GTK_EDITABLE(Entry), ": not found", -1, &pos);
+ gtk_editable_insert_text( GTK_EDITABLE(entry), ": not found", -1, &pos);
}
return FALSE;
struct timeval now;
ip_t * fromaddress = NULL;
int echoreplytype = 0, timeexceededtype = 0, unreachabletype = 0;
- int sequence = 0;
+ int seq_num = 0;
/* MPLS decoding */
struct mplslen mpls;
if(header->id != (uint16)getpid())
return;
- sequence = header->sequence;
+ seq_num = header->sequence;
} else if (header->type == timeexceededtype) {
switch ( af ) {
case AF_INET:
if (header->id != (uint16)getpid())
return;
- sequence = header->sequence;
+ seq_num = header->sequence;
}
break;
return;
if (remoteport && remoteport == ntohs(udpheader->dstport)) {
- sequence = ntohs(udpheader->checksum);
+ seq_num = ntohs(udpheader->checksum);
} else if (!remoteport) {
- sequence = ntohs(udpheader->dstport);
+ seq_num = ntohs(udpheader->dstport);
}
}
break;
break;
#endif
}
- sequence = ntohs(tcpheader->srcport);
+ seq_num = ntohs(tcpheader->srcport);
}
break;
break;
#endif
}
- sequence = ntohs(sctpheader->srcport);
+ seq_num = ntohs(sctpheader->srcport);
}
break;
}
- if (sequence)
- net_process_ping (sequence, mpls, (void *) fromaddress, now);
+ if (seq_num)
+ net_process_ping (seq_num, mpls, (void *) fromaddress, now);
}
}
-int net_open(struct hostent * host)
+int net_open(struct hostent * hostent)
{
#ifdef ENABLE_IPV6
struct sockaddr_storage name_struct;
net_reset();
- remotesockaddr->sa_family = host->h_addrtype;
+ remotesockaddr->sa_family = hostent->h_addrtype;
- switch ( host->h_addrtype ) {
+ switch ( hostent->h_addrtype ) {
case AF_INET:
sendsock = sendsock4;
recvsock = recvsock4;
- addrcpy( (void *) &(rsa4->sin_addr), host->h_addr, AF_INET );
+ addrcpy( (void *) &(rsa4->sin_addr), hostent->h_addr, AF_INET );
sourceaddress = (ip_t *) &(ssa4->sin_addr);
remoteaddress = (ip_t *) &(rsa4->sin_addr);
break;
}
sendsock = sendsock6;
recvsock = recvsock6;
- addrcpy( (void *) &(rsa6->sin6_addr), host->h_addr, AF_INET6 );
+ addrcpy( (void *) &(rsa6->sin6_addr), hostent->h_addr, AF_INET6 );
sourceaddress = (ip_t *) &(ssa6->sin6_addr);
remoteaddress = (ip_t *) &(rsa6->sin6_addr);
break;
}
/* Address comparison. */
-int addrcmp( char * a, char * b, int af ) {
+int addrcmp( char * a, char * b, int family ) {
int rc = -1;
- switch ( af ) {
+ switch ( family ) {
case AF_INET:
rc = memcmp( a, b, sizeof (struct in_addr) );
break;
}
/* Address copy. */
-void addrcpy( char * a, char * b, int af ) {
+void addrcpy( char * a, char * b, int family ) {
- switch ( af ) {
+ switch ( family ) {
case AF_INET:
memcpy( a, b, sizeof (struct in_addr) );
break;