mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
some isc_sockaddr_* functions were undocumented, and others were
documented in the source file rather than the header file
This commit is contained in:
parent
0cff88818a
commit
ff92fcaff3
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: sockaddr.h,v 1.33 2000/08/09 18:55:54 gson Exp $ */
|
/* $Id: sockaddr.h,v 1.34 2000/08/09 19:09:09 gson Exp $ */
|
||||||
|
|
||||||
#ifndef ISC_SOCKADDR_H
|
#ifndef ISC_SOCKADDR_H
|
||||||
#define ISC_SOCKADDR_H 1
|
#define ISC_SOCKADDR_H 1
|
||||||
@ -40,41 +40,81 @@ ISC_LANG_BEGINDECLS
|
|||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
|
isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
|
||||||
|
/*
|
||||||
|
* Return ISC_TRUE iff the socket addresses 'a' and 'b' are equal.
|
||||||
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
|
isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
|
||||||
|
/*
|
||||||
|
* Return ISC_TRUE iff the address parts of the socket addresses
|
||||||
|
* 'a' and 'b' are equal, ignoring the ports.
|
||||||
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
||||||
unsigned int prefixlen);
|
unsigned int prefixlen);
|
||||||
|
/*
|
||||||
|
* Return ISC_TRUE iff the most significant 'prefixlen' bits of the
|
||||||
|
* socket addresses 'a' and 'b' are equal, ignoring the ports.
|
||||||
|
*/
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only);
|
isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only);
|
||||||
|
/*
|
||||||
|
* Return a hash value for the socket address 'sockaddr'. If 'address_only'
|
||||||
|
* is ISC_TRUE, the hash value will not depend on the port.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_any(isc_sockaddr_t *sockaddr);
|
isc_sockaddr_any(isc_sockaddr_t *sockaddr);
|
||||||
|
/*
|
||||||
|
* Return the IPv4 wildcard address.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
|
isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
|
||||||
|
/*
|
||||||
|
* Return the IPv6 wildcard address.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
|
isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
|
||||||
|
/*
|
||||||
|
* Set '*sockaddr' to the wildcard address of protocol family
|
||||||
|
* 'family'.
|
||||||
|
*
|
||||||
|
* Requires:
|
||||||
|
* 'family' is AF_INET or AF_INET6.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
|
isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
|
||||||
in_port_t port);
|
in_port_t port);
|
||||||
|
/*
|
||||||
|
* Construct an isc_sockaddr_t from an IPv4 address and port.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
|
isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
|
||||||
in_port_t port);
|
in_port_t port);
|
||||||
|
/*
|
||||||
|
* Construct an isc_sockaddr_t from an IPv6 address and port.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
|
isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
|
||||||
in_port_t port);
|
in_port_t port);
|
||||||
|
/*
|
||||||
|
* Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address.
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
|
isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
|
||||||
in_port_t port);
|
in_port_t port);
|
||||||
|
/*
|
||||||
|
* Construct an isc_sockaddr_t from an isc_netaddr_t and port.
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
|
isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: sockaddr.c,v 1.45 2000/08/09 18:55:53 gson Exp $ */
|
/* $Id: sockaddr.c,v 1.46 2000/08/09 19:09:08 gson Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -65,9 +65,6 @@ isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
|
|||||||
return (ISC_TRUE);
|
return (ISC_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare just the addresses (ignore ports)
|
|
||||||
*/
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
|
isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
|
||||||
REQUIRE(a != NULL && b != NULL);
|
REQUIRE(a != NULL && b != NULL);
|
||||||
@ -95,11 +92,6 @@ isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b) {
|
|||||||
return (ISC_TRUE);
|
return (ISC_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Compare just a prefix of the addresses (ignore ports and
|
|
||||||
* low address bits)
|
|
||||||
*/
|
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
|
||||||
unsigned int prefixlen)
|
unsigned int prefixlen)
|
||||||
@ -182,10 +174,6 @@ isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, isc_boolean_t address_only) {
|
|||||||
unsigned int h = 0;
|
unsigned int h = 0;
|
||||||
unsigned int g;
|
unsigned int g;
|
||||||
|
|
||||||
/*
|
|
||||||
* Provide a hash value for 'sockaddr'.
|
|
||||||
*/
|
|
||||||
|
|
||||||
REQUIRE(sockaddr != NULL);
|
REQUIRE(sockaddr != NULL);
|
||||||
|
|
||||||
if (address_only) {
|
if (address_only) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user