#include <sys/socket.h>
#include <netinet/in.h>
-#include <System/net/pfkeyv2.h>
+#include <net/pfkeyv2.h>
#include <netinet6/ipsec.h>
#include <stdio.h>
{ 0, "out ipsec esp/transport/fec0::10-fec0::11/use" },
};
-int test1 __P((void));
-int test1sub1 __P((struct req_t *));
-int test1sub2 __P((char *, int));
-int test2 __P((void));
-int test2sub __P((int));
+int test1 (void);
+int test1sub1 (struct req_t *);
+int test1sub2 (char *, int);
+int test2 (void);
+int test2sub (int);
int
main(ac, av)
free(m);
printf("spdsetidx()\n");
- if (pfkey_send_spdsetidx(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spdsetidx(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, sp1, splen1, 0) < 0)
errx(1, "ERROR: %s", ipsec_strerror());
m = pfkey_recv(so);
free(m);
printf("spdupdate()\n");
- if (pfkey_send_spdupdate(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spdupdate(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, sp2, splen2, 0) < 0)
errx(1, "ERROR: %s", ipsec_strerror());
m = pfkey_recv(so);
sleep(4);
printf("spddelete()\n");
- if (pfkey_send_spddelete(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spddelete(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, sp1, splen1, 0) < 0)
errx(1, "ERROR: %s", ipsec_strerror());
m = pfkey_recv(so);
free(m);
printf("spdadd()\n");
- if (pfkey_send_spdadd(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spdadd(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, sp2, splen2, 0) < 0)
errx(1, "ERROR: %s", ipsec_strerror());
spid = test2sub(so);
free(m);
printf("spdadd() with lifetime's 10(s)\n");
- if (pfkey_send_spdadd2(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spdadd2(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, 0, 10, sp2, splen2, 0) < 0)
errx(1, "ERROR: %s", ipsec_strerror());
spid = test2sub(so);
/* expecting failure */
printf("spdupdate()\n");
- if (pfkey_send_spdupdate(so, (struct sockaddr *)addr, 128,
- (struct sockaddr *)addr, 128,
+ if (pfkey_send_spdupdate(so, (struct sockaddr_storage *)addr, 128,
+ (struct sockaddr_storage *)addr, 128,
255, sp2, splen2, 0) == 0) {
warnx("ERROR: expecting failure.");
}