wks_11.c revision 9f139761ca06977d1db8051842efc620c15b8199
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: wks_11.c,v 1.35 2000/08/24 21:41:44 gson Exp $ */
/* Reviewed: Fri Mar 17 15:01:49 PST 2000 by explorer */
#ifndef RDATA_IN_1_WKS_11_C
#define RDATA_IN_1_WKS_11_C
#include <limits.h>
#include <stdlib.h>
#define RRTYPE_WKS_ATTRIBUTES (0)
static inline isc_result_t
char *e;
long proto;
long port;
long maxport = -1;
unsigned int n;
char service[32];
int i;
/*
* IPv4 dotted quad.
*/
return (DNS_R_BADDOTTEDQUAD);
return (ISC_R_NOSPACE);
/*
* Protocol.
*/
if (*e == 0)
;
else
return (ISC_R_UNEXPECTED);
return (ISC_R_RANGE);
if (proto == IPPROTO_TCP)
ps = "tcp";
else if (proto == IPPROTO_UDP)
ps = "udp";
do {
ISC_TRUE));
break;
/*
* Lowercase the service string as some getservbyname() are
* case sensitive and the database is usually in lowercase.
*/
if (*e == 0)
;
!= NULL)
else
return (ISC_R_UNEXPECTED);
return (ISC_R_RANGE);
} while (1);
/*
*/
}
static inline isc_result_t
unsigned short proto;
char buf[sizeof "65535"];
unsigned int i, j;
return (ISC_R_NOSPACE);
for (j = 0 ; j < 8 ; j++)
}
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
return (ISC_R_UNEXPECTEDEND);
return (DNS_R_EXTRADATA);
return (ISC_R_NOSPACE);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
}
static inline int
}
static inline isc_result_t
isc_uint32_t a;
}
static inline isc_result_t
isc_uint32_t n;
n = uint32_fromregion(®ion);
return (ISC_R_NOMEMORY);
} else
return (ISC_R_SUCCESS);
}
static inline void
return;
}
static inline isc_result_t
return (ISC_R_SUCCESS);
}
static inline isc_result_t
isc_region_t r;
dns_rdata_toregion(rdata, &r);
}
#endif /* RDATA_IN_1_WKS_11_C */