~ubuntu-branches/ubuntu/quantal/ncbi-tools6/quantal

« back to all changes in this revision

Viewing changes to connect/mitsock/netdb.h

Tags: upstream-6.1.20070822
ImportĀ upstreamĀ versionĀ 6.1.20070822

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*-
2
 
 * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
3
 
 * All rights reserved.
4
 
 *
5
 
 * Redistribution and use in source and binary forms are permitted
6
 
 * provided that: (1) source distributions retain this entire copyright
7
 
 * notice and comment, and (2) distributions including binaries display
8
 
 * the following acknowledgement:  ``This product includes software
9
 
 * developed by the University of California, Berkeley and its contributors''
10
 
 * in the documentation or other materials provided with the distribution
11
 
 * and in all advertising materials mentioning features or use of this
12
 
 * software. Neither the name of the University nor the names of its
13
 
 * contributors may be used to endorse or promote products derived
14
 
 * from this software without specific prior written permission.
15
 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16
 
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17
 
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
 
 *
19
 
 *      @(#)netdb.h     5.11 (Berkeley) 5/21/90
20
 
*
21
 
*
22
 
* RCS Modification History:
23
 
* $Log: netdb.h,v $
24
 
* Revision 1.2  2001/06/19 22:23:53  juran
25
 
* Include <stddef.h> for size_t.
26
 
*
27
 
* Revision 1.1  2001/04/03 20:35:19  juran
28
 
* Phil Churchill's MIT-derived OT sockets library.  No changes prior to initial check-in.
29
 
*
30
 
* Revision 6.2  2000/03/20 21:49:05  kans
31
 
* initial work on OpenTransport (Churchill)
32
 
*
33
 
* Revision 6.1  1999/11/17 20:52:50  kans
34
 
* changes to allow compilation under c++
35
 
*
36
 
* Revision 6.0  1997/08/25 18:37:33  madden
37
 
* Revision changed to 6.0
38
 
*
39
 
* Revision 4.0  1995/07/26 13:56:09  ostell
40
 
* force revision to 4.0
41
 
*
42
 
 * Revision 1.2  1995/05/17  17:56:51  epstein
43
 
 * add RCS log revision history
44
 
 *
45
 
 */
46
 
 
47
 
/*
48
 
 * Structures returned by network data base library.  All addresses are
49
 
 * supplied in host order, and returned in network order (suitable for
50
 
 * use in system calls).
51
 
 */
52
 
struct  hostent {
53
 
        char    *h_name;                /* official name of host */
54
 
        char    **h_aliases;    /* alias list */
55
 
        SInt32  h_addrtype;             /* host address type */
56
 
        SInt32  h_length;               /* length of address */
57
 
        char    **h_addr_list;  /* list of addresses from name server */
58
 
};
59
 
 
60
 
#define h_addr  h_addr_list[0]  /* address, for backward compatiblity */
61
 
 
62
 
 
63
 
/*
64
 
 * Assumption here is that a network number
65
 
 * fits in 32 bits -- will break with IP6.
66
 
 */
67
 
struct  netent {
68
 
        char            *n_name;                /* official name of net */
69
 
        char            **n_aliases;    /* alias list */
70
 
        SInt32          n_addrtype;             /* net address type */
71
 
        unsigned long   n_net;          /* network # */
72
 
};
73
 
 
74
 
struct  servent {
75
 
        char    *s_name;                /* official service name */
76
 
        char    **s_aliases;    /* alias list */
77
 
        SInt32  s_port;                 /* port # */
78
 
        char    *s_proto;               /* protocol to use */
79
 
};
80
 
 
81
 
struct  protoent {
82
 
        char    *p_name;                /* official protocol name */
83
 
        char    **p_aliases;    /* alias list */
84
 
        SInt32  p_proto;                /* protocol # */
85
 
};
86
 
 
87
 
/*
88
 
 *      prototypes
89
 
 */
90
 
struct hostent  *gethostbyname(const char *name);
91
 
struct hostent  *gethostbyaddr();
92
 
struct servent  *getservbyname(const char *name, const char *proto);
93
 
struct servent  *getservbyport();
94
 
struct servent  *getservent();
95
 
unsigned long   gethostid(void);
96
 
 
97
 
/*  
98
 
 *      not sure they belong here, but need to be somewhere...
99
 
 */
100
 
#include <stddef.h>
101
 
int gethostname( char* machname, size_t buflen);
102
 
void bzero( char *b, long s);
103
 
 
104
 
/*
105
 
 *      not implemented in version ncbiOTsock 1.0
106
 
 */
107
 
struct protoent *getprotobyname();
108
 
struct protoent *getprotobynumber();
109
 
struct protoent *getprotoent();
110
 
struct hostent  *gethostent();
111
 
struct netent   *getnetbyname();
112
 
struct netent   *getnetbyaddr();
113
 
struct netent   *getnetent();
114