[hipl-commit] [tiny] Rev 3618: Removed hip_drop_packet.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 5 Mar 2010 12:08:34 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Fri Mar 05 11:06:35 2010 +0100
Revision: 3618
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Removed hip_drop_packet.
  
  If no handle function for the combination of packet type and state was
  registered, the packet is dropped by default. Therefore it is not necessary
  to register a dedicated function.

Modified:
  M  hipd/init.c
  M  hipd/input.c
  M  hipd/input.h

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-03-05 09:51:49 +0000
+++ hipd/init.c 2010-03-05 10:06:35 +0000
@@ -460,23 +460,12 @@
     hip_register_handle_function(HIP_I2, HIP_STATE_NONE,         
&hip_handle_i2, 1000);
     hip_register_handle_function(HIP_I2, HIP_STATE_NONE,         &hip_send_r2, 
1100);
 
-    hip_register_handle_function(HIP_R1, HIP_STATE_UNASSOCIATED, 
&hip_drop_packet, 1000);
     hip_register_handle_function(HIP_R1, HIP_STATE_I1_SENT,      
&hip_handle_r1, 1000);
     hip_register_handle_function(HIP_R1, HIP_STATE_I2_SENT,      
&hip_handle_r1, 1000);
-    hip_register_handle_function(HIP_R1, HIP_STATE_R2_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R1, HIP_STATE_ESTABLISHED,  
&hip_drop_packet, 1000);
     hip_register_handle_function(HIP_R1, HIP_STATE_CLOSING,      
&hip_handle_r1, 1000);
     hip_register_handle_function(HIP_R1, HIP_STATE_CLOSED,       
&hip_handle_r1, 1000);
-    hip_register_handle_function(HIP_R1, HIP_STATE_NONE,         
&hip_drop_packet, 1000);
 
-    hip_register_handle_function(HIP_R2, HIP_STATE_UNASSOCIATED, 
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_I1_SENT,      
&hip_drop_packet, 1000);
     hip_register_handle_function(HIP_R2, HIP_STATE_I2_SENT,      
&hip_handle_r2, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_R2_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_ESTABLISHED,  
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_CLOSING,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_CLOSED,       
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_R2, HIP_STATE_NONE,         
&hip_drop_packet, 1000);
 
     hip_register_handle_function(HIP_NOTIFY, HIP_STATE_I1_SENT,     
&hip_handle_notify, 1000);
     hip_register_handle_function(HIP_NOTIFY, HIP_STATE_I2_SENT,     
&hip_handle_notify, 1000);
@@ -485,23 +474,11 @@
     hip_register_handle_function(HIP_NOTIFY, HIP_STATE_CLOSING,     
&hip_handle_notify, 1000);
     hip_register_handle_function(HIP_NOTIFY, HIP_STATE_CLOSED,      
&hip_handle_notify, 1000);
 
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_UNASSOCIATED, 
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_I1_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_I2_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_R2_SENT,      
&hip_drop_packet, 1000);
     hip_register_handle_function(HIP_CLOSE, HIP_STATE_ESTABLISHED,  
&hip_handle_close, 1000);
     hip_register_handle_function(HIP_CLOSE, HIP_STATE_CLOSING,      
&hip_handle_close, 1000);
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_CLOSED,       
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE, HIP_STATE_NONE,         
&hip_drop_packet, 1000);
 
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_UNASSOCIATED, 
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I1_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_I2_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_R2_SENT,      
&hip_drop_packet, 1000);
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_ESTABLISHED,  
&hip_drop_packet, 1000);
     hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_CLOSING,      
&hip_handle_close_ack, 1000);
     hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_CLOSED,       
&hip_handle_close_ack, 1000);
-    hip_register_handle_function(HIP_CLOSE_ACK, HIP_STATE_NONE,         
&hip_drop_packet, 1000);
 
     return err;
 }

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-03-05 09:51:49 +0000
+++ hipd/input.c        2010-03-05 10:06:35 +0000
@@ -1047,15 +1047,6 @@
     return err;
 }
 
-int hip_drop_packet(const uint32_t packet_type,
-                    const uint32_t ha_state,
-                    struct hip_packet_context *packet_ctx)
-{
-    HIP_ERROR("Received packet type %d in state: %s. Dropping.\n",
-              packet_type, hip_state_str(ha_state));
-    return 0;
-}
-
 /**
  * Handles an incoming R1 packet.
  *

=== modified file 'hipd/input.h'
--- hipd/input.h        2010-03-05 09:51:49 +0000
+++ hipd/input.h        2010-03-05 10:06:35 +0000
@@ -86,10 +86,6 @@
                                    struct in6_addr *daddr,
                                    hip_portpair_t *info);
 
-int hip_drop_packet(const uint32_t packet_type,
-                    const uint32_t ha_state,
-                    struct hip_packet_context *packet_ctx);
-
 int hip_receive_bos(struct hip_common *bos, struct in6_addr *bos_saddr,
                     struct in6_addr *bos_daddr, hip_ha_t *entry, 
hip_portpair_t *bos_info);

Other related posts:

  • » [hipl-commit] [tiny] Rev 3618: Removed hip_drop_packet. - Tim Just