diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-01-19 11:13:59 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-01-19 11:13:59 +0400 |
commit | 0875732ca32f08b423c404d8bd1605e839e2caf4 (patch) | |
tree | 235dccccec618e0ef8066b3c1b8cd3d266a151c3 /accel-pppd/include | |
parent | b463f4f2559a6f0180ba09fb1cb43d51144e95f0 (diff) | |
download | accel-ppp-0875732ca32f08b423c404d8bd1605e839e2caf4.tar.gz accel-ppp-0875732ca32f08b423c404d8bd1605e839e2caf4.zip |
add missing accel-pppd/include/connlimit.h
Diffstat (limited to 'accel-pppd/include')
-rw-r--r-- | accel-pppd/include/connlimit.h | 23 |
1 files changed, 23 insertions, 0 deletions
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 |