Monero
Loading...
Searching...
No Matches
Macros | Functions | Variables
addr_is_reserved.c File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
Include dependency graph for addr_is_reserved.c:

Macros

#define IP(a, b, c, d)   (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
 
#define MSK(m)   (32-(m))
 

Functions

int addr_is_reserved (const char *addr_str)
 

Variables

struct { 
 
   uint32_t   address 
 
   uint32_t   rmask 
 
reserved [] 
 

Macro Definition Documentation

◆ IP

#define IP ( a,
b,
c,
d )   (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))

◆ MSK

#define MSK ( m)    (32-(m))

Function Documentation

◆ addr_is_reserved()

int addr_is_reserved ( const char * addr_str)
Returns
1 or 0

Variable Documentation

◆ address

uint32_t address

◆ [struct]

const struct { ... } reserved[]
Initial value:
= {
{ IP( 0, 0, 0, 0), MSK( 8) },
{ IP( 10, 0, 0, 0), MSK( 8) },
{ IP(100, 64, 0, 0), MSK(10) },
{ IP(127, 0, 0, 0), MSK( 8) },
{ IP(169, 254, 0, 0), MSK(16) },
{ IP(172, 16, 0, 0), MSK(12) },
{ IP(192, 0, 0, 0), MSK(24) },
{ IP(192, 0, 2, 0), MSK(24) },
{ IP(192, 31, 196, 0), MSK(24) },
{ IP(192, 52, 193, 0), MSK(24) },
{ IP(192, 88, 99, 0), MSK(24) },
{ IP(192, 168, 0, 0), MSK(16) },
{ IP(192, 175, 48, 0), MSK(24) },
{ IP(198, 18, 0, 0), MSK(15) },
{ IP(198, 51, 100, 0), MSK(24) },
{ IP(203, 0, 113, 0), MSK(24) },
{ IP(224, 0, 0, 0), MSK( 4) },
{ IP(240, 0, 0, 0), MSK( 4) },
}
#define IP(a, b, c, d)
Definition addr_is_reserved.c:26
#define MSK(m)
Definition addr_is_reserved.c:27

◆ rmask

uint32_t rmask