[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5407: Drop hip_list_t typedef and _t namespace suffix.

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Fri, 07 Jan 2011 14:49:27 -0000

------------------------------------------------------------
revno: 5407
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: hipl
timestamp: Fri 2011-01-07 15:46:07 +0100
message:
  Drop hip_list_t typedef and _t namespace suffix.
  
  The _t namespace is reserved for POSIX; typedefs are evil.
modified:
  firewall/cache.c
  firewall/user_ipsec_sadb.c
  hipd/cookie.c
  hipd/hadb.c
  hipd/hadb_legacy.c
  hipd/hidb.c
  hipd/hidb.h
  hipd/init.c
  hipd/netdev.c
  hipd/nsupdate.c
  hipd/oppdb.c
  hipd/oppipdb.c
  hipd/output.c
  lib/core/debug.c
  lib/core/list.h
  modules/update/hipd/update.c
  modules/update/hipd/update_legacy.c


--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk

Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'firewall/cache.c'
--- firewall/cache.c    2011-01-04 13:57:31 +0000
+++ firewall/cache.c    2011-01-07 14:46:07 +0000
@@ -40,6 +40,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <netinet/in.h>
+#include <openssl/lhash.h>
 
 #include "lib/core/builder.h"
 #include "lib/core/debug.h"
@@ -181,7 +182,7 @@
 {
     int i;
     struct hip_hadb_user_info_state *this = NULL, *ha_match = NULL;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
 
     if (type == FW_CACHE_HIT) {
         ha_match = hip_ht_find(firewall_cache_db, peer);
@@ -307,7 +308,7 @@
 {
     int i;
     struct hip_hadb_user_info_state *this = NULL;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
 
     HIP_DEBUG("Start hldb delete\n");
     HIP_LOCK_HT(&firewall_cache_db);

=== modified file 'firewall/user_ipsec_sadb.c'
--- firewall/user_ipsec_sadb.c  2011-01-04 18:32:00 +0000
+++ firewall/user_ipsec_sadb.c  2011-01-07 14:46:07 +0000
@@ -40,6 +40,7 @@
 #include <openssl/aes.h>
 #include <openssl/blowfish.h>
 #include <openssl/des.h>
+#include <openssl/lhash.h>
 #include <openssl/sha.h>
 #include <sys/time.h>
 
@@ -839,7 +840,7 @@
 int hip_sadb_flush(void)
 {
     int err               = 0, i = 0;
-    hip_list_t *item      = NULL, *tmp = NULL;
+    LHASH_NODE *item      = NULL, *tmp = NULL;
     struct hip_sa_entry *entry = NULL;
 
     // iterating over all elements

=== modified file 'hipd/cookie.c'
--- hipd/cookie.c       2011-01-04 18:32:00 +0000
+++ hipd/cookie.c       2011-01-07 14:46:07 +0000
@@ -37,6 +37,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <openssl/lhash.h>
 
 #include "lib/core/builder.h"
 #include "lib/core/common.h"
@@ -413,7 +414,7 @@
 int hip_recreate_all_precreated_r1_packets(void)
 {
     HIP_HASHTABLE *ht = hip_ht_init(hip_hidb_hash, hip_hidb_match);
-    hip_list_t *curr, *iter;
+    LHASH_NODE *curr, *iter;
     struct hip_host_id *tmp;
     int c;
 

=== modified file 'hipd/hadb.c'
--- hipd/hadb.c 2011-01-06 17:27:07 +0000
+++ hipd/hadb.c 2011-01-07 14:46:07 +0000
@@ -66,6 +66,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <openssl/dsa.h>
+#include <openssl/lhash.h>
 #include <openssl/rsa.h>
 
 #include "lib/core/builder.h"
@@ -285,7 +286,7 @@
  */
 struct hip_hadb_state *hip_hadb_try_to_find_by_peer_hit(const hip_hit_t *hit)
 {
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
     struct hip_host_id_entry *e;
     struct hip_hadb_state *entry = NULL;
     hip_hit_t our_hit;
@@ -855,7 +856,7 @@
  */
 static void hip_hadb_delete_state(struct hip_hadb_state *ha)
 {
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct hip_peer_addr_list_item *addr_li = NULL;
     int i;
 
@@ -1209,7 +1210,7 @@
 {
     int i = 0, fail = 0;
     struct hip_hadb_state *this;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     if (!func) {
         return -EINVAL;
@@ -1340,7 +1341,7 @@
 {
     int i            = 0;
     struct hip_hadb_state *this   = NULL, *result = NULL;
-    hip_list_t *item = NULL, *tmp = NULL;     //
+    LHASH_NODE *item = NULL, *tmp = NULL;     //
 
     HIP_LOCK_HT(&hadb_hit);
     list_for_each_safe(item, tmp, hadb_hit, i)
@@ -1456,7 +1457,7 @@
 struct hip_hadb_state *hip_hadb_try_to_find_by_pair_lsi(hip_lsi_t *lsi_src,
                                                         hip_lsi_t *lsi_dst)
 {
-    hip_list_t *item, *aux;
+    LHASH_NODE *item, *aux;
     struct hip_hadb_state *tmp;
     int i;
 
@@ -1482,7 +1483,7 @@
  */
 struct hip_hadb_state *hip_hadb_try_to_find_by_peer_lsi(const hip_lsi_t 
*lsi_dst)
 {
-    hip_list_t *item, *aux;
+    LHASH_NODE *item, *aux;
     struct hip_hadb_state *tmp;
     int i;
 

=== modified file 'hipd/hadb_legacy.c'
--- hipd/hadb_legacy.c  2011-01-04 18:32:00 +0000
+++ hipd/hadb_legacy.c  2011-01-07 14:46:07 +0000
@@ -67,7 +67,7 @@
 {
     struct hip_peer_addr_list_item *peer_addr_list_item;
     int i = 1, ii;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     list_for_each_safe(item, tmp, entry->peer_addresses_old, ii)
     {
@@ -103,7 +103,7 @@
 {
     struct hip_peer_addr_list_item *peer_addr_list_item;
     int i;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     /* possibly deprecated function .. */
 

=== modified file 'hipd/hidb.c'
--- hipd/hidb.c 2011-01-04 18:32:00 +0000
+++ hipd/hidb.c 2011-01-07 14:46:07 +0000
@@ -42,6 +42,7 @@
 #include <string.h>
 #include <arpa/inet.h>
 #include <openssl/dsa.h>
+#include <openssl/lhash.h>
 #include <openssl/rsa.h>
 
 #include "lib/core/builder.h"
@@ -272,7 +273,7 @@
  */
 static void hip_uninit_hostid_db(HIP_HASHTABLE *db)
 {
-    hip_list_t *curr, *iter;
+    LHASH_NODE *curr, *iter;
     struct hip_host_id_entry *tmp;
     int count, err;
 
@@ -311,7 +312,7 @@
                                                                int anon)
 {
     struct hip_host_id_entry *id_entry;
-    hip_list_t *item;
+    LHASH_NODE *item;
     int c;
     list_for_each(item, db, c) {
         id_entry = list_entry(item);
@@ -350,7 +351,7 @@
 int hip_hidb_get_lsi_by_hit(const hip_hit_t *our, hip_lsi_t *our_lsi)
 {
     struct hip_host_id_entry *id_entry;
-    hip_list_t *item;
+    LHASH_NODE *item;
     int c, err = 1;
 
     list_for_each(item, hip_local_hostid_db, c) {
@@ -373,7 +374,7 @@
 static int hip_hidb_add_lsi(HIP_HASHTABLE *db, struct hip_host_id_entry 
*id_entry)
 {
     struct hip_host_id_entry *id_entry_aux;
-    hip_list_t *item;
+    LHASH_NODE *item;
     hip_lsi_t lsi_aux;
     int err = 0, used_lsi, c, i;
     int len = sizeof(lsi_addresses) / sizeof(*lsi_addresses);
@@ -671,7 +672,7 @@
 int hip_hidb_exists_lsi(hip_lsi_t *lsi)
 {
     struct hip_host_id_entry *id_entry;
-    hip_list_t *item;
+    LHASH_NODE *item;
     int c, res = 0;
 
     list_for_each(item, hip_local_hostid_db, c) {
@@ -694,7 +695,7 @@
  */
 int hip_for_each_hi(int (*func)(struct hip_host_id_entry *entry, void *opaq), 
void *opaque)
 {
-    hip_list_t *curr, *iter;
+    LHASH_NODE *curr, *iter;
     struct hip_host_id_entry *tmp;
     int err = 0, c;
 
@@ -728,7 +729,7 @@
                                                            const struct 
in_addr *lsi)
 {
     struct hip_host_id_entry *id_entry;
-    hip_list_t *item;
+    LHASH_NODE *item;
     int c;
 
     list_for_each(item, db, c) {

=== modified file 'hipd/hidb.h'
--- hipd/hidb.h 2011-01-04 19:29:36 +0000
+++ hipd/hidb.h 2011-01-07 14:46:07 +0000
@@ -27,6 +27,7 @@
 #define HIP_HIPD_HIDB
 
 #include <netinet/in.h>
+#include <openssl/lhash.h>
 
 #include "lib/core/hashtable.h"
 #include "lib/core/list.h"
@@ -62,7 +63,7 @@
 #define INET6_ADDRSTRLEN 46
 
 struct hip_entry_list {
-    hip_list_t      list;
+    LHASH_NODE      list;
     struct in6_addr peer_hit;
     /* These two _MUST_ be left untouched. Feel free to add more
      * to the end */

=== modified file 'hipd/init.c'
--- hipd/init.c 2011-01-04 18:32:00 +0000
+++ hipd/init.c 2011-01-07 14:46:07 +0000
@@ -44,6 +44,7 @@
 #include <netinet/ip.h>
 #include <netinet/udp.h>
 #include <openssl/aes.h>
+#include <openssl/lhash.h>
 #include <openssl/rand.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
@@ -530,7 +531,7 @@
  */
 static struct hip_host_id_entry *hip_return_first_rsa(void)
 {
-    hip_list_t *curr, *iter;
+    LHASH_NODE *curr, *iter;
     struct hip_host_id_entry *tmp = NULL;
     int c;
     uint16_t algo                 = 0;

=== modified file 'hipd/netdev.c'
--- hipd/netdev.c       2011-01-04 18:56:17 +0000
+++ hipd/netdev.c       2011-01-07 14:46:07 +0000
@@ -217,7 +217,7 @@
 static int hip_count_if_addresses(int ifindex)
 {
     struct netdev_address *na;
-    hip_list_t *n, *t;
+    LHASH_NODE *n, *t;
     int i = 0, c;
 
     list_for_each_safe(n, t, addresses, c) {
@@ -331,7 +331,7 @@
 static int hip_exists_address_family_in_list(const struct in6_addr *addr)
 {
     struct netdev_address *n;
-    hip_list_t *tmp, *t;
+    LHASH_NODE *tmp, *t;
     int c;
     int mapped = IN6_IS_ADDR_V4MAPPED(addr);
 
@@ -357,7 +357,7 @@
 int hip_exists_address_in_list(struct sockaddr *addr, int ifindex)
 {
     struct netdev_address *n;
-    hip_list_t *tmp, *t;
+    LHASH_NODE *tmp, *t;
     int c;
     int err = 0;
     const struct in6_addr *in6;
@@ -489,7 +489,7 @@
 static void hip_delete_address_from_list(struct sockaddr *addr, int ifindex)
 {
     struct netdev_address *n;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
     int i, deleted = 0;
     struct sockaddr_in6 addr_sin6;
 
@@ -541,7 +541,7 @@
 void hip_delete_all_addresses(void)
 {
     struct netdev_address *n;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
     int i;
 
     if (address_count) {
@@ -571,7 +571,7 @@
 static int hip_netdev_find_if(struct sockaddr *addr)
 {
     struct netdev_address *n = NULL;
-    hip_list_t *item         = NULL, *tmp = NULL;
+    LHASH_NODE *item         = NULL, *tmp = NULL;
     int i                    = 0;
 
 #ifdef CONFIG_HIP_DEBUG /* Debug block. */
@@ -1417,7 +1417,7 @@
     if (ipv6_addr_is_teredo(dst)) {
         struct netdev_address *na;
         const struct in6_addr *in6;
-        hip_list_t *n, *t;
+        LHASH_NODE *n, *t;
         int c, match = 0;
 
         list_for_each_safe(n, t, addresses, c) {
@@ -1447,7 +1447,7 @@
  */
 void hip_copy_peer_addrlist_changed(struct hip_hadb_state *ha)
 {
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct hip_peer_addr_list_item *addr_li;
     int i            = 0;
 

=== modified file 'hipd/nsupdate.c'
--- hipd/nsupdate.c     2010-11-30 14:50:30 +0000
+++ hipd/nsupdate.c     2011-01-07 14:46:07 +0000
@@ -43,6 +43,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <arpa/inet.h>
+#include <openssl/lhash.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -276,7 +277,7 @@
     int start          = 0;
     char ip_str[40];     // buffer for one IP address
     char ips_str[1024] = "";     // list of IP addresses
-    hip_list_t *item, *tmp_hip_list_t;
+    LHASH_NODE *item, *tmp;
     int i;
     char hit[INET6_ADDRSTRLEN + 2];
 
@@ -289,7 +290,7 @@
     hip_convert_hit_to_str(&entry->lhi.hit, NULL, hit);
 
     /* make space-separated list of IP addresses in ips_str */
-    list_for_each_safe(item, tmp_hip_list_t, addresses, i) {
+    list_for_each_safe(item, tmp, addresses, i) {
         struct netdev_address *n = list_entry(item);
 
         if (netdev_address_to_str(n, ip_str, sizeof(ip_str)) == NULL) {

=== modified file 'hipd/oppdb.c'
--- hipd/oppdb.c        2011-01-04 18:32:00 +0000
+++ hipd/oppdb.c        2011-01-07 14:46:07 +0000
@@ -61,6 +61,7 @@
 #include <time.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#include <openssl/lhash.h>
 
 #include "lib/core/builder.h"
 #include "lib/core/common.h"
@@ -185,7 +186,7 @@
 {
     int i = 0, fail = 0;
     struct hip_opp_blocking_request *this;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     if (!func) {
         return -EINVAL;
@@ -352,7 +353,7 @@
 {
     int i;
     struct hip_opp_blocking_request *this;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     HIP_DEBUG("start oppdb dump\n");
     HIP_LOCK_HT(&oppdb);
@@ -648,7 +649,7 @@
 {
     int i = 0;
     struct hip_opp_blocking_request *this, *ret = NULL;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     if (oppdb == NULL)
         return NULL;

=== modified file 'hipd/oppipdb.c'
--- hipd/oppipdb.c      2011-01-04 18:32:00 +0000
+++ hipd/oppipdb.c      2011-01-07 14:46:07 +0000
@@ -102,7 +102,7 @@
 {
     int i = 0;
     hip_oppip_t *this;
-    hip_list_t *item, *tmp;
+    LHASH_NODE *item, *tmp;
 
     if (!func) {
         return -EINVAL;

=== modified file 'hipd/output.c'
--- hipd/output.c       2011-01-04 18:32:00 +0000
+++ hipd/output.c       2011-01-07 14:46:07 +0000
@@ -45,6 +45,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <netinet/udp.h>
+#include <openssl/lhash.h>
 
 #include "lib/core/builder.h"
 #include "lib/core/common.h"
@@ -150,7 +151,7 @@
     struct hip_common *i1       = 0;
     uint16_t mask               = 0;
     int err                     = 0;
-    hip_list_t *item            = NULL, *tmp = NULL;
+    LHASH_NODE *item            = NULL, *tmp = NULL;
     struct hip_peer_addr_list_item *addr;
     int i                       = 0;
     struct in6_addr *local_addr = NULL;
@@ -1455,7 +1456,7 @@
     int err                                = 0;
     struct netdev_address *netdev_src_addr = NULL;
     struct in6_addr *src_addr              = NULL;
-    hip_list_t *item                       = NULL, *tmp = NULL;
+    LHASH_NODE *item                       = NULL, *tmp = NULL;
     int i                                  = 0;
 
     /* Notice that the shotgun logic requires us to check always the address 
family.

=== modified file 'lib/core/debug.c'
--- lib/core/debug.c    2011-01-04 19:39:28 +0000
+++ lib/core/debug.c    2011-01-07 14:46:07 +0000
@@ -76,6 +76,7 @@
 #include <string.h>
 #include <syslog.h>
 #include <arpa/inet.h>
+#include <openssl/lhash.h>
 #include <sys/socket.h>
 #include <sys/types.h>
 
@@ -799,7 +800,7 @@
  */
 void hip_print_peer_addresses_to_be_added(struct hip_hadb_state *entry)
 {
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct hip_peer_addr_list_item *addr;
     int i            = 0;
 

=== modified file 'lib/core/list.h'
--- lib/core/list.h     2010-10-15 15:29:14 +0000
+++ lib/core/list.h     2011-01-07 14:46:07 +0000
@@ -40,11 +40,9 @@
 #define LHASH_CAST
 #endif /* LHASH_OF */
 
-typedef LHASH_NODE hip_list_t;
-
 /**
  * list_entry - get the struct for this entry
- * @param ptr the &hip_list_t pointer.
+ * @param ptr the &LHASH_NODE pointer.
  */
 #define list_entry(ptr) (ptr->data)
 

=== modified file 'modules/update/hipd/update.c'
--- modules/update/hipd/update.c        2011-01-06 18:03:18 +0000
+++ modules/update/hipd/update.c        2011-01-07 14:46:07 +0000
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#include <openssl/lhash.h>
 #include <openssl/rand.h>
 
 #include "config.h"
@@ -387,7 +388,7 @@
 static void hip_remove_addresses_to_send_echo_request(struct update_state 
*state)
 {
     int i = 0;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct in6_addr *address = NULL;
 
     list_for_each_safe(item, tmp, state->addresses_to_send_echo_request, i) {
@@ -405,7 +406,7 @@
 static void hip_print_addresses_to_send_update_request(struct hip_hadb_state 
*ha)
 {
     int i = 0;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct in6_addr *address = NULL;
     struct update_state *localstate = NULL;
 
@@ -435,7 +436,7 @@
     int err = 0, c;
     struct sockaddr_storage ss;
     struct netdev_address *na = NULL;
-    hip_list_t *n = NULL, *t = NULL;
+    LHASH_NODE *n = NULL, *t = NULL;
     const struct in6_addr *in6 = NULL;
 
     memset(&ss, 0, sizeof(ss));
@@ -507,7 +508,7 @@
                                 int type)
 {
     int err = 0, i = 0;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
     struct hip_common   *update_packet_to_send = NULL;
     struct update_state *localstate            = NULL;
     struct in6_addr local_addr;
@@ -592,7 +593,7 @@
     struct hip_locator_info_addr_item *locators;
     struct hip_hadb_state *ha          = NULL;
     struct hip_common     *locator_msg = NULL;
-    hip_list_t *item = NULL, *tmp = NULL;
+    LHASH_NODE *item = NULL, *tmp = NULL;
 
     HIP_IFEL(!(locator_msg = hip_msg_alloc()), -ENOMEM,
              "Out of memory while allocation memory for the packet\n");

=== modified file 'modules/update/hipd/update_legacy.c'
--- modules/update/hipd/update_legacy.c 2011-01-04 18:32:00 +0000
+++ modules/update/hipd/update_legacy.c 2011-01-07 14:46:07 +0000
@@ -34,6 +34,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <openssl/lhash.h>
 
 #include "config.h"
 #include "hipd/hipd.h"
@@ -64,7 +65,7 @@
     int err                                 = 0, i = 0, count = 0;
     int addr_max;
     struct netdev_address *n;
-    hip_list_t *item                        = NULL, *tmp = NULL;
+    LHASH_NODE *item                        = NULL, *tmp = NULL;
     struct hip_locator_info_addr_item *locs = NULL;
 
     if (address_count == 0) {

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5407: Drop hip_list_t typedef and _t namespace suffix. - noreply