INSIST(opt->offset + 4 <= opt->length);
r.base = opt->options + opt->offset;
r.length = opt->length - opt->offset;
-
+
opcode->opcode = uint16_fromregion(&r);
isc_region_consume(&r, 2);
opcode->length = uint16_fromregion(&r);
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
/* $Id: spf_99.h,v 1.4 2007/06/19 23:47:17 tbox Exp $ */
typedef struct dns_rdata_spf_string {
- isc_uint8_t length;
- unsigned char *data;
+ isc_uint8_t length;
+ unsigned char *data;
} dns_rdata_spf_string_t;
typedef struct dns_rdata_spf {
- dns_rdatacommon_t common;
- isc_mem_t *mctx;
- unsigned char *txt;
- isc_uint16_t txt_len;
- /* private */
- isc_uint16_t offset;
+ dns_rdatacommon_t common;
+ isc_mem_t *mctx;
+ unsigned char *txt;
+ isc_uint16_t txt_len;
+ /* private */
+ isc_uint16_t offset;
} dns_rdata_spf_t;
/*
REQUIRE(txt->txt != NULL && txt->txt_len != 0);
INSIST(txt->offset + 1 <= txt->txt_len);
- r.base = txt->txt + txt->offset;
- r.length = txt->txt_len - txt->offset;
- length = uint8_fromregion(&r);
- INSIST(txt->offset + 1 + length <= txt->txt_len);
- txt->offset = txt->offset + 1 + length;
- if (txt->offset == txt->txt_len)
- return (ISC_R_NOMORE);
- return (ISC_R_SUCCESS);
+ r.base = txt->txt + txt->offset;
+ r.length = txt->txt_len - txt->offset;
+ length = uint8_fromregion(&r);
+ INSIST(txt->offset + 1 + length <= txt->txt_len);
+ txt->offset = txt->offset + 1 + length;
+ if (txt->offset == txt->txt_len)
+ return (ISC_R_NOMORE);
+ return (ISC_R_SUCCESS);
}
isc_result_t
dns_rdata_txt_current(dns_rdata_txt_t *txt, dns_rdata_txt_string_t *string) {
- isc_region_t r;
+ isc_region_t r;
- REQUIRE(txt != NULL);
- REQUIRE(string != NULL);
- REQUIRE(txt->common.rdtype == 16);
- REQUIRE(txt->txt != NULL);
- REQUIRE(txt->offset < txt->txt_len);
+ REQUIRE(txt != NULL);
+ REQUIRE(string != NULL);
+ REQUIRE(txt->common.rdtype == 16);
+ REQUIRE(txt->txt != NULL);
+ REQUIRE(txt->offset < txt->txt_len);
- INSIST(txt->offset + 1 <= txt->txt_len);
- r.base = txt->txt + txt->offset;
- r.length = txt->txt_len - txt->offset;
+ INSIST(txt->offset + 1 <= txt->txt_len);
+ r.base = txt->txt + txt->offset;
+ r.length = txt->txt_len - txt->offset;
- string->length = uint8_fromregion(&r);
- isc_region_consume(&r, 1);
- string->data = r.base;
- INSIST(txt->offset + 1 + string->length <= txt->txt_len);
+ string->length = uint8_fromregion(&r);
+ isc_region_consume(&r, 1);
+ string->data = r.base;
+ INSIST(txt->offset + 1 + string->length <= txt->txt_len);
- return (ISC_R_SUCCESS);
+ return (ISC_R_SUCCESS);
}
#endif /* RDATA_GENERIC_TXT_16_C */
/*
- * Copyright (C) 2009, 2011-2013 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#ifdef ISC_PLATFORM_HAVESALEN
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - (2 * sizeof(isc_uint8_t)))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (_SS_ALIGNSIZE + _SS_PAD1SIZE \
- + 2 * sizeof(isc_uint8_t)))
+ + 2 * sizeof(isc_uint8_t)))
#else
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(isc_uint16_t))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (_SS_ALIGNSIZE + _SS_PAD1SIZE \
- + sizeof(isc_uint16_t)))
+ + sizeof(isc_uint16_t)))
#endif
struct sockaddr_storage {
/*
- * Copyright (C) 2004, 2007, 2011-2013 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2007, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
*socketp = sock;
iocompletionport_update(sock);
-
+
if (dup_socket) {
#ifndef ISC_ALLOW_MAPPED
isc__socket_ipv6only(sock, ISC_TRUE);