diff options
author | Martin Willi <martin@revosec.ch> | 2013-07-29 09:00:56 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-07-29 09:00:56 +0200 |
commit | 14dfdf7dacfff99aa4ba468e8618afaec1c0657b (patch) | |
tree | 17a1c5df0603cd8a093432e4003638e6a256a4b4 /src/libstrongswan/utils/utils.h | |
parent | 7612a6e42fa4779adbeab74ec044bd554d00c3b3 (diff) | |
parent | 9d75f04eee7fd4e0f9b14fac3f9a67993d8c2267 (diff) | |
download | strongswan-14dfdf7dacfff99aa4ba468e8618afaec1c0657b.tar.bz2 strongswan-14dfdf7dacfff99aa4ba468e8618afaec1c0657b.tar.xz |
Merge branch 'xauth-radius'
Implements verification of XAuth credentials using simple RADIUS User-Name and
(encrypted) User-Password attributes. The XAuth backend is implemented in the
eap-radius plugin, reusing all existing infrastructure and features found in
that plugin, including RADIUS accounting.
Diffstat (limited to 'src/libstrongswan/utils/utils.h')
-rw-r--r-- | src/libstrongswan/utils/utils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/utils.h b/src/libstrongswan/utils/utils.h index 0e103de9c..d055f712d 100644 --- a/src/libstrongswan/utils/utils.h +++ b/src/libstrongswan/utils/utils.h @@ -671,6 +671,29 @@ static inline u_int64_t untoh64(void *network) } /** + * Round up size to be multiple of alignement + */ +static inline size_t round_up(size_t size, int alignement) +{ + int remainder; + + remainder = size % alignement; + if (remainder) + { + size += alignement - remainder; + } + return size; +} + +/** + * Round down size to be a multiple of alignement + */ +static inline size_t round_down(size_t size, int alignement) +{ + return size - (size % alignement); +} + +/** * Special type to count references */ typedef u_int refcount_t; |