[hipl-commit] [trunk] Rev 4245: dead code removal: part V (hipd subdirectory)

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 13 Apr 2010 14:10:50 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 13/04/2010 at 14:10:50
Revision: 4245
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  dead code removal: part V (hipd subdirectory)

Modified:
  M  hipd/blind.c
  M  hipd/bos.c
  M  hipd/cert.c
  M  hipd/close.c
  M  hipd/esp_prot_hipd_msg.c
  M  hipd/hadb.c
  M  hipd/hadb.h
  M  hipd/hadb_legacy.c
  M  hipd/hi3.c
  M  hipd/hidb.c
  M  hipd/hipd.c
  M  hipd/hiprelay.c
  M  hipd/init.c
  M  hipd/init.h
  M  hipd/input.c
  M  hipd/oppdb.c
  M  hipd/oppdb.h
  M  hipd/oppipdb.c
  M  hipd/output.c
  M  hipd/update.c

=== modified file 'hipd/blind.c'
--- hipd/blind.c        2010-04-13 10:36:12 +0000
+++ hipd/blind.c        2010-04-13 11:10:38 +0000
@@ -368,16 +368,6 @@
     char *enc_in_msg  = NULL, *host_id_in_enc = NULL;
     unsigned char *iv = NULL;
 
-    HIP_DEBUG("/n");
-
-    /*
-     *mask |= HIP_PACKET_CTRL_BLIND;
-     *
-     * // Build network header by using blinded HITs
-     * entry->hadb_misc_func->
-     * hip_build_network_hdr(r2, HIP_R2, *mask, &entry->hit_our_blind,
-     * &entry->hit_peer_blind);*/
-
     /************ Encrypted ***********/
     switch (entry->hip_transform) {
     case HIP_HIP_AES_SHA1:
@@ -646,25 +636,6 @@
     hip_get_active_services(service_list, &service_count);
     hip_build_param_reg_info(msg, service_list, service_count);
 
-    /*
-     * int *list;
-     * int count = 0;
-     *
-     * count = hip_get_services_list(&list);
-     *
-     * HIP_DEBUG("Amount of services is %d.\n", count);
-     *
-     * int i;
-     * for (i = 0; i < count; i++) {
-     * HIP_DEBUG("Service is %d.\n", list[i]);
-     * }
-     *
-     * if (count > 0) {
-     * HIP_DEBUG("Adding REG_INFO parameter.\n");
-     * HIP_IFEL(hip_build_param_reg_info(msg,  0, 0, list, count), -1,
-     * "Building of reg_info failed\n");
-     * }*/
-
     /********** ECHO_REQUEST_SIGN (OPTIONAL) *********/
 
     //HIP_HEXDUMP("Pubkey:", host_id_pub, 
hip_get_param_total_len(host_id_pub));

=== modified file 'hipd/bos.c'
--- hipd/bos.c  2010-04-09 15:20:38 +0000
+++ hipd/bos.c  2010-04-13 11:10:38 +0000
@@ -226,7 +226,6 @@
     int err = 0, len;
     struct hip_host_id *peer_host_id;
     hip_lsi_t lsi;
-    //struct hip_lhi peer_lhi;
     struct in6_addr peer_hit;
     char *str;
     struct in6_addr *dstip;

=== modified file 'hipd/cert.c'
--- hipd/cert.c 2010-04-13 09:52:59 +0000
+++ hipd/cert.c 2010-04-13 11:10:38 +0000
@@ -1045,8 +1045,6 @@
     if (extlist != NULL) {
         sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free);
     }
-    //BIO_flush(out);
-    //BIO_free_all(out);
 
     return err;
 }

=== modified file 'hipd/close.c'
--- hipd/close.c        2010-04-09 17:56:34 +0000
+++ hipd/close.c        2010-04-13 11:10:38 +0000
@@ -333,7 +333,6 @@
     if (entry) {
         /* XX CHECK: is the put done twice? once already in handle? */
         HIP_UNLOCK_HA(entry);
-        /* hip_put_ha(entry); */
     }
 out_err:
     return err;
@@ -389,13 +388,6 @@
     HIP_IFEL(hip_del_peer_info(&entry->hit_our, &entry->hit_peer), -1,
              "Deleting peer info failed\n");
 
-    //hip_hadb_remove_state(entry);
-    //hip_delete_esp(entry);
-
-    /* by now, if everything is according to plans, the refcnt should
-     * be 1 */
-    /* hip_put_ha(entry); */
-
 #ifdef CONFIG_HIP_PERFORMANCE
     HIP_DEBUG("Stop and write PERF_HANDLE_CLOSE_ACK, PERF_CLOSE_COMPLETE\n");
     hip_perf_stop_benchmark( perf_set, PERF_HANDLE_CLOSE_ACK );

=== modified file 'hipd/esp_prot_hipd_msg.c'
--- hipd/esp_prot_hipd_msg.c    2010-04-09 16:24:44 +0000
+++ hipd/esp_prot_hipd_msg.c    2010-04-13 11:10:38 +0000
@@ -1099,7 +1099,6 @@
                 HIP_DEBUG("esp prot active peer anchors match\n");
 
                 // set the update anchor as the peer's update anchor
-                //memset(entry->esp_peer_update_anchor, 0, MAX_HASH_LENGTH);
                 memcpy(&entry->esp_peer_update_anchors[i][0], 
&prot_anchor->anchors[hash_length],
                        hash_length);
                 HIP_DEBUG("peer_update_anchor set\n");
@@ -1125,7 +1124,6 @@
                        hash_length);
 
                 // set the update anchor as the peer's update anchor
-                //memset(entry->esp_peer_update_anchor, 0, MAX_HASH_LENGTH);
                 memcpy(&entry->esp_peer_update_anchors[i][0], 
&prot_anchor->anchors[hash_length],
                        hash_length);
                 HIP_DEBUG("peer_update_anchor set\n");
@@ -1147,7 +1145,6 @@
                 /**** received newer update for active anchor ****/
 
                 // set the update anchor as the peer's update anchor
-                //memset(entry->esp_peer_update_anchor, 0, MAX_HASH_LENGTH);
                 memcpy(&entry->esp_peer_update_anchors[i][0],
                        &prot_anchor->anchors[hash_length],
                        hash_length);

=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2010-04-13 10:49:46 +0000
+++ hipd/hadb.c 2010-04-13 11:10:38 +0000
@@ -194,16 +194,12 @@
  */
 hip_ha_t *hip_hadb_find_byhits(const hip_hit_t *hit, const hip_hit_t *hit2)
 {
-    //int n = 0;
     hip_ha_t ha, *ret;
     memcpy(&ha.hit_our, hit, sizeof(hip_hit_t));
     memcpy(&ha.hit_peer, hit2, sizeof(hip_hit_t));
     HIP_DEBUG_HIT("HIT1", hit);
     HIP_DEBUG_HIT("HIT2", hit2);
 
-    //HIP_DEBUG("----------Checking database-----------------\n");
-    //hip_for_each_ha(hip_print_info_hadb, &n);
-    //HIP_DEBUG("----------End Checking database-----------------\n");
     ret = hip_ht_find(hadb_hit, &ha);
     if (!ret) {
         memcpy(&ha.hit_peer, hit, sizeof(hip_hit_t));
@@ -335,7 +331,6 @@
             HIP_DEBUG("HIP association was inserted " \
                       "successfully.\n");
         } else {
-            /* hip_db_put_ha(tmp, hip_hadb_delete_state); */
             HIP_DEBUG("HIP association was NOT inserted because " \
                       "a HIP association with matching HITs was " \
                       "already present in the database.\n");
@@ -434,7 +429,6 @@
     entry = hip_hadb_find_byhits(local_hit, peer_hit);
 
     if (entry) {
-        // hip_hadb_dump_spis_out_old(entry);
         HIP_DEBUG_LSI("    Peer lsi   ", &entry->lsi_peer);
 
 #if 0 /* Required for OpenDHT code of Pardeep?  */
@@ -767,17 +761,10 @@
     int err = 0;
     HIP_IFEL(!entry, -1, "HA is NULL\n");
 
-#if 0
-    INIT_LIST_HEAD(&entry->next_hit);
-    INIT_LIST_HEAD(&entry->spis_in_old);
-    INIT_LIST_HEAD(&entry->spis_out_old);
-#endif
-
 #ifdef CONFIG_HIP_HIPPROXY
     entry->hipproxy = 0;
 #endif
     //HIP_LOCK_INIT(entry);
-    //atomic_set(&entry->refcnt,0);
 
     entry->state         = HIP_STATE_UNASSOCIATED;
     entry->hastate       = HIP_HASTATE_INVALID;
@@ -929,10 +916,8 @@
 int hip_hadb_get_peer_addr(hip_ha_t *entry, struct in6_addr *addr)
 {
     int err = 0;
-    // struct hip_spi_out_item *spi_out;
 
     /* assume already locked entry */
-
     HIP_DEBUG_HIT("entry def addr", &entry->peer_addr);
     ipv6_addr_copy(addr, &entry->peer_addr);
     return err;
@@ -1802,10 +1787,6 @@
     /*For some reason this gives negative result*/
     //hip_timeval_diff(&entry->bex_start, &entry->bex_end, &hid.bex_duration);
 
-    // struct timeval * duration = hip_get_duration(entry->bex_start, 
entry->bex_end);
-    // HIP_ASSERT(duration != NULL);
-    // memcpy(&hid.bex_duration,  duration, sizeof(struct timeval));
-
     _HIP_HEXDUMP("HEXHID ", &hid, sizeof(struct hip_hadb_user_info_state));
 
     hid.nat_udp_port_peer  = entry->peer_udp_port;
@@ -1920,41 +1901,14 @@
                                       hip_hit_t *peer_blind_hit)
 {
     int err          = 0;
-    /* int i = 0; */
-    /* hip_ha_t *this = NULL, *tmp = NULL; */
     hip_ha_t *result = NULL;
 
-    /*
-     * This loop is disabled since &hadb_byhit[i] does not exist anymore and
-     * the code won't compile with CONFIG_HIP_BLIND flag set.
-     * -Lauri 22.07.2008
-     * for(i = 0; i < HIP_HADB_SIZE; i++) {
-     *
-     * list_for_each_entry_safe(this, tmp, &hadb_byhit[i], next_hit)
-     * {
-     * _HIP_DEBUG("List_for_each_entry_safe\n");
-     * hip_hold_ha(this);
-     * if ((ipv6_addr_cmp(local_blind_hit, &this->hit_our_blind) == 0) &&
-     * (ipv6_addr_cmp(peer_blind_hit, &this->hit_peer_blind) == 0)) {
-     * result = this;
-     * break;
-     * }
-     * hip_db_put_ha(this, hip_hadb_delete_state);
-     * if (err)
-     * break;
-     * }
-     * if (err)
-     * break;
-     * }
-     */
-
     if (err) {
         result = NULL;
     }
 
     return result;
 }
-
 #endif
 
 
@@ -2125,7 +2079,6 @@
 
     ipv6_addr_copy(&local_address, &entry->our_addr);
 
-    //hip_build_user_hdr(msg, HIP_HIPPROXY_LOCAL_ADDRESS, 0);
     HIP_IFEL(hip_build_param_contents(msg, &local_address, HIP_PARAM_IPV6_ADDR,
                                       sizeof(struct in6_addr)), -1,
                                       "Building local address info failed\n");

=== modified file 'hipd/hadb.h'
--- hipd/hadb.h 2010-03-19 08:47:02 +0000
+++ hipd/hadb.h 2010-04-13 11:10:38 +0000
@@ -94,7 +94,6 @@
 int hip_del_peer_info_entry(hip_ha_t *ha);
 int hip_del_peer_info(hip_hit_t *, hip_hit_t *);
 
-void hip_hadb_set_spi_ifindex(hip_ha_t *entry, uint32_t spi, int ifindex);
 int hip_store_base_exchange_keys(struct hip_hadb_state *entry,
                                  struct hip_context *ctx, int is_initiator);
 /* Utilities */

=== modified file 'hipd/hadb_legacy.c'
--- hipd/hadb_legacy.c  2010-04-09 16:24:44 +0000
+++ hipd/hadb_legacy.c  2010-04-13 11:10:38 +0000
@@ -33,12 +33,6 @@
                                     uint32_t *lifetime,
                                     struct timeval *modified_time)
 {
-    // 99999: REMOVE
-    /*struct hip_peer_addr_list_item *peer_addr_list_item;
-     * int i = 1, ii;
-     * struct hip_spi_out_item *spi_out;
-     * hip_list_t *item, *tmp, *a_item, *a_tmp;*/
-
     struct hip_peer_addr_list_item *peer_addr_list_item;
     int i = 1, ii;
     hip_list_t *item, *tmp;
@@ -64,32 +58,6 @@
         i++;
     }
 
-    // 99999: REMOVE
-    /* assumes already locked entry */
-/*  list_for_each_safe(item, tmp, entry->spis_out_old, ii)
- *      {
- *              spi_out = list_entry(item);
- *              list_for_each_safe(a_item, a_tmp, entry->peer_addresses_old, 
iii)
- *              {
- *                      s = list_entry(a_item);
- *                      if (!ipv6_addr_cmp(&s->address, addr))
- *                      {
- *                              _HIP_DEBUG("found\n");
- *                              if (lifetime)
- *lifetime = s->lifetime;
- *                              if (modified_time)
- *                              {
- *                                      modified_time->tv_sec = 
s->modified_time.tv_sec;
- *                                      modified_time->tv_usec = 
s->modified_time.tv_usec;
- *                              }
- *                              if (spi)
- *spi = spi_out->spi;
- *                              return 1;
- *                      }
- *                      i++;
- *              }
- *      }*/
-
     _HIP_DEBUG("not found\n");
     return 0;
 }

=== modified file 'hipd/hi3.c'
--- hipd/hi3.c  2010-04-13 09:52:59 +0000
+++ hipd/hi3.c  2010-04-13 11:10:38 +0000
@@ -100,11 +100,6 @@
 static void hip_hi3_receive_payload(void *t, void *data, void *fun_ctx)
 {
     struct hip_common *hip_common;
-    // struct hip_work_order *hwo;
-    // struct sockaddr_in6 src, dst;
-    // struct hi3_ipv4_addr *h4;
-    // struct hi3_ipv6_addr *h6;
-    // int family, l, type;
     cl_buf *clb = (cl_buf *) data;
     char *buf   = clb->data;
     int len     = clb->data_len;
@@ -225,12 +220,9 @@
 
     for (i = 0; i < hi3_pub_tr_count; i++) {
         get_random_bytes(hi3_pri_id[i].x, ID_LEN);
-//      get_random_bytes(key.x, KEY_LEN);
 
         hi3_pub_tr[i] = cl_create_trigger_id(&hi3_pub_id[i], ID_LEN_BITS, 
&hi3_pri_id[i],
                                              CL_TRIGGER_CFLAG_R_CONSTRAINT);
-//      CL_TRIGGER_CFLAG_L_CONSTRAINT |
-//      CL_TRIGGER_CFLAG_PUBLIC);
 
         cl_register_trigger_callback(hi3_pub_tr[i], 
CL_CBK_TRIGGER_CONSTRAINT_FAILED,
                                      hip_hi3_constraint_failed, NULL);

=== modified file 'hipd/hidb.c'
--- hipd/hidb.c 2010-04-09 15:20:38 +0000
+++ hipd/hidb.c 2010-04-13 11:10:38 +0000
@@ -422,8 +422,6 @@
             ?
             1 : 0;
 
-        /*  lhi.algo = eid_endpoint.algo;*/
-
         err = hip_add_host_id(HIP_DB_LOCAL_HID, &lhi,
                               &lsi, host_identity,
                               NULL, NULL, NULL);
@@ -986,8 +984,3 @@
 
     return err;
 }
-
-#undef HIP_READ_LOCK_DB
-#undef HIP_WRITE_LOCK_DB
-#undef HIP_READ_UNLOCK_DB
-#undef HIP_WRITE_UNLOCK_DB

=== modified file 'hipd/hipd.c'
--- hipd/hipd.c 2010-04-09 18:50:26 +0000
+++ hipd/hipd.c 2010-04-13 11:10:38 +0000
@@ -134,9 +134,6 @@
 
 int address_change_time_counter = -1;
 
-//char *hip_i3_config_file = NULL;
-//int hip_use_i3 = 0; // false
-
 /*Define hip_use_userspace_ipsec variable to indicate whether use
  * userspace ipsec or not. If it is 1, hip uses the user space ipsec.
  * It will not use if hip_use_userspace_ipsec = 0. Added By Tao Wan
@@ -675,7 +672,6 @@
 
             /* Read in the values to hip_msg, saddr, daddr and
              * pkt_info. */
-            /* if ( hip_read_control_msg_v4(hip_nat_sock_udp, hipd_msg,&saddr, 
&daddr,&pkt_info, 0) ) */
             err = hip_read_control_msg_v4(hip_nat_sock_input_udp,
                                           hipd_msg,
                                           &saddr,

=== modified file 'hipd/hiprelay.c'
--- hipd/hiprelay.c     2010-04-13 10:36:12 +0000
+++ hipd/hiprelay.c     2010-04-13 11:10:38 +0000
@@ -1154,7 +1154,6 @@
         hip_relay_forward_response(
             msg, msg_type, src_addr, dst_addr, msg_info,
             (in6_addr_t *) &relay_to->address, ntohs(relay_to->port));
-        //  state = HIP_STATE_NONE;
         err = 1;
         goto out_err;
     }
@@ -1289,7 +1288,6 @@
                           in6_addr_t *dest_ip, in_port_t *dest_port)
 {
     hip_tlv_type_t param_type;
-    //   struct hip_relay_from *relay_from = NULL;
     struct hip_from *from  = NULL;
 #ifdef CONFIG_HIP_RVS
     hip_ha_t *rvs_ha_entry = NULL;

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-04-13 10:36:12 +0000
+++ hipd/init.c 2010-04-13 11:10:38 +0000
@@ -626,9 +626,6 @@
     HIP_DEBUG_LSI("default_lsi ", &default_lsi);
     hip_hidb_associate_default_hit_lsi(&default_hit, &default_lsi);
 
-    /*Initializes the hadb with the information contained in /etc/hip/hosts*/
-    //hip_init_hadb_hip_host();
-
 out_err:
 
     if (user_msg) {
@@ -736,7 +733,6 @@
     }
 
     HIP_DEBUG_INADDR("UDP socket created and bound to addr", (struct in_addr 
*) &myaddr.sin_addr.s_addr);
-    //return 0;
 
 out_err:
     return err;

=== modified file 'hipd/init.h'
--- hipd/init.h 2010-03-19 08:47:02 +0000
+++ hipd/init.h 2010-04-13 11:10:38 +0000
@@ -28,9 +28,6 @@
  *
  */
 
-
-extern char *i3_config_file;
-//extern char *hip_i3_config_file;
 extern int hip_use_i3;
 extern hip_ipsec_func_set_t default_ipsec_func_set;
 extern int hip_firewall_sock_fd;

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-04-13 10:36:12 +0000
+++ hipd/input.c        2010-04-13 11:10:38 +0000
@@ -678,10 +678,6 @@
 //add by santtu
 #ifdef CONFIG_HIP_RVS
     //check if it a relaying msg
-
-    //add by santtu
-    //if(hip_relay_handle_relay_to(msg, type, src_addr, dst_addr, msg_info)){
-
     if (hip_relay_handle_relay_to(msg, type, src_addr, dst_addr, msg_info)) {
         //end
         err = -ECANCELED;
@@ -1261,8 +1257,6 @@
     spi_in_data.ifindex = hip_devaddr2ifindex(r1_daddr);
     HIP_LOCK_HA(entry);
 
-    // 99999 HIP_IFEB(hip_hadb_add_spi_old(entry, HIP_SPI_DIRECTION_IN, 
&spi_in_data), -1, HIP_UNLOCK_HA(entry));
-
     entry->esp_transform = transform_esp_suite;
     HIP_DEBUG("Saving base exchange encryption data to entry \n");
     HIP_DEBUG_HIT("Our HIT: ", &entry->hit_our);
@@ -1657,8 +1651,6 @@
         break;
     }
 
-    /* hip_put_ha(entry); */
-
 out_err:
     return err;
 }
@@ -2199,7 +2191,6 @@
         }
     }
 
-    //entry->hip_nat_key = i2_context.hip_nat_key;
     //HIP_DEBUG("hip nat key from context %s", i2_context.hip_nat_key);
     memcpy(entry->hip_nat_key, i2_context.hip_nat_key, HIP_MAX_KEY_LEN);
     //HIP_DEBUG("hip nat key in entry %s", entry->hip_nat_key);
@@ -2347,10 +2338,6 @@
         memset(&spi_out_data, 0, sizeof(struct hip_spi_out_item));
         spi_out_data.spi            = ntohl(esp_info->new_spi);
         entry->spi_outbound_current = spi_out_data.spi;
-        /* 99999
-         * HIP_DEBUG("Adding spi 0x%x\n", spi_out_data.spi);
-         * HIP_IFE(hip_hadb_add_spi_old(entry, HIP_SPI_DIRECTION_OUT,
-         *                       &spi_out_data), -1);*/
         entry->esp_transform        = hip_select_esp_transform(esp_tf);
         HIP_IFEL((esp_tfm = entry->esp_transform) == 0, -1,
                  "Could not select proper ESP transform\n");
@@ -2437,15 +2424,6 @@
         HIP_ERROR("Could not get device ifindex of address.\n");
     }
 
-    /* 99999
-     * err = hip_hadb_add_spi_old(entry, HIP_SPI_DIRECTION_IN, &spi_in_data);
-     * if (err) {
-     *      HIP_UNLOCK_HA(entry);
-     *      HIP_ERROR("Adding of SPI failed. Not creating an R2 packet.\n");
-     *      goto out_err;
-     * }
-     * */
-
     entry->spi_outbound_new = spi_out;
     HIP_IFE(hip_store_base_exchange_keys(entry, &i2_context, 0), -1);
     //hip_hadb_insert_state(entry);
@@ -2538,8 +2516,6 @@
     /* 'entry' cannot be NULL here anymore since it has been used in this
      * function directly without NULL check. -Lauri. */
 
-    /* hip_put_ha(entry); */
-
     if (tmp_enc != NULL) {
         free(tmp_enc);
     }
@@ -2648,8 +2624,6 @@
         break;
     }
 
-    /* hip_put_ha(entry); */
-
 out_err:
     if (err) {
         HIP_ERROR("Error (%d) occurred\n", err);
@@ -2740,7 +2714,6 @@
     spi_recvd                   = ntohl(esp_info->new_spi);
     memset(&spi_out_data, 0, sizeof(struct hip_spi_out_item));
     spi_out_data.spi            = spi_recvd;
-    // 99999 HIP_IFE(hip_hadb_add_spi_old(entry, HIP_SPI_DIRECTION_OUT, 
&spi_out_data), -1);
 
     entry->spi_outbound_current =  spi_recvd;
     HIP_DEBUG("Set SPI out = 0x%x\n", spi_recvd);
@@ -2767,11 +2740,6 @@
     HIP_IFEL(esp_prot_r2_handle_anchor(entry, ctx), -1,
              "failed to handle esp prot anchor\n");
 
-    /************************************************/
-/*comment out for draft v6
- *      hip_nat_handle_pacing(r2, entry);
- */
-
     /***** LOCATOR PARAMETER *****/
     locator = (struct hip_locator *) hip_get_param(r2, HIP_PARAM_LOCATOR);
     if (locator) {
@@ -2845,7 +2813,6 @@
 
     if (idx != 0) {
         HIP_DEBUG("ifindex = %d\n", idx);
-        // hip_hadb_set_spi_ifindex_deprecated(entry, spi_in, idx);
     } else {
         HIP_ERROR("Couldn't get device ifindex of address\n");
     }
@@ -2863,11 +2830,6 @@
 
     hip_handle_reg_from(entry, r2);
 
-    /* These will change SAs' state from ACQUIRE to VALID, and wake up any
-     * transport sockets waiting for a SA. */
-    // hip_finalize_sa(&entry->hit_peer, spi_recvd);
-    // hip_finalize_sa(&entry->hit_our, spi_in);
-
     /** RFC 5201 Section 5.2.13:
      *   Notice that the section says "The Update ID is an unsigned quantity,
      *   initialized by a host to zero upon moving to ESTABLISHED state" and
@@ -3120,7 +3082,6 @@
 
     if (entry) {
         state = entry->state;
-        /* hip_put_ha(entry); */
     } else {
 #ifdef CONFIG_HIP_RVS
         if (hip_relay_get_status() != HIP_RELAY_OFF &&
@@ -3255,9 +3216,6 @@
     }
 
 out_err:
-
-    /* hip_put_ha(entry); */
-
     return err;
 }
 
@@ -3473,9 +3431,6 @@
     err = hip_handle_notify(notify, notify_saddr, notify_daddr, entry);
 
 out_err:
-
-    /* hip_put_ha(entry); */
-
     return err;
 }
 
@@ -3532,7 +3487,6 @@
         HIP_IFEL(1, 0, "Internal state (%d) is incorrect\n", state);
     }
 
-    /* hip_put_ha(entry); */
 out_err:
     return err;
 }

=== modified file 'hipd/oppdb.c'
--- hipd/oppdb.c        2010-04-09 16:24:44 +0000
+++ hipd/oppdb.c        2010-04-13 11:10:38 +0000
@@ -60,7 +60,6 @@
 typedef struct hip_opp_info hip_opp_info_t;
 
 HIP_HASHTABLE *oppdb;
-//static hip_list_t oppdb_list[HIP_OPPDB_SIZE]= { 0 };
 
 static void hip_oppdb_del_entry_by_entry(hip_opp_block_t *entry);
 static hip_opp_block_t *hip_create_opp_block_entry(void);
@@ -150,9 +149,7 @@
     {
         this = (hip_opp_block_t *) list_entry(item);
         _HIP_DEBUG("List_for_each_entry_safe\n");
-        /* hip_hold_ha(this); */
         fail = func(this, opaque);
-        //hip_db_put_ha(this, hip_oppdb_del_entry_by_entry);
         if (fail) {
             goto out_err;
         }
@@ -397,7 +394,6 @@
 static void hip_oppdb_dump(void)
 {
     int i;
-    //  char peer_real_hit[INET6_ADDRSTRLEN] = "\0";
     hip_opp_block_t *this;
     hip_list_t *item, *tmp;
 
@@ -509,9 +505,6 @@
     }
 #endif
 
-    // add new HA with real hit
-    //err = hip_hadb_add_peer_info(&msg->hits, src_addr);
-
     HIP_DEBUG_HIT("!!!! peer hit=", &msg->hits);
     HIP_DEBUG_HIT("!!!! local hit=", &msg->hitr);
     HIP_DEBUG_IN6ADDR("!!!! peer addr=", src_addr);
@@ -761,8 +754,6 @@
     /* Override the receiving function */
     ha->hadb_rcv_func->hip_receive_r1 = hip_receive_opp_r1;
 
-    //entry = hip_oppdb_find_byhits(&phit, src);
-    //HIP_ASSERT(!entry);
     HIP_IFEL(hip_oppdb_add_entry(&phit, &hit_our, &dst_ip, NULL,
                                  src), -1, "Add db failed\n");
 

=== modified file 'hipd/oppdb.h'
--- hipd/oppdb.h        2010-04-13 10:48:24 +0000
+++ hipd/oppdb.h        2010-04-13 11:10:38 +0000
@@ -30,9 +30,6 @@
     hip_hit_t           peer_phit;
     struct sockaddr_in6 caller;
     hip_hit_t           our_real_hit;
-    //hip_hit_t             peer_real_hit;
-    //spinlock_t            lock;
-    //atomic_t              refcnt;
 
     time_t              creation_time;
     struct in6_addr     peer_ip;
@@ -43,7 +40,6 @@
 typedef struct hip_opp_blocking_request_entry hip_opp_block_t;
 
 void hip_init_opp_db(void);
-//void hip_uninit_opp_db();
 int hip_opptcp_send_tcp_packet(struct hip_common *msg, const struct 
sockaddr_in6 *src);
 int hip_opptcp_unblock_and_blacklist(struct hip_common *msg, const struct 
sockaddr_in6 *src);
 int hip_handle_opp_fallback(hip_opp_block_t *entry,

=== modified file 'hipd/oppipdb.c'
--- hipd/oppipdb.c      2010-04-13 10:36:12 +0000
+++ hipd/oppipdb.c      2010-04-13 11:10:38 +0000
@@ -84,9 +84,7 @@
     {
         this = (hip_oppip_t *) list_entry(item);
         _HIP_DEBUG("List_for_each_entry_safe\n");
-        //hip_hold_ha(this);
         func(this, opaque);
-        //hip_db_put_ha(this, hip_oppdb_del_entry_by_entry);
     }
 
     HIP_UNLOCK_HT(&oppipdb);
@@ -168,8 +166,6 @@
         return err;
     }
 
-    //HIP_IFEL(!ipv6_addr_copy(new_item, ip_peer), -1,
-    //  "Copy non-HIP host failed\n");
     ipv6_addr_copy(new_item, ip_peer);
 
     err = hip_ht_add(oppipdb, new_item);

=== modified file 'hipd/output.c'
--- hipd/output.c       2010-04-13 10:36:12 +0000
+++ hipd/output.c       2010-04-13 11:10:38 +0000
@@ -486,8 +486,6 @@
                                      local_addr, &peer_addr,
                                      entry->local_udp_port,
                                      entry->peer_udp_port,
-                                     //(entry->nat_mode ? 
hip_get_local_nat_udp_port() : 0),
-                                     //(entry->nat_mode ? 
hip_get_peer_nat_udp_port() : 0),
                                      i1_blind, entry, 1);
     } else {
         HIP_DEBUG("Number of items in the peer addr list: %d ",
@@ -702,8 +700,6 @@
 
     /* Packet ready */
 
-    //  if (host_id_pub)
-    //      HIP_FREE(host_id_pub);
     if (dh_data1) {
         HIP_FREE(dh_data1);
     }
@@ -711,13 +707,9 @@
         HIP_FREE(dh_data2);
     }
 
-    //HIP_HEXDUMP("r1", msg, hip_get_msg_total_len(msg));
-
     return msg;
 
 out_err:
-    // if (host_id_pub)
-    //      HIP_FREE(host_id_pub);
     if (msg) {
         HIP_FREE(msg);
     }
@@ -1198,14 +1190,6 @@
 
     _HIP_HEXDUMP("Dumping packet ", msg, len);
 
-#if 0
-    /* Kuptsov: multiple source addresses might not work properly without
-     * the trick below. Note that you should find out the ifname with
-     * getifaddr/if_nameindex. */
-    HIP_IFEL(setsockopt(hip_raw_sock_output, SOL_SOCKET, SO_BINDTODEVICE,
-                        ifname, strlen(ifname) + 1), -1, "Cannot set sockopt");
-#endif
-
     for (dupl = 0; dupl < HIP_PACKET_DUPLICATES; dupl++) {
         for (try_again = 0; try_again < 2; try_again++) {
             sent = sendto(hip_raw_sock_output, msg, len, 0,
@@ -1558,9 +1542,6 @@
     buf = clb->data;
 
     hip_zero_msg_checksum(msg);
-//  msg->checksum = hip_checksum_packet((char *)msg,
-//              (struct sockaddr *)&src,
-//              (struct sockaddr *)&dst);
 
     clb->data_len = msg_len;
 

=== modified file 'hipd/update.c'
--- hipd/update.c       2010-04-13 10:36:12 +0000
+++ hipd/update.c       2010-04-13 11:10:38 +0000
@@ -138,9 +138,6 @@
     if (type == HIP_UPDATE_LOCATOR
             || type == HIP_UPDATE_ECHO_REQUEST
             || type == HIP_UPDATE_ESP_ANCHOR) {
-        // TODO check the following function!
-        /* hip_update_set_new_spi_in_old(ha, esp_info_old_spi,
-         *  esp_info_new_spi, 0);*/
 
         ha->update_id_out++;
         update_id_out = ha->update_id_out;
@@ -149,11 +146,6 @@
         HIP_IFEL(hip_build_param_seq(update_packet_to_send, update_id_out), -1,
                  "Building of SEQ param failed\n");
 
-        /* remember the update id of this update */
-        /* hip_update_set_status(ha, esp_info_old_spi,
-         *  0x1 | 0x2 | 0x8, update_id_out, 0, NULL,
-         *  ha->current_keymat_index); */
-
         /************************************************/
     }
 
@@ -763,8 +755,6 @@
         ack_peer_update_id = ntohl(ack->peer_update_id);
         HIP_DEBUG("ACK parameter found with peer Update ID %u.\n",
                   ack_peer_update_id);
-        /*ha->hadb_update_func->hip_update_handle_ack(
-         *      ha, ack, has_esp_info);*/
         if (ack_peer_update_id != ha->update_id_out) {
             // Simplified logic of RFC 5201 6.12.2, 1st step:
             // We drop the packet if the Update ID in the ACK

Other related posts:

  • » [hipl-commit] [trunk] Rev 4245: dead code removal: part V (hipd subdirectory) - Diego Biurrun