[Swan-dev] add_time

Paul Wouters paul at nohats.ca
Thu Jan 29 18:48:26 EET 2015


On Thu, 29 Jan 2015, D. Hugh Redelmeier wrote:

> What is add_time?  It seems to be added in
> 1913dd115696793d8dc5d6b6fd3f8238408fc1d1

The time in uint64_t that the kernel reports back to us via netlink when
it installed a certain IPsec SA into the kernel SADB.

> It seems to derived from netlink (a paragon of documentation)
> 	rsp.info.curlft.add_time
> 	where rsp.info is a struct xfrm_usersa
>
> What makes me most suspicious is that it is a uint64_t.  I bet it is some
> kind of time and it should be represented in Pluto in one of its time
> types, not as a raw number.

I vaguely remember it was tried to be put into a time_t but with the
kernel_netlink.c code requiring uint64_t we failed and in the end left
it as uint64_t. This value is printed in its raw form when using:

root at bofh:/home/paul# ipsec whack --trafficstatus
000 
006 #74: "bofh-extrude", type=ESP,  add_time=0, inBytes=52394436, outBytes=88372286
006 #99: "nssec", type=ESP,  add_time=1422547992, inBytes=0, outBytes=0
006 #94: "redhat", XAUTHuser=pwouters, type=ESP,  add_time=1422543557, inBytes=679440, outBytes=4892803
000

The output is meant to be processed by tools and not by humans.

Paul


More information about the Swan-dev mailing list