gluon/package/gluon-ebtables-limit-arp/src/mac.h
Linus Lüssing 84a6f65f02 gluon-ebtables-limit-arp: a package for ARP rate-limiting
This package adds filters to limit the amount of ARP Requests
devices are allowed to send into the mesh. The limits are 6 packets
per minute per client device, by MAC address, and 1 per second per
node in total.

A burst of up to 50 ARP Requests is allowed until the rate-limiting
takes effect (see --limit-burst in the ebtables manpage).

Furthermore, ARP Requests with a target IP already present in the
batman-adv DAT Cache are excluded from the rate-limiting,
both regarding counting and filtering, as batman-adv will respond
locally with no burden for the mesh. Therefore, this limiter
should not affect popular target IPs, like gateways.

However it should mitigate the problem of curious people or
smart devices scanning the whole IP range. Which could create
a significant amount of overhead for all participants so far.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
2018-02-15 23:21:11 +01:00

20 lines
399 B
C

/*
* Copyright (c) 2017 Linus Lüssing <linus.luessing@c0d3.blue>
*
* SPDX-License-Identifier: GPL-2.0+
* License-Filename: LICENSE
*/
#ifndef _MAC_H_
#define _MAC_H_
struct mac_addr {
/* 8 instead of 6 for multiples of uint32_t for hashword() */
unsigned char storage[8];
};
int mac_aton(const char *cp, struct mac_addr *mac);
char *mac_ntoa(struct mac_addr *mac);
#endif /* _MAC_H_ */