[hipl-commit] [trunk] Rev 4747: Add markings for parameters used only in specific configs.

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 9 Jun 2010 18:40:06 +0300

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 09/06/2010 at 18:40:06
Revision: 4747
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Add markings for parameters used only in specific configs.
  For OPPORTUNISTIC and RVS, that is. When the respective 
  feature is enabled, the macro is "compiled-out". When the
  feature is disabled, the macro resolves to an UNUSED one.

Modified:
  M  firewall/conntrack.c
  M  hipd/hiprelay.c
  M  hipd/input.c
  M  lib/core/common_defines.h

=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-06-09 13:13:23 +0000
+++ firewall/conntrack.c        2010-06-09 15:28:30 +0000
@@ -232,8 +232,8 @@
  * @return the tuple or NULL, if not found.
  */
 static struct tuple *get_tuple_by_hip(const struct hip_data *data,
-                                      const uint8_t type_hdr,
-                                      const struct in6_addr *ip6_from)
+                                      OPP const uint8_t type_hdr,
+                                      OPP const struct in6_addr *ip6_from)
 {
     struct hip_tuple *tuple = NULL;
     DList *list = (DList *) hipList;

=== modified file 'hipd/hiprelay.c'
--- hipd/hiprelay.c     2010-06-09 09:27:57 +0000
+++ hipd/hiprelay.c     2010-06-09 15:28:30 +0000
@@ -1024,7 +1024,7 @@
  * @param dest_port the relayed destination port will be written here
  */
 int hip_relay_handle_relay_from(hip_common_t *source_msg,
-                                in6_addr_t *relay_ip,
+                                RVS in6_addr_t *relay_ip,
                                 in6_addr_t *dest_ip, in_port_t *dest_port)
 {
     hip_tlv_type_t param_type;

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-06-09 11:45:06 +0000
+++ hipd/input.c        2010-06-09 15:28:30 +0000
@@ -663,8 +663,8 @@
  *
  * @return zero on success, or negative error value on error.
  */
-int hip_check_r1(const uint8_t packet_type,
-                 const uint32_t ha_state,
+int hip_check_r1(RVS const uint8_t packet_type,
+                 RVS const uint32_t ha_state,
                  struct hip_packet_context *ctx)
 {
     int err = 0, mask = HIP_PACKET_CTRL_ANON, len;
@@ -1059,7 +1059,7 @@
  *
  * @return zero on success, or negative error value on error.
  */
-int hip_handle_r2(const uint8_t packet_type,
+int hip_handle_r2(RVS const uint8_t packet_type,
                   const uint32_t ha_state,
                   struct hip_packet_context *ctx)
 {

=== modified file 'lib/core/common_defines.h'
--- lib/core/common_defines.h   2010-05-30 17:04:14 +0000
+++ lib/core/common_defines.h   2010-06-09 15:28:30 +0000
@@ -18,6 +18,20 @@
 # define UNUSED
 #endif
 
+/** marking for RVS-specific function parameters */
+#ifdef CONFIG_HIP_RVS
+# define RVS
+#else
+# define RVS UNUSED
+#endif
+
+/** marking for OPPORTUNISTIC-specific function parameters */
+#ifdef CONFIG_HIP_OPPORTUNISTIC
+# define OPP
+#else
+# define OPP UNUSED
+#endif
+
 /*********** ESP structures *************/
 
 struct hip_esp {

Other related posts:

  • » [hipl-commit] [trunk] Rev 4747: Add markings for parameters used only in specific configs. - Mircea Gherzan