2016-03-08 22:14:30 +01:00
|
|
|
#ifndef GB_IPADDRESSCHECKS_H
|
|
|
|
#define GB_IPADDRESSCHECKS_H
|
2016-02-01 15:33:40 +01:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
|
|
|
|
void initialize_ip_address_checks();
|
|
|
|
|
|
|
|
//guess distance to IP
|
2016-02-02 11:34:37 +01:00
|
|
|
static const unsigned ip_distance_ourselves = 0;
|
|
|
|
static const unsigned ip_distance_lan = 1;
|
|
|
|
static const unsigned ip_distance_nearby = 2;
|
2016-02-01 15:33:40 +01:00
|
|
|
// >2 = internet
|
|
|
|
unsigned ip_distance(uint32_t ip/*network-order*/);
|
|
|
|
|
2016-02-02 13:59:01 +01:00
|
|
|
//Is the IP an internal IP as in "we control the hosts and allow more aggressive crawling"
|
|
|
|
bool is_internal_net_ip(uint32_t ip/*network-order*/);
|
|
|
|
|
2016-10-20 15:26:48 +02:00
|
|
|
//Is the IP an internal-like that we allow to use the udp protocol without being registered as part of the cluster?
|
|
|
|
bool is_trusted_protocol_ip(uint32_t ip/*network-order*/);
|
|
|
|
|
2016-06-09 12:30:41 +02:00
|
|
|
//Make a guess if the two IPs are on the same network / controlled by the same
|
|
|
|
//entity and links between them should be treated as internal links
|
2016-06-09 12:33:36 +02:00
|
|
|
//bool is_same_network_linkwise(uint32_t ip_a/*network order*/, uint32_t ip_b/*network order*/);
|
|
|
|
static inline bool is_same_network_linkwise(uint32_t,uint32_t) { return false; }
|
2016-02-18 12:53:15 +01:00
|
|
|
|
2016-03-08 22:14:30 +01:00
|
|
|
#endif // GB_IPADDRESSCHECKS_H
|