Monero
Loading...
Searching...
No Matches
getifaddr.h
Go to the documentation of this file.
1/* $Id: getifaddr.h,v 1.11 2018/07/06 11:47:29 nanard Exp $ */
2/* vim: tabstop=4 shiftwidth=4 noexpandtab
3 * MiniUPnP project
4 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
5 * (c) 2006-2018 Thomas Bernard
6 * This software is subject to the conditions detailed
7 * in the LICENCE file provided within the distribution */
8
9#ifndef GETIFADDR_H_INCLUDED
10#define GETIFADDR_H_INCLUDED
11
12struct in_addr;
13struct in6_addr;
14
15/* getifaddr()
16 * take a network interface name and write the
17 * ip v4 address as text in the buffer
18 * returns: 0 success, -1 failure */
19int
20getifaddr(const char * ifname, char * buf, int len,
21 struct in_addr * addr, struct in_addr * mask);
22
23int
24getifaddr_in6(const char * ifname, int af, struct in6_addr* addr);
25
26/* find a non link local IP v6 address for the interface.
27 * if ifname is NULL, look for all interfaces */
28int
29find_ipv6_addr(const char * ifname,
30 char * dst, int n);
31
32/* check if address is in private / reserved block (e.g. local area network) */
33int
34addr_is_reserved(struct in_addr * addr);
35
36#endif
int find_ipv6_addr(const char *ifname, char *dst, int n)
Definition getifaddr.c:221
int getifaddr(const char *ifname, char *buf, int len, struct in_addr *addr, struct in_addr *mask)
Definition getifaddr.c:30
int getifaddr_in6(const char *ifname, int af, struct in6_addr *addr)
int addr_is_reserved(struct in_addr *addr)
Definition getifaddr.c:293
const char * buf
Definition slow_memmem.cpp:73
static const char * ifname
Definition testipfwrdr.c:17