summaryrefslogtreecommitdiff
path: root/accel-pppd/include/connlimit.h
blob: a5645ee2abf21fd665eefc3da5c74b58b64d0305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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(key.hw));

	return key.key;
}

int connlimit_check(uint64_t key);

#endif