removed NAT_TRAVERSAL compile option
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 7 Jul 2006 05:51:20 +0000 (05:51 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 7 Jul 2006 05:51:20 +0000 (05:51 -0000)
src/libfreeswan/Makefile.am
src/libfreeswan/freeswan.h
src/libfreeswan/pfkey.h
src/libfreeswan/pfkey_v2_build.c
src/libfreeswan/pfkey_v2_debug.c
src/libfreeswan/pfkey_v2_ext_bits.c
src/libfreeswan/pfkey_v2_parse.c
src/libfreeswan/pfkeyv2.h

index 83f4395..d916fca 100644 (file)
@@ -13,7 +13,6 @@ libfreeswan_a_SOURCES = addrtoa.c addrtot.c addrtypeof.c anyaddr.c atoaddr.c ato
                        subnettypeof.c ttoaddr.c ttodata.c ttoprotoport.c ttosa.c ttosubnet.c ttoul.c \
                        ultoa.c ultot.c version.c
 INCLUDES = -I$(top_srcdir)/src/pluto
-AM_CFLAGS = -DNAT_TRAVERSAL
 dist_man3_MANS = anyaddr.3 atoaddr.3 atoasr.3 atosa.3 atoul.3 goodmask.3 initaddr.3 initsubnet.3 \
                  keyblobtoid.3 optionsfrom.3 portof.3 prng.3 rangetosubnet.3 sameaddr.3 subnetof.3 \
                  ttoaddr.3 ttodata.3 ttosa.3 ttoul.3 version.3
index ee21825..b1bca87 100644 (file)
 #  define DEBUG_NO_STATIC static
 #endif /* CONFIG_IPSEC_DEBUG */
 
-#ifdef CONFIG_IPSEC_NAT_TRAVERSAL /* KERNEL ifdef */
-#ifndef NAT_TRAVERSAL
-#define NAT_TRAVERSAL
-#endif
-#endif
-#ifdef NAT_TRAVERSAL
 #define ESPINUDP_WITH_NON_IKE   1  /* draft-ietf-ipsec-nat-t-ike-00/01 */
 #define ESPINUDP_WITH_NON_ESP   2  /* draft-ietf-ipsec-nat-t-ike-02    */
-#endif
 
 /*
  * Basic data types for the address-handling functions.
index f858cd9..afa5ce0 100644 (file)
@@ -242,12 +242,12 @@ pfkey_ident_build(struct sadb_ext**       pfkey_ext,
                  uint8_t               ident_len,
                  char*                 ident_string);
 
-#ifdef NAT_TRAVERSAL
 #ifdef __KERNEL__
 extern int pfkey_nat_t_new_mapping(struct ipsec_sa *, struct sockaddr *, __u16);
 extern int pfkey_x_nat_t_type_process(struct sadb_ext *pfkey_ext, struct pfkey_extracted_data* extr);
 extern int pfkey_x_nat_t_port_process(struct sadb_ext *pfkey_ext, struct pfkey_extracted_data* extr);
 #endif /* __KERNEL__ */
+
 int
 pfkey_x_nat_t_type_build(struct sadb_ext**  pfkey_ext,
             uint8_t         type);
@@ -255,7 +255,6 @@ int
 pfkey_x_nat_t_port_build(struct sadb_ext**  pfkey_ext,
             uint16_t         exttype,
             uint16_t         port);
-#endif
 
 int
 pfkey_sens_build(struct sadb_ext**     pfkey_ext,
@@ -267,7 +266,8 @@ pfkey_sens_build(struct sadb_ext**  pfkey_ext,
                 uint8_t                integ_len,
                 uint64_t*              integ_bitmap);
 
-int pfkey_x_protocol_build(struct sadb_ext **, uint8_t);
+int
+pfkey_x_protocol_build(struct sadb_ext **, uint8_t);
 
 
 int
index 195add1..340c12c 100644 (file)
@@ -454,9 +454,7 @@ pfkey_address_build(struct sadb_ext**       pfkey_ext,
        case SADB_X_EXT_ADDRESS_DST_FLOW:
        case SADB_X_EXT_ADDRESS_SRC_MASK:
        case SADB_X_EXT_ADDRESS_DST_MASK:
-#ifdef NAT_TRAVERSAL
        case SADB_X_EXT_NAT_T_OA:
-#endif 
                break;
        default:
                DEBUGGING( 
@@ -1164,7 +1162,6 @@ errlab:
        return error;
 }
 
-#ifdef NAT_TRAVERSAL
 int
 pfkey_x_nat_t_type_build(struct sadb_ext**     pfkey_ext,
                    uint8_t         type)
@@ -1208,6 +1205,7 @@ pfkey_x_nat_t_type_build(struct sadb_ext**        pfkey_ext,
 errlab:
        return error;
 }
+
 int
 pfkey_x_nat_t_port_build(struct sadb_ext**     pfkey_ext,
                    uint16_t         exttype,
@@ -1261,7 +1259,6 @@ pfkey_x_nat_t_port_build(struct sadb_ext**        pfkey_ext,
 errlab:
        return error;
 }
-#endif
 
 int pfkey_x_protocol_build(struct sadb_ext **pfkey_ext,
                           uint8_t protocol)
index 2f2ddd3..8430766 100644 (file)
@@ -80,12 +80,10 @@ static char *pfkey_sadb_ext_strings[]={
   "X-source-mask",                /* SADB_X_EXT_ADDRESS_SRC_MASK   23 */
   "X-dest-mask",                  /* SADB_X_EXT_ADDRESS_DST_MASK   24 */
   "X-set-debug",                  /* SADB_X_EXT_DEBUG              25 */
-#ifdef NAT_TRAVERSAL
   "X-NAT-T-type",                 /* SADB_X_EXT_NAT_T_TYPE         26 */
   "X-NAT-T-sport",                /* SADB_X_EXT_NAT_T_SPORT        27 */
   "X-NAT-T-dport",                /* SADB_X_EXT_NAT_T_DPORT        28 */
   "X-NAT-T-OA",                   /* SADB_X_EXT_NAT_T_OA           29 */
-#endif  
 };
 
 const char *
index fe3f453..b419418 100644 (file)
@@ -89,10 +89,8 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_IDENTITY_SRC
 | 1<<SADB_EXT_IDENTITY_DST
 | 1<<SADB_EXT_SENSITIVITY
-#ifdef NAT_TRAVERSAL
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
-#endif
 ,
 /* SADB_ADD */
 1<<SADB_EXT_RESERVED
@@ -107,12 +105,10 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_IDENTITY_SRC
 | 1<<SADB_EXT_IDENTITY_DST
 | 1<<SADB_EXT_SENSITIVITY
-#ifdef NAT_TRAVERSAL
 | 1<<SADB_X_EXT_NAT_T_TYPE
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
 | 1<<SADB_X_EXT_NAT_T_OA
-#endif
 ,
 /* SADB_DELETE */
 1<<SADB_EXT_RESERVED
@@ -229,7 +225,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 /* SADB_X_DEBUG */
 1<<SADB_EXT_RESERVED
 | 1<<SADB_X_EXT_DEBUG
-#ifdef NAT_TRAVERSAL
 ,
 /* SADB_X_NAT_T_NEW_MAPPING */
 1<<SADB_EXT_RESERVED
@@ -238,7 +233,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_ADDRESS_DST
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
-#endif
 },
 
 /* REQUIRED IN */
@@ -374,7 +368,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 /* SADB_X_DEBUG */
 1<<SADB_EXT_RESERVED
 | 1<<SADB_X_EXT_DEBUG
-#ifdef NAT_TRAVERSAL
 ,
 /* SADB_X_NAT_T_NEW_MAPPING */
 1<<SADB_EXT_RESERVED
@@ -383,7 +376,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_ADDRESS_DST
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
-#endif
 }
 
 },
@@ -425,12 +417,10 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_IDENTITY_SRC
 | 1<<SADB_EXT_IDENTITY_DST
 | 1<<SADB_EXT_SENSITIVITY
-#ifdef NAT_TRAVERSAL
 | 1<<SADB_X_EXT_NAT_T_TYPE
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
 | 1<<SADB_X_EXT_NAT_T_OA
-#endif
 ,
 /* SADB_DELETE */
 1<<SADB_EXT_RESERVED
@@ -572,7 +562,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 /* SADB_X_DEBUG */
 1<<SADB_EXT_RESERVED
 | 1<<SADB_X_EXT_DEBUG
-#ifdef NAT_TRAVERSAL
 ,
 /* SADB_X_NAT_T_NEW_MAPPING */
 1<<SADB_EXT_RESERVED
@@ -581,7 +570,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_ADDRESS_DST
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
-#endif
 },
 
 /* REQUIRED OUT */
@@ -723,7 +711,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 /* SADB_X_DEBUG */
 1<<SADB_EXT_RESERVED
 | 1<<SADB_X_EXT_DEBUG
-#ifdef NAT_TRAVERSAL
 ,
 /* SADB_X_NAT_T_NEW_MAPPING */
 1<<SADB_EXT_RESERVED
@@ -732,7 +719,6 @@ unsigned int extensions_bitmaps[2/*in/out*/][2/*perm/req*/][SADB_MAX + 1/*ext*/]
 | 1<<SADB_EXT_ADDRESS_DST
 | 1<<SADB_X_EXT_NAT_T_SPORT
 | 1<<SADB_X_EXT_NAT_T_DPORT
-#endif
 }
 }
 };
index 9025654..a1cc6d9 100644 (file)
@@ -387,9 +387,7 @@ pfkey_address_parse(struct sadb_ext *pfkey_ext)
        case SADB_X_EXT_ADDRESS_DST_FLOW:
        case SADB_X_EXT_ADDRESS_SRC_MASK:
        case SADB_X_EXT_ADDRESS_DST_MASK:
-#ifdef NAT_TRAVERSAL
        case SADB_X_EXT_NAT_T_OA:
-#endif
                break;
        default:
                DEBUGGING(PF_KEY_DEBUG_PARSE_PROBLEM, 
@@ -1156,18 +1154,17 @@ pfkey_x_ext_protocol_parse(struct sadb_ext *pfkey_ext)
        return error;
 }
 
-#ifdef NAT_TRAVERSAL
 DEBUG_NO_STATIC int
 pfkey_x_ext_nat_t_type_parse(struct sadb_ext *pfkey_ext)
 {
        return 0;
 }
+
 DEBUG_NO_STATIC int
 pfkey_x_ext_nat_t_port_parse(struct sadb_ext *pfkey_ext)
 {
        return 0;
 }
-#endif
 
 #define DEFINEPARSER(NAME) static struct pf_key_ext_parsers_def NAME##_def={NAME, #NAME};
 
@@ -1184,10 +1181,8 @@ DEFINEPARSER(pfkey_x_kmprivate_parse);
 DEFINEPARSER(pfkey_x_satype_parse);
 DEFINEPARSER(pfkey_x_ext_debug_parse);
 DEFINEPARSER(pfkey_x_ext_protocol_parse);
-#ifdef NAT_TRAVERSAL
 DEFINEPARSER(pfkey_x_ext_nat_t_type_parse);
 DEFINEPARSER(pfkey_x_ext_nat_t_port_parse);
-#endif
 
 struct pf_key_ext_parsers_def *ext_default_parsers[]=
 {
@@ -1217,14 +1212,11 @@ struct pf_key_ext_parsers_def *ext_default_parsers[]=
        &pfkey_address_parse_def,
        &pfkey_address_parse_def,
        &pfkey_x_ext_debug_parse_def,
-       &pfkey_x_ext_protocol_parse_def
-#ifdef NAT_TRAVERSAL
-       ,
+       &pfkey_x_ext_protocol_parse_def ,
        &pfkey_x_ext_nat_t_type_parse_def,
        &pfkey_x_ext_nat_t_port_parse_def,
        &pfkey_x_ext_nat_t_port_parse_def,
        &pfkey_address_parse_def
-#endif 
 };
 
 int
index 48579e2..07126f1 100644 (file)
@@ -19,29 +19,25 @@ you leave this credit intact on any copies of this file.
 #define PF_KEY_V2 2
 #define PFKEYV2_REVISION        199806L
 
-#define SADB_RESERVED    0
-#define SADB_GETSPI      1
-#define SADB_UPDATE      2
-#define SADB_ADD         3
-#define SADB_DELETE      4
-#define SADB_GET         5
-#define SADB_ACQUIRE     6
-#define SADB_REGISTER    7
-#define SADB_EXPIRE      8
-#define SADB_FLUSH       9
-#define SADB_DUMP       10
-#define SADB_X_PROMISC  11
-#define SADB_X_PCHANGE  12
-#define SADB_X_GRPSA    13
-#define SADB_X_ADDFLOW 14
-#define SADB_X_DELFLOW 15
-#define SADB_X_DEBUG   16
-#ifdef NAT_TRAVERSAL
-#define SADB_X_NAT_T_NEW_MAPPING  17
-#define SADB_MAX                  17
-#else
-#define SADB_MAX        16
-#endif
+#define SADB_RESERVED             0
+#define SADB_GETSPI               1
+#define SADB_UPDATE               2
+#define SADB_ADD                  3
+#define SADB_DELETE               4
+#define SADB_GET                  5
+#define SADB_ACQUIRE              6
+#define SADB_REGISTER             7
+#define SADB_EXPIRE               8
+#define SADB_FLUSH                9
+#define SADB_DUMP                10
+#define SADB_X_PROMISC           11
+#define SADB_X_PCHANGE           12
+#define SADB_X_GRPSA             13
+#define SADB_X_ADDFLOW           14
+#define SADB_X_DELFLOW           15
+#define SADB_X_DEBUG             16
+#define SADB_X_NAT_T_NEW_MAPPING 17
+#define SADB_MAX                 17
 
 struct sadb_msg {
   uint8_t sadb_msg_version;
@@ -219,7 +215,6 @@ struct sadb_x_debug {
   uint8_t sadb_x_debug_reserved[4];
 };
 
-#ifdef NAT_TRAVERSAL
 struct sadb_x_nat_t_type {
   uint16_t sadb_x_nat_t_type_len;
   uint16_t sadb_x_nat_t_type_exttype;
@@ -232,8 +227,7 @@ struct sadb_x_nat_t_port {
   uint16_t sadb_x_nat_t_port_port;
   uint16_t sadb_x_nat_t_port_reserved;
 };
-#endif
-  
+
 /*
  * A protocol structure for passing through the transport level
  * protocol.  It contains more fields than are actually used/needed
@@ -279,15 +273,11 @@ struct sadb_protocol {
 #define SADB_X_EXT_ADDRESS_DST_MASK   24
 #define SADB_X_EXT_DEBUG              25
 #define SADB_X_EXT_PROTOCOL           26
-#ifdef NAT_TRAVERSAL
 #define SADB_X_EXT_NAT_T_TYPE         27
 #define SADB_X_EXT_NAT_T_SPORT        28
 #define SADB_X_EXT_NAT_T_DPORT        29
 #define SADB_X_EXT_NAT_T_OA           30
 #define SADB_EXT_MAX                  30
-#else
-#define SADB_EXT_MAX                  26
-#endif
 
 /* SADB_X_DELFLOW required over and above SADB_X_SAFLAGS_CLEARFLOW */
 #define SADB_X_EXT_ADDRESS_DELFLOW \