Windows: remove trailing whitespace
[openafs.git] / src / WINNT / kfw / inc / wshelper / wshelper.h
1 /*! \file wshelper.h
2  * WSHelper DNS/Hesiod Library
3  *
4  * This file contains the function declaration for:     \n
5  *      rgethostbyname()        \n
6  *      rgethostbyaddr()        \n
7  *  rgetservbyname()    \n
8  *  inet_aton()                 \n
9  *      wsh_gethostname()       \n
10  *      wsh_getdomainname()     \n \n
11  *  and unsupported functions: \n
12  *      gethinfobyname()        \n
13  *      getmxbyname()           \n
14  *      getrecordbyname()       \n
15  *      rrhost()                        \n
16  */
17
18 #ifndef _WSHELPER_
19 #define _WSHELPER_
20
21 #include <winsock.h>
22 #include <mitwhich.h>
23 #include <resolv.h>
24 #include <hesiod.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 /*!  \fn struct hostent * WINAPI rgethostbyname(char  *name)
30  *      retrieves host information corresponding to a host name in the DNS database
31  *
32  *      defined in gethna.c
33  *
34  *      \param[in]      name    Pointer to the null-terminated name of the host to resolve. It can be a fully qualified host name such as x.mit.edu
35  *                                              or it can be a simple host name such as x. If it is a simple host name, the default domain name is
36  *                                              appended to do the search.
37  *      \retval         a pointer to the structure hostent. a structure allocated by the library. The hostent structure contains
38  *                              the results of a successful search for the host specified in the name parameter. The caller must never
39  *                              attempt to modify this structure or to free any of its components. Furthermore, only one copy of this
40  *                              structure is allocated per call per thread, so the application should copy any information it needs before
41  *                              issuing another rgethostbyname.
42  *                              NULL if the search has failed
43  *
44 */
45 struct hostent * WINAPI rgethostbyname(char  *name);
46
47 /*! \fn struct hostent * WINAPI rgethostbyaddr(char  *addr, int len, int type)
48  *      retrieves the host information corresponding to a network address in the DNS database
49  *
50  *      defined in gethna.c
51  *
52  *      \param[in]      addr    Pointer to an address in network byte order
53  *      \param[in]      len             Length of the address, in bytes
54  *      \param[in]  type        Type of the address, such as the AF_INET address family type (defined as TCP,
55  *                                              UDP, and other associated Internet protocols). Address family types and their corresponding
56  *                                              values are defined in the Winsock2.h header file.
57  *      \retval         returns a pointer to the hostent structure that contains the name and address corresponding
58  *                              to the given network address. The structure is allocated by the library.  The caller must never
59  *                              attempt to modify this structure or to free any of its components. Furthermore, only one copy of this
60  *                              structure is allocated per call per thread, so the application should copy any information it needs before
61  *                              issuing another rgethostbyaddr.
62  *                              NULL if the search has failed
63  *
64 */
65 struct hostent * WINAPI rgethostbyaddr(char  *addr, int len, int type);
66
67 /*! \fn struct servent * WINAPI rgetservbyname(LPSTR name, LPSTR proto)
68  *      retrieves service information corresponding to a service name and protocol.
69  *
70  *      defined in gethna.c
71  *
72  *      \param[in]      name    Pointer to a null-terminated service name.
73  *      \param[in]  proto       pointer to a null-terminated protocol name. getservbyname should match both
74  *                                              the name and the proto.
75  *      \retval         a pointer to the servent structure containing the name(s) and service number that match the name and proto
76  *                              parameters. The structure is allocated by the library.  The caller must never
77  *                              attempt to modify this structure or to free any of its components. Furthermore, only one copy of this
78  *                              structure is allocated per call per thread, so the application should copy any information it needs before
79  *                              issuing another rgetservbyname.
80  *                              NULL if the search has failed
81  *
82  */
83 struct servent * WINAPI rgetservbyname(LPSTR name, LPSTR proto);
84
85 /*! \fn LPSTR WINAPI gethinfobyname(LPSTR name)
86  *      unsupported
87  */
88 LPSTR WINAPI gethinfobyname(LPSTR name);
89
90 /*! \fn LPSTR WINAPI getmxbyname(LPSTR name)
91  *      unsupported
92  */
93 LPSTR WINAPI getmxbyname(LPSTR name);
94
95 /*! \fn LPSTR WINAPI getrecordbyname(LPSTR name, int rectype)
96  *      unsupported
97  */
98 LPSTR WINAPI getrecordbyname(LPSTR name, int rectype);
99
100 /*! \fn  DWORD WINAPI rrhost( LPSTR lpHost )
101  *      unsupported
102  */
103 DWORD WINAPI rrhost( LPSTR lpHost );
104
105 /*! \fn  unsigned long WINAPI inet_aton(register const char *cp, struct in_addr *addr)
106  *      converts a string containing an (Ipv4) Internet Protocol dotted address into a proper address for the in_addr structure
107  *
108  *      defined in inetaton.c
109  *
110  *      \param[in]              cp              Null-terminated character string representing a number expressed in the
111  *                                                      Internet standard ".'' (dotted) notation.
112  *      \param[in, out] addr    pointer to the in_addr structure. The s_addr memeber will be populated
113  *      \retval Returns 1 if the address is valid, 0 if not.
114  */
115 unsigned long WINAPI inet_aton(register const char *cp, struct in_addr *addr);
116
117
118 /*! \fn int WINAPI wsh_gethostname(char* name, int size)
119  *      Gets the base part of the hostname
120  *
121  *      defined in res_init.c
122  *
123  *      \param[in, out] name    pointer to a buffer that receives a null-terminated string containing the computer name
124  *      \param[in]              size    specifies the size of the buffer, in chars (must be large
125  *                                                      enough to hold NULL-terminated host name)
126  *      \retval                 return 0 ifsuccess,  -1 on error.
127 */
128 int WINAPI wsh_gethostname(char* name, int size);
129
130 /*!     \fn int WINAPI wsh_getdomainname(char* name, int size)
131  *      Gets the machine's domain name
132  *
133  *      defined in res_init.c
134  *
135  *      \param[in, out] name    pointer to a buffer that receives a null-terminated string containing the domain name
136  *      \param[in]              size    specifies the size of the buffer, in chars (must be large
137  *                                                      enough to hold NULL-terminated domain name)
138  *
139  *      \retval                 return 0 ifsuccess,  -1 on error.
140  */
141 int WINAPI wsh_getdomainname(char* name, int size);
142
143
144 #ifdef __cplusplus
145 }
146 #endif
147
148 #endif  /* _WSHELPER_ */
149