xref: /freebsd/lib/libc/rpc/netconfig.5 (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1.\"	$NetBSD: netconfig.5,v 1.2 2000/11/08 13:18:28 lukem Exp $
2.\" $NetBSD: netconfig.5,v 1.2 2000/11/08 13:18:28 lukem Exp $
3.Dd November 17, 2000
4.Dt NETCONFIG 5
5.Os
6.Sh NAME
7.Nm netconfig
8.Nd network configuration data base
9.Sh SYNOPSIS
10.Pa /etc/netconfig
11.Sh DESCRIPTION
12The
13.Nm
14file defines a list of
15.Dq transport names ,
16describing their semantics and protocol.
17In
18.Fx ,
19this file is only used by the RPC library code.
20.Pp
21Entries have the following format:
22.Pp
23.Ar network_id semantics flags family protoname device libraries
24.Pp
25Entries consist of the following fields:
26.Bl -tag -width network_id
27.It Ar network_id
28The name of the transport described.
29.It Ar semantics
30Describes the semantics of the transport.
31This can be one of:
32.Bl -tag -width tpi_cots_ord -offset indent
33.It Sy tpi_clts
34Connectionless transport.
35.It Sy tpi_cots
36Connection-oriented transport
37.It Sy tpi_cots_ord
38Connection-oriented, ordered transport.
39.It Sy tpi_raw
40A raw connection.
41.El
42.It Ar flags
43This field is either blank (specified by
44.Dq Li - ) ,
45or contains one or more of the following characters:
46.Bl -tag -width b -offset indent
47.It Sy b
48The network represented by this entry is broadcast capable.
49This flag is meaningless in
50.Fx .
51.It Sy v
52The entry may be returned by the
53.Xr getnetpath 3
54function.
55.El
56.It Ar family
57The protocol family of the transport.
58This is currently one of:
59.Bl -tag -width loopback -offset indent
60.It Sy inet6
61The IPv6
62.Pq Dv PF_INET6
63family of protocols.
64.It Sy inet
65The IPv4
66.Pq Dv PF_INET
67family of protocols.
68.It Sy loopback
69The
70.Dv PF_LOCAL
71protocol family.
72.El
73.It Ar protoname
74The name of the protocol used for this transport.
75Can currently be either
76.Sy udp ,
77.Sy tcp
78or empty.
79.It Ar device
80This field is always empty in
81.Fx .
82.It Ar libraries
83This field is always empty in
84.Fx .
85.El
86.Pp
87The order of entries in this file will determine which transport will
88be preferred by the RPC library code, given a match on a specified
89network type.
90For example, if a sample network config file would look like this:
91.Bd -literal -offset indent
92udp6       tpi_clts      v     inet6    udp     -       -
93tcp6       tpi_cots_ord  v     inet6    tcp     -       -
94udp        tpi_clts      v     inet     udp     -       -
95tcp        tpi_cots_ord  v     inet     tcp     -       -
96rawip      tpi_raw       -     inet      -      -       -
97local      tpi_cots_ord  -     loopback  -      -       -
98.Ed
99.Pp
100then using the network type
101.Sy udp
102in calls to the RPC library function (see
103.Xr rpc 3 )
104will make the code first try
105.Sy udp6 ,
106and then
107.Sy udp .
108.Pp
109.Xr getnetconfig 3
110and associated functions will parse this file and return structures of
111the following format:
112.Bd -literal
113struct netconfig {
114    char *nc_netid;              /* Network ID */
115    unsigned long nc_semantics;  /* Semantics */
116    unsigned long nc_flag;       /* Flags */
117    char *nc_protofmly;          /* Protocol family */
118    char *nc_proto;              /* Protocol name */
119    char *nc_device;             /* Network device pathname (unused) */
120    unsigned long nc_nlookups;   /* Number of lookup libs (unused) */
121    char **nc_lookups;           /* Names of the libraries (unused) */
122    unsigned long nc_unused[9];  /* reserved */
123};
124.Ed
125.Sh FILES
126.Bl -tag -width /etc/netconfig -compact
127.It Pa /etc/netconfig
128.El
129.Sh SEE ALSO
130.Xr getnetconfig 3 ,
131.Xr getnetpath 3
132