initial checkin
[platform/upstream/libtirpc.git] / tirpc / netconfig.h
1 #ifndef _NETCONFIG_H_
2 #define _NETCONFIG_H_
3
4 #include <features.h>
5
6 #define NETCONFIG "/etc/netconfig"
7 #define NETPATH   "NETPATH"
8
9 struct netconfig {
10   char *nc_netid;               /* Network ID */
11   unsigned long nc_semantics;   /* Semantics (see below) */
12   unsigned long nc_flag;        /* Flags (see below) */
13   char *nc_protofmly;           /* Protocol family */
14   char *nc_proto;               /* Protocol name */
15   char *nc_device;              /* Network device pathname */
16   unsigned long nc_nlookups;    /* Number of directory lookup libs */
17   char **nc_lookups;            /* Names of the libraries */
18   unsigned long nc_unused[9];   /* reserved */
19 };
20
21 typedef struct {
22   struct netconfig **nc_head;
23   struct netconfig **nc_curr;
24 } NCONF_HANDLE;
25
26 /*
27  * nc_semantics values
28  */
29 #define NC_TPI_CLTS     1
30 #define NC_TPI_COTS     2
31 #define NC_TPI_COTS_ORD 3
32 #define NC_TPI_RAW      4
33
34 /*
35  * nc_flag values
36  */
37 #define NC_NOFLAG       0x00
38 #define NC_VISIBLE      0x01
39 #define NC_BROADCAST    0x02
40
41 /*
42  * nc_protofmly values
43  */
44 #define NC_NOPROTOFMLY  "-"
45 #define NC_LOOPBACK     "loopback"
46 #define NC_INET         "inet"
47 #define NC_INET6        "inet6"
48 #define NC_IMPLINK      "implink"
49 #define NC_PUP          "pup"
50 #define NC_CHAOS        "chaos"
51 #define NC_NS           "ns"
52 #define NC_NBS          "nbs"
53 #define NC_ECMA         "ecma"
54 #define NC_DATAKIT      "datakit"
55 #define NC_CCITT        "ccitt"
56 #define NC_SNA          "sna"
57 #define NC_DECNET       "decnet"
58 #define NC_DLI          "dli"
59 #define NC_LAT          "lat"
60 #define NC_HYLINK       "hylink"
61 #define NC_APPLETALK    "appletalk"
62 #define NC_NIT          "nit"
63 #define NC_IEEE802      "ieee802"
64 #define NC_OSI          "osi"
65 #define NC_X25          "x25"
66 #define NC_OSINET       "osinet"
67 #define NC_GOSIP        "gosip"
68
69 /*
70  * nc_proto values
71  */
72 #define NC_NOPROTO      "-"
73 #define NC_TCP          "tcp"
74 #define NC_UDP          "udp"
75 #define NC_ICMP         "icmp"
76
77 __BEGIN_DECLS
78
79 extern void *setnetconfig (void);
80 extern struct netconfig *getnetconfig (void *);
81 extern struct netconfig *getnetconfigent (const char *);
82 extern void freenetconfigent (struct netconfig *);
83 extern int endnetconfig (void *);
84
85 extern void *setnetpath (void);
86 extern struct netconfig *getnetpath (void *);
87 extern int endnetpath (void *);
88
89 extern void nc_perror (const char *);
90 extern char *nc_sperror (void);
91
92 __END_DECLS
93
94 #endif /* _NETCONFIG_H_ */