dns_sv.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1996,1999 by 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#endif
/* Imports */
#include "port_before.h"
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <ctype.h>
#include <stdlib.h>
#include <errno.h>
#include <resolv.h>
#include <isc/memcluster.h>
#include <irs.h>
#include "port_after.h"
#include "irs_p.h"
#include "hesiod.h"
#include "dns_p.h"
/* Definitions */
struct pvt {
char * svbuf;
struct __res_state * res;
void (*free_res)(void *);
};
/* Forward. */
const char *, const char *);
static void sv_minimize(struct irs_sv *);
#ifdef SV_RES_SETGET
static void sv_res_set(struct irs_sv *,
struct __res_state *,
void (*)(void *));
#endif
char **, const char *);
/* Public */
struct irs_sv *
return (NULL);
}
return (NULL);
}
return (NULL);
}
#ifdef SV_RES_SETGET
#else
#endif
return (sv);
}
/* Methods */
static void
}
static struct servent *
struct servent *s;
char **hes_list;
return (NULL);
return (s);
}
static struct servent *
struct servent *s;
char portstr[16];
char **hes_list;
return (NULL);
return (s);
}
static struct servent *
return (NULL);
}
static void
/* NOOP */
}
/* Private */
static struct servent *
int proto_len;
int num = 0;
int max = 0;
/* Strip away comments, if any. */
*p = 0;
/* Check to make sure the protocol matches. */
p = cp;
while (*p && !isspace((unsigned char)*p))
p++;
if (!*p)
continue;
if (proto) {
continue;
continue;
}
/* OK, we've got a live one. Let's parse it for real. */
while (*p && !isspace(*p&0xff))
p++;
if (!*p)
continue;
*p++ = '\0';
while (*p && !isspace(*p&0xff))
p++;
if (!*p)
continue;
*p++ = '\0';
while (*p && !isspace(*p&0xff))
p++;
if (*p)
*p++ = '\0';
while (*p) {
max += 10;
max * sizeof(char *));
if (!new) {
goto cleanup;
}
}
while (*p && !isspace(*p&0xff))
p++;
if (*p)
*p++ = '\0';
}
goto cleanup;
}
}
}
return (NULL);
}
static void
/* NOOP */
}
#ifdef SV_RES_SETGET
static struct __res_state *
}
static void
void (*free_res)(void *)) {
}
#endif