Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/isc
File: sockaddr.h
/*
[0] Fix | Delete
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
[1] Fix | Delete
*
[2] Fix | Delete
* This Source Code Form is subject to the terms of the Mozilla Public
[3] Fix | Delete
* License, v. 2.0. If a copy of the MPL was not distributed with this
[4] Fix | Delete
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
[5] Fix | Delete
*
[6] Fix | Delete
* See the COPYRIGHT file distributed with this work for additional
[7] Fix | Delete
* information regarding copyright ownership.
[8] Fix | Delete
*/
[9] Fix | Delete
[10] Fix | Delete
[11] Fix | Delete
#ifndef ISC_SOCKADDR_H
[12] Fix | Delete
#define ISC_SOCKADDR_H 1
[13] Fix | Delete
[14] Fix | Delete
/*! \file isc/sockaddr.h */
[15] Fix | Delete
[16] Fix | Delete
#include <stdbool.h>
[17] Fix | Delete
[18] Fix | Delete
#include <isc/lang.h>
[19] Fix | Delete
#include <isc/net.h>
[20] Fix | Delete
#include <isc/types.h>
[21] Fix | Delete
#ifdef ISC_PLATFORM_HAVESYSUNH
[22] Fix | Delete
#include <sys/un.h>
[23] Fix | Delete
#endif
[24] Fix | Delete
[25] Fix | Delete
struct isc_sockaddr {
[26] Fix | Delete
union {
[27] Fix | Delete
struct sockaddr sa;
[28] Fix | Delete
struct sockaddr_in sin;
[29] Fix | Delete
struct sockaddr_in6 sin6;
[30] Fix | Delete
struct sockaddr_storage ss;
[31] Fix | Delete
#ifdef ISC_PLATFORM_HAVESYSUNH
[32] Fix | Delete
struct sockaddr_un sunix;
[33] Fix | Delete
#endif
[34] Fix | Delete
} type;
[35] Fix | Delete
unsigned int length; /* XXXRTH beginning? */
[36] Fix | Delete
ISC_LINK(struct isc_sockaddr) link;
[37] Fix | Delete
};
[38] Fix | Delete
[39] Fix | Delete
#define ISC_SOCKADDR_CMPADDR 0x0001 /*%< compare the address
[40] Fix | Delete
* sin_addr/sin6_addr */
[41] Fix | Delete
#define ISC_SOCKADDR_CMPPORT 0x0002 /*%< compare the port
[42] Fix | Delete
* sin_port/sin6_port */
[43] Fix | Delete
#define ISC_SOCKADDR_CMPSCOPE 0x0004 /*%< compare the scope
[44] Fix | Delete
* sin6_scope */
[45] Fix | Delete
#define ISC_SOCKADDR_CMPSCOPEZERO 0x0008 /*%< when comparing scopes
[46] Fix | Delete
* zero scopes always match */
[47] Fix | Delete
[48] Fix | Delete
ISC_LANG_BEGINDECLS
[49] Fix | Delete
[50] Fix | Delete
bool
[51] Fix | Delete
isc_sockaddr_compare(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
[52] Fix | Delete
unsigned int flags);
[53] Fix | Delete
/*%<
[54] Fix | Delete
* Compare the elements of the two address ('a' and 'b') as specified
[55] Fix | Delete
* by 'flags' and report if they are equal or not.
[56] Fix | Delete
*
[57] Fix | Delete
* 'flags' is set from ISC_SOCKADDR_CMP*.
[58] Fix | Delete
*/
[59] Fix | Delete
[60] Fix | Delete
bool
[61] Fix | Delete
isc_sockaddr_equal(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
[62] Fix | Delete
/*%<
[63] Fix | Delete
* Return true iff the socket addresses 'a' and 'b' are equal.
[64] Fix | Delete
*/
[65] Fix | Delete
[66] Fix | Delete
bool
[67] Fix | Delete
isc_sockaddr_eqaddr(const isc_sockaddr_t *a, const isc_sockaddr_t *b);
[68] Fix | Delete
/*%<
[69] Fix | Delete
* Return true iff the address parts of the socket addresses
[70] Fix | Delete
* 'a' and 'b' are equal, ignoring the ports.
[71] Fix | Delete
*/
[72] Fix | Delete
[73] Fix | Delete
bool
[74] Fix | Delete
isc_sockaddr_eqaddrprefix(const isc_sockaddr_t *a, const isc_sockaddr_t *b,
[75] Fix | Delete
unsigned int prefixlen);
[76] Fix | Delete
/*%<
[77] Fix | Delete
* Return true iff the most significant 'prefixlen' bits of the
[78] Fix | Delete
* socket addresses 'a' and 'b' are equal, ignoring the ports.
[79] Fix | Delete
* If 'b''s scope is zero then 'a''s scope will be ignored.
[80] Fix | Delete
*/
[81] Fix | Delete
[82] Fix | Delete
unsigned int
[83] Fix | Delete
isc_sockaddr_hash(const isc_sockaddr_t *sockaddr, bool address_only);
[84] Fix | Delete
/*%<
[85] Fix | Delete
* Return a hash value for the socket address 'sockaddr'. If 'address_only'
[86] Fix | Delete
* is true, the hash value will not depend on the port.
[87] Fix | Delete
*
[88] Fix | Delete
* IPv6 addresses containing mapped IPv4 addresses generate the same hash
[89] Fix | Delete
* value as the equivalent IPv4 address.
[90] Fix | Delete
*/
[91] Fix | Delete
[92] Fix | Delete
void
[93] Fix | Delete
isc_sockaddr_any(isc_sockaddr_t *sockaddr);
[94] Fix | Delete
/*%<
[95] Fix | Delete
* Return the IPv4 wildcard address.
[96] Fix | Delete
*/
[97] Fix | Delete
[98] Fix | Delete
void
[99] Fix | Delete
isc_sockaddr_any6(isc_sockaddr_t *sockaddr);
[100] Fix | Delete
/*%<
[101] Fix | Delete
* Return the IPv6 wildcard address.
[102] Fix | Delete
*/
[103] Fix | Delete
[104] Fix | Delete
void
[105] Fix | Delete
isc_sockaddr_anyofpf(isc_sockaddr_t *sockaddr, int family);
[106] Fix | Delete
/*%<
[107] Fix | Delete
* Set '*sockaddr' to the wildcard address of protocol family
[108] Fix | Delete
* 'family'.
[109] Fix | Delete
*
[110] Fix | Delete
* Requires:
[111] Fix | Delete
* \li 'family' is AF_INET or AF_INET6.
[112] Fix | Delete
*/
[113] Fix | Delete
[114] Fix | Delete
void
[115] Fix | Delete
isc_sockaddr_fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
[116] Fix | Delete
in_port_t port);
[117] Fix | Delete
/*%<
[118] Fix | Delete
* Construct an isc_sockaddr_t from an IPv4 address and port.
[119] Fix | Delete
*/
[120] Fix | Delete
[121] Fix | Delete
void
[122] Fix | Delete
isc_sockaddr_fromin6(isc_sockaddr_t *sockaddr, const struct in6_addr *ina6,
[123] Fix | Delete
in_port_t port);
[124] Fix | Delete
/*%<
[125] Fix | Delete
* Construct an isc_sockaddr_t from an IPv6 address and port.
[126] Fix | Delete
*/
[127] Fix | Delete
[128] Fix | Delete
void
[129] Fix | Delete
isc_sockaddr_v6fromin(isc_sockaddr_t *sockaddr, const struct in_addr *ina,
[130] Fix | Delete
in_port_t port);
[131] Fix | Delete
/*%<
[132] Fix | Delete
* Construct an IPv6 isc_sockaddr_t representing a mapped IPv4 address.
[133] Fix | Delete
*/
[134] Fix | Delete
[135] Fix | Delete
void
[136] Fix | Delete
isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na,
[137] Fix | Delete
in_port_t port);
[138] Fix | Delete
/*%<
[139] Fix | Delete
* Construct an isc_sockaddr_t from an isc_netaddr_t and port.
[140] Fix | Delete
*/
[141] Fix | Delete
[142] Fix | Delete
int
[143] Fix | Delete
isc_sockaddr_pf(const isc_sockaddr_t *sockaddr);
[144] Fix | Delete
/*%<
[145] Fix | Delete
* Get the protocol family of 'sockaddr'.
[146] Fix | Delete
*
[147] Fix | Delete
* Requires:
[148] Fix | Delete
*
[149] Fix | Delete
*\li 'sockaddr' is a valid sockaddr with an address family of AF_INET
[150] Fix | Delete
* or AF_INET6.
[151] Fix | Delete
*
[152] Fix | Delete
* Returns:
[153] Fix | Delete
*
[154] Fix | Delete
*\li The protocol family of 'sockaddr', e.g. PF_INET or PF_INET6.
[155] Fix | Delete
*/
[156] Fix | Delete
[157] Fix | Delete
void
[158] Fix | Delete
isc_sockaddr_setport(isc_sockaddr_t *sockaddr, in_port_t port);
[159] Fix | Delete
/*%<
[160] Fix | Delete
* Set the port of 'sockaddr' to 'port'.
[161] Fix | Delete
*/
[162] Fix | Delete
[163] Fix | Delete
in_port_t
[164] Fix | Delete
isc_sockaddr_getport(const isc_sockaddr_t *sockaddr);
[165] Fix | Delete
/*%<
[166] Fix | Delete
* Get the port stored in 'sockaddr'.
[167] Fix | Delete
*/
[168] Fix | Delete
[169] Fix | Delete
isc_result_t
[170] Fix | Delete
isc_sockaddr_totext(const isc_sockaddr_t *sockaddr, isc_buffer_t *target);
[171] Fix | Delete
/*%<
[172] Fix | Delete
* Append a text representation of 'sockaddr' to the buffer 'target'.
[173] Fix | Delete
* The text will include both the IP address (v4 or v6) and the port.
[174] Fix | Delete
* The text is null terminated, but the terminating null is not
[175] Fix | Delete
* part of the buffer's used region.
[176] Fix | Delete
*
[177] Fix | Delete
* Returns:
[178] Fix | Delete
* \li ISC_R_SUCCESS
[179] Fix | Delete
* \li ISC_R_NOSPACE The text or the null termination did not fit.
[180] Fix | Delete
*/
[181] Fix | Delete
[182] Fix | Delete
void
[183] Fix | Delete
isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size);
[184] Fix | Delete
/*%<
[185] Fix | Delete
* Format a human-readable representation of the socket address '*sa'
[186] Fix | Delete
* into the character array 'array', which is of size 'size'.
[187] Fix | Delete
* The resulting string is guaranteed to be null-terminated.
[188] Fix | Delete
*/
[189] Fix | Delete
[190] Fix | Delete
bool
[191] Fix | Delete
isc_sockaddr_ismulticast(const isc_sockaddr_t *sa);
[192] Fix | Delete
/*%<
[193] Fix | Delete
* Returns #true if the address is a multicast address.
[194] Fix | Delete
*/
[195] Fix | Delete
[196] Fix | Delete
bool
[197] Fix | Delete
isc_sockaddr_isexperimental(const isc_sockaddr_t *sa);
[198] Fix | Delete
/*
[199] Fix | Delete
* Returns true if the address is a experimental (CLASS E) address.
[200] Fix | Delete
*/
[201] Fix | Delete
[202] Fix | Delete
bool
[203] Fix | Delete
isc_sockaddr_islinklocal(const isc_sockaddr_t *sa);
[204] Fix | Delete
/*%<
[205] Fix | Delete
* Returns true if the address is a link local address.
[206] Fix | Delete
*/
[207] Fix | Delete
[208] Fix | Delete
bool
[209] Fix | Delete
isc_sockaddr_issitelocal(const isc_sockaddr_t *sa);
[210] Fix | Delete
/*%<
[211] Fix | Delete
* Returns true if the address is a sitelocal address.
[212] Fix | Delete
*/
[213] Fix | Delete
[214] Fix | Delete
bool
[215] Fix | Delete
isc_sockaddr_isnetzero(const isc_sockaddr_t *sa);
[216] Fix | Delete
/*%<
[217] Fix | Delete
* Returns true if the address is in net zero.
[218] Fix | Delete
*/
[219] Fix | Delete
[220] Fix | Delete
isc_result_t
[221] Fix | Delete
isc_sockaddr_frompath(isc_sockaddr_t *sockaddr, const char *path);
[222] Fix | Delete
/*
[223] Fix | Delete
* Create a UNIX domain sockaddr that refers to path.
[224] Fix | Delete
*
[225] Fix | Delete
* Returns:
[226] Fix | Delete
* \li ISC_R_NOSPACE
[227] Fix | Delete
* \li ISC_R_NOTIMPLEMENTED
[228] Fix | Delete
* \li ISC_R_SUCCESS
[229] Fix | Delete
*/
[230] Fix | Delete
[231] Fix | Delete
#define ISC_SOCKADDR_FORMATSIZE \
[232] Fix | Delete
sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:XXX.XXX.XXX.XXX%SSSSSSSSSS#YYYYY")
[233] Fix | Delete
/*%<
[234] Fix | Delete
* Minimum size of array to pass to isc_sockaddr_format().
[235] Fix | Delete
*/
[236] Fix | Delete
[237] Fix | Delete
ISC_LANG_ENDDECLS
[238] Fix | Delete
[239] Fix | Delete
#endif /* ISC_SOCKADDR_H */
[240] Fix | Delete
[241] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function