summaryrefslogtreecommitdiff
path: root/apps/snmpnetstat/winstub.h
blob: 8fc51ddffd9663b37e3c502b0cc4ade0a1e3d642 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#ifndef _WINSTUB_H_
#define _WINSTUB_H_

#include <net-snmp/types.h>

#if (defined(WIN32) || defined(cygwin))

/*
 * database access functions for host, services, protocols, networks 
 */

/*
 * sets can open. ends must close. 
 */
void            sethostent(int stay_open);
void            setservent(int stay_open);
void            setprotoent(int stay_open);
void            setnetent(int stay_open);
void            endhostent(void);
void            endservent(void);
void            endprotoent(void);
void            endnetent(void);

/*
 * get next entry from data base file, or from NIS if possible. 
 */
/*
 * returns 0 if there are no more entries to read. 
 */
struct hostent *gethostent(void);
struct servent *getservent(void);
struct protoent *getprotoent(void);
struct netent  *getnetent(void);

struct netent  *getnetbyaddr(long net, int type);

/*
 * Return the network number from an internet address 
 */
u_long          inet_netof(struct in_addr in);

/*
 * Return the host number from an internet address 
 */
u_long          inet_lnaof(struct in_addr in);

#endif                          /* WIN32 or cygwin */

#endif /*_WINSTUB_H_ */