summaryrefslogtreecommitdiffstats
path: root/lib/libipsec/test-policy.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
committerume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
commit832f8d224926758a9ae0b23a6b45353e44fbc87a (patch)
treea79fc7ad2b97862c4a404f352f0211ad93a7b5f1 /lib/libipsec/test-policy.c
parent2693854b01a52b0395a91322aa3edf926bddff38 (diff)
downloadFreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.zip
FreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.tar.gz
Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
Diffstat (limited to 'lib/libipsec/test-policy.c')
-rw-r--r--lib/libipsec/test-policy.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/lib/libipsec/test-policy.c b/lib/libipsec/test-policy.c
index 5a4faf5..960de20 100644
--- a/lib/libipsec/test-policy.c
+++ b/lib/libipsec/test-policy.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: test-policy.c,v 1.13 2000/05/07 05:25:03 itojun Exp $ */
+/* $KAME: test-policy.c,v 1.14 2000/12/27 11:38:11 sakane Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
@@ -46,6 +46,8 @@
#include <errno.h>
#include <err.h>
+#include "libpfkey.h"
+
struct req_t {
int result; /* expected result; 0:ok 1:ng */
char *str;
@@ -111,9 +113,9 @@ test1()
result = test1sub1(&reqs[i]);
if (result == 0 && reqs[i].result == 1) {
- errx(1, "ERROR: expecting failure.\n");
+ warnx("ERROR: expecting failure.\n");
} else if (result == 1 && reqs[i].result == 0) {
- errx(1, "ERROR: expecting success.\n");
+ warnx("ERROR: expecting success.\n");
}
}
@@ -245,7 +247,8 @@ test2()
errx(1, "ERROR: %s\n", ipsec_strerror());
m = pfkey_recv(so);
free(m);
-
+
+#if 0
printf("spdsetidx()\n");
if (pfkey_send_spdsetidx(so, (struct sockaddr *)addr, 128,
(struct sockaddr *)addr, 128,
@@ -262,6 +265,8 @@ test2()
m = pfkey_recv(so);
free(m);
+ sleep(4);
+
printf("spddelete()\n");
if (pfkey_send_spddelete(so, (struct sockaddr *)addr, 128,
(struct sockaddr *)addr, 128,
@@ -283,19 +288,31 @@ test2()
m = pfkey_recv(so);
free(m);
+ sleep(4);
+
printf("spddelete2()\n");
if (pfkey_send_spddelete2(so, spid) < 0)
errx(1, "ERROR: %s\n", ipsec_strerror());
m = pfkey_recv(so);
free(m);
+#endif
+ printf("spdadd() with lifetime's 10(s)\n");
+ if (pfkey_send_spdadd2(so, (struct sockaddr *)addr, 128,
+ (struct sockaddr *)addr, 128,
+ 255, 0, 10, sp2, splen2, 0) < 0)
+ errx(1, "ERROR: %s\n", ipsec_strerror());
+ spid = test2sub(so);
+
+#if 0
/* expecting failure */
printf("spdupdate()\n");
if (pfkey_send_spdupdate(so, (struct sockaddr *)addr, 128,
(struct sockaddr *)addr, 128,
255, sp2, splen2, 0) == 0) {
- errx(1, "ERROR: expecting failure.\n");
+ warnx("ERROR: expecting failure.\n");
}
+#endif
return 0;
}
OpenPOWER on IntegriCloud