Hi all:<br><br>I&#39;m a newbie in the development area of Openswan. Recently I search the internet and find there is little documents about the source code. Most related docs are foucus on the usage and configuration of Openswan however. Paul introduce the mailing list to me. So here am I&nbsp; ~!<br>
<br>&nbsp;I want to to build my module using the interface of ipsec tunnel. So I pay much of attention to the ipsec_tunnel.c and ipsec_tunnel_start_xmit() function especially. And I depict the picture below to understand the key function invovled.<br>
<br><br>ipsec_tunnel_start_xmit(skb,dev)<br>{<br>&nbsp;&nbsp;&nbsp; ....<br>&nbsp;&nbsp;&nbsp; ipsec_tunnel_SAlookup();//??<br>&nbsp;&nbsp;&nbsp; ....<br>&nbsp;&nbsp;&nbsp; ipsec_xmit_encap_bundle(ixs)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ipsec_xmit_encap_once(ixs);// which do the work of encapsulation and ESP/AH&nbsp; <br>
&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; ....<br>&nbsp;&nbsp;&nbsp; ipsec_tunnel_send(ixs)//which send the packet out<br>}<br><br><br>It&#39;s torturous for me to look up the source code without any help-doc. So my question are mainly about the code and falls in three parts as follows:<br>
<br>1.which part of the code is designed to decide which connection (or SA )to use and which part is to trigger the establishment of SA if it do not exist?<br>2. what the functionality of function of ipsec_findroute() and the structure&nbsp; eroute?&nbsp; <br>
3.KLIPS is only designed for IPv4 ? As many data structure are only for IPv4.<br><br>My task is to transport&nbsp; the IPv4 packet by IPv6 IPsec tunnel . When I receive the packet , I need to determine&nbsp; which&nbsp; connection£¨or SA£©will bei used to tunnel the ipv4 packet (in sk_buff ). Can anyone give me any idea or suggestion about my task?&nbsp; Thank you .<br>