Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/lwres
File: lwres.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
#ifndef LWRES_LWRES_H
[11] Fix | Delete
#define LWRES_LWRES_H 1
[12] Fix | Delete
[13] Fix | Delete
#include <inttypes.h>
[14] Fix | Delete
#include <stdio.h>
[15] Fix | Delete
[16] Fix | Delete
#include <lwres/context.h>
[17] Fix | Delete
#include <lwres/lang.h>
[18] Fix | Delete
#include <lwres/list.h>
[19] Fix | Delete
#include <lwres/lwpacket.h>
[20] Fix | Delete
#include <lwres/platform.h>
[21] Fix | Delete
[22] Fix | Delete
/*! \file lwres/lwres.h */
[23] Fix | Delete
[24] Fix | Delete
/*!
[25] Fix | Delete
* Design notes:
[26] Fix | Delete
*
[27] Fix | Delete
* Each opcode has two structures and three functions which operate on each
[28] Fix | Delete
* structure. For example, using the "no operation/ping" opcode as an
[29] Fix | Delete
* example:
[30] Fix | Delete
*
[31] Fix | Delete
* <ul><li>lwres_nooprequest_t:
[32] Fix | Delete
*
[33] Fix | Delete
* lwres_nooprequest_render() takes a lwres_nooprequest_t and
[34] Fix | Delete
* and renders it into wire format, storing the allocated
[35] Fix | Delete
* buffer information in a passed-in buffer. When this buffer
[36] Fix | Delete
* is no longer needed, it must be freed by
[37] Fix | Delete
* lwres_context_freemem(). All other memory used by the
[38] Fix | Delete
* caller must be freed manually, including the
[39] Fix | Delete
* lwres_nooprequest_t passed in.<br /><br />
[40] Fix | Delete
*
[41] Fix | Delete
* lwres_nooprequest_parse() takes a wire format message and
[42] Fix | Delete
* breaks it out into a lwres_nooprequest_t. The structure
[43] Fix | Delete
* must be freed via lwres_nooprequest_free() when it is no longer
[44] Fix | Delete
* needed.<br /><br />
[45] Fix | Delete
*
[46] Fix | Delete
* lwres_nooprequest_free() releases into the lwres_context_t
[47] Fix | Delete
* any space allocated during parsing.</li>
[48] Fix | Delete
*
[49] Fix | Delete
* <li>lwres_noopresponse_t:
[50] Fix | Delete
*
[51] Fix | Delete
* The functions used are similar to the three used for
[52] Fix | Delete
* requests, just with different names.</li></ul>
[53] Fix | Delete
*
[54] Fix | Delete
* Typically, the client will use request_render, response_parse, and
[55] Fix | Delete
* response_free, while the daemon will use request_parse, response_render,
[56] Fix | Delete
* and request_free.
[57] Fix | Delete
*
[58] Fix | Delete
* The basic flow of a typical client is:
[59] Fix | Delete
*
[60] Fix | Delete
* \li fill in a request_t, and call the render function.
[61] Fix | Delete
*
[62] Fix | Delete
* \li Transmit the buffer returned to the daemon.
[63] Fix | Delete
*
[64] Fix | Delete
* \li Wait for a response.
[65] Fix | Delete
*
[66] Fix | Delete
* \li When a response is received, parse it into a response_t.
[67] Fix | Delete
*
[68] Fix | Delete
* \li free the request buffer using lwres_context_freemem().
[69] Fix | Delete
*
[70] Fix | Delete
* \li free the response structure and its associated buffer using
[71] Fix | Delete
* response_free().
[72] Fix | Delete
*/
[73] Fix | Delete
[74] Fix | Delete
#define LWRES_UDP_PORT 921 /*%< UDP Port Number */
[75] Fix | Delete
#define LWRES_RECVLENGTH 16384 /*%< Maximum Packet Length */
[76] Fix | Delete
#define LWRES_ADDR_MAXLEN 16 /*%< changing this breaks ABI */
[77] Fix | Delete
#define LWRES_RESOLV_CONF "/etc/resolv.conf" /*%< Location of resolv.conf */
[78] Fix | Delete
[79] Fix | Delete
/*% DNSSEC is not required (input). Only relevant to rrset queries. */
[80] Fix | Delete
#define LWRES_FLAG_TRUSTNOTREQUIRED 0x00000001U
[81] Fix | Delete
/*% The data was crypto-verified with DNSSEC (output). */
[82] Fix | Delete
#define LWRES_FLAG_SECUREDATA 0x00000002U
[83] Fix | Delete
[84] Fix | Delete
/*% no-op */
[85] Fix | Delete
#define LWRES_OPCODE_NOOP 0x00000000U
[86] Fix | Delete
[87] Fix | Delete
/*% lwres_nooprequest_t */
[88] Fix | Delete
typedef struct {
[89] Fix | Delete
/* public */
[90] Fix | Delete
uint16_t datalength;
[91] Fix | Delete
unsigned char *data;
[92] Fix | Delete
} lwres_nooprequest_t;
[93] Fix | Delete
[94] Fix | Delete
/*% lwres_noopresponse_t */
[95] Fix | Delete
typedef struct {
[96] Fix | Delete
/* public */
[97] Fix | Delete
uint16_t datalength;
[98] Fix | Delete
unsigned char *data;
[99] Fix | Delete
} lwres_noopresponse_t;
[100] Fix | Delete
[101] Fix | Delete
/*% get addresses by name */
[102] Fix | Delete
#define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U
[103] Fix | Delete
[104] Fix | Delete
/*% lwres_addr_t */
[105] Fix | Delete
typedef struct lwres_addr lwres_addr_t;
[106] Fix | Delete
[107] Fix | Delete
/*% LWRES_LIST */
[108] Fix | Delete
typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
[109] Fix | Delete
[110] Fix | Delete
/*% lwres_addr */
[111] Fix | Delete
struct lwres_addr {
[112] Fix | Delete
uint32_t family;
[113] Fix | Delete
uint16_t length;
[114] Fix | Delete
unsigned char address[LWRES_ADDR_MAXLEN];
[115] Fix | Delete
uint32_t zone;
[116] Fix | Delete
LWRES_LINK(lwres_addr_t) link;
[117] Fix | Delete
};
[118] Fix | Delete
[119] Fix | Delete
/*% lwres_gabnrequest_t */
[120] Fix | Delete
typedef struct {
[121] Fix | Delete
/* public */
[122] Fix | Delete
uint32_t flags;
[123] Fix | Delete
uint32_t addrtypes;
[124] Fix | Delete
uint16_t namelen;
[125] Fix | Delete
char *name;
[126] Fix | Delete
} lwres_gabnrequest_t;
[127] Fix | Delete
[128] Fix | Delete
/*% lwres_gabnresponse_t */
[129] Fix | Delete
typedef struct {
[130] Fix | Delete
/* public */
[131] Fix | Delete
uint32_t flags;
[132] Fix | Delete
uint16_t naliases;
[133] Fix | Delete
uint16_t naddrs;
[134] Fix | Delete
char *realname;
[135] Fix | Delete
char **aliases;
[136] Fix | Delete
uint16_t realnamelen;
[137] Fix | Delete
uint16_t *aliaslen;
[138] Fix | Delete
lwres_addrlist_t addrs;
[139] Fix | Delete
/*! if base != NULL, it will be freed when this structure is freed. */
[140] Fix | Delete
void *base;
[141] Fix | Delete
size_t baselen;
[142] Fix | Delete
} lwres_gabnresponse_t;
[143] Fix | Delete
[144] Fix | Delete
/*% get name by address */
[145] Fix | Delete
#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
[146] Fix | Delete
[147] Fix | Delete
/*% lwres_gnbarequest_t */
[148] Fix | Delete
typedef struct {
[149] Fix | Delete
/* public */
[150] Fix | Delete
uint32_t flags;
[151] Fix | Delete
lwres_addr_t addr;
[152] Fix | Delete
} lwres_gnbarequest_t;
[153] Fix | Delete
[154] Fix | Delete
/*% lwres_gnbaresponse_t */
[155] Fix | Delete
typedef struct {
[156] Fix | Delete
/* public */
[157] Fix | Delete
uint32_t flags;
[158] Fix | Delete
uint16_t naliases;
[159] Fix | Delete
char *realname;
[160] Fix | Delete
char **aliases;
[161] Fix | Delete
uint16_t realnamelen;
[162] Fix | Delete
uint16_t *aliaslen;
[163] Fix | Delete
/*! if base != NULL, it will be freed when this structure is freed. */
[164] Fix | Delete
void *base;
[165] Fix | Delete
size_t baselen;
[166] Fix | Delete
} lwres_gnbaresponse_t;
[167] Fix | Delete
[168] Fix | Delete
/*% get rdata by name */
[169] Fix | Delete
#define LWRES_OPCODE_GETRDATABYNAME 0x00010003U
[170] Fix | Delete
[171] Fix | Delete
/*% lwres_grbnrequest_t */
[172] Fix | Delete
typedef struct {
[173] Fix | Delete
/* public */
[174] Fix | Delete
uint32_t flags;
[175] Fix | Delete
uint16_t rdclass;
[176] Fix | Delete
uint16_t rdtype;
[177] Fix | Delete
uint16_t namelen;
[178] Fix | Delete
char *name;
[179] Fix | Delete
} lwres_grbnrequest_t;
[180] Fix | Delete
[181] Fix | Delete
/*% lwres_grbnresponse_t */
[182] Fix | Delete
typedef struct {
[183] Fix | Delete
/* public */
[184] Fix | Delete
uint32_t flags;
[185] Fix | Delete
uint16_t rdclass;
[186] Fix | Delete
uint16_t rdtype;
[187] Fix | Delete
uint32_t ttl;
[188] Fix | Delete
uint16_t nrdatas;
[189] Fix | Delete
uint16_t nsigs;
[190] Fix | Delete
char *realname;
[191] Fix | Delete
uint16_t realnamelen;
[192] Fix | Delete
unsigned char **rdatas;
[193] Fix | Delete
uint16_t *rdatalen;
[194] Fix | Delete
unsigned char **sigs;
[195] Fix | Delete
uint16_t *siglen;
[196] Fix | Delete
/*% if base != NULL, it will be freed when this structure is freed. */
[197] Fix | Delete
void *base;
[198] Fix | Delete
size_t baselen;
[199] Fix | Delete
} lwres_grbnresponse_t;
[200] Fix | Delete
[201] Fix | Delete
/*% Used by lwres_getrrsetbyname() */
[202] Fix | Delete
#define LWRDATA_VALIDATED 0x00000001
[203] Fix | Delete
[204] Fix | Delete
/*!
[205] Fix | Delete
* resolv.conf data
[206] Fix | Delete
*/
[207] Fix | Delete
[208] Fix | Delete
#define LWRES_CONFMAXNAMESERVERS 3 /*%< max 3 "nameserver" entries */
[209] Fix | Delete
#define LWRES_CONFMAXLWSERVERS 1 /*%< max 1 "lwserver" entry */
[210] Fix | Delete
#define LWRES_CONFMAXSEARCH 8 /*%< max 8 domains in "search" entry */
[211] Fix | Delete
#define LWRES_CONFMAXLINELEN 256 /*%< max size of a line */
[212] Fix | Delete
#define LWRES_CONFMAXSORTLIST 10 /*%< max 10 */
[213] Fix | Delete
[214] Fix | Delete
/*% lwres_conf_t */
[215] Fix | Delete
typedef struct {
[216] Fix | Delete
lwres_context_t *lwctx;
[217] Fix | Delete
lwres_addr_t nameservers[LWRES_CONFMAXNAMESERVERS];
[218] Fix | Delete
uint8_t nsnext; /*%< index for next free slot */
[219] Fix | Delete
[220] Fix | Delete
lwres_addr_t lwservers[LWRES_CONFMAXLWSERVERS];
[221] Fix | Delete
uint8_t lwnext; /*%< index for next free slot */
[222] Fix | Delete
[223] Fix | Delete
char *domainname;
[224] Fix | Delete
[225] Fix | Delete
char *search[LWRES_CONFMAXSEARCH];
[226] Fix | Delete
uint8_t searchnxt; /*%< index for next free slot */
[227] Fix | Delete
[228] Fix | Delete
struct {
[229] Fix | Delete
lwres_addr_t addr;
[230] Fix | Delete
/*% mask has a non-zero 'family' and 'length' if set */
[231] Fix | Delete
lwres_addr_t mask;
[232] Fix | Delete
} sortlist[LWRES_CONFMAXSORTLIST];
[233] Fix | Delete
uint8_t sortlistnxt;
[234] Fix | Delete
[235] Fix | Delete
uint8_t resdebug; /*%< non-zero if 'options debug' set */
[236] Fix | Delete
uint8_t ndots; /*%< set to n in 'options ndots:n' */
[237] Fix | Delete
uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
[238] Fix | Delete
int32_t attempts; /*%< set to n in 'options attempts:n' */
[239] Fix | Delete
int32_t timeout; /*%< set to n in 'options timeout:n' */
[240] Fix | Delete
} lwres_conf_t;
[241] Fix | Delete
[242] Fix | Delete
#define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */
[243] Fix | Delete
#define LWRES_ADDRTYPE_V6 0x00000002U /*%< ipv6 */
[244] Fix | Delete
[245] Fix | Delete
#define LWRES_MAX_ALIASES 16 /*%< max # of aliases */
[246] Fix | Delete
#define LWRES_MAX_ADDRS 64 /*%< max # of addrs */
[247] Fix | Delete
[248] Fix | Delete
LWRES_LANG_BEGINDECLS
[249] Fix | Delete
[250] Fix | Delete
/*% This is in host byte order. */
[251] Fix | Delete
LIBLWRES_EXTERNAL_DATA extern uint16_t lwres_udp_port;
[252] Fix | Delete
[253] Fix | Delete
LIBLWRES_EXTERNAL_DATA extern const char *lwres_resolv_conf;
[254] Fix | Delete
[255] Fix | Delete
lwres_result_t
[256] Fix | Delete
lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
[257] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[258] Fix | Delete
[259] Fix | Delete
lwres_result_t
[260] Fix | Delete
lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req,
[261] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[262] Fix | Delete
[263] Fix | Delete
lwres_result_t
[264] Fix | Delete
lwres_gabnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[265] Fix | Delete
lwres_lwpacket_t *pkt, lwres_gabnrequest_t **structp);
[266] Fix | Delete
[267] Fix | Delete
lwres_result_t
[268] Fix | Delete
lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[269] Fix | Delete
lwres_lwpacket_t *pkt,
[270] Fix | Delete
lwres_gabnresponse_t **structp);
[271] Fix | Delete
[272] Fix | Delete
void
[273] Fix | Delete
lwres_gabnrequest_free(lwres_context_t *ctx, lwres_gabnrequest_t **structp);
[274] Fix | Delete
/**<
[275] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[276] Fix | Delete
*
[277] Fix | Delete
* Requires:
[278] Fix | Delete
*
[279] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[280] Fix | Delete
*
[281] Fix | Delete
* structp != NULL && *structp != NULL.
[282] Fix | Delete
*
[283] Fix | Delete
* Ensures:
[284] Fix | Delete
*
[285] Fix | Delete
* *structp == NULL.
[286] Fix | Delete
*
[287] Fix | Delete
* All memory allocated by this structure will be returned to the
[288] Fix | Delete
* system via the context's free function.
[289] Fix | Delete
*/
[290] Fix | Delete
[291] Fix | Delete
void
[292] Fix | Delete
lwres_gabnresponse_free(lwres_context_t *ctx, lwres_gabnresponse_t **structp);
[293] Fix | Delete
/**<
[294] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[295] Fix | Delete
*
[296] Fix | Delete
* Requires:
[297] Fix | Delete
*
[298] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[299] Fix | Delete
*
[300] Fix | Delete
* structp != NULL && *structp != NULL.
[301] Fix | Delete
*
[302] Fix | Delete
* Ensures:
[303] Fix | Delete
*
[304] Fix | Delete
* *structp == NULL.
[305] Fix | Delete
*
[306] Fix | Delete
* All memory allocated by this structure will be returned to the
[307] Fix | Delete
* system via the context's free function.
[308] Fix | Delete
*/
[309] Fix | Delete
[310] Fix | Delete
[311] Fix | Delete
lwres_result_t
[312] Fix | Delete
lwres_gnbarequest_render(lwres_context_t *ctx, lwres_gnbarequest_t *req,
[313] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[314] Fix | Delete
[315] Fix | Delete
lwres_result_t
[316] Fix | Delete
lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req,
[317] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[318] Fix | Delete
[319] Fix | Delete
lwres_result_t
[320] Fix | Delete
lwres_gnbarequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[321] Fix | Delete
lwres_lwpacket_t *pkt, lwres_gnbarequest_t **structp);
[322] Fix | Delete
[323] Fix | Delete
lwres_result_t
[324] Fix | Delete
lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[325] Fix | Delete
lwres_lwpacket_t *pkt,
[326] Fix | Delete
lwres_gnbaresponse_t **structp);
[327] Fix | Delete
[328] Fix | Delete
void
[329] Fix | Delete
lwres_gnbarequest_free(lwres_context_t *ctx, lwres_gnbarequest_t **structp);
[330] Fix | Delete
/**<
[331] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[332] Fix | Delete
*
[333] Fix | Delete
* Requires:
[334] Fix | Delete
*
[335] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[336] Fix | Delete
*
[337] Fix | Delete
* structp != NULL && *structp != NULL.
[338] Fix | Delete
*
[339] Fix | Delete
* Ensures:
[340] Fix | Delete
*
[341] Fix | Delete
* *structp == NULL.
[342] Fix | Delete
*
[343] Fix | Delete
* All memory allocated by this structure will be returned to the
[344] Fix | Delete
* system via the context's free function.
[345] Fix | Delete
*/
[346] Fix | Delete
[347] Fix | Delete
void
[348] Fix | Delete
lwres_gnbaresponse_free(lwres_context_t *ctx, lwres_gnbaresponse_t **structp);
[349] Fix | Delete
/**<
[350] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[351] Fix | Delete
*
[352] Fix | Delete
* Requires:
[353] Fix | Delete
*
[354] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[355] Fix | Delete
*
[356] Fix | Delete
* structp != NULL && *structp != NULL.
[357] Fix | Delete
*
[358] Fix | Delete
* Ensures:
[359] Fix | Delete
*
[360] Fix | Delete
* *structp == NULL.
[361] Fix | Delete
*
[362] Fix | Delete
* All memory allocated by this structure will be returned to the
[363] Fix | Delete
* system via the context's free function.
[364] Fix | Delete
*/
[365] Fix | Delete
[366] Fix | Delete
lwres_result_t
[367] Fix | Delete
lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
[368] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[369] Fix | Delete
[370] Fix | Delete
lwres_result_t
[371] Fix | Delete
lwres_grbnresponse_render(lwres_context_t *ctx, lwres_grbnresponse_t *req,
[372] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[373] Fix | Delete
[374] Fix | Delete
lwres_result_t
[375] Fix | Delete
lwres_grbnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[376] Fix | Delete
lwres_lwpacket_t *pkt, lwres_grbnrequest_t **structp);
[377] Fix | Delete
[378] Fix | Delete
lwres_result_t
[379] Fix | Delete
lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[380] Fix | Delete
lwres_lwpacket_t *pkt,
[381] Fix | Delete
lwres_grbnresponse_t **structp);
[382] Fix | Delete
[383] Fix | Delete
void
[384] Fix | Delete
lwres_grbnrequest_free(lwres_context_t *ctx, lwres_grbnrequest_t **structp);
[385] Fix | Delete
/**<
[386] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[387] Fix | Delete
*
[388] Fix | Delete
* Requires:
[389] Fix | Delete
*
[390] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[391] Fix | Delete
*
[392] Fix | Delete
* structp != NULL && *structp != NULL.
[393] Fix | Delete
*
[394] Fix | Delete
* Ensures:
[395] Fix | Delete
*
[396] Fix | Delete
* *structp == NULL.
[397] Fix | Delete
*
[398] Fix | Delete
* All memory allocated by this structure will be returned to the
[399] Fix | Delete
* system via the context's free function.
[400] Fix | Delete
*/
[401] Fix | Delete
[402] Fix | Delete
void
[403] Fix | Delete
lwres_grbnresponse_free(lwres_context_t *ctx, lwres_grbnresponse_t **structp);
[404] Fix | Delete
/**<
[405] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[406] Fix | Delete
*
[407] Fix | Delete
* Requires:
[408] Fix | Delete
*
[409] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[410] Fix | Delete
*
[411] Fix | Delete
* structp != NULL && *structp != NULL.
[412] Fix | Delete
*
[413] Fix | Delete
* Ensures:
[414] Fix | Delete
*
[415] Fix | Delete
* *structp == NULL.
[416] Fix | Delete
*
[417] Fix | Delete
* All memory allocated by this structure will be returned to the
[418] Fix | Delete
* system via the context's free function.
[419] Fix | Delete
*/
[420] Fix | Delete
[421] Fix | Delete
lwres_result_t
[422] Fix | Delete
lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req,
[423] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[424] Fix | Delete
/**<
[425] Fix | Delete
* Allocate space and render into wire format a noop request packet.
[426] Fix | Delete
*
[427] Fix | Delete
* Requires:
[428] Fix | Delete
*
[429] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[430] Fix | Delete
*
[431] Fix | Delete
* b != NULL, and points to a lwres_buffer_t. The contents of the
[432] Fix | Delete
* buffer structure will be initialized to contain the wire-format
[433] Fix | Delete
* noop request packet.
[434] Fix | Delete
*
[435] Fix | Delete
* Caller needs to fill in parts of "pkt" before calling:
[436] Fix | Delete
* serial, maxrecv, result.
[437] Fix | Delete
*
[438] Fix | Delete
* Returns:
[439] Fix | Delete
*
[440] Fix | Delete
* Returns 0 on success, non-zero on failure.
[441] Fix | Delete
*
[442] Fix | Delete
* On successful return, *b will contain data about the wire-format
[443] Fix | Delete
* packet. It can be transmitted in any way, including lwres_sendblock().
[444] Fix | Delete
*/
[445] Fix | Delete
[446] Fix | Delete
lwres_result_t
[447] Fix | Delete
lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req,
[448] Fix | Delete
lwres_lwpacket_t *pkt, lwres_buffer_t *b);
[449] Fix | Delete
[450] Fix | Delete
lwres_result_t
[451] Fix | Delete
lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[452] Fix | Delete
lwres_lwpacket_t *pkt, lwres_nooprequest_t **structp);
[453] Fix | Delete
/**<
[454] Fix | Delete
* Parse a noop request. Note that to get here, the lwpacket must have
[455] Fix | Delete
* already been parsed and removed by the caller, otherwise it would be
[456] Fix | Delete
* pretty hard for it to know this is the right function to call.
[457] Fix | Delete
*
[458] Fix | Delete
* The function verifies bits of the header, but does not modify it.
[459] Fix | Delete
*/
[460] Fix | Delete
[461] Fix | Delete
lwres_result_t
[462] Fix | Delete
lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
[463] Fix | Delete
lwres_lwpacket_t *pkt,
[464] Fix | Delete
lwres_noopresponse_t **structp);
[465] Fix | Delete
[466] Fix | Delete
void
[467] Fix | Delete
lwres_nooprequest_free(lwres_context_t *ctx, lwres_nooprequest_t **structp);
[468] Fix | Delete
[469] Fix | Delete
void
[470] Fix | Delete
lwres_noopresponse_free(lwres_context_t *ctx, lwres_noopresponse_t **structp);
[471] Fix | Delete
[472] Fix | Delete
/**<
[473] Fix | Delete
* Frees any dynamically allocated memory for this structure.
[474] Fix | Delete
*
[475] Fix | Delete
* Requires:
[476] Fix | Delete
*
[477] Fix | Delete
* ctx != NULL, and be a context returned via lwres_context_create().
[478] Fix | Delete
*
[479] Fix | Delete
* structp != NULL && *structp != NULL.
[480] Fix | Delete
*
[481] Fix | Delete
* Ensures:
[482] Fix | Delete
*
[483] Fix | Delete
* *structp == NULL.
[484] Fix | Delete
*
[485] Fix | Delete
* All memory allocated by this structure will be returned to the
[486] Fix | Delete
* system via the context's free function.
[487] Fix | Delete
*/
[488] Fix | Delete
[489] Fix | Delete
lwres_result_t
[490] Fix | Delete
lwres_conf_parse(lwres_context_t *ctx, const char *filename);
[491] Fix | Delete
/**<
[492] Fix | Delete
* parses a resolv.conf-format file and stores the results in the structure
[493] Fix | Delete
* pointed to by *ctx.
[494] Fix | Delete
*
[495] Fix | Delete
* Requires:
[496] Fix | Delete
* ctx != NULL
[497] Fix | Delete
* filename != NULL && strlen(filename) > 0
[498] Fix | Delete
*
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function