[hipl-commit] [trunk] Rev 4733: hipd: mark/remove some more unused parameters.

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

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 09/06/2010 at 12:56:35
Revision: 4733
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  hipd: mark/remove some more unused parameters.

Modified:
  M  hipd/close.c
  M  hipd/init.c
  M  hipd/input.c
  M  hipd/maintenance.c
  M  hipd/maintenance.h
  M  hipd/nat.c
  M  hipd/netdev.c
  M  hipd/netdev.h
  M  hipd/nsupdate.c
  M  hipd/output.c

=== modified file 'hipd/close.c'
--- hipd/close.c        2010-06-08 23:10:07 +0000
+++ hipd/close.c        2010-06-09 09:55:23 +0000
@@ -70,7 +70,6 @@
               "CLOSE message to peer.\n");
 
     hip_firewall_set_bex_data(HIP_MSG_FW_UPDATE_DB,
-                              entry,
                               &entry->hit_our,
                               &entry->hit_peer);
 

=== modified file 'hipd/init.c'
--- hipd/init.c 2010-06-08 23:31:25 +0000
+++ hipd/init.c 2010-06-09 09:55:23 +0000
@@ -1026,7 +1026,7 @@
      * NETLINK_ROUTE! See the comment about address_count global var. */
     HIP_DEBUG("Initializing the netdev_init_addresses\n");
 
-    hip_netdev_init_addresses(&hip_nl_ipsec);
+    hip_netdev_init_addresses();
 
     if (rtnl_open_byproto(&hip_nl_route,
                           RTMGRP_LINK | RTMGRP_IPV6_IFADDR | IPPROTO_IPV6

=== modified file 'hipd/input.c'
--- hipd/input.c        2010-06-09 09:27:57 +0000
+++ hipd/input.c        2010-06-09 09:55:23 +0000
@@ -1212,12 +1212,10 @@
     if (ctx->hadb_entry->state == HIP_STATE_ESTABLISHED) {
         HIP_DEBUG("Send response to firewall.\n");
         hip_firewall_set_bex_data(HIP_MSG_FW_BEX_DONE,
-                                  ctx->hadb_entry,
                                   &(ctx->hadb_entry)->hit_our,
                                   &(ctx->hadb_entry)->hit_peer);
     } else {
         hip_firewall_set_bex_data(HIP_MSG_FW_BEX_DONE,
-                                  ctx->hadb_entry,
                                   NULL,
                                   NULL);
     }

=== modified file 'hipd/maintenance.c'
--- hipd/maintenance.c  2010-05-30 15:53:09 +0000
+++ hipd/maintenance.c  2010-06-09 09:55:23 +0000
@@ -337,13 +337,12 @@
  * LSI and system-based opportunistic mode in the firewall.
  *
  * @param action HIP_MSG_FW_UPDATE_DB or HIP_MSG_FW_BEX_DONE
- * @param entry the host association
  * @param hit_s optional source HIT
  * @param hit_r optional destination HIT
  *
  * @return zero on success or negative on failure
  */
-int hip_firewall_set_bex_data(int action, hip_ha_t *entry, struct in6_addr 
*hit_s, struct in6_addr *hit_r)
+int hip_firewall_set_bex_data(int action, struct in6_addr *hit_s, struct 
in6_addr *hit_r)
 {
     struct hip_common *msg = NULL;
     struct sockaddr_in6 hip_fw_addr;

=== modified file 'hipd/maintenance.h'
--- hipd/maintenance.h  2010-05-20 16:14:34 +0000
+++ hipd/maintenance.h  2010-06-09 09:55:23 +0000
@@ -24,8 +24,7 @@
 int hip_get_firewall_status(void);
 
 /*Communication with firewall daemon*/
-int hip_firewall_set_bex_data(int action, hip_ha_t *entry, struct in6_addr 
*hit_s,
-                              struct in6_addr *hit_r);
+int hip_firewall_set_bex_data(int action, struct in6_addr *hit_s, struct 
in6_addr *hit_r);
 int hip_firewall_set_esp_relay(int action);
 
 #endif /* HIP_HIPD_MAINTENANCE_H */

=== modified file 'hipd/nat.c'
--- hipd/nat.c  2010-06-01 15:11:40 +0000
+++ hipd/nat.c  2010-06-09 09:55:23 +0000
@@ -24,7 +24,6 @@
  * @note    All Doxygen comments have been added in version 1.1.
  */
 
-#include "nat.h"
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -34,8 +33,11 @@
 #include <netdb.h>
 #include <stdlib.h>
 #include <netinet/in.h>
+
+#include "lib/core/debug.h"
+#include "lib/core/common_defines.h"
+#include "nat.h"
 #include "user.h"
-#include "lib/core/debug.h"
 
 static int nat_keep_alive_counter = HIP_NAT_KEEP_ALIVE_INTERVAL;
 
@@ -83,7 +85,7 @@
  *
  * @param entry    a pointer to a host association which links current host and
  *                 the peer.
- * @param not_used this parameter is not used (but it's needed).
+ * @param opaque   this parameter is not used (but it's needed).
  * @return         zero on success, or negative error value on error.
  * @note           If the state of @c entry is not ESTABLISHED or if
  *                 @c entry->nat_mode = 0 this function still returns zero
@@ -91,7 +93,7 @@
  *                 value is only returned when the creation of the new UPDATE
  *                 message fails in some way.
  */
-static int hip_nat_send_keep_alive(hip_ha_t *entry, void *not_used)
+static int hip_nat_send_keep_alive(hip_ha_t *entry, UNUSED void *opaque)
 {
     int err                = 0;
     struct hip_common *msg = NULL;

=== modified file 'hipd/netdev.c'
--- hipd/netdev.c       2010-05-31 09:44:40 +0000
+++ hipd/netdev.c       2010-06-09 09:55:23 +0000
@@ -29,17 +29,18 @@
 #include <linux/rtnetlink.h>
 
 #include "config.h"
-#include "lib/tool/nlink.h"
+#include "hipd.h"
 #include "accessor.h"
 #include "netdev.h"
 #include "maintenance.h"
 #include "lib/core/debug.h"
-#include "lib/tool/lutil.h"
+#include "lib/core/common_defines.h"
 #include "lib/core/conf.h"
 #include "lib/core/hostsfiles.h"
 #include "lib/core/hip_udp.h"
 #include "lib/core/hit.h"
-#include "hipd.h"
+#include "lib/tool/lutil.h"
+#include "lib/tool/nlink.h"
 
 /**
  * We really don't expect more than a handfull of interfaces to be on
@@ -599,13 +600,12 @@
 /**
  * Initialize the address cache of localhost addresses
  *
- * @param nl a handle to netlink socket (currently unused)
  * @return zero on success and non-zero on error
  * @todo This creates a new NETLINK socket (via getifaddrs), so this has to be
  *       run before the global NETLINK socket is opened. We did not have the 
time
  *       and energy to import all of the necessary functionality from iproute2.
  */
-int hip_netdev_init_addresses(struct rtnl_handle *nl)
+int hip_netdev_init_addresses(void)
 {
     struct ifaddrs *g_ifaces = NULL, *g_iface = NULL;
     int err                  = 0, if_index = 0;
@@ -1154,10 +1154,10 @@
  *
  * @param msg a netlink message
  * @param len the length of the netlink message in bytes
- * @param arg argument to pass
+ * @param arg argument to pass (needed because of the callaback nature)
  * @return zero on success and non-zero on error
  */
-int hip_netdev_event(struct nlmsghdr *msg, int len, void *arg)
+int hip_netdev_event(struct nlmsghdr *msg, int len, UNUSED void *arg)
 {
     int err = 0, l = 0, is_add = 0, exists;
     struct sockaddr_storage ss_addr;

=== modified file 'hipd/netdev.h'
--- hipd/netdev.h       2010-05-26 10:28:47 +0000
+++ hipd/netdev.h       2010-06-09 09:55:23 +0000
@@ -25,7 +25,7 @@
 struct rtnl_handle;
 
 int hip_devaddr2ifindex(struct in6_addr *addr);
-int hip_netdev_init_addresses(struct rtnl_handle *nl);
+int hip_netdev_init_addresses(void);
 void hip_delete_all_addresses(void);
 int hip_netdev_event(struct nlmsghdr *msg, int len, void *arg);
 int hip_add_iface_local_hit(const hip_hit_t *local_hit);

=== modified file 'hipd/nsupdate.c'
--- hipd/nsupdate.c     2010-05-31 09:44:40 +0000
+++ hipd/nsupdate.c     2010-06-09 09:55:23 +0000
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "hidb.h"
 #include "nsupdate.h"
+#include "lib/core/common_defines.h"
 #include "lib/core/hit.h"
 
 // parameters for nsupdate.pl
@@ -107,8 +108,9 @@
  * Handle child exits to avoid zombies
  *
  * @param signo number of the signal triggered the function
+ *        Needed because of the signal-handler signature.
  */
-static void sig_chld(int signo)
+static void sig_chld(UNUSED int signo)
 {
     pid_t child_pid;
     int child_status;     // child exit code

=== modified file 'hipd/output.c'
--- hipd/output.c       2010-06-08 23:10:07 +0000
+++ hipd/output.c       2010-06-09 09:55:23 +0000
@@ -20,6 +20,7 @@
 
 #include "config.h"
 #include "output.h"
+#include "lib/core/common_defines.h"
 #include "lib/core/performance.h"
 #include "lib/core/hip_udp.h"
 #include "lib/core/solve.h"
@@ -46,19 +47,16 @@
  * @param src_port   not used.
  * @param dst_port   not used.
  * @param entry      a pointer to the current host association database state.
- * @param retransmit a boolean value indicating if this is a retransmission
- *                   (@b zero if this is @b not a retransmission).
  * @return           zero on success, or negative error value on error.
  * @todo remove the dst_hit parameter? test with the opportunistic TCP 
extension
  */
 static int hip_send_i1_pkt(struct hip_common *i1,
-                           hip_hit_t *dst_hit,
+                           UNUSED hip_hit_t *dst_hit,
                            struct in6_addr *local_addr,
                            struct in6_addr *peer_addr,
                            in_port_t src_port,
                            in_port_t dst_port,
-                           hip_ha_t *entry,
-                           int retransmit)
+                           hip_ha_t *entry)
 {
     int err = 0;
 
@@ -165,8 +163,7 @@
                                      &peer_addr,
                                      entry->local_udp_port,
                                      entry->peer_udp_port,
-                                     entry,
-                                     1);
+                                     entry);
     } else {
         HIP_DEBUG("Number of items in the peer addr list: %d ",
                   ((struct lhash_st *) 
entry->peer_addr_list_to_be_added)->num_items);
@@ -181,8 +178,7 @@
                                    &peer_addr,
                                    entry->local_udp_port,
                                    entry->peer_udp_port,
-                                   entry,
-                                   1);
+                                   entry);
 
             /* Do not bail out on error with shotgun. Some
              * address pairs just might fail. */
@@ -214,8 +210,8 @@
  *
  * @return zero on success, non-negative on error.
  */
-int hip_send_i2(const uint8_t packet_type,
-                const uint32_t ha_state,
+int hip_send_i2(UNUSED const uint8_t packet_type,
+                UNUSED const uint32_t ha_state,
                 struct hip_packet_context *ctx)
 {
     hip_transform_suite_t transform_hip_suite, transform_esp_suite;
@@ -731,8 +727,8 @@
  *
  * @return              zero on success, or negative error value on error.
  */
-int hip_send_r1(const uint8_t packet_type,
-                const uint32_t ha_state,
+int hip_send_r1(UNUSED const uint8_t packet_type,
+                UNUSED const uint32_t ha_state,
                 struct hip_packet_context *ctx)
 {
     int err = 0;
@@ -880,8 +876,8 @@
  *
  * @return zero on success, negative otherwise.
  */
-int hip_send_r2(const uint8_t packet_type,
-                const uint32_t ha_state,
+int hip_send_r2(UNUSED const uint8_t packet_type,
+                UNUSED const uint32_t ha_state,
                 struct hip_packet_context *ctx)
 {
     struct hip_crypto_key hmac;

Other related posts:

  • » [hipl-commit] [trunk] Rev 4733: hipd: mark/remove some more unused parameters. - Mircea Gherzan