diff options
Diffstat (limited to 'accel-pppd/include/connlimit.h')
-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 |