[hipl-commit] [trunk] Rev 4237: cosmetics: Use the preprocessor instead of comments to disable code (blocks).

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 13 Apr 2010 12:53:35 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 13/04/2010 at 12:53:35
Revision: 4237
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  cosmetics: Use the preprocessor instead of comments to disable code (blocks).

Modified:
  M  firewall/conntrack.c
  M  hipd/cert.c
  M  hipd/hadb.c
  M  hipd/hi3.c
  M  hipd/maintenance.c
  M  hipd/update.c
  M  hipd/user.c
  M  i3/chord/util.c
  M  i3/utils/inetfns.c
  M  lib/core/state.h
  M  lib/gui/create.c
  M  lib/gui/tools.c
  M  lib/tool/pk.c
  M  test/conntest-client-hip.c

=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-04-09 17:56:34 +0000
+++ firewall/conntrack.c        2010-04-13 09:52:59 +0000
@@ -54,18 +54,21 @@
 unsigned long timeoutValue = 0;
 
 /*------------print functions-------------*/
-/*void print_data(struct hip_data * data)
- * {
- * char src[INET6_ADDRSTRLEN];
- * char dst[INET6_ADDRSTRLEN];
- * hip_in6_ntop(&data->src_hit, src);
- * hip_in6_ntop(&data->dst_hit, dst);
- * HIP_DEBUG("hip data: src %s dst %s\n", src, dst);
- * if(data->src_hi == NULL)
- *  HIP_DEBUG("no hi\n");
- * else
- *  HIP_DEBUG("hi\n");
- * } */
+#if 0
+static void print_data(struct hip_data *data)
+{
+    char src[INET6_ADDRSTRLEN];
+    char dst[INET6_ADDRSTRLEN];
+    hip_in6_ntop(&data->src_hit, src);
+    hip_in6_ntop(&data->dst_hit, dst);
+    HIP_DEBUG("hip data: src %s dst %s\n", src, dst);
+    if (data->src_hi == NULL) {
+        HIP_DEBUG("no hi\n");
+    } else {
+        HIP_DEBUG("hi\n");
+    }
+}
+#endif
 
 /**
  * prints out the list of addresses of esp_addr_list
@@ -183,10 +186,11 @@
 static struct hip_data *get_hip_data(const struct hip_common *common)
 {
     struct hip_data *data = NULL;
-    /*struct in6_addr hit;
-     * struct hip_host_id * host_id = NULL;
-     * int err = 0;
-     * int len = 0;*/
+#if 0
+    struct in6_addr hit;
+    struct hip_host_id * host_id = NULL;
+    int err = 0, len = 0;
+#endif
 
     // init hip_data for this tuple
     data = (struct hip_data *) malloc(sizeof(struct hip_data));
@@ -1131,10 +1135,13 @@
 
     // store in tuple of other direction that will be using
     // this spi and dst address
-    /*if(tuple->direction == ORIGINAL_DIR)
-     * other_dir = &tuple->connection->reply;
-     * else
-     * other_dir = &tuple->connection->original;*/
+#if 0
+    if (tuple->direction == ORIGINAL_DIR) {
+        other_dir = &tuple->connection->reply;
+    } else {
+        other_dir = &tuple->connection->original;
+    }
+#endif
 
 out_err:
     return err;
@@ -1213,10 +1220,13 @@
 
     // TEST_END
 
-    /*if(tuple->direction == ORIGINAL_DIR)
-     * other_dir = &tuple->connection->reply;
-     * else
-     * other_dir = &tuple->connection->original;*/
+#if 0
+    if (tuple->direction == ORIGINAL_DIR) {
+        other_dir = &tuple->connection->reply;
+    } else {
+        other_dir = &tuple->connection->original;
+    }
+#endif
 
     if (esp_relay && ctx->udp_encap_hdr) {
         HIP_IFEL(hipfw_handle_relay_to_r2(common, ctx),

=== modified file 'hipd/cert.c'
--- hipd/cert.c 2010-04-09 16:24:44 +0000
+++ hipd/cert.c 2010-04-13 09:52:59 +0000
@@ -275,11 +275,13 @@
     }
 
     /* openssl structs */
-/*        if (algo == HIP_HI_RSA) {
- *              if (rsa) RSA_free(rsa);
- *      } else if(algo == HIP_HI_DSA) {
- *              if (dsa) DSA_free(dsa);
- *      }*/
+#if 0
+    if (algo == HIP_HI_RSA && rsa) {
+        RSA_free(rsa);
+    } else if (algo == HIP_HI_DSA && dsa) {
+        DSA_free(dsa);
+    }
+#endif
 
     /* RSA pubkey */
     if (e_bin) {

=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2010-04-09 16:24:44 +0000
+++ hipd/hadb.c 2010-04-13 09:52:59 +0000
@@ -790,10 +790,11 @@
     HIP_IFEL(hip_hadb_set_handle_function_set(entry,
                                               &default_handle_func_set),
              -1, "Can't set new function pointer set.\n");
-    /*HIP_IFEL(hip_hadb_set_update_function_set(entry,
-     *                                        &default_update_func_set),
-     *       -1, "Can't set new function pointer set\n");*/
-
+#if 0
+    HIP_IFEL(hip_hadb_set_update_function_set(entry,
+                                              &default_update_func_set),
+             -1, "Can't set new function pointer set\n");
+#endif
     HIP_IFEL(hip_hadb_set_misc_function_set(entry, &default_misc_func_set),
              -1, "Can't set new function pointer set.\n");
 
@@ -1294,13 +1295,15 @@
     /* insert your alternative function sets here!*/
 
     /* initialize default function pointer sets for update functions*/
-    /*default_update_func_set.hip_handle_update_plain_locator  = 
hip_handle_update_plain_locator_old;
-     * default_update_func_set.hip_handle_update_addr_verify   = 
hip_handle_update_addr_verify_old;
-     * default_update_func_set.hip_update_handle_ack           = 
hip_update_handle_ack_old;
-     * default_update_func_set.hip_handle_update_established   = 
hip_handle_update_established_old;
-     * default_update_func_set.hip_handle_update_rekeying      = 
hip_handle_update_rekeying_old;
-     * default_update_func_set.hip_update_send_addr_verify     = 
hip_update_send_addr_verify_deprecated;
-     * default_update_func_set.hip_update_send_echo            = 
hip_update_send_echo_old;*/
+#if 0
+    default_update_func_set.hip_handle_update_plain_locator  = 
hip_handle_update_plain_locator_old;
+    default_update_func_set.hip_handle_update_addr_verify    = 
hip_handle_update_addr_verify_old;
+    default_update_func_set.hip_update_handle_ack            = 
hip_update_handle_ack_old;
+    default_update_func_set.hip_handle_update_established    = 
hip_handle_update_established_old;
+    default_update_func_set.hip_handle_update_rekeying       = 
hip_handle_update_rekeying_old;
+    default_update_func_set.hip_update_send_addr_verify      = 
hip_update_send_addr_verify_deprecated;
+    default_update_func_set.hip_update_send_echo             = 
hip_update_send_echo_old;
+#endif
 
     /* xmit function set */
 #ifdef CONFIG_HIP_I3
@@ -2200,9 +2203,13 @@
 
     HIP_DEBUG("New inbound SA created with SPI=0x%x\n", new_spi_in);
 
-    /*HIP_IFEL(ha->hadb_ipsec_func->hip_setup_hit_sp_pair(&ha->hit_our,
-     *      &ha->hit_peer, src_addr, dst_addr, IPPROTO_ESP, 1, 0), -1,
-     *       "Setting up SP pair failed\n");      */
+#if 0
+    HIP_IFEL(ha->hadb_ipsec_func->hip_setup_hit_sp_pair(&ha->hit_our,
+                                                        &ha->hit_peer, 
src_addr,
+                                                        dst_addr, IPPROTO_ESP,
+                                                        1, 0),
+             -1, "Setting up SP pair failed\n");
+#endif
 
     // Create a new outbound SA
     HIP_DEBUG("Creating a new outbound SA, SPI=0x%x\n", new_spi_out);

=== modified file 'hipd/hi3.c'
--- hipd/hi3.c  2010-04-10 09:12:33 +0000
+++ hipd/hi3.c  2010-04-13 09:52:59 +0000
@@ -121,13 +121,15 @@
     _HIP_HEXDUMP("HIP PACKET", hip_common,
                  hip_get_msg_total_len(hip_common));
 
-    /*        if (hip_verify_network_header(hip_common,
-     *                            (struct sockaddr *)&src,
-     *                            (struct sockaddr *)&dst,
-     *                            len)) {
-     *      HIP_ERROR("Verifying of the network header failed\n");
-     *      goto out_err;
-     *      }*/
+#if 0
+    if (hip_verify_network_header(hip_common,
+                                  (struct sockaddr *)&src,
+                                  (struct sockaddr *)&dst,
+                                  len)) {
+        HIP_ERROR("Verifying of the network header failed\n");
+        goto out_err;
+    }
+#endif
 
     if (hip_check_network_msg(hip_common)) {
         HIP_ERROR("HIP packet is invalid\n");
@@ -209,12 +211,16 @@
 {
     Key key[HI3_TRIGGER_MAX];
     int i;
-//  hip_hit_t peer_hit;
-
-    // hip_get_default_hit(&peer_hit);
-    // hip_i3_init(/*&peer_hit*/);
-    // hi3_pub_tr_count = 1;
-    // memcpy(&hi3_pub_id[0], &peer_hit, sizeof(hip_hit_t));
+
+#if 0
+    hip_hit_t peer_hit;
+
+    hip_get_default_hit(&peer_hit);
+    hip_i3_init(/*&peer_hit*/);
+    hi3_pub_tr_count = 1;
+    memcpy(&hi3_pub_id[0], &peer_hit, sizeof(hip_hit_t));
+#endif
+
     hip_for_each_hi(hip_hi3_add_pub_trigger_id, &hi3_pub_tr_count );
 
     for (i = 0; i < hi3_pub_tr_count; i++) {

=== modified file 'hipd/maintenance.c'
--- hipd/maintenance.c  2010-04-09 15:20:38 +0000
+++ hipd/maintenance.c  2010-04-13 09:52:59 +0000
@@ -195,10 +195,11 @@
     struct hip_common *msg = NULL;
     int n;
 
-/*if (!hip_agent_is_alive())
- *      {
- *              return (-ENOENT);
- *      }*/
+#if 0
+    if (!hip_agent_is_alive()) {
+        return (-ENOENT);
+    }
+#endif
 
     msg = malloc(HIP_MAX_PACKET);
     if (!msg) {

=== modified file 'hipd/update.c'
--- hipd/update.c       2010-04-09 16:24:44 +0000
+++ hipd/update.c       2010-04-13 09:52:59 +0000
@@ -423,18 +423,18 @@
             break;
         }
     }
+#if 0
     // TODO
-    /*else
-     * {
-     *  for go through all local addressses
-     *  {
-     *      for go through all peer addresses
-     *      {
-     *          if (check_if_address_peer_ok)
-     *              send_update_pkt()
-     *      }
-     *  }
-     * }*/
+    else {
+        for (go through all local addresses) {
+            for (go through all peer addresses) {
+                if (check_if_address_peer_ok) {
+                    send_update_pkt();
+                }
+            }
+        }
+    }
+#endif
 
 out_err:
     if (update_packet_to_send) {

=== modified file 'hipd/user.c'
--- hipd/user.c 2010-04-09 15:20:38 +0000
+++ hipd/user.c 2010-04-13 09:52:59 +0000
@@ -403,21 +403,23 @@
         }
         HIP_DEBUG("Building gw_info complete\n");
 
-        /* NOT the way to do this
-         * int err_value = 0;
-         * if(hip_opendht_inuse != HIP_MSG_DHT_ON){
-         *      err_value = 5;
-         *      hip_build_param_contents(msg, &err_value,
-         *                       HIP_PARAM_INT, sizeof(int));
-         * }else if((opendht_serving_gateway == NULL) ||
-         *       (opendht_serving_gateway->ai_addr == NULL)){
-         *      err_value = 4;
-         *      hip_build_param_contents(msg, &err_value,
-         *                       HIP_PARAM_INT, sizeof(int));
-         * }else{
-         *      err = hip_get_dht_mapping_for_HIT_msg(msg);
-         * }
-         */
+#if 0
+        /* NOT the way to do this */
+        int err_value = 0;
+        if (hip_opendht_inuse != HIP_MSG_DHT_ON){
+            err_value = 5;
+            hip_build_param_contents(msg, &err_value,
+                                     HIP_PARAM_INT, sizeof(int));
+        } else if ((opendht_serving_gateway          == NULL) ||
+                   (opendht_serving_gateway->ai_addr == NULL)) {
+            err_value = 4;
+            hip_build_param_contents(msg, &err_value,
+                                     HIP_PARAM_INT, sizeof(int));
+        } else {
+            err = hip_get_dht_mapping_for_HIT_msg(msg);
+        }
+#endif
+
     }
     break;
     case HIP_MSG_DHT_SET:

=== modified file 'i3/chord/util.c'
--- i3/chord/util.c     2010-03-29 17:50:59 +0000
+++ i3/chord/util.c     2010-04-13 09:52:59 +0000
@@ -266,12 +266,13 @@
 /**********************************************************************/
 
 /* greater: a>b? */
-/*
- * static int is_greater(chordID *a, chordID *b)
- * {
- *  return memcmp(a->x, b->x, sizeof(chordID)) > 0;
- * }
- */
+
+#if 0
+static int is_greater(chordID *a, chordID *b)
+{
+    return memcmp(a->x, b->x, sizeof(chordID)) > 0;
+}
+#endif
 
 /* less: a<b? */
 static int is_less(chordID *a, chordID *b)

=== modified file 'i3/utils/inetfns.c'
--- i3/utils/inetfns.c  2010-03-29 17:50:59 +0000
+++ i3/utils/inetfns.c  2010-04-13 09:52:59 +0000
@@ -299,56 +299,60 @@
     return ret;
 }
 
-/*
- * uint32_t get_local_addr(void)
- * {
- *  // - retrieve information about all network adapters
- *  // - look for the first non-loopback interface
- *  DWORD err = 0;
- *  PIP_ADAPTER_ADDRESSES addresses = NULL;
- *  ULONG size;
- *  uint32_t lb_addr, ret_val;
- *
- *  lb_addr = inet_addr("127.0.0.1");
- *
- *  // allocate a Real Large Buffer hoping that it's big enough
- *  size = sizeof(IP_ADAPTER_ADDRESSES) * 64;
- *  addresses = (PIP_ADAPTER_ADDRESSES)calloc(size, 1);
- *  assert(NULL != addresses);
- *
- *  err = GetAdaptersAddresses(AF_INET, GAA_FLAG_SKIP_ANYCAST || 
GAA_FLAG_SKIP_FRIENDLY_NAME || GAA_FLAG_SKIP_MULTICAST || 
GAA_FLAG_SKIP_DNS_SERVER, NULL, addresses, &size);
- *  switch(err)
- *  {
- *      case ERROR_SUCCESS:
- *          while (NULL != addresses) {
- *              PIP_ADAPTER_UNICAST_ADDRESS addr = 
addresses->FirstUnicastAddress;
- *              while (NULL != addr) {
- *                  if (AF_INET == addr->Address.lpSockaddr->sa_family && 
((SOCKADDR_IN*)addr->Address.lpSockaddr)->sin_addr.S_un.S_addr != lb_addr) {
- *                      ret_val = 
((SOCKADDR_IN*)addr->Address.lpSockaddr)->sin_addr.S_un.S_addr;
- *                      free(addresses);
- *                      return ret_val;
- *                  }
- *                  addr = addr->Next;
- *              }
- *              addresses = addresses->Next;
- *          }
- *          break;
- *      case ERROR_NOT_ENOUGH_MEMORY:
- *          weprintf("GetAdaptersAddresses returned NOT ENOUGH MEMORY!");
- *          break;
- *      case ERROR_BUFFER_OVERFLOW:
- *          weprintf("GetAdaptersAddresses returned BUFFER OVERFLOW\n");
- *          break;
- *      case ERROR_INVALID_PARAMETER:
- *          weprintf("GetAdaptersAddresses returned INVALID PARAMETER\n");
- *          break;
- *      default:
- *          weprintf("GetAdaptersAddresses returned unknown return code\n");
- *          break;
- *  }
- *  free(addresses);
- *  return 0;
- * }
- */
+#if 0
+uint32_t get_local_addr(void)
+{
+    // - retrieve information about all network adapters
+    // - look for the first non-loopback interface
+    DWORD err = 0;
+    PIP_ADAPTER_ADDRESSES addresses = NULL;
+    ULONG size;
+    uint32_t lb_addr, ret_val;
+
+    lb_addr = inet_addr("127.0.0.1");
+
+    // allocate a Real Large Buffer hoping that it's big enough
+    size = sizeof(IP_ADAPTER_ADDRESSES) * 64;
+    addresses = (PIP_ADAPTER_ADDRESSES)calloc(size, 1);
+    assert(NULL != addresses);
+
+    err = GetAdaptersAddresses(AF_INET, GAA_FLAG_SKIP_ANYCAST ||
+                                        GAA_FLAG_SKIP_FRIENDLY_NAME ||
+                                        GAA_FLAG_SKIP_MULTICAST ||
+                                        GAA_FLAG_SKIP_DNS_SERVER,
+                               NULL, addresses, &size);
+    switch(err) {
+    case ERROR_SUCCESS:
+        while (NULL != addresses) {
+            PIP_ADAPTER_UNICAST_ADDRESS addr = addresses->FirstUnicastAddress;
+            while (NULL != addr) {
+                if (AF_INET == addr->Address.lpSockaddr->sa_family &&
+                    
((SOCKADDR_IN*)addr->Address.lpSockaddr)->sin_addr.S_un.S_addr != lb_addr) {
+                    ret_val = 
((SOCKADDR_IN*)addr->Address.lpSockaddr)->sin_addr.S_un.S_addr;
+                    free(addresses);
+                    return ret_val;
+                }
+                addr = addr->Next;
+            }
+            addresses = addresses->Next;
+        }
+        break;
+    case ERROR_NOT_ENOUGH_MEMORY:
+        weprintf("GetAdaptersAddresses returned NOT ENOUGH MEMORY!");
+        break;
+    case ERROR_BUFFER_OVERFLOW:
+        weprintf("GetAdaptersAddresses returned BUFFER OVERFLOW\n");
+        break;
+    case ERROR_INVALID_PARAMETER:
+        weprintf("GetAdaptersAddresses returned INVALID PARAMETER\n");
+        break;
+    default:
+        weprintf("GetAdaptersAddresses returned unknown return code\n");
+        break;
+    }
+    free(addresses);
+    return 0;
+}
+#endif /* 0 */
 
 #endif //_WIN32

=== modified file 'lib/core/state.h'
--- lib/core/state.h    2010-03-24 11:06:15 +0000
+++ lib/core/state.h    2010-04-13 09:52:59 +0000
@@ -657,42 +657,43 @@
                                 hip_ha_t *entry);
 };
 
-/*
- * struct hip_hadb_update_func_set{
- *      int (*hip_handle_update_plain_locator)(hip_ha_t *entry,
- *                                             struct hip_common *msg,
- *                                             struct in6_addr *src_ip,
- *                                             struct in6_addr *dst_ip,
- *                                             struct hip_esp_info *esp_info,
- *                                             struct hip_seq *seq);
- *
- *      int (*hip_handle_update_addr_verify)(hip_ha_t *entry,
- *                                           struct hip_common *msg,
- *                                           struct in6_addr *src_ip,
- *                                           struct in6_addr *dst_ip);
- *
- *      void (*hip_update_handle_ack)(hip_ha_t *entry,
- *                                    struct hip_ack *ack,
- *                                    int have_nes);
- *
- *      int (*hip_handle_update_established)(hip_ha_t *entry,
- *                                           struct hip_common *msg,
- *                                           struct in6_addr *src_ip,
- *                                           struct in6_addr *dst_ip,
- *                                           hip_portpair_t *);
- *      int (*hip_handle_update_rekeying)(hip_ha_t *entry,
- *                                        struct hip_common *msg,
- *                                        struct in6_addr *src_ip);
- *
- *      int (*hip_update_send_addr_verify)(hip_ha_t *entry,
- *                                         struct hip_common *msg,
- *                                         struct in6_addr *src_ip,
- *                                         uint32_t spi);
- *
- *      int (*hip_update_send_echo)(hip_ha_t *entry,
- *                                  uint32_t spi_out,
- *                                  struct hip_peer_addr_list_item *addr);
- * };*/
+#if 0
+struct hip_hadb_update_func_set {
+    int (*hip_handle_update_plain_locator)(hip_ha_t *entry,
+                                           struct hip_common *msg,
+                                           struct in6_addr *src_ip,
+                                           struct in6_addr *dst_ip,
+                                           struct hip_esp_info *esp_info,
+                                           struct hip_seq *seq);
+
+    int (*hip_handle_update_addr_verify)(hip_ha_t *entry,
+                                         struct hip_common *msg,
+                                         struct in6_addr *src_ip,
+                                         struct in6_addr *dst_ip);
+
+    void (*hip_update_handle_ack)(hip_ha_t *entry,
+                                  struct hip_ack *ack,
+                                  int have_nes);
+
+    int (*hip_handle_update_established)(hip_ha_t *entry,
+                                         struct hip_common *msg,
+                                         struct in6_addr *src_ip,
+                                         struct in6_addr *dst_ip,
+                                         hip_portpair_t *);
+    int (*hip_handle_update_rekeying)(hip_ha_t *entry,
+                                      struct hip_common *msg,
+                                      struct in6_addr *src_ip);
+
+    int (*hip_update_send_addr_verify)(hip_ha_t *entry,
+                                       struct hip_common *msg,
+                                       struct in6_addr *src_ip,
+                                       uint32_t spi);
+
+    int (*hip_update_send_echo)(hip_ha_t *entry,
+                                uint32_t spi_out,
+                                struct hip_peer_addr_list_item *addr);
+};
+#endif
 
 struct hip_hadb_misc_func_set {
     uint64_t (*hip_solve_puzzle)(void *puzzle,

=== modified file 'lib/gui/create.c'
--- lib/gui/create.c    2010-03-18 21:15:21 +0000
+++ lib/gui/create.c    2010-04-13 09:52:59 +0000
@@ -913,30 +913,31 @@
     gtk_box_pack_start(GTK_BOX(vb2), hb, FALSE, FALSE, 1);
     gtk_widget_show(GTK_WIDGET(hb));
 
-/*      w = gtk_label_new(lang_get("nhdlg-url"));
- *      gtk_box_pack_start(GTK_BOX(hb), w, FALSE, FALSE, 5);
- *      gtk_widget_show(GTK_WIDGET(w));
- *      w = gtk_entry_new();
- *      gtk_entry_set_text(GTK_ENTRY(w), "");
- *      gtk_box_pack_start(GTK_BOX(hb), w, TRUE, TRUE, 5);
- *      gtk_entry_set_max_length(GTK_ENTRY(w), MAX_URL_LEN);
- *      gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
- *      gtk_widget_show(GTK_WIDGET(w));
- *      widget_set(ID_NH_URL, w);
- */
-
-/*      w = gtk_label_new(lang_get("nhdlg-port"));
- *      gtk_box_pack_start(GTK_BOX(hb), w, FALSE, FALSE, 5);
- *      gtk_widget_show(GTK_WIDGET(w));
- *      w = gtk_entry_new();
- *      gtk_entry_set_text(GTK_ENTRY(w), "0");
- *      gtk_box_pack_start(GTK_BOX(hb), w, FALSE, TRUE, 5);
- *      gtk_widget_set_size_request(GTK_WIDGET(w), 70, -1);
- *      gtk_entry_set_max_length(GTK_ENTRY(w), 8);
- *      gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
- *      gtk_widget_show(GTK_WIDGET(w));
- *      widget_set(ID_NH_PORT, w);
- */
+#if 0
+    w = gtk_label_new(lang_get("nhdlg-url"));
+    gtk_box_pack_start(GTK_BOX(hb), w, FALSE, FALSE, 5);
+    gtk_widget_show(GTK_WIDGET(w));
+    w = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(w), "");
+    gtk_box_pack_start(GTK_BOX(hb), w, TRUE, TRUE, 5);
+    gtk_entry_set_max_length(GTK_ENTRY(w), MAX_URL_LEN);
+    gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
+    gtk_widget_show(GTK_WIDGET(w));
+    widget_set(ID_NH_URL, w);
+
+
+    w = gtk_label_new(lang_get("nhdlg-port"));
+    gtk_box_pack_start(GTK_BOX(hb), w, FALSE, FALSE, 5);
+    gtk_widget_show(GTK_WIDGET(w));
+    w = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(w), "0");
+    gtk_box_pack_start(GTK_BOX(hb), w, FALSE, TRUE, 5);
+    gtk_widget_set_size_request(GTK_WIDGET(w), 70, -1);
+    gtk_entry_set_max_length(GTK_ENTRY(w), 8);
+    gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
+    gtk_widget_show(GTK_WIDGET(w));
+    widget_set(ID_NH_PORT, w);
+#endif
 
     frame = gtk_frame_new(NULL);
     gtk_frame_set_label(GTK_FRAME(frame), lang_get("nhdlg-g-info"));

=== modified file 'lib/gui/tools.c'
--- lib/gui/tools.c     2010-04-07 13:56:32 +0000
+++ lib/gui/tools.c     2010-04-13 09:52:59 +0000
@@ -972,10 +972,12 @@
             NAMECPY(ud.old_name, r->name);
             NAMECPY(ud.new_name, str);
             NAMECPY(r->name, str);
-/*                      ps = (char 
*)gtk_entry_get_text(GTK_ENTRY(widget(ID_TWR_URL)));
- *                      URLCPY(r->url, ps);
- *                      ps = (char 
*)gtk_entry_get_text(GTK_ENTRY(widget(ID_TWR_PORT)));
- *                      URLCPY(r->port, ps);*/
+#if 0
+            ps = (char *) gtk_entry_get_text(GTK_ENTRY(widget(ID_TWR_URL)));
+            URLCPY(r->url, ps);
+            ps = (char *) gtk_entry_get_text(GTK_ENTRY(widget(ID_TWR_PORT)));
+            URLCPY(r->port, ps);
+#endif
 
             ud.depth         = 2;
             ud.indices_first = -1;

=== modified file 'lib/tool/pk.c'
--- lib/tool/pk.c       2010-04-09 17:56:34 +0000
+++ lib/tool/pk.c       2010-04-13 09:52:59 +0000
@@ -178,15 +178,17 @@
 
     ipv6_addr_copy(&msg->hitr, &tmpaddr);
 
-    /*switch(err) {
-     * case 0:
-     *  err = 0;
-     *  break;
-     * case 1:
-     * default:
-     *  err = -1;
-     *  break;
-     * }*/
+#if 0
+    switch (err) {
+    case 0:
+        err = 0;
+        break;
+    case 1:
+    default:
+        err = -1;
+        break;
+    }
+#endif
 
     if (err) {
         err = -1;

=== modified file 'test/conntest-client-hip.c'
--- test/conntest-client-hip.c  2010-04-09 16:24:44 +0000
+++ test/conntest-client-hip.c  2010-04-13 09:52:59 +0000
@@ -80,14 +80,15 @@
     port = atoi(argv[3]);
 
     /* Disabled since this comparison is always true with the current
-     * port number boundaries.
-     * if(port < MINPORTNUM || port > MAXPORTNUM){
-     *      HIP_INFO("Invalid port number, allowed port numbers are "\
-     *               "from %d to %d.\n%s\n", MINPORTNUM, MAXPORTNUM,
-     *               usage);
-     *      return EXIT_FAILURE;
-     * }
-     */
+     * port number boundaries. */
+#if 0
+    if (port < MINPORTNUM || port > MAXPORTNUM) {
+        HIP_INFO("Invalid port number, allowed port numbers are "
+                 "from %d to %d.\n%s\n", MINPORTNUM, MAXPORTNUM,
+                 usage);
+        return EXIT_FAILURE;
+     }
+#endif
 
     HIP_INFO("=== Testing %s connection to '%s' on port %s ===\n",
              (socktype == SOCK_STREAM ? "TCP" : "UDP"), argv[1],

Other related posts:

  • » [hipl-commit] [trunk] Rev 4237: cosmetics: Use the preprocessor instead of comments to disable code (blocks). - Diego Biurrun