1 /* $Copyright:
\r *
\r * Copyright 1998-2000 by the Massachusetts Institute of Technology.
\r *
\r * All rights reserved.
\r *
\r * Permission to use, copy, modify, and distribute this software and its
\r * documentation for any purpose and without fee is hereby granted,
\r * provided that the above copyright notice appear in all copies and that
\r * both that copyright notice and this permission notice appear in
\r * supporting documentation, and that the name of M.I.T. not be used in
\r * advertising or publicity pertaining to distribution of the software
\r * without specific, written prior permission. Furthermore if you modify
\r * this software you must label your software as modified software and not
\r * distribute it in such a fashion that it might be confused with the
\r * original MIT software. M.I.T. makes no representations about the
\r * suitability of this software for any purpose. It is provided "as is"
\r * without express or implied warranty.
\r *
\r * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
\r * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
\r * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
\r *
\r * Individual source code files are copyright MIT, Cygnus Support,
\r * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
\r *
\r * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
\r * and Zephyr are trademarks of the Massachusetts Institute of Technology
\r * (MIT). No commercial use of these trademarks may be made without prior
\r * written permission of MIT.
\r *
\r * "Commercial use" means use of a name in a product or other for-profit
\r * manner. It does NOT prevent a commercial firm from referring to the MIT
\r * trademarks in order to convey information (although in doing so,
\r * recognition of their trademark status should be given).
\r * $
\r */
\r\r/* $Header: /afs/andrew/system/cvs/src/sasl/mac/CommonKClient/mac_kclient3/Headers/KerberosSupport/netdb.h,v 1.2 2001/12/04 02:05:57 rjs3 Exp $ */
\r\r/* MIT Sockets Library
\r * netdb.h
\r * macdev@mit.edu
\r */
\r\r#ifndef _NETDB_H
\r#define _NETDB_H
\r\r#include <stdlib.h>
\r\r#ifdef __cplusplus
\rextern "C" {
\r#endif
\r\rstruct hostent
\r{
\r char *h_name; /* official (cannonical) name of host */
\r char **h_aliases; /* pointer to array of pointers of alias names */
\r int h_addrtype; /* host address type: AF_INET or AF_INET6 */
\r int h_length; /* length of address: 4 or 16 */
\r char **h_addr_list; /* pointer to array of pointers with IPv4 or IPv6 addresses */
\r};
\r\r#define h_addr h_addr_list[0] /* first address in list */
\r\rstruct servent
\r{
\r char *s_name; /* official service name */
\r char **s_aliases; /* alias list */
\r int s_port; /* port number, network-byte order */
\r char *s_proto; /* protocol to use */
\r};
\r\r#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
\r# pragma import on
\r#endif
\r\r#if !TARGET_RT_MAC_CFM
\r# pragma d0_pointers on
\r#endif
\r\rstruct hostent *gethostbyname(const char *hostname);
\rstruct hostent *gethostbyaddr(const char *addr, size_t len, int family);
\r\r/* Gets the local host's hostname. If namelen isn't long enough, it puts in as much of
\r the name as possible, without a terminating null. This is done so it is compatible
\r with the unix version. This is, admittedly, the wrong way to write a code, but my
\r excuse is compatibility. It should really dynamically allocate space. Oh well.
\r It also assert()'s if you don't pass it a reasonably sized buffer. */
\rint gethostname(char *name, size_t namelen);
\r\r/* Opens the service database if needed and gets the next service entry.
\r Returns NULL if you have read them all. On error, returns NULL and
\r calls SetMITLibError(). */
\rstruct servent *getservent (void);
\r\r/* Closes the service database. On error, calls SetMITLibError(). */
\rvoid endservent (void);
\r\rstruct servent *getservbyname (const char *servname, const char *protname);
\rstruct servent *getservbyport (int port, const char *protname);
\r\r#if !TARGET_RT_MAC_CFM
\r# pragma d0_pointers reset
\r#endif
\r\r#if defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
\r# pragma import reset
\r#endif
\r\r#ifdef __cplusplus
\r}
\r#endif
\r\r#endif /* _NETDB_H */