mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-16 17:19:44 -05:00
Update lwres to use stdint types to finish transition to using stdint types
This commit is contained in:
parent
71f62894b5
commit
e37e27c560
45 changed files with 355 additions and 360 deletions
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/socket.h>
|
||||
#include <isc/string.h> /* Required for HP/UX (and others?) */
|
||||
|
|
@ -37,7 +39,7 @@ static void start_lookup(ns_lwdclient_t *);
|
|||
|
||||
static isc_result_t
|
||||
fill_array(int *pos, dns_rdataset_t *rdataset,
|
||||
int size, unsigned char **rdatas, lwres_uint16_t *rdatalen)
|
||||
int size, unsigned char **rdatas, uint16_t *rdatalen)
|
||||
{
|
||||
dns_rdata_t rdata;
|
||||
isc_result_t result;
|
||||
|
|
@ -70,11 +72,11 @@ iterate_node(lwres_grbnresponse_t *grbn, dns_db_t *db, dns_dbnode_t *node,
|
|||
int used = 0, count;
|
||||
int size = 8, oldsize = 0;
|
||||
unsigned char **rdatas = NULL, **oldrdatas = NULL, **newrdatas = NULL;
|
||||
lwres_uint16_t *lens = NULL, *oldlens = NULL, *newlens = NULL;
|
||||
uint16_t *lens = NULL, *oldlens = NULL, *newlens = NULL;
|
||||
dns_rdatasetiter_t *iter = NULL;
|
||||
dns_rdataset_t set;
|
||||
dns_ttl_t ttl = INT32_MAX;
|
||||
lwres_uint32_t flags = LWRDATA_VALIDATED;
|
||||
uint32_t flags = LWRDATA_VALIDATED;
|
||||
isc_result_t result = ISC_R_NOMEMORY;
|
||||
|
||||
result = dns_db_allrdatasets(db, node, NULL, 0, &iter);
|
||||
|
|
@ -275,7 +277,7 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
|
|||
if (grbn->rdatas == NULL)
|
||||
goto out;
|
||||
grbn->rdatalen = isc_mem_get(cm->mctx, grbn->nrdatas *
|
||||
sizeof(lwres_uint16_t));
|
||||
sizeof(uint16_t));
|
||||
if (grbn->rdatalen == NULL)
|
||||
goto out;
|
||||
|
||||
|
|
@ -306,7 +308,7 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
|
|||
if (grbn->sigs == NULL)
|
||||
goto out;
|
||||
grbn->siglen = isc_mem_get(cm->mctx, grbn->nsigs *
|
||||
sizeof(lwres_uint16_t));
|
||||
sizeof(uint16_t));
|
||||
if (grbn->siglen == NULL)
|
||||
goto out;
|
||||
|
||||
|
|
@ -336,14 +338,14 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
|
|||
isc_mem_put(cm->mctx, grbn->rdatas,
|
||||
grbn->nrdatas * sizeof(unsigned char *));
|
||||
isc_mem_put(cm->mctx, grbn->rdatalen,
|
||||
grbn->nrdatas * sizeof(lwres_uint16_t));
|
||||
grbn->nrdatas * sizeof(uint16_t));
|
||||
|
||||
if (grbn->sigs != NULL)
|
||||
isc_mem_put(cm->mctx, grbn->sigs,
|
||||
grbn->nsigs * sizeof(unsigned char *));
|
||||
if (grbn->siglen != NULL)
|
||||
isc_mem_put(cm->mctx, grbn->siglen,
|
||||
grbn->nsigs * sizeof(lwres_uint16_t));
|
||||
grbn->nsigs * sizeof(uint16_t));
|
||||
|
||||
r.base = lwb.base;
|
||||
r.length = lwb.used;
|
||||
|
|
@ -366,14 +368,14 @@ lookup_done(isc_task_t *task, isc_event_t *event) {
|
|||
grbn->nrdatas * sizeof(unsigned char *));
|
||||
if (grbn->rdatalen != NULL)
|
||||
isc_mem_put(cm->mctx, grbn->rdatalen,
|
||||
grbn->nrdatas * sizeof(lwres_uint16_t));
|
||||
grbn->nrdatas * sizeof(uint16_t));
|
||||
|
||||
if (grbn->sigs != NULL)
|
||||
isc_mem_put(cm->mctx, grbn->sigs,
|
||||
grbn->nsigs * sizeof(unsigned char *));
|
||||
if (grbn->siglen != NULL)
|
||||
isc_mem_put(cm->mctx, grbn->siglen,
|
||||
grbn->nsigs * sizeof(lwres_uint16_t));
|
||||
grbn->nsigs * sizeof(uint16_t));
|
||||
out2:
|
||||
if (client->lookup != NULL)
|
||||
dns_lookup_destroy(&client->lookup);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -187,7 +188,7 @@ test_gabn(const char *target) {
|
|||
}
|
||||
|
||||
static void
|
||||
test_gnba(const char *target, lwres_uint32_t af) {
|
||||
test_gnba(const char *target, uint32_t af) {
|
||||
lwres_gnbaresponse_t *res;
|
||||
int ret;
|
||||
unsigned int i;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/net.h>
|
||||
|
|
@ -124,7 +125,7 @@ test_noop(void) {
|
|||
|
||||
static void
|
||||
test_gabn(const char *target, lwres_result_t expected, const char *address,
|
||||
lwres_uint32_t af)
|
||||
uint32_t af)
|
||||
{
|
||||
lwres_gabnresponse_t *res;
|
||||
unsigned char addrbuf[16];
|
||||
|
|
@ -185,7 +186,7 @@ test_gabn(const char *target, lwres_result_t expected, const char *address,
|
|||
}
|
||||
|
||||
static void
|
||||
test_gnba(const char *target, lwres_uint32_t af, lwres_result_t expected,
|
||||
test_gnba(const char *target, uint32_t af, lwres_result_t expected,
|
||||
const char *name)
|
||||
{
|
||||
lwres_gnbaresponse_t *res;
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -122,7 +123,7 @@ do { \
|
|||
} while (0)
|
||||
#endif
|
||||
|
||||
LIBLWRES_EXTERNAL_DATA lwres_uint16_t lwres_udp_port = LWRES_UDP_PORT;
|
||||
LIBLWRES_EXTERNAL_DATA uint16_t lwres_udp_port = LWRES_UDP_PORT;
|
||||
LIBLWRES_EXTERNAL_DATA const char *lwres_resolv_conf = LWRES_RESOLV_CONF;
|
||||
|
||||
static void *
|
||||
|
|
@ -227,7 +228,7 @@ lwres_context_destroy(lwres_context_t **contextp) {
|
|||
CTXFREE(ctx, sizeof(lwres_context_t));
|
||||
}
|
||||
/*% Increments the serial number and returns the previous value. */
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
lwres_context_nextserial(lwres_context_t *ctx) {
|
||||
REQUIRE(ctx != NULL);
|
||||
|
||||
|
|
@ -236,7 +237,7 @@ lwres_context_nextserial(lwres_context_t *ctx) {
|
|||
|
||||
/*% Sets the serial number for context *ctx to serial. */
|
||||
void
|
||||
lwres_context_initserial(lwres_context_t *ctx, lwres_uint32_t serial) {
|
||||
lwres_context_initserial(lwres_context_t *ctx, uint32_t serial) {
|
||||
REQUIRE(ctx != NULL);
|
||||
|
||||
ctx->serial = serial;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#ifndef LWRES_CONTEXT_P_H
|
||||
#define LWRES_CONTEXT_P_H 1
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/*! \file */
|
||||
|
||||
/*@{*/
|
||||
|
|
@ -33,7 +35,7 @@
|
|||
*/
|
||||
struct lwres_context {
|
||||
unsigned int timeout; /*%< time to wait for reply */
|
||||
lwres_uint32_t serial; /*%< serial number state */
|
||||
uint32_t serial; /*%< serial number state */
|
||||
|
||||
/*
|
||||
* For network I/O.
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -358,7 +359,7 @@ lwres_getaddrinfo(const char *hostname, const char *servname,
|
|||
#ifdef LWRES_HAVE_SIN6_SCOPE_ID
|
||||
char *p, *ep;
|
||||
char ntmp[NI_MAXHOST];
|
||||
lwres_uint32_t scopeid;
|
||||
uint32_t scopeid;
|
||||
#endif
|
||||
|
||||
#ifdef LWRES_HAVE_SIN6_SCOPE_ID
|
||||
|
|
@ -378,7 +379,7 @@ lwres_getaddrinfo(const char *hostname, const char *servname,
|
|||
*/
|
||||
|
||||
if (p != NULL)
|
||||
scopeid = (lwres_uint32_t)strtoul(p + 1,
|
||||
scopeid = (uint32_t)strtoul(p + 1,
|
||||
&ep, 10);
|
||||
if (p != NULL && ep != NULL && ep[0] == '\0')
|
||||
*p = '\0';
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -172,7 +173,7 @@ lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
|||
char numaddr[sizeof("abcd:abcd:abcd:abcd:abcd:abcd:255.255.255.255")
|
||||
+ 1 + sizeof("4294967295")];
|
||||
const char *proto;
|
||||
lwres_uint32_t lwf = 0;
|
||||
uint32_t lwf = 0;
|
||||
lwres_context_t *lwrctx = NULL;
|
||||
lwres_gnbaresponse_t *by = NULL;
|
||||
int result = SUCCESS;
|
||||
|
|
@ -306,7 +307,7 @@ lwres_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
|||
|
||||
if (n == 0)
|
||||
n = lwres_getnamebyaddr(lwrctx, lwf,
|
||||
(lwres_uint16_t)afd->a_addrlen,
|
||||
(uint16_t)afd->a_addrlen,
|
||||
addr, &by);
|
||||
if (n == 0) {
|
||||
if (flags & NI_NOFQDN) {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -173,8 +174,8 @@ lwres_getrrsetbyname(const char *hostname, unsigned int rdclass,
|
|||
lwflags = 0;
|
||||
|
||||
lwresult = lwres_getrdatabyname(lwrctx, hostname,
|
||||
(lwres_uint16_t)rdclass,
|
||||
(lwres_uint16_t)rdtype,
|
||||
(uint16_t)rdclass,
|
||||
(uint16_t)rdtype,
|
||||
lwflags, &response);
|
||||
if (lwresult != LWRES_R_SUCCESS) {
|
||||
result = lwresult_to_result(lwresult);
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
/*! \file lwres/context.h */
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <lwres/lang.h>
|
||||
#include <lwres/int.h>
|
||||
#include <lwres/result.h>
|
||||
|
||||
/*!
|
||||
|
|
@ -91,14 +91,14 @@ lwres_context_destroy(lwres_context_t **contextp);
|
|||
*\pre contextp != NULL && contextp == NULL.
|
||||
*/
|
||||
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
lwres_context_nextserial(lwres_context_t *ctx);
|
||||
/**<
|
||||
* XXXMLG Document
|
||||
*/
|
||||
|
||||
void
|
||||
lwres_context_initserial(lwres_context_t *ctx, lwres_uint32_t serial);
|
||||
lwres_context_initserial(lwres_context_t *ctx, uint32_t serial);
|
||||
|
||||
void
|
||||
lwres_context_freemem(lwres_context_t *ctx, void *mem, size_t len);
|
||||
|
|
@ -127,4 +127,3 @@ lwres_context_sendrecv(lwres_context_t *ctx,
|
|||
LWRES_LANG_ENDDECLS
|
||||
|
||||
#endif /* LWRES_CONTEXT_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -9,20 +9,20 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id: int.h,v 1.14 2007/06/19 23:47:23 tbox Exp $ */
|
||||
|
||||
#ifndef LWRES_INT_H
|
||||
#define LWRES_INT_H 1
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
/*! \file lwres/int.h */
|
||||
|
||||
typedef char lwres_int8_t;
|
||||
typedef unsigned char lwres_uint8_t;
|
||||
typedef short lwres_int16_t;
|
||||
typedef unsigned short lwres_uint16_t;
|
||||
typedef int lwres_int32_t;
|
||||
typedef unsigned int lwres_uint32_t;
|
||||
typedef long long lwres_int64_t;
|
||||
typedef unsigned long long lwres_uint64_t;
|
||||
typedef lwres_int8_t int8_t;
|
||||
typedef lwres_uint8_t uint8_t;
|
||||
typedef lwres_int16_t int16_t;
|
||||
typedef lwres_uint16_t uint16_t;
|
||||
typedef lwres_int32_t int32_t;
|
||||
typedef lwres_uint32_t uint32_t;
|
||||
typedef lwres_int64_t int64_t;
|
||||
typedef lwres_uint64_t uint64_t;
|
||||
|
||||
#endif /* LWRES_INT_H */
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@
|
|||
*** Imports.
|
||||
***/
|
||||
|
||||
#include <lwres/int.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <lwres/platform.h>
|
||||
|
||||
/***
|
||||
|
|
@ -36,9 +37,9 @@
|
|||
/*% in6_addr structure */
|
||||
struct in6_addr {
|
||||
union {
|
||||
lwres_uint8_t _S6_u8[16];
|
||||
lwres_uint16_t _S6_u16[8];
|
||||
lwres_uint32_t _S6_u32[4];
|
||||
uint8_t _S6_u8[16];
|
||||
uint16_t _S6_u16[8];
|
||||
uint32_t _S6_u32[4];
|
||||
} _S6_un;
|
||||
};
|
||||
/*@{*/
|
||||
|
|
@ -58,15 +59,15 @@ LIBLWRES_EXTERNAL_DATA extern const struct in6_addr in6addr_loopback;
|
|||
/*% used in getaddrinfo.c and getnameinfo.c */
|
||||
struct sockaddr_in6 {
|
||||
#ifdef LWRES_PLATFORM_HAVESALEN
|
||||
lwres_uint8_t sin6_len;
|
||||
lwres_uint8_t sin6_family;
|
||||
uint8_t sin6_len;
|
||||
uint8_t sin6_family;
|
||||
#else
|
||||
lwres_uint16_t sin6_family;
|
||||
uint16_t sin6_family;
|
||||
#endif
|
||||
lwres_uint16_t sin6_port;
|
||||
lwres_uint32_t sin6_flowinfo;
|
||||
uint16_t sin6_port;
|
||||
uint32_t sin6_flowinfo;
|
||||
struct in6_addr sin6_addr;
|
||||
lwres_uint32_t sin6_scope_id;
|
||||
uint32_t sin6_scope_id;
|
||||
};
|
||||
|
||||
#ifdef LWRES_PLATFORM_HAVESALEN
|
||||
|
|
|
|||
|
|
@ -97,8 +97,9 @@
|
|||
*** Imports
|
||||
***/
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <lwres/lang.h>
|
||||
#include <lwres/int.h>
|
||||
|
||||
LWRES_LANG_BEGINDECLS
|
||||
|
||||
|
|
@ -262,7 +263,7 @@ lwres_buffer_back(lwres_buffer_t *b, unsigned int n);
|
|||
*
|
||||
*/
|
||||
|
||||
lwres_uint8_t
|
||||
uint8_t
|
||||
lwres_buffer_getuint8(lwres_buffer_t *b);
|
||||
/**<
|
||||
* Read an unsigned 8-bit integer from 'b' and return it.
|
||||
|
|
@ -283,7 +284,7 @@ lwres_buffer_getuint8(lwres_buffer_t *b);
|
|||
*/
|
||||
|
||||
void
|
||||
lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val);
|
||||
lwres_buffer_putuint8(lwres_buffer_t *b, uint8_t val);
|
||||
/**<
|
||||
* Store an unsigned 8-bit integer from 'val' into 'b'.
|
||||
*
|
||||
|
|
@ -296,7 +297,7 @@ lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val);
|
|||
* The used pointer in 'b' is advanced by 1.
|
||||
*/
|
||||
|
||||
lwres_uint16_t
|
||||
uint16_t
|
||||
lwres_buffer_getuint16(lwres_buffer_t *b);
|
||||
/**<
|
||||
* Read an unsigned 16-bit integer in network byte order from 'b', convert
|
||||
|
|
@ -318,7 +319,7 @@ lwres_buffer_getuint16(lwres_buffer_t *b);
|
|||
*/
|
||||
|
||||
void
|
||||
lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val);
|
||||
lwres_buffer_putuint16(lwres_buffer_t *b, uint16_t val);
|
||||
/**<
|
||||
* Store an unsigned 16-bit integer in host byte order from 'val'
|
||||
* into 'b' in network byte order.
|
||||
|
|
@ -332,7 +333,7 @@ lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val);
|
|||
* The used pointer in 'b' is advanced by 2.
|
||||
*/
|
||||
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
lwres_buffer_getuint32(lwres_buffer_t *b);
|
||||
/**<
|
||||
* Read an unsigned 32-bit integer in network byte order from 'b', convert
|
||||
|
|
@ -354,7 +355,7 @@ lwres_buffer_getuint32(lwres_buffer_t *b);
|
|||
*/
|
||||
|
||||
void
|
||||
lwres_buffer_putuint32(lwres_buffer_t *b, lwres_uint32_t val);
|
||||
lwres_buffer_putuint32(lwres_buffer_t *b, uint32_t val);
|
||||
/**<
|
||||
* Store an unsigned 32-bit integer in host byte order from 'val'
|
||||
* into 'b' in network byte order.
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#ifndef LWRES_LWPACKET_H
|
||||
#define LWRES_LWPACKET_H 1
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <lwres/lang.h>
|
||||
#include <lwres/lwbuffer.h>
|
||||
#include <lwres/result.h>
|
||||
|
|
@ -29,14 +31,14 @@ struct lwres_lwpacket {
|
|||
* \link lwres_gabn.c lwres_gabn_*()\endlink
|
||||
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
|
||||
*/
|
||||
lwres_uint32_t length;
|
||||
uint32_t length;
|
||||
/*! Specifies the header format. Currently,
|
||||
* there is only one format, #LWRES_LWPACKETVERSION_0.
|
||||
* This field is filled in by the
|
||||
* \link lwres_gabn.c lwres_gabn_*()\endlink
|
||||
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
|
||||
*/
|
||||
lwres_uint16_t version;
|
||||
uint16_t version;
|
||||
/*! Specifies library-defined flags for this packet, such as
|
||||
* whether the packet is a request or a reply. None of
|
||||
* these are definable by the caller, but library-defined values
|
||||
|
|
@ -49,7 +51,7 @@ struct lwres_lwpacket {
|
|||
* \link lwres_gabn.c lwres_gabn_*()\endlink
|
||||
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
|
||||
*/
|
||||
lwres_uint16_t pktflags;
|
||||
uint16_t pktflags;
|
||||
/*! Set by the requestor and is returned in all replies.
|
||||
* If two packets from the same source have the same serial
|
||||
* number and are from the same source, they are assumed to
|
||||
|
|
@ -57,7 +59,7 @@ struct lwres_lwpacket {
|
|||
* (The library does not do this by default on replies, but
|
||||
* does so on requests.)
|
||||
*/
|
||||
lwres_uint32_t serial;
|
||||
uint32_t serial;
|
||||
/*! Opcodes between 0x04000000 and 0xffffffff
|
||||
* are application defined. Opcodes between
|
||||
* 0x00000000 and 0x03ffffff are
|
||||
|
|
@ -66,7 +68,7 @@ struct lwres_lwpacket {
|
|||
* \link lwres_gabn.c lwres_gabn_*()\endlink
|
||||
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
|
||||
*/
|
||||
lwres_uint32_t opcode;
|
||||
uint32_t opcode;
|
||||
/*! Only valid for results.
|
||||
* Results between 0x04000000 and 0xffffffff are application
|
||||
* defined.
|
||||
|
|
@ -80,14 +82,14 @@ struct lwres_lwpacket {
|
|||
* \link lwres_gabn.c lwres_gabn_*()\endlink
|
||||
* and \link lwres_gnba.c lwres_gnba_*()\endlink calls.
|
||||
*/
|
||||
lwres_uint32_t result;
|
||||
uint32_t result;
|
||||
/*! Set to the maximum buffer size that the receiver can
|
||||
* handle on requests, and the size of the buffer needed to
|
||||
* satisfy a request
|
||||
* when the buffer is too large for replies.
|
||||
* This field is supplied by the application.
|
||||
*/
|
||||
lwres_uint32_t recvlength;
|
||||
uint32_t recvlength;
|
||||
/*! The packet level auth type used.
|
||||
* Authtypes between 0x1000 and 0xffff are application defined.
|
||||
* Authtypes
|
||||
|
|
@ -95,14 +97,14 @@ struct lwres_lwpacket {
|
|||
* This is currently
|
||||
* unused and MUST be set to zero.
|
||||
*/
|
||||
lwres_uint16_t authtype;
|
||||
uint16_t authtype;
|
||||
/*! The length of the authentication data.
|
||||
* See the specific
|
||||
* authtypes for more information on what is contained
|
||||
* in this field. This is currently unused, and
|
||||
* MUST be set to zero.
|
||||
*/
|
||||
lwres_uint16_t authlength;
|
||||
uint16_t authlength;
|
||||
};
|
||||
|
||||
#define LWRES_LWPACKET_LENGTH (4 * 5 + 2 * 4) /*%< Overall length. */
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#ifndef LWRES_LWRES_H
|
||||
#define LWRES_LWRES_H 1
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <lwres/context.h>
|
||||
|
|
@ -90,14 +91,14 @@
|
|||
/*% lwres_nooprequest_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_nooprequest_t;
|
||||
|
||||
/*% lwres_noopresponse_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_noopresponse_t;
|
||||
|
||||
|
|
@ -112,32 +113,32 @@ typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
|
|||
|
||||
/*% lwres_addr */
|
||||
struct lwres_addr {
|
||||
lwres_uint32_t family;
|
||||
lwres_uint16_t length;
|
||||
uint32_t family;
|
||||
uint16_t length;
|
||||
unsigned char address[LWRES_ADDR_MAXLEN];
|
||||
lwres_uint32_t zone;
|
||||
uint32_t zone;
|
||||
LWRES_LINK(lwres_addr_t) link;
|
||||
};
|
||||
|
||||
/*% lwres_gabnrequest_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint32_t addrtypes;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_gabnrequest_t;
|
||||
|
||||
/*% lwres_gabnresponse_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
/*! if base != NULL, it will be freed when this structure is freed. */
|
||||
void *base;
|
||||
|
|
@ -150,19 +151,19 @@ typedef struct {
|
|||
/*% lwres_gnbarequest_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
uint32_t flags;
|
||||
lwres_addr_t addr;
|
||||
} lwres_gnbarequest_t;
|
||||
|
||||
/*% lwres_gnbaresponse_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
/*! if base != NULL, it will be freed when this structure is freed. */
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
@ -174,28 +175,28 @@ typedef struct {
|
|||
/*% lwres_grbnrequest_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t rdclass;
|
||||
lwres_uint16_t rdtype;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint16_t rdclass;
|
||||
uint16_t rdtype;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_grbnrequest_t;
|
||||
|
||||
/*% lwres_grbnresponse_t */
|
||||
typedef struct {
|
||||
/* public */
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t rdclass;
|
||||
lwres_uint16_t rdtype;
|
||||
lwres_uint32_t ttl;
|
||||
lwres_uint16_t nrdatas;
|
||||
lwres_uint16_t nsigs;
|
||||
uint32_t flags;
|
||||
uint16_t rdclass;
|
||||
uint16_t rdtype;
|
||||
uint32_t ttl;
|
||||
uint16_t nrdatas;
|
||||
uint16_t nsigs;
|
||||
char *realname;
|
||||
lwres_uint16_t realnamelen;
|
||||
uint16_t realnamelen;
|
||||
unsigned char **rdatas;
|
||||
lwres_uint16_t *rdatalen;
|
||||
uint16_t *rdatalen;
|
||||
unsigned char **sigs;
|
||||
lwres_uint16_t *siglen;
|
||||
uint16_t *siglen;
|
||||
/*% if base != NULL, it will be freed when this structure is freed. */
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
@ -218,28 +219,28 @@ typedef struct {
|
|||
typedef struct {
|
||||
lwres_context_t *lwctx;
|
||||
lwres_addr_t nameservers[LWRES_CONFMAXNAMESERVERS];
|
||||
lwres_uint8_t nsnext; /*%< index for next free slot */
|
||||
uint8_t nsnext; /*%< index for next free slot */
|
||||
|
||||
lwres_addr_t lwservers[LWRES_CONFMAXLWSERVERS];
|
||||
lwres_uint8_t lwnext; /*%< index for next free slot */
|
||||
uint8_t lwnext; /*%< index for next free slot */
|
||||
|
||||
char *domainname;
|
||||
|
||||
char *search[LWRES_CONFMAXSEARCH];
|
||||
lwres_uint8_t searchnxt; /*%< index for next free slot */
|
||||
uint8_t searchnxt; /*%< index for next free slot */
|
||||
|
||||
struct {
|
||||
lwres_addr_t addr;
|
||||
/*% mask has a non-zero 'family' and 'length' if set */
|
||||
lwres_addr_t mask;
|
||||
} sortlist[LWRES_CONFMAXSORTLIST];
|
||||
lwres_uint8_t sortlistnxt;
|
||||
uint8_t sortlistnxt;
|
||||
|
||||
lwres_uint8_t resdebug; /*%< non-zero if 'options debug' set */
|
||||
lwres_uint8_t ndots; /*%< set to n in 'options ndots:n' */
|
||||
lwres_uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
|
||||
lwres_int32_t attempts; /*%< set to n in 'options attempts:n' */
|
||||
lwres_int32_t timeout; /*%< set to n in 'options timeout:n' */
|
||||
uint8_t resdebug; /*%< non-zero if 'options debug' set */
|
||||
uint8_t ndots; /*%< set to n in 'options ndots:n' */
|
||||
uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
|
||||
int32_t attempts; /*%< set to n in 'options attempts:n' */
|
||||
int32_t timeout; /*%< set to n in 'options timeout:n' */
|
||||
} lwres_conf_t;
|
||||
|
||||
#define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */
|
||||
|
|
@ -251,7 +252,7 @@ typedef struct {
|
|||
LWRES_LANG_BEGINDECLS
|
||||
|
||||
/*% This is in host byte order. */
|
||||
LIBLWRES_EXTERNAL_DATA extern lwres_uint16_t lwres_udp_port;
|
||||
LIBLWRES_EXTERNAL_DATA extern uint16_t lwres_udp_port;
|
||||
|
||||
LIBLWRES_EXTERNAL_DATA extern const char *lwres_resolv_conf;
|
||||
|
||||
|
|
@ -549,27 +550,27 @@ lwres_conf_get(lwres_context_t *ctx);
|
|||
*/
|
||||
|
||||
lwres_result_t
|
||||
lwres_data_parse(lwres_buffer_t *b, unsigned char **p, lwres_uint16_t *len);
|
||||
lwres_data_parse(lwres_buffer_t *b, unsigned char **p, uint16_t *len);
|
||||
|
||||
lwres_result_t
|
||||
lwres_string_parse(lwres_buffer_t *b, char **c, lwres_uint16_t *len);
|
||||
lwres_string_parse(lwres_buffer_t *b, char **c, uint16_t *len);
|
||||
|
||||
lwres_result_t
|
||||
lwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr);
|
||||
|
||||
lwres_result_t
|
||||
lwres_getaddrsbyname(lwres_context_t *ctx, const char *name,
|
||||
lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp);
|
||||
uint32_t addrtypes, lwres_gabnresponse_t **structp);
|
||||
|
||||
lwres_result_t
|
||||
lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype,
|
||||
lwres_uint16_t addrlen, const unsigned char *addr,
|
||||
lwres_getnamebyaddr(lwres_context_t *ctx, uint32_t addrtype,
|
||||
uint16_t addrlen, const unsigned char *addr,
|
||||
lwres_gnbaresponse_t **structp);
|
||||
|
||||
lwres_result_t
|
||||
lwres_getrdatabyname(lwres_context_t *ctx, const char *name,
|
||||
lwres_uint16_t rdclass, lwres_uint16_t rdtype,
|
||||
lwres_uint32_t flags, lwres_grbnresponse_t **structp);
|
||||
uint16_t rdclass, uint16_t rdtype,
|
||||
uint32_t flags, lwres_grbnresponse_t **structp);
|
||||
|
||||
LWRES_LANG_ENDDECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@
|
|||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <lwres/lwbuffer.h>
|
||||
|
|
@ -214,11 +215,11 @@ lwres_buffer_back(lwres_buffer_t *b, unsigned int n)
|
|||
}
|
||||
|
||||
/* Read an unsigned 8-bit integer from 'b' and return it. */
|
||||
lwres_uint8_t
|
||||
uint8_t
|
||||
lwres_buffer_getuint8(lwres_buffer_t *b)
|
||||
{
|
||||
unsigned char *cp;
|
||||
lwres_uint8_t result;
|
||||
uint8_t result;
|
||||
|
||||
|
||||
REQUIRE(LWRES_BUFFER_VALID(b));
|
||||
|
|
@ -234,7 +235,7 @@ lwres_buffer_getuint8(lwres_buffer_t *b)
|
|||
|
||||
/* Put an unsigned 8-bit integer */
|
||||
void
|
||||
lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val)
|
||||
lwres_buffer_putuint8(lwres_buffer_t *b, uint8_t val)
|
||||
{
|
||||
unsigned char *cp;
|
||||
|
||||
|
|
@ -248,11 +249,11 @@ lwres_buffer_putuint8(lwres_buffer_t *b, lwres_uint8_t val)
|
|||
}
|
||||
|
||||
/* Read an unsigned 16-bit integer in network byte order from 'b', convert it to host byte order, and return it. */
|
||||
lwres_uint16_t
|
||||
uint16_t
|
||||
lwres_buffer_getuint16(lwres_buffer_t *b)
|
||||
{
|
||||
unsigned char *cp;
|
||||
lwres_uint16_t result;
|
||||
uint16_t result;
|
||||
|
||||
|
||||
REQUIRE(LWRES_BUFFER_VALID(b));
|
||||
|
|
@ -269,7 +270,7 @@ lwres_buffer_getuint16(lwres_buffer_t *b)
|
|||
|
||||
/* Put an unsigned 16-bit integer. */
|
||||
void
|
||||
lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val)
|
||||
lwres_buffer_putuint16(lwres_buffer_t *b, uint16_t val)
|
||||
{
|
||||
unsigned char *cp;
|
||||
|
||||
|
|
@ -284,11 +285,11 @@ lwres_buffer_putuint16(lwres_buffer_t *b, lwres_uint16_t val)
|
|||
}
|
||||
|
||||
/* Read an unsigned 32-bit integer in network byte order from 'b', convert it to host byte order, and return it. */
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
lwres_buffer_getuint32(lwres_buffer_t *b)
|
||||
{
|
||||
unsigned char *cp;
|
||||
lwres_uint32_t result;
|
||||
uint32_t result;
|
||||
|
||||
REQUIRE(LWRES_BUFFER_VALID(b));
|
||||
REQUIRE(b->used - b->current >= 4);
|
||||
|
|
@ -306,7 +307,7 @@ lwres_buffer_getuint32(lwres_buffer_t *b)
|
|||
|
||||
/* Put an unsigned 32-bit integer. */
|
||||
void
|
||||
lwres_buffer_putuint32(lwres_buffer_t *b, lwres_uint32_t val)
|
||||
lwres_buffer_putuint32(lwres_buffer_t *b, uint32_t val)
|
||||
{
|
||||
unsigned char *cp;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
@ -588,19 +589,19 @@ lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp) {
|
|||
return (LWRES_R_FAILURE);
|
||||
if (ndots < 0 || ndots > 0xff) /* Out of range. */
|
||||
return (LWRES_R_FAILURE);
|
||||
confdata->ndots = (lwres_uint8_t)ndots;
|
||||
confdata->ndots = (uint8_t)ndots;
|
||||
} else if (strncmp("timeout:", word, 8) == 0) {
|
||||
timeout = strtol(word + 8, &p, 10);
|
||||
if (*p != '\0') /* Bad string. */
|
||||
return (LWRES_R_FAILURE);
|
||||
confdata->timeout = (lwres_int32_t)timeout;
|
||||
confdata->timeout = (int32_t)timeout;
|
||||
} else if (strncmp("attempts:", word, 9) == 0) {
|
||||
attempts = strtol(word + 9, &p, 10);
|
||||
if (*p != '\0') /* Bad string. */
|
||||
return (LWRES_R_FAILURE);
|
||||
if (attempts < 0) /* Out of range. */
|
||||
return (LWRES_R_FAILURE);
|
||||
confdata->attempts = (lwres_int32_t)attempts;
|
||||
confdata->attempts = (int32_t)attempts;
|
||||
}
|
||||
|
||||
if (delim == EOF || delim == '\n')
|
||||
|
|
|
|||
|
|
@ -68,10 +68,9 @@ static char rcsid[] = "$Id: lwinetaton.c,v 1.16 2007/06/19 23:47:22 tbox Exp $";
|
|||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <lwres/int.h>
|
||||
#include <lwres/net.h>
|
||||
|
||||
#include "assert_p.h"
|
||||
|
|
@ -85,12 +84,12 @@ static char rcsid[] = "$Id: lwinetaton.c,v 1.16 2007/06/19 23:47:22 tbox Exp $";
|
|||
*/
|
||||
int
|
||||
lwres_net_aton(const char *cp, struct in_addr *addr) {
|
||||
lwres_uint32_t val;
|
||||
uint32_t val;
|
||||
int base;
|
||||
ptrdiff_t n;
|
||||
unsigned char c;
|
||||
lwres_uint8_t parts[4];
|
||||
lwres_uint8_t *pp = parts;
|
||||
uint8_t parts[4];
|
||||
uint8_t *pp = parts;
|
||||
int digit;
|
||||
|
||||
REQUIRE(cp != NULL);
|
||||
|
|
@ -147,7 +146,7 @@ lwres_net_aton(const char *cp, struct in_addr *addr) {
|
|||
*/
|
||||
if (pp >= parts + 3 || val > 0xffU)
|
||||
return (0);
|
||||
*pp++ = (lwres_uint8_t)val;
|
||||
*pp++ = (uint8_t)val;
|
||||
c = *++cp;
|
||||
} else
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -64,7 +65,7 @@
|
|||
|
||||
/*% Length of Packet */
|
||||
#define LWPACKET_LENGTH \
|
||||
(sizeof(lwres_uint16_t) * 4 + sizeof(lwres_uint32_t) * 5)
|
||||
(sizeof(uint16_t) * 4 + sizeof(uint32_t) * 5)
|
||||
|
||||
/*% transfers the contents of lightweight resolver packet structure lwres_lwpacket_t *pkt in network byte order to the lightweight resolver buffer, *b. */
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ lwres_lwpacket_renderheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt) {
|
|||
|
||||
lwres_result_t
|
||||
lwres_lwpacket_parseheader(lwres_buffer_t *b, lwres_lwpacket_t *pkt) {
|
||||
lwres_uint32_t space;
|
||||
uint32_t space;
|
||||
|
||||
REQUIRE(b != NULL);
|
||||
REQUIRE(pkt != NULL);
|
||||
|
|
|
|||
|
|
@ -34,20 +34,20 @@ typedef struct lwres_addr lwres_addr_t;
|
|||
typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
|
||||
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint32_t addrtypes;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_gabnrequest_t;
|
||||
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
@ -99,6 +99,7 @@ typedef struct {
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -119,7 +120,7 @@ lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
|
|||
size_t buflen;
|
||||
int ret;
|
||||
size_t payload_length;
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
REQUIRE(req != NULL);
|
||||
|
|
@ -127,7 +128,7 @@ lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
|
|||
REQUIRE(pkt != NULL);
|
||||
REQUIRE(b != NULL);
|
||||
|
||||
datalen = (lwres_uint16_t) strlen(req->name);
|
||||
datalen = (uint16_t) strlen(req->name);
|
||||
|
||||
payload_length = 4 + 4 + 2 + req->namelen + 1;
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ lwres_gabnrequest_render(lwres_context_t *ctx, lwres_gabnrequest_t *req,
|
|||
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags &= ~LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETADDRSBYNAME;
|
||||
|
|
@ -186,7 +187,7 @@ lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req,
|
|||
size_t buflen;
|
||||
int ret;
|
||||
size_t payload_length;
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
lwres_addr_t *addr;
|
||||
int x;
|
||||
|
||||
|
|
@ -219,7 +220,7 @@ lwres_gabnresponse_render(lwres_context_t *ctx, lwres_gabnresponse_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags |= LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETADDRSBYNAME;
|
||||
|
|
@ -282,9 +283,9 @@ lwres_gabnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
int ret;
|
||||
char *name;
|
||||
lwres_gabnrequest_t *gabn;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t addrtypes;
|
||||
uint32_t flags;
|
||||
uint16_t namelen;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
REQUIRE(pkt != NULL);
|
||||
|
|
@ -331,9 +332,9 @@ lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
{
|
||||
lwres_result_t ret;
|
||||
unsigned int x;
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
lwres_gabnresponse_t *gabn;
|
||||
lwres_addrlist_t addrlist;
|
||||
lwres_addr_t *addr;
|
||||
|
|
@ -378,7 +379,7 @@ lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
goto out;
|
||||
}
|
||||
|
||||
gabn->aliaslen = CTXMALLOC(sizeof(lwres_uint16_t) * naliases);
|
||||
gabn->aliaslen = CTXMALLOC(sizeof(uint16_t) * naliases);
|
||||
if (gabn->aliaslen == NULL) {
|
||||
ret = LWRES_R_NOMEMORY;
|
||||
goto out;
|
||||
|
|
@ -441,7 +442,7 @@ lwres_gabnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
CTXFREE(gabn->aliases, sizeof(char *) * naliases);
|
||||
if (gabn->aliaslen != NULL)
|
||||
CTXFREE(gabn->aliaslen,
|
||||
sizeof(lwres_uint16_t) * naliases);
|
||||
sizeof(uint16_t) * naliases);
|
||||
addr = LWRES_LIST_HEAD(addrlist);
|
||||
while (addr != NULL) {
|
||||
LWRES_LIST_UNLINK(addrlist, addr, link);
|
||||
|
|
@ -485,7 +486,7 @@ lwres_gabnresponse_free(lwres_context_t *ctx, lwres_gabnresponse_t **structp)
|
|||
if (gabn->naliases > 0) {
|
||||
CTXFREE(gabn->aliases, sizeof(char *) * gabn->naliases);
|
||||
CTXFREE(gabn->aliaslen,
|
||||
sizeof(lwres_uint16_t) * gabn->naliases);
|
||||
sizeof(uint16_t) * gabn->naliases);
|
||||
}
|
||||
addr = LWRES_LIST_HEAD(gabn->addrs);
|
||||
while (addr != NULL) {
|
||||
|
|
|
|||
|
|
@ -32,17 +32,17 @@
|
|||
#define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U
|
||||
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
uint32_t flags;
|
||||
lwres_addr_t addr;
|
||||
} lwres_gnbarequest_t;
|
||||
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
} lwres_gnbaresponse_t;
|
||||
|
|
@ -95,6 +95,7 @@ semantics as lwres_gnbarequest_parse() except it yields a
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -131,7 +132,7 @@ lwres_gnbarequest_render(lwres_context_t *ctx, lwres_gnbarequest_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags &= ~LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETNAMEBYADDR;
|
||||
|
|
@ -172,7 +173,7 @@ lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req,
|
|||
size_t buflen;
|
||||
int ret;
|
||||
size_t payload_length;
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
int x;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
|
|
@ -195,7 +196,7 @@ lwres_gnbaresponse_render(lwres_context_t *ctx, lwres_gnbaresponse_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags |= LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETNAMEBYADDR;
|
||||
|
|
@ -287,8 +288,8 @@ lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
{
|
||||
int ret;
|
||||
unsigned int x;
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
lwres_gnbaresponse_t *gnba;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
|
|
@ -326,7 +327,7 @@ lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
goto out;
|
||||
}
|
||||
|
||||
gnba->aliaslen = CTXMALLOC(sizeof(lwres_uint16_t) * naliases);
|
||||
gnba->aliaslen = CTXMALLOC(sizeof(uint16_t) * naliases);
|
||||
if (gnba->aliaslen == NULL) {
|
||||
ret = LWRES_R_NOMEMORY;
|
||||
goto out;
|
||||
|
|
@ -364,7 +365,7 @@ lwres_gnbaresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
CTXFREE(gnba->aliases, sizeof(char *) * naliases);
|
||||
if (gnba->aliaslen != NULL)
|
||||
CTXFREE(gnba->aliaslen,
|
||||
sizeof(lwres_uint16_t) * naliases);
|
||||
sizeof(uint16_t) * naliases);
|
||||
CTXFREE(gnba, sizeof(lwres_gnbaresponse_t));
|
||||
}
|
||||
|
||||
|
|
@ -401,7 +402,7 @@ lwres_gnbaresponse_free(lwres_context_t *ctx, lwres_gnbaresponse_t **structp)
|
|||
if (gnba->naliases > 0) {
|
||||
CTXFREE(gnba->aliases, sizeof(char *) * gnba->naliases);
|
||||
CTXFREE(gnba->aliaslen,
|
||||
sizeof(lwres_uint16_t) * gnba->naliases);
|
||||
sizeof(uint16_t) * gnba->naliases);
|
||||
}
|
||||
if (gnba->base != NULL)
|
||||
CTXFREE(gnba->base, gnba->baselen);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -38,7 +39,7 @@ lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
|
|||
size_t buflen;
|
||||
int ret;
|
||||
size_t payload_length;
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
REQUIRE(req != NULL);
|
||||
|
|
@ -46,7 +47,7 @@ lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
|
|||
REQUIRE(pkt != NULL);
|
||||
REQUIRE(b != NULL);
|
||||
|
||||
datalen = (lwres_uint16_t) strlen(req->name);
|
||||
datalen = (uint16_t) strlen(req->name);
|
||||
|
||||
payload_length = 4 + 2 + 2 + 2 + req->namelen + 1;
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ lwres_grbnrequest_render(lwres_context_t *ctx, lwres_grbnrequest_t *req,
|
|||
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags &= ~LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETRDATABYNAME;
|
||||
|
|
@ -111,7 +112,7 @@ lwres_grbnresponse_render(lwres_context_t *ctx, lwres_grbnresponse_t *req,
|
|||
size_t buflen;
|
||||
int ret;
|
||||
size_t payload_length;
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
int x;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
|
|
@ -135,7 +136,7 @@ lwres_grbnresponse_render(lwres_context_t *ctx, lwres_grbnresponse_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags |= LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_GETRDATABYNAME;
|
||||
|
|
@ -198,9 +199,9 @@ lwres_grbnrequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
int ret;
|
||||
char *name;
|
||||
lwres_grbnrequest_t *grbn;
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t rdclass, rdtype;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint16_t rdclass, rdtype;
|
||||
uint16_t namelen;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
REQUIRE(pkt != NULL);
|
||||
|
|
@ -251,10 +252,10 @@ lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
{
|
||||
lwres_result_t ret;
|
||||
unsigned int x;
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t rdclass, rdtype;
|
||||
lwres_uint32_t ttl;
|
||||
lwres_uint16_t nrdatas, nsigs;
|
||||
uint32_t flags;
|
||||
uint16_t rdclass, rdtype;
|
||||
uint32_t ttl;
|
||||
uint16_t nrdatas, nsigs;
|
||||
lwres_grbnresponse_t *grbn;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
|
|
@ -306,7 +307,7 @@ lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
goto out;
|
||||
}
|
||||
|
||||
grbn->rdatalen = CTXMALLOC(sizeof(lwres_uint16_t) * nrdatas);
|
||||
grbn->rdatalen = CTXMALLOC(sizeof(uint16_t) * nrdatas);
|
||||
if (grbn->rdatalen == NULL) {
|
||||
ret = LWRES_R_NOMEMORY;
|
||||
goto out;
|
||||
|
|
@ -320,7 +321,7 @@ lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
goto out;
|
||||
}
|
||||
|
||||
grbn->siglen = CTXMALLOC(sizeof(lwres_uint16_t) * nsigs);
|
||||
grbn->siglen = CTXMALLOC(sizeof(uint16_t) * nsigs);
|
||||
if (grbn->siglen == NULL) {
|
||||
ret = LWRES_R_NOMEMORY;
|
||||
goto out;
|
||||
|
|
@ -367,11 +368,11 @@ lwres_grbnresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
CTXFREE(grbn->rdatas, sizeof(char *) * nrdatas);
|
||||
if (grbn->rdatalen != NULL)
|
||||
CTXFREE(grbn->rdatalen,
|
||||
sizeof(lwres_uint16_t) * nrdatas);
|
||||
sizeof(uint16_t) * nrdatas);
|
||||
if (grbn->sigs != NULL)
|
||||
CTXFREE(grbn->sigs, sizeof(char *) * nsigs);
|
||||
if (grbn->siglen != NULL)
|
||||
CTXFREE(grbn->siglen, sizeof(lwres_uint16_t) * nsigs);
|
||||
CTXFREE(grbn->siglen, sizeof(uint16_t) * nsigs);
|
||||
CTXFREE(grbn, sizeof(lwres_grbnresponse_t));
|
||||
}
|
||||
|
||||
|
|
@ -408,11 +409,11 @@ lwres_grbnresponse_free(lwres_context_t *ctx, lwres_grbnresponse_t **structp)
|
|||
if (grbn->nrdatas > 0) {
|
||||
CTXFREE(grbn->rdatas, sizeof(char *) * grbn->nrdatas);
|
||||
CTXFREE(grbn->rdatalen,
|
||||
sizeof(lwres_uint16_t) * grbn->nrdatas);
|
||||
sizeof(uint16_t) * grbn->nrdatas);
|
||||
}
|
||||
if (grbn->nsigs > 0) {
|
||||
CTXFREE(grbn->sigs, sizeof(char *) * grbn->nsigs);
|
||||
CTXFREE(grbn->siglen, sizeof(lwres_uint16_t) * grbn->nsigs);
|
||||
CTXFREE(grbn->siglen, sizeof(uint16_t) * grbn->nsigs);
|
||||
}
|
||||
if (grbn->base != NULL)
|
||||
CTXFREE(grbn->base, grbn->baselen);
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@
|
|||
* #define LWRES_OPCODE_NOOP 0x00000000U
|
||||
*
|
||||
* typedef struct {
|
||||
* lwres_uint16_t datalength;
|
||||
* uint16_t datalength;
|
||||
* unsigned char *data;
|
||||
* } lwres_nooprequest_t;
|
||||
*
|
||||
* typedef struct {
|
||||
* lwres_uint16_t datalength;
|
||||
* uint16_t datalength;
|
||||
* unsigned char *data;
|
||||
* } lwres_noopresponse_t;
|
||||
* \endcode
|
||||
|
|
@ -94,6 +94,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -120,7 +121,7 @@ lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req,
|
|||
REQUIRE(pkt != NULL);
|
||||
REQUIRE(b != NULL);
|
||||
|
||||
payload_length = sizeof(lwres_uint16_t) + req->datalength;
|
||||
payload_length = sizeof(uint16_t) + req->datalength;
|
||||
|
||||
buflen = LWRES_LWPACKET_LENGTH + payload_length;
|
||||
buf = CTXMALLOC(buflen);
|
||||
|
|
@ -128,7 +129,7 @@ lwres_nooprequest_render(lwres_context_t *ctx, lwres_nooprequest_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags &= ~LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_NOOP;
|
||||
|
|
@ -173,7 +174,7 @@ lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req,
|
|||
REQUIRE(pkt != NULL);
|
||||
REQUIRE(b != NULL);
|
||||
|
||||
payload_length = sizeof(lwres_uint16_t) + req->datalength;
|
||||
payload_length = sizeof(uint16_t) + req->datalength;
|
||||
|
||||
buflen = LWRES_LWPACKET_LENGTH + payload_length;
|
||||
buf = CTXMALLOC(buflen);
|
||||
|
|
@ -181,7 +182,7 @@ lwres_noopresponse_render(lwres_context_t *ctx, lwres_noopresponse_t *req,
|
|||
return (LWRES_R_NOMEMORY);
|
||||
lwres_buffer_init(b, buf, (unsigned int)buflen);
|
||||
|
||||
pkt->length = (lwres_uint32_t)buflen;
|
||||
pkt->length = (uint32_t)buflen;
|
||||
pkt->version = LWRES_LWPACKETVERSION_0;
|
||||
pkt->pktflags |= LWRES_LWPACKETFLAG_RESPONSE;
|
||||
pkt->opcode = LWRES_OPCODE_NOOP;
|
||||
|
|
@ -229,7 +230,7 @@ lwres_nooprequest_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
if (req == NULL)
|
||||
return (LWRES_R_NOMEMORY);
|
||||
|
||||
if (!SPACE_REMAINING(b, sizeof(lwres_uint16_t))) {
|
||||
if (!SPACE_REMAINING(b, sizeof(uint16_t))) {
|
||||
ret = LWRES_R_UNEXPECTEDEND;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -277,7 +278,7 @@ lwres_noopresponse_parse(lwres_context_t *ctx, lwres_buffer_t *b,
|
|||
if (req == NULL)
|
||||
return (LWRES_R_NOMEMORY);
|
||||
|
||||
if (!SPACE_REMAINING(b, sizeof(lwres_uint16_t))) {
|
||||
if (!SPACE_REMAINING(b, sizeof(uint16_t))) {
|
||||
ret = LWRES_R_UNEXPECTEDEND;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@
|
|||
*
|
||||
* \code
|
||||
* typedef struct {
|
||||
* lwres_uint32_t flags;
|
||||
* lwres_uint16_t naliases;
|
||||
* lwres_uint16_t naddrs;
|
||||
* uint32_t flags;
|
||||
* uint16_t naliases;
|
||||
* uint16_t naddrs;
|
||||
* char *realname;
|
||||
* char **aliases;
|
||||
* lwres_uint16_t realnamelen;
|
||||
* lwres_uint16_t *aliaslen;
|
||||
* uint16_t realnamelen;
|
||||
* uint16_t *aliaslen;
|
||||
* lwres_addrlist_t addrs;
|
||||
* void *base;
|
||||
* size_t baselen;
|
||||
|
|
@ -93,6 +93,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -121,9 +122,9 @@
|
|||
*
|
||||
*/
|
||||
lwres_result_t
|
||||
lwres_data_parse(lwres_buffer_t *b, unsigned char **p, lwres_uint16_t *len)
|
||||
lwres_data_parse(lwres_buffer_t *b, unsigned char **p, uint16_t *len)
|
||||
{
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
unsigned char *data;
|
||||
|
||||
REQUIRE(b != NULL);
|
||||
|
|
@ -169,9 +170,9 @@ lwres_data_parse(lwres_buffer_t *b, unsigned char **p, lwres_uint16_t *len)
|
|||
*
|
||||
*/
|
||||
lwres_result_t
|
||||
lwres_string_parse(lwres_buffer_t *b, char **c, lwres_uint16_t *len)
|
||||
lwres_string_parse(lwres_buffer_t *b, char **c, uint16_t *len)
|
||||
{
|
||||
lwres_uint16_t datalen;
|
||||
uint16_t datalen;
|
||||
char *string;
|
||||
|
||||
REQUIRE(b != NULL);
|
||||
|
|
@ -233,7 +234,7 @@ lwres_addr_parse(lwres_buffer_t *b, lwres_addr_t *addr)
|
|||
/*% Used to perform forward lookups. */
|
||||
lwres_result_t
|
||||
lwres_getaddrsbyname(lwres_context_t *ctx, const char *name,
|
||||
lwres_uint32_t addrtypes, lwres_gabnresponse_t **structp)
|
||||
uint32_t addrtypes, lwres_gabnresponse_t **structp)
|
||||
{
|
||||
lwres_gabnrequest_t request;
|
||||
lwres_gabnresponse_t *response;
|
||||
|
|
@ -241,7 +242,7 @@ lwres_getaddrsbyname(lwres_context_t *ctx, const char *name,
|
|||
int recvlen;
|
||||
lwres_buffer_t b_in, b_out;
|
||||
lwres_lwpacket_t pkt;
|
||||
lwres_uint32_t serial;
|
||||
uint32_t serial;
|
||||
char *buffer;
|
||||
char target_name[1024];
|
||||
unsigned int target_length;
|
||||
|
|
@ -347,8 +348,8 @@ lwres_getaddrsbyname(lwres_context_t *ctx, const char *name,
|
|||
|
||||
/*% Used to perform reverse lookups. */
|
||||
lwres_result_t
|
||||
lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype,
|
||||
lwres_uint16_t addrlen, const unsigned char *addr,
|
||||
lwres_getnamebyaddr(lwres_context_t *ctx, uint32_t addrtype,
|
||||
uint16_t addrlen, const unsigned char *addr,
|
||||
lwres_gnbaresponse_t **structp)
|
||||
{
|
||||
lwres_gnbarequest_t request;
|
||||
|
|
@ -357,7 +358,7 @@ lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype,
|
|||
int recvlen;
|
||||
lwres_buffer_t b_in, b_out;
|
||||
lwres_lwpacket_t pkt;
|
||||
lwres_uint32_t serial;
|
||||
uint32_t serial;
|
||||
char *buffer;
|
||||
|
||||
REQUIRE(ctx != NULL);
|
||||
|
|
@ -457,14 +458,14 @@ lwres_getnamebyaddr(lwres_context_t *ctx, lwres_uint32_t addrtype,
|
|||
/*% Get rdata by name. */
|
||||
lwres_result_t
|
||||
lwres_getrdatabyname(lwres_context_t *ctx, const char *name,
|
||||
lwres_uint16_t rdclass, lwres_uint16_t rdtype,
|
||||
lwres_uint32_t flags, lwres_grbnresponse_t **structp)
|
||||
uint16_t rdclass, uint16_t rdtype,
|
||||
uint32_t flags, lwres_grbnresponse_t **structp)
|
||||
{
|
||||
int ret;
|
||||
int recvlen;
|
||||
lwres_buffer_t b_in, b_out;
|
||||
lwres_lwpacket_t pkt;
|
||||
lwres_uint32_t serial;
|
||||
uint32_t serial;
|
||||
char *buffer;
|
||||
lwres_grbnrequest_t request;
|
||||
lwres_grbnresponse_t *response;
|
||||
|
|
|
|||
|
|
@ -60,18 +60,18 @@ lwres_buffer_init, lwres_buffer_invalidate, lwres_buffer_add, lwres_buffer_subtr
|
|||
.BI "void lwres_buffer_forward(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");"
|
||||
.HP \w'void\ lwres_buffer_back('u
|
||||
.BI "void lwres_buffer_back(lwres_buffer_t\ *" "b" ", unsigned\ int\ " "n" ");"
|
||||
.HP \w'lwres_uint8_t\ lwres_buffer_getuint8('u
|
||||
.BI "lwres_uint8_t lwres_buffer_getuint8(lwres_buffer_t\ *" "b" ");"
|
||||
.HP \w'uint8_t\ lwres_buffer_getuint8('u
|
||||
.BI "uint8_t lwres_buffer_getuint8(lwres_buffer_t\ *" "b" ");"
|
||||
.HP \w'void\ lwres_buffer_putuint8('u
|
||||
.BI "void lwres_buffer_putuint8(lwres_buffer_t\ *" "b" ", lwres_uint8_t\ " "val" ");"
|
||||
.HP \w'lwres_uint16_t\ lwres_buffer_getuint16('u
|
||||
.BI "lwres_uint16_t lwres_buffer_getuint16(lwres_buffer_t\ *" "b" ");"
|
||||
.BI "void lwres_buffer_putuint8(lwres_buffer_t\ *" "b" ", uint8_t\ " "val" ");"
|
||||
.HP \w'uint16_t\ lwres_buffer_getuint16('u
|
||||
.BI "uint16_t lwres_buffer_getuint16(lwres_buffer_t\ *" "b" ");"
|
||||
.HP \w'void\ lwres_buffer_putuint16('u
|
||||
.BI "void lwres_buffer_putuint16(lwres_buffer_t\ *" "b" ", lwres_uint16_t\ " "val" ");"
|
||||
.HP \w'lwres_uint32_t\ lwres_buffer_getuint32('u
|
||||
.BI "lwres_uint32_t lwres_buffer_getuint32(lwres_buffer_t\ *" "b" ");"
|
||||
.BI "void lwres_buffer_putuint16(lwres_buffer_t\ *" "b" ", uint16_t\ " "val" ");"
|
||||
.HP \w'uint32_t\ lwres_buffer_getuint32('u
|
||||
.BI "uint32_t lwres_buffer_getuint32(lwres_buffer_t\ *" "b" ");"
|
||||
.HP \w'void\ lwres_buffer_putuint32('u
|
||||
.BI "void lwres_buffer_putuint32(lwres_buffer_t\ *" "b" ", lwres_uint32_t\ " "val" ");"
|
||||
.BI "void lwres_buffer_putuint32(lwres_buffer_t\ *" "b" ", uint32_t\ " "val" ");"
|
||||
.HP \w'void\ lwres_buffer_putmem('u
|
||||
.BI "void lwres_buffer_putmem(lwres_buffer_t\ *" "b" ", const\ unsigned\ char\ *" "base" ", unsigned\ int\ " "length" ");"
|
||||
.HP \w'void\ lwres_buffer_getmem('u
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void
|
|||
|
||||
<funcprototype>
|
||||
<funcdef>
|
||||
lwres_uint8_t
|
||||
uint8_t
|
||||
<function>lwres_buffer_getuint8</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
|
@ -141,12 +141,12 @@ lwres_uint8_t
|
|||
void
|
||||
<function>lwres_buffer_putuint8</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
<paramdef>lwres_uint8_t <parameter>val</parameter></paramdef>
|
||||
<paramdef>uint8_t <parameter>val</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
||||
<funcprototype>
|
||||
<funcdef>
|
||||
lwres_uint16_t
|
||||
uint16_t
|
||||
<function>lwres_buffer_getuint16</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
|
@ -156,12 +156,12 @@ lwres_uint16_t
|
|||
void
|
||||
<function>lwres_buffer_putuint16</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
<paramdef>lwres_uint16_t <parameter>val</parameter></paramdef>
|
||||
<paramdef>uint16_t <parameter>val</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
||||
<funcprototype>
|
||||
<funcdef>
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
<function>lwres_buffer_getuint32</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
|
@ -171,7 +171,7 @@ lwres_uint32_t
|
|||
void
|
||||
<function>lwres_buffer_putuint32</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
<paramdef>lwres_uint32_t <parameter>val</parameter></paramdef>
|
||||
<paramdef>uint32_t <parameter>val</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
||||
<funcprototype>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void
|
|||
|
||||
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
|
||||
<td><code class="funcdef">
|
||||
lwres_uint8_t
|
||||
uint8_t
|
||||
<b class="fsfunc">lwres_buffer_getuint8</b>(</code></td>
|
||||
<td>lwres_buffer_t *<var class="pdparam">b</var><code>)</code>;</td>
|
||||
</tr></table>
|
||||
|
|
@ -165,14 +165,14 @@ void
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint8_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
<td>uint8_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="funcprototype-spacer"> </div>
|
||||
|
||||
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
|
||||
<td><code class="funcdef">
|
||||
lwres_uint16_t
|
||||
uint16_t
|
||||
<b class="fsfunc">lwres_buffer_getuint16</b>(</code></td>
|
||||
<td>lwres_buffer_t *<var class="pdparam">b</var><code>)</code>;</td>
|
||||
</tr></table>
|
||||
|
|
@ -187,14 +187,14 @@ void
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint16_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
<td>uint16_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="funcprototype-spacer"> </div>
|
||||
|
||||
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
|
||||
<td><code class="funcdef">
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
<b class="fsfunc">lwres_buffer_getuint32</b>(</code></td>
|
||||
<td>lwres_buffer_t *<var class="pdparam">b</var><code>)</code>;</td>
|
||||
</tr></table>
|
||||
|
|
@ -209,7 +209,7 @@ void
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint32_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
<td>uint32_t <var class="pdparam">val</var><code>)</code>;</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="funcprototype-spacer"> </div>
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ lwres_context_create, lwres_context_destroy, lwres_context_nextserial, lwres_con
|
|||
.HP \w'lwres_result_t\ lwres_context_destroy('u
|
||||
.BI "lwres_result_t lwres_context_destroy(lwres_context_t\ **" "contextp" ");"
|
||||
.HP \w'void\ lwres_context_initserial('u
|
||||
.BI "void lwres_context_initserial(lwres_context_t\ *" "ctx" ", lwres_uint32_t\ " "serial" ");"
|
||||
.HP \w'lwres_uint32_t\ lwres_context_nextserial('u
|
||||
.BI "lwres_uint32_t lwres_context_nextserial(lwres_context_t\ *" "ctx" ");"
|
||||
.BI "void lwres_context_initserial(lwres_context_t\ *" "ctx" ", uint32_t\ " "serial" ");"
|
||||
.HP \w'uint32_t\ lwres_context_nextserial('u
|
||||
.BI "uint32_t lwres_context_nextserial(lwres_context_t\ *" "ctx" ");"
|
||||
.HP \w'void\ lwres_context_freemem('u
|
||||
.BI "void lwres_context_freemem(lwres_context_t\ *" "ctx" ", void\ *" "mem" ", size_t\ " "len" ");"
|
||||
.HP \w'void\ lwres_context_allocmem('u
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ lwres_result_t
|
|||
void
|
||||
<function>lwres_context_initserial</function></funcdef>
|
||||
<paramdef>lwres_context_t *<parameter>ctx</parameter></paramdef>
|
||||
<paramdef>lwres_uint32_t <parameter>serial</parameter></paramdef>
|
||||
<paramdef>uint32_t <parameter>serial</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
<function>lwres_context_nextserial</function></funcdef>
|
||||
<paramdef>lwres_context_t *<parameter>ctx</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ void
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint32_t <var class="pdparam">serial</var><code>)</code>;</td>
|
||||
<td>uint32_t <var class="pdparam">serial</var><code>)</code>;</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="funcprototype-spacer"> </div>
|
||||
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
|
||||
<td><code class="funcdef">
|
||||
lwres_uint32_t
|
||||
uint32_t
|
||||
<b class="fsfunc">lwres_context_nextserial</b>(</code></td>
|
||||
<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
|
||||
</tr></table>
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint32_t addrtypes;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_gabnrequest_t;
|
||||
.fi
|
||||
|
|
@ -110,13 +110,13 @@ typedef struct {
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -142,22 +142,22 @@ typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
|
|||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint32_t addrtypes;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_gabnrequest_t;
|
||||
</programlisting>
|
||||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -188,9 +188,9 @@ typedef LWRES_LIST(lwres_addr_t) lwres_addrlist_t;
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint32_t addrtypes;
|
||||
lwres_uint16_t namelen;
|
||||
uint32_t flags;
|
||||
uint32_t addrtypes;
|
||||
uint16_t namelen;
|
||||
char *name;
|
||||
} lwres_gabnrequest_t;
|
||||
</pre>
|
||||
|
|
@ -198,13 +198,13 @@ typedef struct {
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ lwres/lwres\&.h\&. They are shown below\&.
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
uint32_t flags;
|
||||
lwres_addr_t addr;
|
||||
} lwres_gnbarequest_t;
|
||||
.fi
|
||||
|
|
@ -97,12 +97,12 @@ typedef struct {
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
} lwres_gnbaresponse_t;
|
||||
|
|
|
|||
|
|
@ -150,19 +150,19 @@ void
|
|||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
uint32_t flags;
|
||||
lwres_addr_t addr;
|
||||
} lwres_gnbarequest_t;
|
||||
</programlisting>
|
||||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
} lwres_gnbaresponse_t;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ void
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
uint32_t flags;
|
||||
lwres_addr_t addr;
|
||||
} lwres_gnbarequest_t;
|
||||
</pre>
|
||||
|
|
@ -203,12 +203,12 @@ typedef struct {
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
} lwres_gnbaresponse_t;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ lwres/lwres\&.h\&. They are shown below\&.
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_nooprequest_t;
|
||||
.fi
|
||||
|
|
@ -101,7 +101,7 @@ typedef struct {
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_noopresponse_t;
|
||||
.fi
|
||||
|
|
|
|||
|
|
@ -145,14 +145,14 @@ void
|
|||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_nooprequest_t;
|
||||
</programlisting>
|
||||
</para>
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_noopresponse_t;
|
||||
</programlisting>
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ void
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_nooprequest_t;
|
||||
</pre>
|
||||
|
|
@ -198,7 +198,7 @@ typedef struct {
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint16_t datalength;
|
||||
uint16_t datalength;
|
||||
unsigned char *data;
|
||||
} lwres_noopresponse_t;
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -70,15 +70,15 @@ typedef struct lwres_lwpacket lwres_lwpacket_t;
|
|||
.\}
|
||||
.nf
|
||||
struct lwres_lwpacket {
|
||||
lwres_uint32_t length;
|
||||
lwres_uint16_t version;
|
||||
lwres_uint16_t pktflags;
|
||||
lwres_uint32_t serial;
|
||||
lwres_uint32_t opcode;
|
||||
lwres_uint32_t result;
|
||||
lwres_uint32_t recvlength;
|
||||
lwres_uint16_t authtype;
|
||||
lwres_uint16_t authlength;
|
||||
uint32_t length;
|
||||
uint16_t version;
|
||||
uint16_t pktflags;
|
||||
uint32_t serial;
|
||||
uint32_t opcode;
|
||||
uint32_t result;
|
||||
uint32_t recvlength;
|
||||
uint16_t authtype;
|
||||
uint16_t authlength;
|
||||
};
|
||||
.fi
|
||||
.if n \{\
|
||||
|
|
|
|||
|
|
@ -79,15 +79,15 @@ typedef struct lwres_lwpacket lwres_lwpacket_t;
|
|||
</para>
|
||||
<para><programlisting>
|
||||
struct lwres_lwpacket {
|
||||
lwres_uint32_t length;
|
||||
lwres_uint16_t version;
|
||||
lwres_uint16_t pktflags;
|
||||
lwres_uint32_t serial;
|
||||
lwres_uint32_t opcode;
|
||||
lwres_uint32_t result;
|
||||
lwres_uint32_t recvlength;
|
||||
lwres_uint16_t authtype;
|
||||
lwres_uint16_t authlength;
|
||||
uint32_t length;
|
||||
uint16_t version;
|
||||
uint16_t pktflags;
|
||||
uint32_t serial;
|
||||
uint32_t opcode;
|
||||
uint32_t result;
|
||||
uint32_t recvlength;
|
||||
uint16_t authtype;
|
||||
uint16_t authlength;
|
||||
};
|
||||
</programlisting>
|
||||
</para>
|
||||
|
|
|
|||
|
|
@ -78,15 +78,15 @@ typedef struct lwres_lwpacket lwres_lwpacket_t;
|
|||
</p>
|
||||
<pre class="programlisting">
|
||||
struct lwres_lwpacket {
|
||||
lwres_uint32_t length;
|
||||
lwres_uint16_t version;
|
||||
lwres_uint16_t pktflags;
|
||||
lwres_uint32_t serial;
|
||||
lwres_uint32_t opcode;
|
||||
lwres_uint32_t result;
|
||||
lwres_uint32_t recvlength;
|
||||
lwres_uint16_t authtype;
|
||||
lwres_uint16_t authlength;
|
||||
uint32_t length;
|
||||
uint16_t version;
|
||||
uint16_t pktflags;
|
||||
uint32_t serial;
|
||||
uint32_t opcode;
|
||||
uint32_t result;
|
||||
uint32_t recvlength;
|
||||
uint16_t authtype;
|
||||
uint16_t authlength;
|
||||
};
|
||||
</pre>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ lwres_string_parse, lwres_addr_parse, lwres_getaddrsbyname, lwres_getnamebyaddr
|
|||
.fi
|
||||
.ft
|
||||
.HP \w'lwres_result_t\ lwres_string_parse('u
|
||||
.BI "lwres_result_t lwres_string_parse(lwres_buffer_t\ *" "b" ", char\ **" "c" ", lwres_uint16_t\ *" "len" ");"
|
||||
.BI "lwres_result_t lwres_string_parse(lwres_buffer_t\ *" "b" ", char\ **" "c" ", uint16_t\ *" "len" ");"
|
||||
.HP \w'lwres_result_t\ lwres_addr_parse('u
|
||||
.BI "lwres_result_t lwres_addr_parse(lwres_buffer_t\ *" "b" ", lwres_addr_t\ *" "addr" ");"
|
||||
.HP \w'lwres_result_t\ lwres_getaddrsbyname('u
|
||||
.BI "lwres_result_t lwres_getaddrsbyname(lwres_context_t\ *" "ctx" ", const\ char\ *" "name" ", lwres_uint32_t\ " "addrtypes" ", lwres_gabnresponse_t\ **" "structp" ");"
|
||||
.BI "lwres_result_t lwres_getaddrsbyname(lwres_context_t\ *" "ctx" ", const\ char\ *" "name" ", uint32_t\ " "addrtypes" ", lwres_gabnresponse_t\ **" "structp" ");"
|
||||
.HP \w'lwres_result_t\ lwres_getnamebyaddr('u
|
||||
.BI "lwres_result_t lwres_getnamebyaddr(lwres_context_t\ *" "ctx" ", lwres_uint32_t\ " "addrtype" ", lwres_uint16_t\ " "addrlen" ", const\ unsigned\ char\ *" "addr" ", lwres_gnbaresponse_t\ **" "structp" ");"
|
||||
.BI "lwres_result_t lwres_getnamebyaddr(lwres_context_t\ *" "ctx" ", uint32_t\ " "addrtype" ", uint16_t\ " "addrlen" ", const\ unsigned\ char\ *" "addr" ", lwres_gnbaresponse_t\ **" "structp" ");"
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBlwres_string_parse()\fR
|
||||
|
|
@ -88,13 +88,13 @@ structure defined below:
|
|||
.\}
|
||||
.nf
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ lwres_result_t
|
|||
<function>lwres_string_parse</function></funcdef>
|
||||
<paramdef>lwres_buffer_t *<parameter>b</parameter></paramdef>
|
||||
<paramdef>char **<parameter>c</parameter></paramdef>
|
||||
<paramdef>lwres_uint16_t *<parameter>len</parameter></paramdef>
|
||||
<paramdef>uint16_t *<parameter>len</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
<funcdef>
|
||||
|
|
@ -71,7 +71,7 @@ lwres_result_t
|
|||
<function>lwres_getaddrsbyname</function></funcdef>
|
||||
<paramdef>lwres_context_t *<parameter>ctx</parameter></paramdef>
|
||||
<paramdef>const char *<parameter>name</parameter></paramdef>
|
||||
<paramdef>lwres_uint32_t <parameter>addrtypes</parameter></paramdef>
|
||||
<paramdef>uint32_t <parameter>addrtypes</parameter></paramdef>
|
||||
<paramdef>lwres_gabnresponse_t **<parameter>structp</parameter></paramdef>
|
||||
</funcprototype>
|
||||
<funcprototype>
|
||||
|
|
@ -79,8 +79,8 @@ lwres_result_t
|
|||
lwres_result_t
|
||||
<function>lwres_getnamebyaddr</function></funcdef>
|
||||
<paramdef>lwres_context_t *<parameter>ctx</parameter></paramdef>
|
||||
<paramdef>lwres_uint32_t <parameter>addrtype</parameter></paramdef>
|
||||
<paramdef>lwres_uint16_t <parameter>addrlen</parameter></paramdef>
|
||||
<paramdef>uint32_t <parameter>addrtype</parameter></paramdef>
|
||||
<paramdef>uint16_t <parameter>addrlen</parameter></paramdef>
|
||||
<paramdef>const unsigned char *<parameter>addr</parameter></paramdef>
|
||||
<paramdef>lwres_gnbaresponse_t **<parameter>structp</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
|
@ -123,13 +123,13 @@ lwres_result_t
|
|||
|
||||
<para><programlisting>
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ lwres_result_t
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint16_t *<var class="pdparam">len</var><code>)</code>;</td>
|
||||
<td>uint16_t *<var class="pdparam">len</var><code>)</code>;</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="funcprototype-spacer"> </div>
|
||||
|
|
@ -78,7 +78,7 @@ lwres_result_t
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint32_t <var class="pdparam">addrtypes</var>, </td>
|
||||
<td>uint32_t <var class="pdparam">addrtypes</var>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
|
@ -95,11 +95,11 @@ lwres_result_t
|
|||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint32_t <var class="pdparam">addrtype</var>, </td>
|
||||
<td>uint32_t <var class="pdparam">addrtype</var>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>lwres_uint16_t <var class="pdparam">addrlen</var>, </td>
|
||||
<td>uint16_t <var class="pdparam">addrlen</var>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
|
@ -151,13 +151,13 @@ lwres_result_t
|
|||
|
||||
<pre class="programlisting">
|
||||
typedef struct {
|
||||
lwres_uint32_t flags;
|
||||
lwres_uint16_t naliases;
|
||||
lwres_uint16_t naddrs;
|
||||
uint32_t flags;
|
||||
uint16_t naliases;
|
||||
uint16_t naddrs;
|
||||
char *realname;
|
||||
char **aliases;
|
||||
lwres_uint16_t realnamelen;
|
||||
lwres_uint16_t *aliaslen;
|
||||
uint16_t realnamelen;
|
||||
uint16_t *aliaslen;
|
||||
lwres_addrlist_t addrs;
|
||||
void *base;
|
||||
size_t baselen;
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id: int.h,v 1.4 2007/06/19 23:47:23 tbox Exp $ */
|
||||
|
||||
#ifndef LWRES_INT_H
|
||||
#define LWRES_INT_H 1
|
||||
|
||||
typedef char lwres_int8_t;
|
||||
typedef unsigned char lwres_uint8_t;
|
||||
typedef short lwres_int16_t;
|
||||
typedef unsigned short lwres_uint16_t;
|
||||
typedef int lwres_int32_t;
|
||||
typedef unsigned int lwres_uint32_t;
|
||||
typedef __int64 lwres_int64_t;
|
||||
typedef unsigned __int64 lwres_uint64_t;
|
||||
|
||||
#endif /* LWRES_INT_H */
|
||||
Loading…
Reference in a new issue