summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyexchange/isakmpd-20041012/.depend6
-rw-r--r--keyexchange/isakmpd-20041012/anytun_key.c63
2 files changed, 68 insertions, 1 deletions
diff --git a/keyexchange/isakmpd-20041012/.depend b/keyexchange/isakmpd-20041012/.depend
index 4a6e1fb..6af7a05 100644
--- a/keyexchange/isakmpd-20041012/.depend
+++ b/keyexchange/isakmpd-20041012/.depend
@@ -259,7 +259,11 @@ virtual.o: virtual.c /usr/include/openssl/err.h conf.h \
anytun_key.o: anytun_key.c anytun_key.h \
/home/otti/anytun/keyexchange/isakmpd-20041012/sysdep/linux/sys/queue.h \
sysdep.h \
- /home/otti/anytun/keyexchange/isakmpd-20041012/sysdep/linux/sysdep-os.h
+ /home/otti/anytun/keyexchange/isakmpd-20041012/sysdep/linux/sysdep-os.h \
+ cert.h conf.h exchange.h exchange_num.h constants.h isakmp.h \
+ isakmp_fld.h field.h isakmp_num.h ipsec.h ipsec_doi.h ipsec_fld.h \
+ ipsec_num.h isakmp_cfg.h key.h log.h pf_key_v2.h sa.h timer.h \
+ transport.h message.h util.h
x509.o: x509.c sysdep.h \
/home/otti/anytun/keyexchange/isakmpd-20041012/sysdep/linux/sysdep-os.h \
cert.h \
diff --git a/keyexchange/isakmpd-20041012/anytun_key.c b/keyexchange/isakmpd-20041012/anytun_key.c
index e86fb9a..60047e3 100644
--- a/keyexchange/isakmpd-20041012/anytun_key.c
+++ b/keyexchange/isakmpd-20041012/anytun_key.c
@@ -8,6 +8,23 @@
#include <string.h>
#include "sysdep.h"
+#include "cert.h"
+#include "conf.h"
+#include "exchange.h"
+#include "ipsec.h"
+#include "ipsec_num.h"
+#include "key.h"
+#include "log.h"
+#include "pf_key_v2.h"
+#include "sa.h"
+#include "timer.h"
+#include "transport.h"
+#include "util.h"
+
+#include <sys/socket.h>
+#include <netdb.h>
+
+
int anytun_key_socket;
void anytun_key_connection_check(char * conn)
@@ -21,6 +38,52 @@ return 0;
int anytun_key_enable_sa(struct sa *sa, struct sa *isakmp_sa)
{
+ struct ipsec_sa *isa = sa->data;
+ struct sockaddr *dst, *src;
+ char idsrc[256], iddst[256];
+// int error;
+// struct proto *proto = TAILQ_FIRST(&sa->protos);
+// int sidtype = 0, didtype = 0;
+// size_t sidlen = 0, didlen = 0;
+// u_int8_t *sid = 0, *did = 0;
+
+ sa->transport->vtbl->get_dst(sa->transport, &dst);
+ sa->transport->vtbl->get_src(sa->transport, &src);
+ if (getnameinfo(src, sysdep_sa_len(src), idsrc, sizeof idsrc, NULL, 0,
+ NI_NUMERICHOST) != 0) {
+ log_print("udp_decode_ids: getnameinfo () failed for 'src'");
+ strlcpy(idsrc, "<error>", 256);
+ }
+ if (getnameinfo(dst, sysdep_sa_len(dst), iddst, sizeof iddst, NULL, 0,
+ NI_NUMERICHOST) != 0) {
+ log_print("udp_decode_ids: getnameinfo () failed for 'dst'");
+ strlcpy(iddst, "<error>", 256);
+ }
+
+ printf( "anytun src: %s dst: %s\n", idsrc, iddst);
+
+//struct ipsec_sa {
+// /* Phase 1. */
+// u_int8_t hash;
+// size_t skeyid_len;
+// u_int8_t *skeyid_d;
+// u_int8_t *skeyid_a;
+// u_int16_t prf_type;
+//
+// /* Phase 2. */
+// u_int16_t group_desc;
+//
+// /* Tunnel parameters. These are in network byte order. */
+// struct sockaddr *src_net;
+// struct sockaddr *src_mask;
+// struct sockaddr *dst_net;
+// struct sockaddr *dst_mask;
+// u_int8_t tproto;
+// u_int16_t sport;
+// u_int16_t dport;
+//};
+
+
return 0;
}