[hipl-commit] [trunk] Rev 3921: Fixed --enable-pfkey build.

  • From: Miika Komu <miika@xxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Thu, 11 Mar 2010 10:59:29 +0200

Committer: Miika Komu <miika@xxxxxx>
Date: Thu Mar 11 10:59:28 2010 +0200
Revision: 3921
Revision-id: miika@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Fixed --enable-pfkey build.
  * Couple of missing headers due to misc.c splitting
  * Imported pfkeyv2.h from ipsec-tools-0.8-alpha20090422
  * Changed tabs to spaces in pfkeyv2.h

Modified:
  A  lib/ipsec/pfkeyv2.h
  M  hipd/pfkeyapi.c
  M  lib/ipsec/pfkey.c
  M  lib/ipsec/policy_parse.y

=== modified file 'hipd/pfkeyapi.c'
--- hipd/pfkeyapi.c     2010-03-09 18:26:22 +0000
+++ hipd/pfkeyapi.c     2010-03-11 08:59:28 +0000
@@ -8,12 +8,14 @@
 /* required for caddr_t */
 #define _BSD_SOURCE
 
-#include <linux/pfkeyv2.h>
+#include <lib/ipsec/pfkeyv2.h>
 #include <linux/ipsec.h>
 
 #include "config.h"
 #include "lib/ipsec/libpfkey.h"
 #include "pfkeyapi.h"
+#include "lib/core/hip_udp.h"
+#include "lib/core/keylen.h"
 
 
 // FIXME: This must be turned to BEET when BEET will be supported by pfkey as 
well

=== modified file 'lib/ipsec/pfkey.c'
--- lib/ipsec/pfkey.c   2010-03-09 18:26:22 +0000
+++ lib/ipsec/pfkey.c   2010-03-11 08:59:28 +0000
@@ -50,7 +50,7 @@
 #include "config.h"
 #include "ipsec_strerror.h"
 #include "libpfkey.h"
-#include "linux/pfkeyv2.h"
+#include "pfkeyv2.h"
 
 #define CALLOC(size, cast) (cast) calloc(1, (size))
 

=== added file 'lib/ipsec/pfkeyv2.h'
--- lib/ipsec/pfkeyv2.h 1970-01-01 00:00:00 +0000
+++ lib/ipsec/pfkeyv2.h 2010-03-11 08:59:28 +0000
@@ -0,0 +1,71 @@
+/*    $NetBSD: pfkeyv2.h,v 1.4 2006/09/09 16:22:08 manu Exp $    */
+
+#ifndef __NET_PFKEYV2_H_
+#define __NET_PFKEYV2_H_ 1
+
+#include <stdint.h>
+#include <linux/pfkeyv2.h>
+
+/* Private allocations for authentication algorithms */
+#define SADB_AALG_SHA2_256        SADB_X_AALG_SHA2_256HMAC
+#define SADB_X_AALG_SHA2_256        SADB_X_AALG_SHA2_256HMAC
+#define SADB_AALG_SHA2_384        SADB_X_AALG_SHA2_384HMAC
+#define SADB_X_AALG_SHA2_384        SADB_X_AALG_SHA2_384HMAC
+#define SADB_AALG_SHA2_512        SADB_X_AALG_SHA2_512HMAC
+#define SADB_X_AALG_SHA2_512        SADB_X_AALG_SHA2_512HMAC
+#define SADB_AALG_RIPEMD160HMAC        SADB_X_AALG_RIPEMD160HMAC
+#define SADB_X_AALG_MD5              249
+#define SADB_X_AALG_SHA              250
+
+/* private allocations - based on RFC2407/IANA assignment */
+#define SADB_X_EALG_CAST128CBC    5    /* SADB_X_EALG_CASTCBC? == 6 */
+#define SADB_X_EALG_RIJNDAELCBC        SADB_X_EALG_AESCBC
+#define SADB_X_EALG_AES            SADB_X_EALG_AESCBC
+
+
+#define SADB_X_CALG_NONE    0
+#define SADB_X_CALG_OUI        1
+#define SADB_X_CALG_DEFLATE    2
+#define SADB_X_CALG_LZS        3
+#define SADB_X_CALG_MAX        4
+
+
+#define SADB_X_EXT_NONE        0x0000    /* i.e. new format. */
+#define SADB_X_EXT_OLD        0x0001    /* old format. */
+
+#define SADB_X_EXT_IV4B        0x0010    /* IV length of 4 bytes in use */
+#define SADB_X_EXT_DERIV    0x0020    /* DES derived */
+#define SADB_X_EXT_CYCSEQ    0x0040    /* allowing to cyclic sequence. */
+
+    /* three of followings are exclusive flags each them */
+#define SADB_X_EXT_PSEQ        0x0000    /* sequencial padding for ESP */
+#define SADB_X_EXT_PRAND    0x0100    /* random padding for ESP */
+#define SADB_X_EXT_PZERO    0x0200    /* zero padding for ESP */
+#define SADB_X_EXT_PMASK    0x0300    /* mask for padding flag */
+
+#define SADB_X_EXT_RAWCPI    0x0080    /* use well known CPI (IPComp) */
+
+
+#define PFKEY_SOFT_LIFETIME_RATE    80
+
+#define SADB_X_LIFETIME_ALLOCATIONS    0
+#define SADB_X_LIFETIME_BYTES        1
+#define SADB_X_LIFETIME_ADDTIME        2
+#define SADB_X_LIFETIME_USETIME        3
+
+
+#define PFKEY_ALIGN8(a) (1 + (((a) - 1) | (8 - 1)))
+#define    PFKEY_EXTLEN(msg) \
+    PFKEY_UNUNIT64(((struct sadb_ext *)(msg))->sadb_ext_len)
+#define PFKEY_ADDR_PREFIX(ext) \
+    (((struct sadb_address *)(ext))->sadb_address_prefixlen)
+#define PFKEY_ADDR_PROTO(ext) \
+    (((struct sadb_address *)(ext))->sadb_address_proto)
+#define PFKEY_ADDR_SADDR(ext) \
+    ((struct sockaddr *)((caddr_t)(ext) + sizeof(struct sadb_address)))
+
+/* in 64bits */
+#define    PFKEY_UNUNIT64(a)    ((a) << 3)
+#define    PFKEY_UNIT64(a)        ((a) >> 3)
+
+#endif

=== modified file 'lib/ipsec/policy_parse.y'
--- lib/ipsec/policy_parse.y    2010-03-09 18:26:22 +0000
+++ lib/ipsec/policy_parse.y    2010-03-11 08:59:28 +0000
@@ -81,7 +81,7 @@
 #include "config.h"
 #include "ipsec_strerror.h"
 #include "libpfkey.h"
-#include "linux/pfkeyv2.h"
+#include "pfkeyv2.h"
 
 #ifndef INT32_MAX
 #define INT32_MAX       (0xffffffff)

Other related posts:

  • » [hipl-commit] [trunk] Rev 3921: Fixed --enable-pfkey build. - Miika Komu