[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5165: whitespace cosmetics: indentation and K&R style changes

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Fri, 19 Nov 2010 14:34:27 -0000

------------------------------------------------------------
revno: 5165
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-11-19 15:32:22 +0100
message:
  whitespace cosmetics: indentation and K&R style changes
modified:
  firewall/esp_prot_conntrack.c
  lib/core/prefix.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/esp_prot_conntrack.c'
--- firewall/esp_prot_conntrack.c       2010-11-15 13:38:47 +0000
+++ firewall/esp_prot_conntrack.c       2010-11-19 14:32:22 +0000
@@ -88,8 +88,7 @@
  * @param transform     TPA transform
  * @return              resolved transform, NULL for UNUSED transform
  */
-static esp_prot_conntrack_tfm_t *esp_prot_conntrack_resolve_transform(
-        const uint8_t transform)
+static esp_prot_conntrack_tfm_t *esp_prot_conntrack_resolve_transform(const 
uint8_t transform)
 {
     HIP_DEBUG("resolving transform: %u\n", transform);
 
@@ -137,10 +136,9 @@
  * @param   hash_length length of the anchor element
  * @return  esp state of the connection
  */
-static struct esp_tuple *esp_prot_conntrack_find_esp_tuple(
-        const struct tuple *tuple,
-        const unsigned char *active_anchor,
-        const int hash_length)
+static struct esp_tuple *esp_prot_conntrack_find_esp_tuple(const struct tuple 
*tuple,
+                                                           const unsigned char 
*active_anchor,
+                                                           const int 
hash_length)
 {
     struct esp_tuple *esp_tuple = NULL;
     SList *list                 = NULL;
@@ -424,9 +422,9 @@
  * @return  0 on success, -1 on error
  */
 static int esp_prot_conntrack_verify_branch(const struct tuple *tuple,
-        const struct esp_prot_anchor *esp_anchors[MAX_NUM_PARALLEL_HCHAINS],
-        const struct esp_prot_branch *esp_branches[MAX_NUM_PARALLEL_HCHAINS],
-        const struct esp_prot_secret *esp_secrets[MAX_NUM_PARALLEL_HCHAINS])
+                                            const struct esp_prot_anchor 
*esp_anchors[MAX_NUM_PARALLEL_HCHAINS],
+                                            const struct esp_prot_branch 
*esp_branches[MAX_NUM_PARALLEL_HCHAINS],
+                                            const struct esp_prot_secret 
*esp_secrets[MAX_NUM_PARALLEL_HCHAINS])
 {
     esp_prot_conntrack_tfm_t *conntrack_tfm = NULL;
     int hash_length                         = 0;
@@ -547,8 +545,8 @@
     int err = 0;
 
     // uninit all possible transforms
-    memset(esp_prot_conntrack_tfms, 0, MAX_NUM_TRANSFORMS
-           * sizeof(esp_prot_conntrack_tfm_t));
+    memset(esp_prot_conntrack_tfms, 0,
+           MAX_NUM_TRANSFORMS * sizeof(esp_prot_conntrack_tfm_t));
 
     return err;
 }
@@ -881,7 +879,8 @@
  * @param   tuple connection state of the connection tracking mechanism
  * @return  0 on success, -1 in case of an error or unsupported update
  */
-int esp_prot_conntrack_update(const hip_common_t *update, const struct tuple 
*tuple)
+int esp_prot_conntrack_update(const hip_common_t *update,
+                              const struct tuple *tuple)
 {
     const struct hip_tlv_common *param  = NULL;
     const struct hip_seq *seq           = NULL;
@@ -898,7 +897,7 @@
     HIP_ASSERT(tuple != NULL);
 
     memset(esp_anchors, 0, MAX_NUM_PARALLEL_HCHAINS * sizeof(struct 
esp_prot_anchor *));
-    memset(esp_roots, 0, MAX_NUM_PARALLEL_HCHAINS * sizeof(struct 
esp_prot_root *));
+    memset(esp_roots,   0, MAX_NUM_PARALLEL_HCHAINS * sizeof(struct 
esp_prot_root *));
 
     seq      = hip_get_param(update, HIP_PARAM_SEQ);
     esp_info = hip_get_param(update, HIP_PARAM_ESP_INFO);
@@ -1148,8 +1147,10 @@
                                                           
conntrack_tfm->hash_length, esp_tuple->hash_tree_depth,
                                                           
&esp_tuple->active_anchors[active_hchain][0],
                                                           
&esp_tuple->next_anchors[active_hchain][0],
-                                                          
esp_tuple->active_roots[active_hchain], esp_tuple->active_root_length,
-                                                          
esp_tuple->next_roots[active_hchain], 
esp_tuple->next_root_length[active_hchain],
+                                                          
esp_tuple->active_roots[active_hchain],
+                                                          
esp_tuple->active_root_length,
+                                                          
esp_tuple->next_roots[active_hchain],
+                                                          
esp_tuple->next_root_length[active_hchain],
                                                           ((unsigned char *) 
esp) + sizeof(struct hip_esp))) < 0, -1,
                      "failed to verify ESP protection hash\n");
         } else {
@@ -1167,8 +1168,11 @@
                                                                
&esp_tuple->active_anchors[active_hchain][0],
                                                                
&esp_tuple->next_anchors[active_hchain][0],
                                                                ((unsigned char 
*) esp) + sizeof(struct hip_esp),
-                                                               num_verify, 
esp_tuple->active_roots[active_hchain], esp_tuple->active_root_length,
-                                                               
esp_tuple->next_roots[active_hchain], 
esp_tuple->next_root_length[active_hchain])) < 0, -1,
+                                                               num_verify,
+                                                               
esp_tuple->active_roots[active_hchain],
+                                                               
esp_tuple->active_root_length,
+                                                               
esp_tuple->next_roots[active_hchain],
+                                                               
esp_tuple->next_root_length[active_hchain])) < 0, -1,
                          "failed to verify ESP protection hash\n");
             } else if ((esp_tuple->esp_prot_tfm == ESP_PROT_TFM_CUMULATIVE
                         || esp_tuple->esp_prot_tfm == ESP_PROT_TFM_PARA_CUMUL)
@@ -1218,7 +1222,8 @@
 
                     // keep the buffer filled with fresh elements only
                     if (cumulative_ptr[i].seq > 
esp_tuple->hash_buffer[cumulative_ptr[i].seq % ring_buffer_size].seq) {
-                        memcpy(&esp_tuple->hash_buffer[cumulative_ptr[i].seq % 
ring_buffer_size], &cumulative_ptr[i],
+                        memcpy(&esp_tuple->hash_buffer[cumulative_ptr[i].seq % 
ring_buffer_size],
+                               &cumulative_ptr[i],
                                sizeof(esp_cumulative_item_t));
 
                         HIP_DEBUG("cached cumulative token with SEQ: %u\n", 
cumulative_ptr[i].seq);

=== modified file 'lib/core/prefix.c'
--- lib/core/prefix.c   2010-11-15 13:39:24 +0000
+++ lib/core/prefix.c   2010-11-19 14:32:22 +0000
@@ -381,23 +381,23 @@
     return IS_IPV4_LOOPBACK(addr_in.s_addr);
 }
 
-int ipv4_addr_cmp(const struct in_addr *a1,
-                                const struct in_addr *a2) {
+int ipv4_addr_cmp(const struct in_addr *a1, const struct in_addr *a2)
+{
     return memcmp(a1, a2, sizeof(struct in_addr));
 }
 
-void ipv4_addr_copy(struct in_addr *a1,
-                                  const struct in_addr *a2) {
+void ipv4_addr_copy(struct in_addr *a1, const struct in_addr *a2)
+{
     memcpy(a1, a2, sizeof(struct in_addr));
 }
 
-int ipv6_addr_cmp(const struct in6_addr *a1,
-                  const struct in6_addr *a2) {
+int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2)
+{
     return memcmp(a1, a2, sizeof(struct in6_addr));
 }
 
-void ipv6_addr_copy(struct in6_addr *a1,
-               const struct in6_addr *a2) {
+void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
+{
     memcpy(a1, a2, sizeof(struct in6_addr));
 }
 
@@ -409,7 +409,8 @@
 }
 
 void hip_copy_in6addr_null_check(struct in6_addr *to,
-                                 const struct in6_addr *from) {
+                                 const struct in6_addr *from)
+{
     HIP_ASSERT(to);
     if (from) {
         ipv6_addr_copy(to, from);
@@ -418,8 +419,8 @@
     }
 }
 
-void hip_copy_inaddr_null_check(struct in_addr *to,
-                                const struct in_addr *from) {
+void hip_copy_inaddr_null_check(struct in_addr *to, const struct in_addr *from)
+{
     HIP_ASSERT(to);
     if (from) {
         memcpy(to, from, sizeof(*to));

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5165: whitespace cosmetics: indentation and K&R style changes - noreply