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