在我的项目中,需要通过编程将IPsec实现到数据包。目前,我的系统使用n个etfilter队列捕获数据包,并将包准备为mangled。从现在开始,我对如何对这些包实现IPsec一无所知。
在我的研究中,我遇到了一个名为xfrm的linux内核库,但是这缺乏文档来掌握它(https://www.google.com/search?client=ubuntu&channel=fs&q=how+to+use+xfrm+c&ie=utf-8&oe=utf-8#channel=fs&q=linux+ipsec+xfrm+example)。如果你们中的任何一位专家能为我提供一些用xfrm执行xfrm的示例或实现IPsec的其他方法,我将非常感激。
非常感谢
发布于 2014-04-29 21:35:25
In kernel space look at this files
[Sasi@localhost linux]$ ls -l net/ipv4/xfrm4_*
-rw-r--r--. 1 root root 3957 Apr 19 20:09 net/ipv4/xfrm4_input.c
-rw-r--r--. 1 root root 3773 Apr 19 20:09 net/ipv4/xfrm4_mode_beet.c
-rw-r--r--. 1 root root 2135 Apr 19 20:09 net/ipv4/xfrm4_mode_transport.c
-rw-r--r--. 1 root root 3024 Apr 19 20:09 net/ipv4/xfrm4_mode_tunnel.c
-rw-r--r--. 1 root root 2494 Apr 19 20:09 net/ipv4/xfrm4_output.c
-rw-r--r--. 1 root root 7530 Apr 19 20:09 net/ipv4/xfrm4_policy.c
-rw-r--r--. 1 root root 6523 Apr 19 20:09 net/ipv4/xfrm4_protocol.c
-rw-r--r--. 1 root root 2494 Apr 19 20:09 net/ipv4/xfrm4_state.c
-rw-r--r--. 1 root root 2765 Apr 19 20:09 net/ipv4/xfrm4_tunnel.c
[Sasi@localhost linux]$ ls -l net/xfrm/*
-rw-r--r--. 1 root root 2246 Apr 19 20:09 net/xfrm/Kconfig
-rw-r--r--. 1 root root 342 Apr 19 20:09 net/xfrm/Makefile
-rw-r--r--. 1 root root 14094 Apr 19 20:09 net/xfrm/xfrm_algo.c
-rw-r--r--. 1 root root 766 Apr 19 20:09 net/xfrm/xfrm_hash.c
-rw-r--r--. 1 root root 3179 Apr 19 20:09 net/xfrm/xfrm_hash.h
-rw-r--r--. 1 root root 8683 Apr 19 20:09 net/xfrm/xfrm_input.c
-rw-r--r--. 1 root root 7816 Apr 19 20:09 net/xfrm/xfrm_ipcomp.c
-rw-r--r--. 1 root root 4874 Apr 19 20:09 net/xfrm/xfrm_output.c
-rw-r--r--. 1 root root 78405 Apr 19 20:09 net/xfrm/xfrm_policy.c
-rw-r--r--. 1 root root 3364 Apr 19 20:09 net/xfrm/xfrm_proc.c
-rw-r--r--. 1 root root 14582 Apr 19 20:09 net/xfrm/xfrm_replay.c
-rw-r--r--. 1 root root 56892 Apr 19 20:09 net/xfrm/xfrm_state.c
-rw-r--r--. 1 root root 1877 Apr 19 20:09 net/xfrm/xfrm_sysctl.c
-rw-r--r--. 1 root root 73048 Apr 19 20:09 net/xfrm/xfrm_user.chttps://stackoverflow.com/questions/23358326
复制相似问题