[pisa-src] r1013 - in trunk: include libpisa pisand test

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 05 Oct 2009 14:44:59 +0200

Author: tjansen
Date: Mon Oct  5 14:44:58 2009
New Revision: 1013

Log:
Removed function pisa_ipv4_dump().

It's a bad idea to write directly to stderr without going through our logging
macros that might redirect output to other sinks than stderr.

Modified:
   trunk/include/global.h
   trunk/libpisa/conmgr.c
   trunk/pisand/ndconf.c
   trunk/pisand/ndconmgr.c
   trunk/pisand/ndctx.c
   trunk/test/sendbures.c

Modified: trunk/include/global.h
==============================================================================
--- trunk/include/global.h      Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/include/global.h      Mon Oct  5 14:44:58 2009        (r1013)
@@ -280,18 +280,6 @@
 } pisa_cert_spki_info;
 
 /**
- * Dump a given ip v4 address
- * @param text text which will be prepended to the dump
- * @param address address which shall be shown
- */
-static inline void pisa_ipv4_dump(const char* text, struct in_addr *address)
-{
-       char buffer[INET_ADDRSTRLEN];
-       inet_ntop(AF_INET, address, buffer, sizeof(buffer));
-       fprintf(stderr,"%s <%s>\n", text, buffer);
-}
-
-/**
  * Copy a IPv4 address
  * @param dst destination
  * @param src source

Modified: trunk/libpisa/conmgr.c
==============================================================================
--- trunk/libpisa/conmgr.c      Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/libpisa/conmgr.c      Mon Oct  5 14:44:58 2009        (r1013)
@@ -161,9 +161,6 @@
 #if 0
 /*
        buildIPs(&entry->serverIpv4address,&entry->clientIpv4address);
-
-       pisa_ipv4_dump("generated server ip - pisa_conmgr_add_pstun", 
&entry->serverIpv4address);
-       pisa_ipv4_dump("generated client ip - pisa_conmgr_add_pstun", 
&entry->clientIpv4address);
 */
        entry->address_control = dubIp6SocketAddress(client_addr);
 

Modified: trunk/pisand/ndconf.c
==============================================================================
--- trunk/pisand/ndconf.c       Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/pisand/ndconf.c       Mon Oct  5 14:44:58 2009        (r1013)
@@ -309,7 +309,6 @@
                myaddr.s_addr = pisa_get_ifaddr(ndconf->ifname_wlan);
                if (myaddr.s_addr) {
                        pisa_ipv4_copy(&ndconf->ipaddr_wlan, &myaddr);
-/*                        pisa_ipv4_dump("my wlan IP address", 
&ndconf->ipaddr_wlan);*/
                } else {
                        memset(&ndconf->ipaddr_wlan, 0, 
sizeof(ndconf->ipaddr_wlan));
                }
@@ -337,7 +336,6 @@
                myaddr.s_addr = pisa_get_ifaddr(ndconf->ifname_eth);
                if (myaddr.s_addr) {
                        pisa_ipv4_copy(&ndconf->ipaddr_eth, &myaddr);
-/*                        pisa_ipv4_dump("my eth IP address", 
&ndconf->ipaddr_eth);*/
                } else {
                        memset(&ndconf->ipaddr_eth, 0, 
sizeof(ndconf->ipaddr_eth));
                }

Modified: trunk/pisand/ndconmgr.c
==============================================================================
--- trunk/pisand/ndconmgr.c     Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/pisand/ndconmgr.c     Mon Oct  5 14:44:58 2009        (r1013)
@@ -189,9 +189,6 @@
        pisa_ipv4_copy(&entry->serverIpv4address, my_addr);
        pisa_ipv4_copy(&entry->clientIpv4address, &client_addr->sin_addr);
 
-       pisa_ipv4_dump("server ip - ndConMgrAdd", &entry->serverIpv4address);
-       pisa_ipv4_dump("client ip - ndConMgrAdd", &entry->clientIpv4address);
-
        entry->praddr.saf = client_addr->sin_family;
        entry->praddr.sa.sa4 = client_addr->sin_addr;
        entry->praddr.port = ntohs(client_addr->sin_port);

Modified: trunk/pisand/ndctx.c
==============================================================================
--- trunk/pisand/ndctx.c        Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/pisand/ndctx.c        Mon Oct  5 14:44:58 2009        (r1013)
@@ -153,11 +153,13 @@
 void show_conf_cnblist(pisa_ll *llist) {
        pisa_ll_node *iter = NULL;
        pisand_clist_entry *entry;
+       char buffer[INET_ADDRSTRLEN];
 
        while ((iter = pisa_ll_iterate(llist, iter)) != NULL) {
                entry = (pisand_clist_entry *)iter->ptr;
+               inet_ntop(AF_INET, &entry->ipaddr, buffer, sizeof(buffer));
                PISA_INFO("ENTRY: SSID = %s\n", entry->ssid);
-               pisa_ipv4_dump("IP address = ", &entry->ipaddr);
+               PISA_INFO("IP address = %s\n", buffer);
        }
 
        return;
@@ -172,11 +174,13 @@
 void show_conf_rnblist(pisa_ll *llist) {
        pisa_ll_node *iter = NULL;
        pisand_rlist_entry *entry;
+       char buffer[INET_ADDRSTRLEN];
 
        while ((iter = pisa_ll_iterate(llist, iter)) != NULL) {
                entry = (pisand_rlist_entry *)iter->ptr;
+               inet_ntop(AF_INET, &entry->ipaddr, buffer, sizeof(buffer));
                PISA_INFO("ENTRY: SSID = %s\n", entry->ssid);
-               pisa_ipv4_dump("IP address = ", &entry->ipaddr);
+               PISA_INFO("IP address = %s\n", buffer);
                PISA_INFO("ENTRY: token = %s\n", entry->token);
        }
 
@@ -421,7 +425,6 @@
                        inet_pton(AF_INET, "10.0.11.1", &dhcp_info->ipaddr_nar);
                }
        }
-       pisa_ipv4_dump("My wireless IP address", &dhcp_info->ipaddr_nar);
 
        /* Assign an IP address for the mobile guest */
        pisa_ipv4_copy(&dhcp_info->ipaddr_client, &dhcp_info->ipaddr_nar);
@@ -430,8 +433,6 @@
         * removed. This has to be fixed properly. Increase the IP address by
         * one. pisasd/sdclients.c should have relevant code*/
 
-       pisa_ipv4_dump("ipaddr assigned to the client", 
&dhcp_info->ipaddr_client);
-
        /* Get the netmask of the wireless interface */
        myaddr.s_addr = pisa_get_ifnetmask(ifname);
        if (myaddr.s_addr) {
@@ -443,7 +444,6 @@
                 */
                inet_pton(AF_INET, "255.255.255.0", &dhcp_info->netmask_client);
        }
-       pisa_ipv4_dump("Netmask of my wireless interface", 
&dhcp_info->netmask_client);
 
        /* Increase the count to be used at the next time */
        ipaddr_count++;

Modified: trunk/test/sendbures.c
==============================================================================
--- trunk/test/sendbures.c      Mon Oct  5 14:20:19 2009        (r1012)
+++ trunk/test/sendbures.c      Mon Oct  5 14:44:58 2009        (r1013)
@@ -104,14 +104,10 @@
 {
        inet_pton(AF_INET, "192.168.6.1", &dhcp_info->ipaddr_nar);
 
-       pisa_ipv4_dump("My wireless IP address", &dhcp_info->ipaddr_nar);
-
        /* Assign an IP address for the mobile guest */
        inet_pton(AF_INET, "192.168.6.101", &dhcp_info->ipaddr_client);
        inet_pton(AF_INET, "255.255.255.0", &dhcp_info->netmask_client);
 
-       pisa_ipv4_dump("Netmask of my wireless interface", 
&dhcp_info->netmask_client);
-
        inet_pton(AF_INET, "192.168.6.1", &dhcp_info->ipaddr_dnssrv);
 
        /* TODO: calculate the more accurate DHCP lease. */

Other related posts:

  • » [pisa-src] r1013 - in trunk: include libpisa pisand test - Thomas Jansen