Monero
Loading...
Searching...
No Matches
getifaddr.c File Reference
#include <stdio.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "config.h"
#include "getifaddr.h"
#include <ifaddrs.h>
Include dependency graph for getifaddr.c:

Macros

#define IP(a, b, c, d)
#define MSK(m)

Functions

int getifaddr (const char *ifname, char *buf, int len, struct in_addr *addr, struct in_addr *mask)
int find_ipv6_addr (const char *ifname, char *dst, int n)
int addr_is_reserved (struct in_addr *addr)

Variables

struct { 
   uint32_t   address 
   uint32_t   rmask 
reserved []

Macro Definition Documentation

◆ IP

#define IP ( a,
b,
c,
d )
Value:
(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
cryptonote::block b
Definition block.cpp:40
Definition d.py:1
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124

◆ MSK

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

Function Documentation

◆ addr_is_reserved()

int addr_is_reserved ( struct in_addr * addr)

◆ find_ipv6_addr()

int find_ipv6_addr ( const char * ifname,
char * dst,
int n )

◆ getifaddr()

int getifaddr ( const char * ifname,
char * buf,
int len,
struct in_addr * addr,
struct in_addr * mask )

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(16) },
{ 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 getifaddr.c:267
#define MSK(m)
Definition getifaddr.c:268

◆ rmask

uint32_t rmask