[strongSwan] Place for a function in ipsec starter

Martin Willi martin at strongswan.org
Mon May 19 16:57:29 CEST 2014


Hi Noel,

> I'm trying to make the wait delay in invokecharon.c configurable, but
> because the time is in microseconds or miliseconds, I can't use
> lib->get_time().

There are some existing settings using ms resolution as well. We took
the pragmatic approach by using lib->get_int(), and just always expect
milliseconds. Usually good enough.

> That's why I want to write a function that takes times in the
> "amountSuffix" format like this: 1us, 1ms, 1s, 1m, 1h, 1d.

Doable, but most likely somewhat over-engineered? Probably no setting
ever needs both "us" and day resolutions? And 32-bit integers would be
insufficient...

> Should I put it in invokecharon.c or should I extend the libstrongswan
> to include the function, although I only need it in starter?

If such a function has other potential users, putting it in
libstrongswan can make sense. But as said, probably more complicated
than needed.

Regards
Martin



More information about the Users mailing list