[hipl-commit] [release-1.0.5] Rev 3804: Compilation fixes due to merging. Compiles with default options.

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Fri, 19 Mar 2010 12:17:52 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: 19/03/2010 at 12:17:52
Revision: 3804
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: release-1.0.5

Log:
  Compilation fixes due to merging. Compiles with default options.

Modified:
  M  Makefile.am
  M  firewall/firewall.c
  M  firewall/sava_api.c
  M  hipd/accessor.c
  M  hipd/accessor.h
  M  hipd/maintenance.c
  M  hipd/maintenance.h
  M  hipd/update_legacy.c
  M  hipd/user.c
  M  lib/core/builder.h
  M  lib/core/getendpointinfo.c
  M  test/conntest.c

=== modified file 'Makefile.am'
--- Makefile.am 2010-03-19 10:00:34 +0000
+++ Makefile.am 2010-03-19 10:18:16 +0000
@@ -38,8 +38,6 @@
                test/conntest-client-native-user-key \
                test/conntest-server \
                test/conntest-server-native \
-               test/hipsetup \
-               test/first_test \
                test/cookietest \
                test/keygentest \
                test/hashtest \
@@ -124,14 +122,6 @@
 test_conntest_server_native_SOURCES = test/conntest-server-native.c \
                                       test/conntest.c
 
-test_hipsetup_SOURCES = test/hipsetup.c \
-                        test/misc_install.c \
-                        test/conntest.c
-
-test_first_test_SOURCES = test/first_test.c \
-                          test/misc_install.c \
-                          test/conntest.c
-
 test_cookietest_SOURCES = test/cookietest.c
 
 test_keygentest_SOURCES = test/keygentest.c
@@ -471,28 +461,6 @@
 test_conntest_server_native_LDADD += lib/performance/libperformance.la
 endif
 
-test_hipsetup_LDADD = lib/core/libhipcore.la \
-                      lib/tool/libhiptool.la \
-                      lib/conf/libhipconf.la
-if HIP_DHT
-test_hipsetup_LDADD += lib/dht/libhipdht.la
-endif
-
-if HIP_PERFORMANCE
-test_hipsetup_LDADD += lib/performance/libperformance.la
-endif
-
-test_first_test_LDADD = lib/core/libhipcore.la \
-                        lib/tool/libhiptool.la \
-                        lib/conf/libhipconf.la
-if HIP_DHT
-test_first_test_LDADD += lib/dht/libhipdht.la
-endif
-
-if HIP_PERFORMANCE
-test_first_test_LDADD += lib/performance/libperformance.la
-endif
-
 test_cookietest_LDADD = lib/core/libhipcore.la \
                         lib/tool/libhiptool.la
 if HIP_PERFORMANCE
@@ -658,7 +626,6 @@
 test_conntest_client_native_user_key_LDADD += libinet6/libinet6.la
 test_conntest_server_LDADD += libinet6/libinet6.la
 test_conntest_server_native_LDADD += libinet6/libinet6.la
-test_hipsetup_LDADD += libinet6/libinet6.la
 endif
 
 CLEANFILES = tools/hipdnsproxy tools/hipdnskeyparse

=== modified file 'firewall/firewall.c'
--- firewall/firewall.c 2010-03-19 09:53:35 +0000
+++ firewall/firewall.c 2010-03-19 10:18:16 +0000
@@ -1462,6 +1462,8 @@
         verdict = ACCEPT;
     }
 
+ out_err:
+
     /* zero return value means that the packet should be dropped */
     return verdict;
 }

=== modified file 'firewall/sava_api.c'
--- firewall/sava_api.c 2010-03-19 09:32:05 +0000
+++ firewall/sava_api.c 2010-03-19 10:18:16 +0000
@@ -1,13 +1,15 @@
 /* required for s6_addr32 */
 #define _BSD_SOURCE
 
+#include <openssl/hmac.h>
+
 #ifdef HAVE_CONFIG_H
   #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
 #include "sava_api.h"
-
 #include "rule_management.h"
+#include "lib/core/keylen.h"
 
 #define SAVA_INBOUND_KEY 0
 #define SAVA_OUTBOUND_KEY 1

=== modified file 'hipd/accessor.c'
--- hipd/accessor.c     2010-03-19 09:53:35 +0000
+++ hipd/accessor.c     2010-03-19 10:18:16 +0000
@@ -398,3 +398,29 @@
 {
     hipsava_server = 0;
 }
+
+int hip_firewall_set_savah_status(int status)
+{
+  int n, err = 0;
+  struct sockaddr_in6 sock_addr;
+  struct hip_common *msg = NULL;
+  bzero(&sock_addr, sizeof(sock_addr));
+  sock_addr.sin6_family = AF_INET6;
+  sock_addr.sin6_port   = htons(HIP_FIREWALL_PORT);
+  sock_addr.sin6_addr   = in6addr_loopback;
+
+  HIP_IFEL(!(msg = HIP_MALLOC(HIP_MAX_PACKET, 0)), -1, "alloc\n");
+  hip_msg_init(msg);
+
+  hip_build_user_hdr(msg, status, 0);
+
+  n = hip_sendto_user(msg, (struct sockaddr *) &sock_addr);
+
+  HIP_IFEL(n < 0, 0, "sendto() failed\n");
+
+  if (err == 0) {
+    HIP_DEBUG("SEND SAVAH SERVER STATUS OK.\n");
+  }
+ out_err:
+  return err;
+}

=== modified file 'hipd/accessor.h'
--- hipd/accessor.h     2010-03-19 10:00:34 +0000
+++ hipd/accessor.h     2010-03-19 10:18:16 +0000
@@ -37,12 +37,6 @@
 
 #define INDEX_HASH_FN           HIP_DIGEST_SHA1
 
-/** Specifies the NAT status of the daemon. This value indicates if the current
- *  machine is behind a NAT. Defined in hipd.c */
-extern int hipproxy;
-
-extern unsigned int opportunistic_mode;
-
 unsigned int hipd_get_state(void);
 void hipd_set_state(unsigned int);
 int hipd_get_flag(unsigned int);
@@ -70,6 +64,7 @@
 void hip_set_sava_server_on(void);
 void hip_set_sava_client_off(void);
 void hip_set_sava_server_off(void);
+int hip_firewall_set_savah_status(int status);
 
 /** Specifies the NAT status of the daemon. This value indicates if the current
  *  machine is behind a NAT. Defined in hipd.c */

=== modified file 'hipd/maintenance.c'
--- hipd/maintenance.c  2010-03-19 09:53:35 +0000
+++ hipd/maintenance.c  2010-03-19 10:18:16 +0000
@@ -661,3 +661,48 @@
     }
     return err;
 }
+
+int hip_firewall_set_i2_data(int action,  hip_ha_t *entry,
+                             struct in6_addr *hit_s,
+                             struct in6_addr *hit_r,
+                             struct in6_addr *src,
+                             struct in6_addr *dst)
+{
+  struct hip_common *msg = NULL;
+  struct sockaddr_in6 hip_firewall_addr;
+  int err                = 0, n = 0;
+  HIP_IFEL(!(msg = HIP_MALLOC(HIP_MAX_PACKET, 0)), -1, "alloc\n");
+  hip_msg_init(msg);
+  HIP_IFEL(hip_build_user_hdr(msg, action, 0), -1,
+           "Build hdr failed\n");
+
+  HIP_IFEL(hip_build_param_contents(msg, (void *) hit_r, HIP_PARAM_HIT,
+                                    sizeof(struct in6_addr)), -1,
+                                    "build param contents failed\n");
+  HIP_IFEL(hip_build_param_contents(msg, (void *) src, HIP_PARAM_HIT,
+                                    sizeof(struct in6_addr)), -1,
+                                    "build param contents failed\n");
+
+  socklen_t alen = sizeof(hip_firewall_addr);
+
+  bzero(&hip_firewall_addr, alen);
+  hip_firewall_addr.sin6_family = AF_INET6;
+  hip_firewall_addr.sin6_port   = htons(HIP_FIREWALL_PORT);
+  hip_firewall_addr.sin6_addr   = in6addr_loopback;
+
+  n = sendto(hip_firewall_sock_lsi_fd, (char *) msg, 
hip_get_msg_total_len(msg),
+             0, (struct sockaddr *) &hip_firewall_addr, alen);
+  if (n < 0) {
+    HIP_DEBUG("Send to firewall failed str errno %s\n", strerror(errno));
+  }
+  HIP_IFEL( n < 0, -1, "Sendto firewall failed.\n");
+
+  HIP_DEBUG("Sendto firewall OK.\n");
+
+ out_err:
+  if (msg) {
+    free(msg);
+  }
+
+  return err;
+}

=== modified file 'hipd/maintenance.h'
--- hipd/maintenance.h  2010-03-19 10:00:34 +0000
+++ hipd/maintenance.h  2010-03-19 10:18:16 +0000
@@ -34,13 +34,12 @@
                         struct timeval *stval, struct timeval *rtval);
 
 /*Communication with firewall daemon*/
-int hip_firewall_set_savah_status(int status);
 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_esp_relay(int action);
 int hip_firewall_set_i2_data(int action,  hip_ha_t *entry,
                              struct in6_addr *hit_s,
                              struct in6_addr *hit_r,
                              struct in6_addr *src,
                              struct in6_addr *dst);
+int hip_firewall_set_esp_relay(int action);
 #endif /* HIP_HIPD_MAINTENANCE_H */

=== modified file 'hipd/update_legacy.c'
--- hipd/update_legacy.c        2010-03-19 10:00:34 +0000
+++ hipd/update_legacy.c        2010-03-19 10:18:16 +0000
@@ -95,7 +95,7 @@
 
         msg = hip_msg_alloc();
         HIP_IFEL(!msg, -1, "msg alloc failed\n");
-        HIP_IFEL(hip_build_user_hdr(msg, HIP_MSG_FW_FLUSH_SYS_OPP_HIP, 0),
+        HIP_IFEL(hip_build_user_hdr(msg, SO_HIP_FW_FLUSH_SYS_OPP_HIP, 0),
                  -1, "build hdr failed\n");
 
         err = hip_sendto_firewall(msg);

=== modified file 'hipd/user.c'
--- hipd/user.c 2010-03-19 10:00:34 +0000
+++ hipd/user.c 2010-03-19 10:18:16 +0000
@@ -601,6 +601,7 @@
     break;
     case SO_HIP_REGISTER_SAVAHR:
     {
+        struct in6_addr *dst_hit, *dst_ip;
         dst_hit = hip_get_param_contents(msg, HIP_PARAM_HIT);
         dst_ip  = hip_get_param_contents(msg, HIP_PARAM_IPV6_ADDR);
         if (dst_hit == NULL && dst_ip == NULL) {   //HIT and IP are missing 
worst case opportunistic mode to register with the SAVAH router

=== modified file 'lib/core/builder.h'
--- lib/core/builder.h  2010-03-19 09:53:35 +0000
+++ lib/core/builder.h  2010-03-19 10:18:16 +0000
@@ -21,7 +21,6 @@
 #else
 #  include "kerncompat.h"
 #  include "debug.h"
-#  include "misc.h"
 #  include "icomm.h"
 #  include "certtools.h"
 #  include "config.h"

=== modified file 'lib/core/getendpointinfo.c'
--- lib/core/getendpointinfo.c  2010-03-04 11:12:58 +0000
+++ lib/core/getendpointinfo.c  2010-03-19 10:18:16 +0000
@@ -65,6 +65,8 @@
 #include "icomm.h"
 #include "debug.h"
 #include "getendpointinfo.h"
+#include "hostid.h"
+#include "hostsfiles.h"
 
 /* to compensate for a missing system include in OpenWRT */
 #ifndef HOST_NAME_MAX

=== modified file 'test/conntest.c'
--- test/conntest.c     2010-03-19 10:00:34 +0000
+++ test/conntest.c     2010-03-19 10:18:16 +0000
@@ -14,6 +14,7 @@
 #include "conntest.h"
 #include "lib/tool/nlink.h"
 #include "lib/tool/lutil.h"
+#include "lib/core/getendpointinfo.h"
 
 /**
  * given the port and the protocol, this function binds the socket and listen 
to it

Other related posts:

  • » [hipl-commit] [release-1.0.5] Rev 3804: Compilation fixes due to merging. Compiles with default options. - Miika Komu