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