[hipl-commit] [trunk] Rev 3727: Removed redundant functions from lib/core/utils.c

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Sat, 27 Feb 2010 15:45:58 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Sat Feb 27 15:45:57 2010 +0200
Revision: 3727
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Removed redundant functions from lib/core/utils.c

Modified:
  M  hipd/accessor.c
  M  hipd/hadb.c
  M  hipd/oppdb.c
  M  hipd/output.c
  M  lib/core/utils.c
  M  lib/core/utils.h

=== modified file 'hipd/accessor.c'
--- hipd/accessor.c     2010-02-11 09:57:04 +0000
+++ hipd/accessor.c     2010-02-27 13:45:57 +0000
@@ -149,7 +149,7 @@
 
 
     hit = (struct in6_addr *) hip_get_param_contents(msg, 
HIP_PARAM_PSEUDO_HIT);
-    HIP_ASSERT(hit_is_opportunistic_hashed_hit(hit));
+    HIP_ASSERT(hit_is_opportunistic_hit(hit));
 
     entry = hip_hadb_try_to_find_by_peer_hit(hit);
     if (entry) {

=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2010-02-17 14:11:29 +0000
+++ hipd/hadb.c 2010-02-27 13:45:57 +0000
@@ -600,7 +600,7 @@
     err = hip_hadb_add_peer_info(hit, ip, lsi, peer_hostname);
 
     _HIP_DEBUG_HIT("hip_add_map_info peer's real hit=", hit);
-    _HIP_ASSERT(hit_is_opportunistic_hashed_hit(hit));
+    _HIP_ASSERT(hit_is_opportunistic_hit(hit));
 
     if (err) {
         HIP_ERROR("Failed to insert peer map (%d)\n", err);
@@ -1694,7 +1694,7 @@
 
     if (ipv6_addr_cmp(&entry->peer_addr, id) == 0 &&
         !ipv6_addr_any(&entry->hit_peer) &&
-        !hit_is_opportunistic_hashed_hit(&entry->hit_peer)) {
+        !hit_is_opportunistic_hit(&entry->hit_peer)) {
         ipv6_addr_copy(id, &entry->hit_peer);
         HIP_DEBUG_HIT("hit", &entry->hit_peer);
         HIP_DEBUG_HIT("pref", &entry->peer_addr);

=== modified file 'hipd/oppdb.c'
--- hipd/oppdb.c        2010-02-17 14:11:29 +0000
+++ hipd/oppdb.c        2010-02-27 13:45:57 +0000
@@ -333,7 +333,7 @@
                                            HIP_HIT_TYPE_HASH100), -1,
              "hip_opportunistic_ipv6_to_hit failed\n");
 
-    HIP_ASSERT(hit_is_opportunistic_hashed_hit(&phit));
+    HIP_ASSERT(hit_is_opportunistic_hit(&phit));
 
     entry_tmp = hip_hadb_find_byhits(init_hit, &phit);
 
@@ -350,7 +350,7 @@
     hip_ha_t *entry     = NULL;
 
     if (type == HIP_I1) {
-        if (!hit_is_opportunistic_null(&msg->hitr)) {
+        if (!ipv6_addr_is_null(&msg->hitr)) {
             goto out_err;
         }
         hip_get_default_hit(&msg->hitr);
@@ -464,7 +464,7 @@
                                            HIP_HIT_TYPE_HASH100),
              -1, "Opp HIT conversion failed\n");
 
-    HIP_ASSERT(hit_is_opportunistic_hashed_hit(&opp_hit));
+    HIP_ASSERT(hit_is_opportunistic_hit(&opp_hit));
 
     HIP_DEBUG_HIT("opportunistic hashed hit", &opp_hit);
 
@@ -609,7 +609,7 @@
                                            HIP_HIT_TYPE_HASH100),
              -1, "Opp HIT conversion failed\n");
 
-    HIP_ASSERT(hit_is_opportunistic_hashed_hit(&phit));
+    HIP_ASSERT(hit_is_opportunistic_hit(&phit));
 
     HIP_DEBUG_HIT("phit", &phit);
 

=== modified file 'hipd/output.c'
--- hipd/output.c       2010-02-23 14:10:06 +0000
+++ hipd/output.c       2010-02-27 13:45:57 +0000
@@ -358,7 +358,7 @@
 
 #ifdef CONFIG_HIP_OPPORTUNISTIC
     // if hitr is hashed null hit, send it as null on the wire
-    if  (hit_is_opportunistic_hashed_hit(&i1->hitr)) {
+    if  (hit_is_opportunistic_hit(&i1->hitr)) {
         ipv6_addr_copy(&i1->hitr, &in6addr_any);
     }
 
@@ -405,7 +405,7 @@
 
     /*send the TCP SYN_i1 packet*/
     if (hip_get_opportunistic_tcp_status() &&
-        hit_is_opportunistic_hashed_hit(dst_hit)) {
+        hit_is_opportunistic_hit(dst_hit)) {
         /* Ensure that I1 gets first to destination */
         usleep(50);
         hip_send_opp_tcp_i1(entry);
@@ -834,7 +834,7 @@
 #ifdef CONFIG_HIP_OPPORTUNISTIC
     /* It should not be null hit, null hit has been replaced by real local
      * hit. */
-    HIP_ASSERT(!hit_is_opportunistic_hashed_hit(&i1->hitr));
+    HIP_ASSERT(!hit_is_opportunistic_hit(&i1->hitr));
 #endif
 
     /* Case: I ----->IPv4---> RVS ---IPv6---> R */

=== modified file 'lib/core/utils.c'
--- lib/core/utils.c    2010-02-27 13:35:38 +0000
+++ lib/core/utils.c    2010-02-27 13:45:57 +0000
@@ -85,32 +85,6 @@
 }
 
 /**
- * Test if a given IPv6 address is a pseudo HIT instead of a
- * real HIT
- *
- * @param hit the IPv6 address to be tested
- * @return zero if the IPv6 address was a real HIT and
-'          one if it was a pseudo HIT
- */
-int hit_is_opportunistic_hashed_hit(const struct in6_addr *hit)
-{
-    return hit_is_opportunistic_hit(hit);
-}
-
-/**
- * Test if an IPv6 address is all zeroes
- *
- * @param ip the IPv6 address to test
- * @return one if the address is all zeroes and zero otherwise
- */
-int hit_is_opportunistic_null(const struct in6_addr *hit)
-{
-    // return hit_is_opportunistic_hit(hit);
-    return (hit->s6_addr32[0] | hit->s6_addr32[1] |
-            hit->s6_addr32[2] | (hit->s6_addr32[3]))  == 0;
-}
-
-/**
  * Fill in the HIT prefix for a given IPv6 address
  *
  * @param hit an IPv6 address for which to set the HIT prefix

=== modified file 'lib/core/utils.h'
--- lib/core/utils.h    2010-02-17 13:08:39 +0000
+++ lib/core/utils.h    2010-02-27 13:45:57 +0000
@@ -39,8 +39,6 @@
 int ipv6_addr_is_null(struct in6_addr *ip);
 int hit_is_real_hit(const struct in6_addr *hit);
 int hit_is_opportunistic_hit(const struct in6_addr *hit);
-int hit_is_opportunistic_hashed_hit(const struct in6_addr *hit);
-int hit_is_opportunistic_null(const struct in6_addr *hit);
 void set_hit_prefix(struct in6_addr *hit);
 void set_lsi_prefix(hip_lsi_t *lsi);

Other related posts:

  • » [hipl-commit] [trunk] Rev 3727: Removed redundant functions from lib/core/utils.c - Miika Komu