2 * WSHelper DNS/Hesiod Library
4 * This file contains the function declaration for: \n
10 * wsh_getdomainname() \n \n
11 * and unsupported functions: \n
14 * getrecordbyname() \n
29 /*! \fn struct hostent * WINAPI rgethostbyname(char *name)
30 * retrieves host information corresponding to a host name in the DNS database
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
45 struct hostent * WINAPI rgethostbyname(char *name);
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
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
65 struct hostent * WINAPI rgethostbyaddr(char *addr, int len, int type);
67 /*! \fn struct servent * WINAPI rgetservbyname(LPSTR name, LPSTR proto)
68 * retrieves service information corresponding to a service name and protocol.
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
83 struct servent * WINAPI rgetservbyname(LPSTR name, LPSTR proto);
85 /*! \fn LPSTR WINAPI gethinfobyname(LPSTR name)
88 LPSTR WINAPI gethinfobyname(LPSTR name);
90 /*! \fn LPSTR WINAPI getmxbyname(LPSTR name)
93 LPSTR WINAPI getmxbyname(LPSTR name);
95 /*! \fn LPSTR WINAPI getrecordbyname(LPSTR name, int rectype)
98 LPSTR WINAPI getrecordbyname(LPSTR name, int rectype);
100 /*! \fn DWORD WINAPI rrhost( LPSTR lpHost )
103 DWORD WINAPI rrhost( LPSTR lpHost );
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
108 * defined in inetaton.c
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.
115 unsigned long WINAPI inet_aton(register const char *cp, struct in_addr *addr);
118 /*! \fn int WINAPI wsh_gethostname(char* name, int size)
119 * Gets the base part of the hostname
121 * defined in res_init.c
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.
128 int WINAPI wsh_gethostname(char* name, int size);
130 /*! \fn int WINAPI wsh_getdomainname(char* name, int size)
131 * Gets the machine's domain name
133 * defined in res_init.c
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)
139 * \retval return 0 ifsuccess, -1 on error.
141 int WINAPI wsh_getdomainname(char* name, int size);
148 #endif /* _WSHELPER_ */