Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bind9/lwres
File: lwpacket.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_LWPACKET_H
[11] Fix | Delete
#define LWRES_LWPACKET_H 1
[12] Fix | Delete
[13] Fix | Delete
#include <inttypes.h>
[14] Fix | Delete
[15] Fix | Delete
#include <lwres/lang.h>
[16] Fix | Delete
#include <lwres/lwbuffer.h>
[17] Fix | Delete
#include <lwres/result.h>
[18] Fix | Delete
[19] Fix | Delete
/*% lwres_lwpacket_t */
[20] Fix | Delete
typedef struct lwres_lwpacket lwres_lwpacket_t;
[21] Fix | Delete
[22] Fix | Delete
/*% lwres_lwpacket structure */
[23] Fix | Delete
struct lwres_lwpacket {
[24] Fix | Delete
/*! The overall packet length, including the
[25] Fix | Delete
* entire packet header.
[26] Fix | Delete
* This field is filled in by the
[27] Fix | Delete
* \link lwres_gabn.c lwres_gabn_*()\endlink
[28] Fix | Delete
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
[29] Fix | Delete
*/
[30] Fix | Delete
uint32_t length;
[31] Fix | Delete
/*! Specifies the header format. Currently,
[32] Fix | Delete
* there is only one format, #LWRES_LWPACKETVERSION_0.
[33] Fix | Delete
* This field is filled in by the
[34] Fix | Delete
* \link lwres_gabn.c lwres_gabn_*()\endlink
[35] Fix | Delete
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
[36] Fix | Delete
*/
[37] Fix | Delete
uint16_t version;
[38] Fix | Delete
/*! Specifies library-defined flags for this packet, such as
[39] Fix | Delete
* whether the packet is a request or a reply. None of
[40] Fix | Delete
* these are definable by the caller, but library-defined values
[41] Fix | Delete
* can be set by the caller. For example, one bit in this field
[42] Fix | Delete
* indicates if the packet is a request or a response.
[43] Fix | Delete
* This field is filled in by
[44] Fix | Delete
* the application wits the exception of the
[45] Fix | Delete
* #LWRES_LWPACKETFLAG_RESPONSE bit, which is set by the library
[46] Fix | Delete
* in the
[47] Fix | Delete
* \link lwres_gabn.c lwres_gabn_*()\endlink
[48] Fix | Delete
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
[49] Fix | Delete
*/
[50] Fix | Delete
uint16_t pktflags;
[51] Fix | Delete
/*! Set by the requestor and is returned in all replies.
[52] Fix | Delete
* If two packets from the same source have the same serial
[53] Fix | Delete
* number and are from the same source, they are assumed to
[54] Fix | Delete
* be duplicates and the latter ones may be dropped.
[55] Fix | Delete
* (The library does not do this by default on replies, but
[56] Fix | Delete
* does so on requests.)
[57] Fix | Delete
*/
[58] Fix | Delete
uint32_t serial;
[59] Fix | Delete
/*! Opcodes between 0x04000000 and 0xffffffff
[60] Fix | Delete
* are application defined. Opcodes between
[61] Fix | Delete
* 0x00000000 and 0x03ffffff are
[62] Fix | Delete
* reserved for library use.
[63] Fix | Delete
* This field is filled in by the
[64] Fix | Delete
* \link lwres_gabn.c lwres_gabn_*()\endlink
[65] Fix | Delete
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
[66] Fix | Delete
*/
[67] Fix | Delete
uint32_t opcode;
[68] Fix | Delete
/*! Only valid for results.
[69] Fix | Delete
* Results between 0x04000000 and 0xffffffff are application
[70] Fix | Delete
* defined.
[71] Fix | Delete
* Results between 0x00000000 and 0x03ffffff are reserved for
[72] Fix | Delete
* library use.
[73] Fix | Delete
* (This is the same reserved range defined in <isc/resultclass.h>,
[74] Fix | Delete
* so it
[75] Fix | Delete
* would be trivial to map ISC_R_* result codes into packet result
[76] Fix | Delete
* codes when appropriate.)
[77] Fix | Delete
* This field is filled in by the
[78] Fix | Delete
* \link lwres_gabn.c lwres_gabn_*()\endlink
[79] Fix | Delete
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
[80] Fix | Delete
*/
[81] Fix | Delete
uint32_t result;
[82] Fix | Delete
/*! Set to the maximum buffer size that the receiver can
[83] Fix | Delete
* handle on requests, and the size of the buffer needed to
[84] Fix | Delete
* satisfy a request
[85] Fix | Delete
* when the buffer is too large for replies.
[86] Fix | Delete
* This field is supplied by the application.
[87] Fix | Delete
*/
[88] Fix | Delete
uint32_t recvlength;
[89] Fix | Delete
/*! The packet level auth type used.
[90] Fix | Delete
* Authtypes between 0x1000 and 0xffff are application defined.
[91] Fix | Delete
* Authtypes
[92] Fix | Delete
* between 0x0000 and 0x0fff are reserved for library use.
[93] Fix | Delete
* This is currently
[94] Fix | Delete
* unused and MUST be set to zero.
[95] Fix | Delete
*/
[96] Fix | Delete
uint16_t authtype;
[97] Fix | Delete
/*! The length of the authentication data.
[98] Fix | Delete
* See the specific
[99] Fix | Delete
* authtypes for more information on what is contained
[100] Fix | Delete
* in this field. This is currently unused, and
[101] Fix | Delete
* MUST be set to zero.
[102] Fix | Delete
*/
[103] Fix | Delete
uint16_t authlength;
[104] Fix | Delete
};
[105] Fix | Delete
[106] Fix | Delete
#define LWRES_LWPACKET_LENGTH (4 * 5 + 2 * 4) /*%< Overall length. */
[107] Fix | Delete
[108] Fix | Delete
#define LWRES_LWPACKETFLAG_RESPONSE 0x0001U /*%< If set, pkt is a response. */
[109] Fix | Delete
[110] Fix | Delete
[111] Fix | Delete
#define LWRES_LWPACKETVERSION_0 0 /*%< Header format. */
[112] Fix | Delete
[113] Fix | Delete
/*! \file lwres/lwpacket.h
[114] Fix | Delete
*
[115] Fix | Delete
*
[116] Fix | Delete
* The remainder of the packet consists of two regions, one described by
[117] Fix | Delete
* "authlen" and one of "length - authlen - sizeof(lwres_lwpacket_t)".
[118] Fix | Delete
*
[119] Fix | Delete
* That is:
[120] Fix | Delete
*
[121] Fix | Delete
* \code
[122] Fix | Delete
* pkt header
[123] Fix | Delete
* authlen bytes of auth information
[124] Fix | Delete
* data bytes
[125] Fix | Delete
* \endcode
[126] Fix | Delete
*
[127] Fix | Delete
* Currently defined opcodes:
[128] Fix | Delete
*
[129] Fix | Delete
*\li #LWRES_OPCODE_NOOP. Success is always returned, with the packet contents echoed.
[130] Fix | Delete
*
[131] Fix | Delete
*\li #LWRES_OPCODE_GETADDRSBYNAME. Return all known addresses for a given name.
[132] Fix | Delete
* This may return NIS or /etc/hosts info as well as DNS
[133] Fix | Delete
* information. Flags will be provided to indicate ip4/ip6
[134] Fix | Delete
* addresses are desired.
[135] Fix | Delete
*
[136] Fix | Delete
*\li #LWRES_OPCODE_GETNAMEBYADDR. Return the hostname for the given address. Once
[137] Fix | Delete
* again, it will return data from multiple sources.
[138] Fix | Delete
*/
[139] Fix | Delete
[140] Fix | Delete
LWRES_LANG_BEGINDECLS
[141] Fix | Delete
[142] Fix | Delete
/* XXXMLG document */
[143] Fix | Delete
lwres_result_t
[144] Fix | Delete
lwres_lwpacket_renderheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
[145] Fix | Delete
[146] Fix | Delete
lwres_result_t
[147] Fix | Delete
lwres_lwpacket_parseheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt);
[148] Fix | Delete
[149] Fix | Delete
LWRES_LANG_ENDDECLS
[150] Fix | Delete
[151] Fix | Delete
#endif /* LWRES_LWPACKET_H */
[152] Fix | Delete
[153] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function