[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5344: Drop hashchain_store typedefs and _t namespace suffixes.

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Tue, 04 Jan 2011 12:01:32 -0000

------------------------------------------------------------
revno: 5344
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: hipl
timestamp: Mon 2011-01-03 18:24:19 +0100
message:
  Drop hashchain_store typedefs and _t namespace suffixes.
  
  The _t namespace is reserved for POSIX; typedefs are evil.
modified:
  firewall/esp_prot_api.c
  firewall/esp_prot_fw_msg.c
  firewall/esp_prot_fw_msg.h
  lib/core/hashchain_store.c
  lib/core/hashchain_store.h


--
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/esp_prot_api.c'
--- firewall/esp_prot_api.c     2011-01-03 17:03:05 +0000
+++ firewall/esp_prot_api.c     2011-01-03 17:24:19 +0000
@@ -112,9 +112,9 @@
 static esp_prot_tfm_t esp_prot_transforms[MAX_NUM_TRANSFORMS];
 
 // this store only contains hchains used when negotiating esp protection in BEX
-static hchain_store_t bex_store;
+static struct hchain_store bex_store;
 // this stores hchains used during UPDATE
-static hchain_store_t update_store;
+static struct hchain_store update_store;
 
 /**
  * Adds buffered packet hashes to a protected IPsec packet

=== modified file 'firewall/esp_prot_fw_msg.c'
--- firewall/esp_prot_fw_msg.c  2011-01-03 17:03:05 +0000
+++ firewall/esp_prot_fw_msg.c  2011-01-03 17:24:19 +0000
@@ -65,7 +65,7 @@
  *       this should be set up for the store containing the hchains for the BEX
  * @note the created message contains hash_length and anchors for each 
transform
  */
-static hip_common_t *create_bex_store_update_msg(hchain_store_t *hcstore,
+static hip_common_t *create_bex_store_update_msg(struct hchain_store *hcstore,
                                                  const int use_hash_trees)
 {
     struct hip_common *msg    = NULL;
@@ -284,7 +284,7 @@
  * @param   use_hash_trees indicates whether hash chains or hash trees are 
stored
  * @return  0 on success, -1 on error
  */
-int send_bex_store_update_to_hipd(hchain_store_t *hcstore,
+int send_bex_store_update_to_hipd(struct hchain_store *hcstore,
                                   const int use_hash_trees)
 {
     struct hip_common *msg = NULL;

=== modified file 'firewall/esp_prot_fw_msg.h'
--- firewall/esp_prot_fw_msg.h  2010-10-15 15:29:14 +0000
+++ firewall/esp_prot_fw_msg.h  2011-01-03 17:24:19 +0000
@@ -43,7 +43,7 @@
 #include "user_ipsec_sadb.h"
 
 int send_esp_prot_to_hipd(const int active);
-int send_bex_store_update_to_hipd(hchain_store_t *hcstore,
+int send_bex_store_update_to_hipd(struct hchain_store *hcstore,
                                   const int use_hash_trees);
 int send_trigger_update_to_hipd(const hip_sa_entry_t *entry,
                                 const unsigned char 
*anchors[MAX_NUM_PARALLEL_HCHAINS],

=== modified file 'lib/core/hashchain_store.c'
--- lib/core/hashchain_store.c  2011-01-03 17:03:05 +0000
+++ lib/core/hashchain_store.c  2011-01-03 17:24:19 +0000
@@ -67,7 +67,7 @@
  * @param       refill_threshold the threshold below which a hierarchy level 
will be refilled
  * @return      always returns 0
  */
-int hcstore_init(hchain_store_t *hcstore,
+int hcstore_init(struct hchain_store *hcstore,
                  const int num_hchains_per_item,
                  const double refill_threshold)
 {
@@ -112,7 +112,7 @@
  * @param       hcstore the store to be un-initialized
  * @param       use_hash_trees indicates whether hash chains or hash trees are 
stored
  */
-void hcstore_uninit(hchain_store_t *hcstore, const int use_hash_trees)
+void hcstore_uninit(struct hchain_store *hcstore, const int use_hash_trees)
 {
     int i, j, g, h;
 
@@ -155,7 +155,7 @@
  * @return      returns the index to the hash function in the store,
  *          -1 if MAX_FUNCTIONS is reached
  */
-int hcstore_register_function(hchain_store_t *hcstore,
+int hcstore_register_function(struct hchain_store *hcstore,
                               const hash_function hash_func)
 {
     int err = 0;
@@ -197,7 +197,7 @@
  * @return      returns the index to the hash length in the store,
  *          -1 if MAX_NUM_HASH_LENGTH is reached
  */
-int hcstore_register_hash_length(hchain_store_t *hcstore, const int 
function_id,
+int hcstore_register_hash_length(struct hchain_store *hcstore, const int 
function_id,
                                  const int hash_length)
 {
     int err = 0;
@@ -241,7 +241,7 @@
  * @return      returns the index to the hash structure length in the store,
  *          -1 if MAX_NUM_HCHAIN_LENGTH is reached
  */
-int hcstore_register_hash_item_length(hchain_store_t *hcstore,
+int hcstore_register_hash_item_length(struct hchain_store *hcstore,
                                       const int function_id,
                                       const int hash_length_id,
                                       const int hitem_length)
@@ -293,7 +293,7 @@
  * @param       addtional_hierarchies
  * @return      returns the hierarchy count, -1 if MAX_NUM_HIERARCHIES is 
reached
  */
-int hcstore_register_hash_item_hierarchy(hchain_store_t *hcstore,
+int hcstore_register_hash_item_hierarchy(struct hchain_store *hcstore,
                                          const int function_id,
                                          const int hash_length_id,
                                          const int hitem_length,
@@ -354,7 +354,7 @@
  * @param       use_hash_trees indicates whether hash chains or hash trees are 
stored
  * @return      number of created hash structures, -1 in case of an error
  */
-static int hcstore_fill_item(hchain_store_t *hcstore,
+static int hcstore_fill_item(struct hchain_store *hcstore,
                              const int hash_func_id,
                              const int hash_length_id,
                              const int hchain_length_id,
@@ -507,7 +507,7 @@
  * @param       use_hash_trees indicates whether hash chains or hash trees are 
stored
  * @return      number of created hash structures, -1 in case of an error
  */
-int hcstore_refill(hchain_store_t *hcstore, const int use_hash_trees)
+int hcstore_refill(struct hchain_store *hcstore, const int use_hash_trees)
 {
     int err = 0;
     unsigned i, j, g, h;
@@ -541,7 +541,7 @@
  * @param       hchain_length length of the hash structure
  * @return      pointer to the hash structure, NULL in case of an error or no 
such structure
  */
-void *hcstore_get_hash_item(hchain_store_t *hcstore,
+void *hcstore_get_hash_item(struct hchain_store *hcstore,
                             const int function_id,
                             const int hash_length_id,
                             const int hchain_length)
@@ -603,7 +603,7 @@
  * @param       use_hash_trees indicates whether hash chains or hash trees are 
stored
  * @return      pointer to the hash structure, NULL in case of an error or no 
such structure
  */
-void *hcstore_get_item_by_anchor(hchain_store_t *hcstore,
+void *hcstore_get_item_by_anchor(struct hchain_store *hcstore,
                                  const int function_id,
                                  const int hash_length_id,
                                  const int hierarchy_level,
@@ -690,7 +690,7 @@
  * @param       function_id index of the hash function
  * @return      pointer to the hash function, NULL if no such hash function
  */
-hash_function hcstore_get_hash_function(hchain_store_t *hcstore,
+hash_function hcstore_get_hash_function(struct hchain_store *hcstore,
                                         const int function_id)
 {
     HIP_ASSERT(hcstore != NULL);
@@ -706,7 +706,7 @@
  * @param       hash_length_id index of the hash length
  * @return      the hash length, 0 if no such hash length
  */
-int hcstore_get_hash_length(hchain_store_t *hcstore,
+int hcstore_get_hash_length(struct hchain_store *hcstore,
                             const int function_id,
                             const int hash_length_id)
 {

=== modified file 'lib/core/hashchain_store.h'
--- lib/core/hashchain_store.h  2011-01-03 17:03:05 +0000
+++ lib/core/hashchain_store.h  2011-01-03 17:24:19 +0000
@@ -51,7 +51,7 @@
 #define MAX_NUM_HIERARCHIES             100
 
 
-typedef struct hchain_shelf {
+struct hchain_shelf {
     /* number of different hchain lengths currently used for this
      * (hash-function, hash_length)-combination */
     unsigned      num_hchain_lengths;
@@ -61,9 +61,9 @@
     unsigned      num_hierarchies[MAX_NUM_HCHAIN_LENGTH];
     /* hchains with the respective hchain length */
     struct hip_ll hchains[MAX_NUM_HCHAIN_LENGTH][MAX_NUM_HIERARCHIES];
-} hchain_shelf_t;
+};
 
-typedef struct hchain_store {
+struct hchain_store {
     /* determines at which volume a store item should be refilled */
     double      refill_threshold;
     /* number of hash structures stored per item, when it is full */
@@ -74,47 +74,47 @@
      *
      * @note params: (in_buffer, in_length, out_buffer)
      * @note out_buffer should be size MAX_HASH_LENGTH */
-    hash_function hash_functions[MAX_FUNCTIONS];
+    hash_function       hash_functions[MAX_FUNCTIONS];
     /* amount of different hash_lengths per hash-function */
-    unsigned        num_hash_lengths[MAX_FUNCTIONS];
+    unsigned            num_hash_lengths[MAX_FUNCTIONS];
     /* length of the hashes, of which the respective hchain items consist */
-    unsigned        hash_lengths[MAX_FUNCTIONS][MAX_NUM_HASH_LENGTH];
+    unsigned            hash_lengths[MAX_FUNCTIONS][MAX_NUM_HASH_LENGTH];
     /* contains hchains and meta-information about how to process them */
-    hchain_shelf_t  hchain_shelves[MAX_FUNCTIONS][MAX_NUM_HASH_LENGTH];
-} hchain_store_t;
+    struct hchain_shelf hchain_shelves[MAX_FUNCTIONS][MAX_NUM_HASH_LENGTH];
+};
 
-int hcstore_init(hchain_store_t *hcstore,
+int hcstore_init(struct hchain_store *hcstore,
                  const int num_hchains_per_item,
                  const double refill_threshold);
-void hcstore_uninit(hchain_store_t *hcstore, const int use_hash_trees);
-int hcstore_register_function(hchain_store_t *hcstore,
+void hcstore_uninit(struct hchain_store *hcstore, const int use_hash_trees);
+int hcstore_register_function(struct hchain_store *hcstore,
                               const hash_function hash_function);
-int hcstore_register_hash_length(hchain_store_t *hcstore,
+int hcstore_register_hash_length(struct hchain_store *hcstore,
                                  const int function_id,
                                  const int hash_length);
-int hcstore_register_hash_item_length(hchain_store_t *hcstore,
+int hcstore_register_hash_item_length(struct hchain_store *hcstore,
                                       const int function_id,
                                       const int hash_length_id,
                                       const int hitem_length);
-int hcstore_register_hash_item_hierarchy(hchain_store_t *hcstore,
+int hcstore_register_hash_item_hierarchy(struct hchain_store *hcstore,
                                          const int function_id,
                                          const int hash_length_id,
                                          const int hitem_length,
                                          const int addtional_hierarchies);
-int hcstore_refill(hchain_store_t *hcstore, const int use_hash_trees);
-void *hcstore_get_hash_item(hchain_store_t *hcstore,
+int hcstore_refill(struct hchain_store *hcstore, const int use_hash_trees);
+void *hcstore_get_hash_item(struct hchain_store *hcstore,
                             const int function_id,
                             const int hash_length_id,
                             const int hchain_length);
-void *hcstore_get_item_by_anchor(hchain_store_t *hcstore,
+void *hcstore_get_item_by_anchor(struct hchain_store *hcstore,
                                  const int function_id,
                                  const int hash_length_id,
                                  const int hierarchy_level,
                                  const unsigned char *anchor,
                                  const int use_hash_trees);
-hash_function hcstore_get_hash_function(hchain_store_t *hcstore,
+hash_function hcstore_get_hash_function(struct hchain_store *hcstore,
                                         const int function_id);
-int hcstore_get_hash_length(hchain_store_t *hcstore,
+int hcstore_get_hash_length(struct hchain_store *hcstore,
                             const int function_id,
                             const int hash_length_id);
 

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5344: Drop hashchain_store typedefs and _t namespace suffixes. - noreply