Commit 8360c3dc authored by Bob Halley's avatar Bob Halley
Browse files

eliminate inet.h; do not use UNIX-specific .h files

parent da492078
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: a6_38.c,v 1.10 1999/06/08 10:35:21 gson Exp $ */
/* $Id: a6_38.c,v 1.11 1999/07/16 00:24:32 halley Exp $ */
/* draft-ietf-ipngwg-dns-lookups-03.txt */
......@@ -24,13 +24,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/inet.h>
#include <isc/net.h>
#ifndef MAX
#define MAX(A, B) ((A > B) ? (A) : (B))
......@@ -67,7 +61,7 @@ fromtext_in_a6(dns_rdataclass_t class, dns_rdatatype_t type,
/* octets 0..15 */
RETERR(gettoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
return (DNS_R_BADAAAA);
mask = 0xff >> (prefixlen % 8);
addr[octets] &= mask;
......@@ -118,8 +112,8 @@ totext_in_a6(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
mask = 0xff >> (prefixlen % 8);
addr[octets] &= mask;
isc_buffer_available(target, &tr);
if (isc_inet_ntop(AF_INET6, addr,
(char *)tr.base, tr.length) == NULL)
if (inet_ntop(AF_INET6, addr,
(char *)tr.base, tr.length) == NULL)
return (DNS_R_NOSPACE);
isc_buffer_add(target, strlen((char *)tr.base));
......
......@@ -15,20 +15,14 @@
* SOFTWARE.
*/
/* $Id: a_1.c,v 1.15 1999/06/08 10:35:21 gson Exp $ */
/* $Id: a_1.c,v 1.16 1999/07/16 00:24:32 halley Exp $ */
#ifndef RDATA_IN_1_A_1_C
#define RDATA_IN_1_A_1_C
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/inet.h>
#include <isc/net.h>
static dns_result_t
fromtext_in_a(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -47,7 +41,7 @@ fromtext_in_a(dns_rdataclass_t class, dns_rdatatype_t type,
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
if (isc_inet_aton(token.value.as_pointer, &addr) != 1)
if (inet_aton(token.value.as_pointer, &addr) != 1)
return (DNS_R_BADDOTTEDQUAD);
isc_buffer_available(target, &region);
if (region.length < 4)
......@@ -70,7 +64,7 @@ totext_in_a(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
tctx = tctx; /* unused */
isc_buffer_available(target, &region);
if (isc_inet_ntop(AF_INET, rdata->data,
if (inet_ntop(AF_INET, rdata->data,
(char *)region.base, region.length) == NULL)
return (DNS_R_NOSPACE);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: aaaa_28.c,v 1.9 1999/06/08 10:35:21 gson Exp $ */
/* $Id: aaaa_28.c,v 1.10 1999/07/16 00:24:33 halley Exp $ */
/* RFC 1886 */
......@@ -24,13 +24,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/inet.h>
#include <isc/net.h>
static dns_result_t
fromtext_in_aaaa(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -49,7 +43,7 @@ fromtext_in_aaaa(dns_rdataclass_t class, dns_rdatatype_t type,
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
if (isc_inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
if (inet_pton(AF_INET6, token.value.as_pointer, addr) != 1)
return (DNS_R_BADAAAA);
isc_buffer_available(target, &region);
if (region.length < 16)
......@@ -72,8 +66,8 @@ totext_in_aaaa(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
tctx = tctx; /* unused */
isc_buffer_available(target, &region);
if (isc_inet_ntop(AF_INET6, rdata->data,
(char *)region.base, region.length) == NULL)
if (inet_ntop(AF_INET6, rdata->data,
(char *)region.base, region.length) == NULL)
return (DNS_R_NOSPACE);
isc_buffer_add(target, strlen((char *)region.base));
......
......@@ -15,22 +15,17 @@
* SOFTWARE.
*/
/* $Id: wks_11.c,v 1.12 1999/07/05 05:50:52 gson Exp $ */
/* $Id: wks_11.c,v 1.13 1999/07/16 00:24:33 halley Exp $ */
#ifndef RDATA_IN_1_WKS_11_C
#define RDATA_IN_1_WKS_11_C
#include <limits.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <isc/inet.h>
#include <isc/net.h>
#include <isc/netdb.h>
static dns_result_t
fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
......@@ -60,7 +55,7 @@ fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
isc_buffer_available(target, &region);
if (isc_inet_aton(token.value.as_pointer, &addr) != 1)
if (inet_aton(token.value.as_pointer, &addr) != 1)
return (DNS_R_BADDOTTEDQUAD);
if (region.length < 4)
return (DNS_R_NOSPACE);
......@@ -128,8 +123,7 @@ totext_in_wks(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
tctx = tctx;
dns_rdata_toregion(rdata, &sr);
isc_buffer_available(target, &tr);
if (isc_inet_ntop(AF_INET, sr.base, (char *)tr.base, tr.length)
== NULL)
if (inet_ntop(AF_INET, sr.base, (char *)tr.base, tr.length) == NULL)
return (DNS_R_NOSPACE);
isc_buffer_add(target, strlen((char *)tr.base));
isc_region_consume(&sr, 4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment