[hipl-dev] [Branch ~hipl-core/hipl/mobility-fixes] Rev 5182: moved locator-specific structs from protodefs.h to update module

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Mon, 22 Nov 2010 14:53:29 -0000

------------------------------------------------------------
revno: 5182
committer: Rene Hummen <rene.hummen@xxxxxxxxxxxxxxxxx>
branch nick: mobility-fixes
timestamp: Mon 2010-11-22 15:51:50 +0100
message:
  moved locator-specific structs from protodefs.h to update module
modified:
  firewall/conntrack.c
  lib/core/protodefs.h
  lib/core/state.h
  modules/update/hipd/update.h
  modules/update/hipd/update_builder.h


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

Your team HIPL core team is subscribed to branch 
lp:~hipl-core/hipl/mobility-fixes.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/mobility-fixes/+edit-subscription
=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-10-27 11:27:48 +0000
+++ firewall/conntrack.c        2010-11-22 14:51:50 +0000
@@ -59,6 +59,7 @@
 #include "lib/core/prefix.h"
 #include "lib/core/protodefs.h"
 #include "lib/tool/pk.h"
+#include "modules/update/hipd/update.h"
 #include "common_types.h"
 #include "dlist.h"
 #include "esp_prot_conntrack.h"

=== modified file 'lib/core/protodefs.h'
--- lib/core/protodefs.h        2010-11-19 17:43:30 +0000
+++ lib/core/protodefs.h        2010-11-22 14:51:50 +0000
@@ -682,46 +682,6 @@
     uint16_t       caseid;
 } __attribute__ ((packed));
 
-/**
- * Fixed start of this struct must match to struct hip_peer_addr_list_item
- * for the part of address item. It is used in hip_update_locator_match().
- * @todo Maybe fix this in some better way?
- */
-struct hip_locator_info_addr_item {
-    uint8_t         traffic_type;
-    uint8_t         locator_type;
-    uint8_t         locator_length;
-    uint8_t         reserved; /**< last bit is P (prefered) */
-    uint32_t        lifetime;
-    struct in6_addr address;
-}  __attribute__ ((packed));
-//add by santtu
-/**
- * it is the type 2 locater for UDP or other transport protocol later.
- */
-struct hip_locator_info_addr_item2 {
-    uint8_t         traffic_type;
-    uint8_t         locator_type;
-    uint8_t         locator_length;
-    uint8_t         reserved; /* last bit is P (prefered) */
-    uint32_t        lifetime;
-    uint16_t        port;
-    uint8_t         transport_protocol;
-    uint8_t         kind;
-    uint32_t        priority;
-    uint32_t        spi;
-    struct in6_addr address;
-}  __attribute__ ((packed));
-
-
-/**
- * it is a union of both type1 and type2 locator.
- */
-union hip_locator_info_addr {
-    struct hip_locator_info_addr_item  type1;
-    struct hip_locator_info_addr_item2 type2;
-} __attribute__ ((packed));
-//end add
 /** Structure describing an endpoint. This structure is used by the resolver in
  * the userspace, so it is not length-padded like HIP parameters. All of the
  * members are in network byte order.
@@ -932,12 +892,6 @@
     uint8_t        data[0]; /**< A pointer to the notification data */
 } __attribute__ ((packed));
 
-struct hip_locator {
-    hip_tlv_type_t type;
-    hip_tlv_len_t  length;
-    /* fixed part ends */
-} __attribute__ ((packed));
-
 struct hip_hmac {
     hip_tlv_type_t type;
     hip_tlv_len_t  length;

=== modified file 'lib/core/state.h'
--- lib/core/state.h    2010-11-22 14:27:43 +0000
+++ lib/core/state.h    2010-11-22 14:51:50 +0000
@@ -150,9 +150,6 @@
     uint16_t      keymat_index;        /* advertised keymat index */
     /* the Update ID in SEQ parameter these SPI are related to */
     struct hip_esp_info                stored_received_esp_info;
-    /* our addresses this SPI is related to, reuse struct to ease coding */
-    struct hip_locator_info_addr_item *addresses;
-    int                                addresses_n; /* number of addresses */
 };
 
 struct hip_spi_out_item {

=== modified file 'modules/update/hipd/update.h'
--- modules/update/hipd/update.h        2010-11-22 14:27:43 +0000
+++ modules/update/hipd/update.h        2010-11-22 14:51:50 +0000
@@ -50,6 +50,52 @@
 #define HIP_LOCATOR_LOCATOR_TYPE_ESP_SPI 1
 #define HIP_LOCATOR_LOCATOR_TYPE_UDP     2
 
+
+struct hip_locator {
+    hip_tlv_type_t type;
+    hip_tlv_len_t  length;
+    /* fixed part ends */
+} __attribute__ ((packed));
+
+/**
+ * Fixed start of this struct must match to struct hip_peer_addr_list_item
+ * for the part of address item. It is used in hip_update_locator_match().
+ * @todo Maybe fix this in some better way?
+ */
+struct hip_locator_info_addr_item {
+    uint8_t         traffic_type;
+    uint8_t         locator_type;
+    uint8_t         locator_length;
+    uint8_t         reserved; /**< last bit is P (prefered) */
+    uint32_t        lifetime;
+    struct in6_addr address;
+}  __attribute__ ((packed));
+
+/**
+ * it is the type 2 locater for UDP or other transport protocol later.
+ */
+struct hip_locator_info_addr_item2 {
+    uint8_t         traffic_type;
+    uint8_t         locator_type;
+    uint8_t         locator_length;
+    uint8_t         reserved; /* last bit is P (prefered) */
+    uint32_t        lifetime;
+    uint16_t        port;
+    uint8_t         transport_protocol;
+    uint8_t         kind;
+    uint32_t        priority;
+    uint32_t        spi;
+    struct in6_addr address;
+}  __attribute__ ((packed));
+
+/**
+ * it is a union of both type1 and type2 locator.
+ */
+union hip_locator_info_addr {
+    struct hip_locator_info_addr_item  type1;
+    struct hip_locator_info_addr_item2 type2;
+} __attribute__ ((packed));
+
 int hip_get_locator_addr_item_count(const struct hip_locator *locator);
 
 int hip_create_locators(hip_common_t *locator_msg,

=== modified file 'modules/update/hipd/update_builder.h'
--- modules/update/hipd/update_builder.h        2010-11-22 14:03:57 +0000
+++ modules/update/hipd/update_builder.h        2010-11-22 14:51:50 +0000
@@ -33,7 +33,7 @@
  */
 
 #include "lib/core/protodefs.h"
-
+#include "update.h"
 
 #ifndef MODULES_UPDATE_HIPD_UPDATE_BUILDER_H
 #define MODULES_UPDATE_HIPD_UPDATE_BUILDER_H

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/mobility-fixes] Rev 5182: moved locator-specific structs from protodefs.h to update module - noreply