libcidr(3) | Library Functions Manual | libcidr(3) |
libcidr
—
CIDR-style IP address manipulation functions
#include
<libcidr.h>
Library libcidr (-lcidr)
libcidr
is a C library implementing a
variety of functions to manipulate IP addresses and netblocks. It handles
both IPv4 and IPv6 networks, will transform them to and from text strings in
a variety of formats, cram them into and lever them out of
in_addr and in6_addr structures,
and give you all sorts of stats about them. Functions are provided also to
tell you a few things about the network any given CIDR block is in, what its
parent and child networks are, and so on. If you're really nice,
libcidr
may even cook you breakfast.
The primary documentation for libcidr
is
maintained elsewhere, with a full description of the functions, their
options, and their return values. Your installation probably has a copy of
the reference manual installed somewhere, perhaps in
/usr/share/libcidr/docs. Documentation is also
available on the webpage (see below). This manpage is provided as a quick
reference.
CIDR
*cidr_addr_broadcast(const CIDR *cidr)
CIDR
*cidr_addr_hostmax(const CIDR *cidr)
CIDR
*cidr_addr_hostmin(const CIDR *cidr)
CIDR
*cidr_addr_network(const CIDR *cidr)
CIDR
*cidr_alloc(void)
int
cidr_contains(const CIDR *big, const CIDR *little)
CIDR
*cidr_dup(const CIDR *cidr)
int
cidr_equals(const CIDR *first, const CIDR *second)
void
cidr_free(CIDR *cidr)
CIDR
*cidr_from_inaddr(const struct in_addr *in)
CIDR
*cidr_from_in6addr(const struct in6_addr *in)
CIDR
*cidr_from_str(const char *str)
uint8_t
*cidr_get_addr(const CIDR *cidr)
uint8_t
*cidr_get_mask(const CIDR *cidr)
int
cidr_get_pflen(const CIDR *cidr)
int
cidr_get_proto(const CIDR *cidr)
int
cidr_is_v4mapped(const CIDR *addr)
CIDR
**cidr_net_subnets(const CIDR *cidr)
CIDR
*cidr_net_supernet(const CIDR *cidr)
const char
*cidr_numaddr(const CIDR *cidr)
const
char *cidr_numaddr_pflen(int pflen)
const
char *cidr_numhost(const CIDR *cidr)
const
char *cidr_numhost_pflen(int pflen)
struct
in_addr *cidr_to_inaddr(const CIDR *cidr, struct in_addr
*in)
struct
in6_addr *cidr_to_in6addr(const CIDR *cidr, struct in6_addr
*in)
char
*cidr_to_str(const CIDR *cidr, int flags)
const
char *cidr_version(void)
libcidr
is written and maintained by
Matthew Fuller
⟨fullermd@over-yonder.net⟩. Its home on the web is at
⟨http://www.over-yonder.net/~fullermd/projects/libcidr⟩; check
there for updates and additional documentation.
May 7, 2012 | Debian |