[hipl-commit] [trunk] Rev 4748: Add a marking for parameters used only by DEBUG code.

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

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

Log:
  Add a marking for parameters used only by DEBUG code.

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

=== modified file 'firewall/conntrack.c'
--- firewall/conntrack.c        2010-06-09 15:28:30 +0000
+++ firewall/conntrack.c        2010-06-09 17:00:38 +0000
@@ -886,7 +886,8 @@
 
 // first check signature then store hi
 static int handle_r1(struct hip_common *common, struct tuple *tuple,
-                     int verify_responder, UNUSED const hip_fw_context_t *ctx)
+                     DBG int verify_responder,
+                     UNUSED const hip_fw_context_t *ctx)
 {
     struct in6_addr hit;
     struct hip_host_id *host_id = NULL;

=== modified file 'firewall/firewall.c'
--- firewall/firewall.c 2010-06-09 13:41:52 +0000
+++ firewall/firewall.c 2010-06-09 17:00:38 +0000
@@ -621,7 +621,7 @@
  * and clean up all packet capture rules.
  *
  */
-static void firewall_close(const int sig)
+static void firewall_close(DBG const int sig)
 {
     HIP_DEBUG("Caught signal %d, closing firewall.\n", sig);
     firewall_exit();

=== modified file 'hipd/cert.c'
--- hipd/cert.c 2010-06-08 23:10:07 +0000
+++ hipd/cert.c 2010-06-09 17:00:38 +0000
@@ -9,6 +9,8 @@
  */
 
 #include "cert.h"
+#include "lib/core/common_defines.h"
+
 
 /****************************************************************************
  *
@@ -944,7 +946,7 @@
     return err;
 }
 
-static int verify_callback(int ok, X509_STORE_CTX *stor)
+static int verify_callback(int ok, DBG X509_STORE_CTX *stor)
 {
     /* This is not called from anywhere else than this file */
     if (!ok) {

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-06-09 15:28:30 +0000
+++ hipd/input.c        2010-06-09 17:00:38 +0000
@@ -986,7 +986,7 @@
  * @return zero on success, or negative error value on error.
  */
 int hip_check_r2(UNUSED const uint8_t packet_type,
-                 const uint32_t ha_state,
+                 DBG const uint32_t ha_state,
                  struct hip_packet_context *ctx)
 {
     int err = 0;
@@ -1367,7 +1367,7 @@
  * @return zero on success, or negative error value on error.
  */
 int hip_check_i2(UNUSED const uint8_t packet_type,
-                 const uint32_t ha_state,
+                 DBG const uint32_t ha_state,
                  struct hip_packet_context *ctx)
 {
     int err = 0, is_loopback = 0;

=== modified file 'lib/core/common_defines.h'
--- lib/core/common_defines.h   2010-06-09 15:28:30 +0000
+++ lib/core/common_defines.h   2010-06-09 17:00:38 +0000
@@ -32,6 +32,12 @@
 # define OPP UNUSED
 #endif
 
+/** marking for DEBUG-specific function parameters */
+#ifdef CONFIG_HIP_DEBUG
+# define DBG
+#else
+# define DBG UNUSED
+#endif
 /*********** ESP structures *************/
 
 struct hip_esp {

=== modified file 'lib/core/debug.c'
--- lib/core/debug.c    2010-06-02 10:41:37 +0000
+++ lib/core/debug.c    2010-06-09 17:00:38 +0000
@@ -726,7 +726,7 @@
  */
 void hip_print_locator(UNUSED int debug_level, UNUSED const char *file,
                        UNUSED int line, UNUSED const char *function,
-                       const char *str, const struct hip_locator *locator)
+                       DBG const char *str, const struct hip_locator *locator)
 {
 /* XXTRASHXX Totally useless does anything but what it is supposed to do -SAMU 
*/

Other related posts:

  • » [hipl-commit] [trunk] Rev 4748: Add a marking for parameters used only by DEBUG code. - Mircea Gherzan