summaryrefslogtreecommitdiff
path: root/accel-pppd/include/connlimit.h
blob: 4227bad1e2d56164e8fee78aa86e4f19347b4303 (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(hw));

	return key.key;
}

int connlimit_check(uint64_t key);

#endif