[hipl-commit] [tiny] Rev 3636: Changed type of the packet_type variable to uint8_t.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Mon, 8 Mar 2010 11:47:23 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Mon Mar 08 10:44:30 2010 +0100
Revision: 3636
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Changed type of the packet_type variable to uint8_t.
  
  Since the packet type field is a 7-bit value (RFC5201, 9.), the new type 
  is sufficient.

Modified:
  M  hipd/bos.c
  M  hipd/bos.h
  M  hipd/close.c
  M  hipd/close.h
  M  hipd/esp_prot_light_update.c
  M  hipd/esp_prot_light_update.h
  M  hipd/input.c
  M  hipd/input.h
  M  hipd/modularization.c
  M  hipd/modularization.h
  M  hipd/output.c
  M  hipd/output.h
  M  modules/update/hipd/update.c
  M  modules/update/hipd/update.h

=== modified file 'hipd/bos.c'
--- hipd/bos.c  2010-03-05 19:01:11 +0000
+++ hipd/bos.c  2010-03-08 09:44:30 +0000
@@ -200,7 +200,7 @@
  * @return On success (BOS payloads are checked) 0 is returned, otherwise < 0.
  */
 
-int hip_handle_bos(const uint32_t packet_type,
+int hip_handle_bos(const uint8_t packet_type,
                    const uint32_t ha_state,
                    struct hip_packet_context *ctx)
 {

=== modified file 'hipd/bos.h'
--- hipd/bos.h  2010-03-05 17:28:01 +0000
+++ hipd/bos.h  2010-03-08 09:44:30 +0000
@@ -16,7 +16,7 @@
 int hip_verify_packet_signature(struct hip_common *bos,
                                 struct hip_host_id *peer_host_id);
 
-int hip_handle_bos(const uint32_t packet_type,
+int hip_handle_bos(const uint8_t packet_type,
                    const uint32_t ha_state,
                    struct hip_packet_context *packet_ctx);
 

=== modified file 'hipd/close.c'
--- hipd/close.c        2010-03-05 18:45:16 +0000
+++ hipd/close.c        2010-03-08 09:44:30 +0000
@@ -173,7 +173,7 @@
     return err;
 }
 
-int hip_handle_close(const uint32_t packet_type,
+int hip_handle_close(const uint8_t packet_type,
                      const uint32_t ha_state,
                      struct hip_packet_context *ctx)
 {
@@ -277,7 +277,7 @@
     return err;
 }
 
-int hip_handle_close_ack(const uint32_t packet_type,
+int hip_handle_close_ack(const uint8_t packet_type,
                          const uint32_t ha_state,
                          struct hip_packet_context *ctx)
 {

=== modified file 'hipd/close.h'
--- hipd/close.h        2010-03-05 17:28:01 +0000
+++ hipd/close.h        2010-03-08 09:44:30 +0000
@@ -14,10 +14,10 @@
 #include "lib/tool/pk.h"
 
 int hip_send_close(struct hip_common *msg, int delete_ha_info);
-int hip_handle_close(const uint32_t packet_type,
+int hip_handle_close(const uint8_t packet_type,
                      const uint32_t ha_state,
                      struct hip_packet_context *ctx);
-int hip_handle_close_ack(const uint32_t packet_type,
+int hip_handle_close_ack(const uint8_t packet_type,
                          const uint32_t ha_state,
                          struct hip_packet_context *ctx);
 int hip_purge_closing_ha(hip_ha_t *ha, void *notused);

=== modified file 'hipd/esp_prot_light_update.c'
--- hipd/esp_prot_light_update.c        2010-03-05 19:14:35 +0000
+++ hipd/esp_prot_light_update.c        2010-03-08 09:44:30 +0000
@@ -183,7 +183,7 @@
  * @param entry     host association for this connection
  * @return          0 in case of succcess, -1 otherwise
  */
-int esp_prot_handle_light_update(const uint32_t packet_type,
+int esp_prot_handle_light_update(const uint8_t packet_type,
                                  const uint32_t ha_state,
                                  struct hip_packet_context *ctx)
 {

=== modified file 'hipd/esp_prot_light_update.h'
--- hipd/esp_prot_light_update.h        2010-03-05 17:28:01 +0000
+++ hipd/esp_prot_light_update.h        2010-03-08 09:44:30 +0000
@@ -24,7 +24,7 @@
                                const int secret_length[],
                                unsigned char 
*branch_nodes[MAX_NUM_PARALLEL_HCHAINS],
                                const int branch_length[]);
-int esp_prot_handle_light_update(const uint32_t packet_type,
+int esp_prot_handle_light_update(const uint8_t packet_type,
                                  const uint32_t ha_state,
                                  struct hip_packet_context *ctx);
 

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-03-05 19:14:35 +0000
+++ hipd/input.c        2010-03-08 09:44:30 +0000
@@ -712,7 +712,7 @@
  *                 initiator should store these addresses to cope with the
  *                 double jump problem.
  */
-int hip_handle_r1(const uint32_t packet_type,
+int hip_handle_r1(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *packet_ctx)
 {
@@ -976,7 +976,7 @@
  *         Error   = -1
  *
  */
-int hip_handle_i2_in_i2_sent(const uint32_t packet_type,
+int hip_handle_i2_in_i2_sent(const uint8_t packet_type,
                              const uint32_t ha_state,
                              struct hip_packet_context *ctx)
 {
@@ -1018,7 +1018,7 @@
  *                 <a href="http://www.rfc-editor.org/rfc/rfc5201.txt";>
  *                 RFC 5201</a>.
  */
-int hip_handle_i2(const uint32_t packet_type,
+int hip_handle_i2(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx)
 {
@@ -1583,7 +1583,7 @@
  * On success (payloads are created and IPsec is set up) 0 is
  * returned, otherwise < 0.
  */
-int hip_handle_r2(const uint32_t packet_type,
+int hip_handle_r2(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *packet_ctx)
 {
@@ -1846,7 +1846,7 @@
  *                 present in the incoming I1 packet, only the first of a kind
  *                 is parsed.
  */
-int hip_handle_i1(const uint32_t packet_type,
+int hip_handle_i1(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx)
 {
@@ -1930,7 +1930,7 @@
  *                     packet was sent to (own address).
  * @param entry        a pointer to a host association
  */
-int hip_handle_notify(const uint32_t packet_type,
+int hip_handle_notify(const uint8_t packet_type,
                       const uint32_t ha_state,
                       struct hip_packet_context *ctx)
 {

=== modified file 'hipd/input.h'
--- hipd/input.h        2010-03-05 18:54:17 +0000
+++ hipd/input.h        2010-03-08 09:44:30 +0000
@@ -86,27 +86,27 @@
                                    struct in6_addr *daddr,
                                    hip_portpair_t *info);
 
-int hip_handle_i1(const uint32_t packet_type,
+int hip_handle_i1(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx);
 
-int hip_handle_i2_in_i2_sent(const uint32_t packet_type,
+int hip_handle_i2_in_i2_sent(const uint8_t packet_type,
                              const uint32_t ha_state,
                              struct hip_packet_context *ctx);
 
-int hip_handle_i2(const uint32_t packet_type,
+int hip_handle_i2(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx);
 
-int hip_handle_notify(const uint32_t packet_type,
+int hip_handle_notify(const uint8_t packet_type,
                       const uint32_t ha_state,
                       struct hip_packet_context *ctx);
 
-int hip_handle_r1(const uint32_t packet_type,
+int hip_handle_r1(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx);
 
-int hip_handle_r2(const uint32_t packet_type,
+int hip_handle_r2(const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *packet_ctx);
 

=== modified file 'hipd/modularization.c'
--- hipd/modularization.c       2010-03-08 09:34:52 +0000
+++ hipd/modularization.c       2010-03-08 09:44:30 +0000
@@ -14,7 +14,7 @@
 
 struct handle_function {
     uint32_t            priority;
-    int               (*func_ptr)(const uint32_t packet_type,
+    int               (*func_ptr)(const uint8_t packet_type,
                                   const uint32_t ha_state,
                                   struct hip_packet_context *ctx);
 };
@@ -50,9 +50,9 @@
  * @return Success =  0
  *         Error   = -1
  */
-int hip_register_handle_function(const uint32_t packet_type,
+int hip_register_handle_function(const uint8_t packet_type,
                                  const uint32_t ha_state,
-                                 int (*handle_function)(const uint32_t 
packet_type,
+                                 int (*handle_function)(const uint8_t 
packet_type,
                                                         const uint32_t 
ha_state,
                                                         struct 
hip_packet_context *ctx),
                                  const uint16_t priority)
@@ -99,7 +99,7 @@
  * @return Success =  0
  *         Error   = -1
  */
-int hip_unregister_handle_function(const uint32_t packet_type,
+int hip_unregister_handle_function(const uint8_t packet_type,
                                    const uint32_t ha_state,
                                    const void *handle_function)
 {
@@ -134,7 +134,7 @@
  * @return Success =  0
  *         Error   = -1
  */
-int hip_run_handle_functions(const uint32_t packet_type,
+int hip_run_handle_functions(const uint8_t packet_type,
                              const uint32_t ha_state,
                              struct hip_packet_context *ctx)
 {

=== modified file 'hipd/modularization.h'
--- hipd/modularization.h       2010-03-05 10:01:58 +0000
+++ hipd/modularization.h       2010-03-08 09:44:30 +0000
@@ -10,18 +10,18 @@
 #ifndef HIP_HIPD_MODULARIZATION_H
 #define HIP_HIPD_MODULARIZATION_H
 
-int hip_register_handle_function(const uint32_t packet_type,
+int hip_register_handle_function(const uint8_t packet_type,
                                  const uint32_t ha_state,
-                                 int (*handle_function)(const uint32_t 
packet_type,
+                                 int (*handle_function)(const uint8_t 
packet_type,
                                                         const uint32_t 
ha_state,
                                                         struct 
hip_packet_context *ctx),
                                  const uint16_t priority);
 
-int hip_unregister_handle_function(const uint32_t packet_type,
+int hip_unregister_handle_function(const uint8_t packet_type,
                                    const uint32_t ha_state,
                                    const void *handle_function);
 
-int hip_run_handle_functions(const uint32_t packet_type,
+int hip_run_handle_functions(const uint8_t packet_type,
                              const uint32_t ha_state,
                              struct hip_packet_context *ctx);
 

=== modified file 'hipd/output.c'
--- hipd/output.c       2010-03-05 18:02:42 +0000
+++ hipd/output.c       2010-03-08 09:44:30 +0000
@@ -519,7 +519,7 @@
  *
  * @return zero on success, non-negative on error.
  */
-int hip_send_i2(const uint32_t packet_type,
+int hip_send_i2(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *packet_ctx)
 {
@@ -1068,7 +1068,7 @@
  * @param rvs_count     number of addresses in @c traversed_rvs.
  * @return              zero on success, or negative error value on error.
  */
-int hip_send_r1(const uint32_t packet_type,
+int hip_send_r1(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *ctx)
 {
@@ -1230,7 +1230,7 @@
  *                  in use).
  * @return zero on success, negative otherwise.
  */
-int hip_send_r2(const uint32_t packet_type,
+int hip_send_r2(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *packet_ctx)
 {

=== modified file 'hipd/output.h'
--- hipd/output.h       2010-03-05 17:28:01 +0000
+++ hipd/output.h       2010-03-08 09:44:30 +0000
@@ -51,11 +51,11 @@
                                  const struct hip_host_id *host_id_pub,
                                  int cookie_k);
 
-int hip_send_r1(const uint32_t packet_type,
+int hip_send_r1(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *ctx);
 
-int hip_send_r2(const uint32_t packet_type,
+int hip_send_r2(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *packet_ctx);
 
@@ -67,7 +67,7 @@
 
 int hip_send_i1(hip_hit_t *, hip_hit_t *, hip_ha_t *);
 
-int hip_send_i2(const uint32_t packet_type,
+int hip_send_i2(const uint8_t packet_type,
                 const uint32_t ha_state,
                 struct hip_packet_context *packet_ctx);
 

=== modified file 'modules/update/hipd/update.c'
--- modules/update/hipd/update.c        2010-03-05 17:28:01 +0000
+++ modules/update/hipd/update.c        2010-03-08 09:44:30 +0000
@@ -684,7 +684,7 @@
     }
 }
 
-int hip_handle_update(const uint32_t packet_type,
+int hip_handle_update(const uint8_t packet_type,
                       const uint32_t ha_state,
                       struct hip_packet_context *ctx)
 {

=== modified file 'modules/update/hipd/update.h'
--- modules/update/hipd/update.h        2010-03-05 17:28:01 +0000
+++ modules/update/hipd/update.h        2010-03-08 09:44:30 +0000
@@ -66,7 +66,7 @@
  *
  * @return 0 if succeeded, error number otherwise
  */
-int hip_handle_update(const uint32_t packet_type,
+int hip_handle_update(const uint8_t packet_type,
                       const uint32_t ha_state,
                       struct hip_packet_context *ctx);

Other related posts:

  • » [hipl-commit] [tiny] Rev 3636: Changed type of the packet_type variable to uint8_t. - Tim Just