From 0875732ca32f08b423c404d8bd1605e839e2caf4 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Thu, 19 Jan 2012 11:13:59 +0400 Subject: add missing accel-pppd/include/connlimit.h --- accel-pppd/include/connlimit.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 accel-pppd/include/connlimit.h (limited to 'accel-pppd/include') diff --git a/accel-pppd/include/connlimit.h b/accel-pppd/include/connlimit.h new file mode 100644 index 00000000..4227bad1 --- /dev/null +++ b/accel-pppd/include/connlimit.h @@ -0,0 +1,23 @@ +#ifndef __CONNLIMIT_H +#define __CONNLIMIT_H + +static inline uint64_t cl_key_from_ipv4(uint32_t ip) +{ + return ip; +} + +static inline uint64_t cl_key_from_mac(uint8_t hw[6]) +{ + union { + uint8_t hw[6]; + uint64_t key; + } key; + + memcpy(key.hw, hw, sizeof(hw)); + + return key.key; +} + +int connlimit_check(uint64_t key); + +#endif -- cgit v1.2.3