[Openswan dev] pfkey_sock in spi.c

mds 0x at student.ethz.ch
Thu Jul 5 05:07:05 EDT 2007

In spi.c on line 1191 (in the main function) the following socket is 
pfkey_sock = socket(PF_KEY, SOCK_RAW, PF_KEY_V2)

later in the main function a write to the socket is performed (line 1608):
write(pfkey_sock, pfkey_msg, pfkey_msg->sadb_msg_len * IPSEC_PFKEYv2_ALIGN)

I couldn't locate the code where the message that was sent by this command
is recieved.
I would apreciate a short explanation of this mechanism very much.

Thanks for your time.

I found a file documenting what files end up in kernel & user space in
openswanDir/linux/README.openswan-2. The problem there was that
that file is outdated (last update in 2003). The ipsec_netlink.c file is 
in that readme - as an example - but ipsec_netlink.c does not exist in the
current version of Openswan.
Is it alright to assume that only code located in ./linux/net end up in
kernel space? 

More information about the Dev mailing list