libc: Fix -Wunused-parameter.
[dragonfly.git] / lib / libc / rpc / netconfig.5
1 .\" $NetBSD: netconfig.5,v 1.2 2000/11/08 13:18:28 lukem Exp $
2 .\" $FreeBSD: src/lib/libc/rpc/netconfig.5,v 1.3 2006/01/11 13:57:15 ceri Exp $
3 .Dd November 15, 2008
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
12 The
13 .Nm
14 file defines a list of
15 .Dq transport names ,
16 describing their semantics and protocol.
17 In
18 .Fx ,
19 this file is only used by the RPC library code.
20 .Pp
21 Entries have the following format:
22 .Pp
23 .Ar network_id semantics flags family protoname device libraries
24 .Pp
25 Entries consist of the following fields:
26 .Bl -tag -width network_id
27 .It Ar network_id
28 The name of the transport described.
29 .It Ar semantics
30 Describes the semantics of the transport.
31 This can be one of:
32 .Bl -tag -width tpi_cots_ord -offset indent
33 .It Sy tpi_clts
34 Connectionless transport.
35 .It Sy tpi_cots
36 Connection-oriented transport
37 .It Sy tpi_cots_ord
38 Connection-oriented, ordered transport.
39 .It Sy tpi_raw
40 A raw connection.
41 .El
42 .It Ar flags
43 This field is either blank (specified by
44 .Dq Li - ) ,
45 or contains one or more of the following characters:
46 .Bl -tag -width b -offset indent
47 .It Sy b
48 The network represented by this entry is broadcast capable.
49 This flag is meaningless in
50 .Fx .
51 .It Sy v
52 The entry may be returned by the
53 .Xr getnetpath 3
54 function.
55 .El
56 .It Ar family
57 The protocol family of the transport.
58 This is currently one of:
59 .Bl -tag -width loopback -offset indent
60 .It Sy inet6
61 The IPv6
62 .Pq Dv PF_INET6
63 family of protocols.
64 .It Sy inet
65 The IPv4
66 .Pq Dv PF_INET
67 family of protocols.
68 .It Sy loopback
69 The
70 .Dv PF_LOCAL
71 protocol family.
72 .El
73 .It Ar protoname
74 The name of the protocol used for this transport.
75 Can currently be either
76 .Sy udp ,
77 .Sy tcp
78 or empty.
79 .It Ar device
80 This field is always empty in
81 .Fx .
82 .It Ar libraries
83 This field is always empty in
84 .Fx .
85 .El
86 .Pp
87 The order of entries in this file will determine which transport will
88 be preferred by the RPC library code, given a match on a specified
89 network type.
90 For example, if a sample network config file would look like this:
91 .Bd -literal -offset indent
92 udp6       tpi_clts      v     inet6    udp     -       -
93 tcp6       tpi_cots_ord  v     inet6    tcp     -       -
94 udp        tpi_clts      v     inet     udp     -       -
95 tcp        tpi_cots_ord  v     inet     tcp     -       -
96 rawip      tpi_raw       -     inet      -      -       -
97 local      tpi_cots_ord  -     loopback  -      -       -
98 .Ed
99 .Pp
100 then using the network type
101 .Sy udp
102 in calls to the RPC library function (see
103 .Xr rpc 3 )
104 will make the code first try
105 .Sy udp6 ,
106 and then
107 .Sy udp .
108 .Pp
109 .Xr getnetconfig 3
110 and associated functions will parse this file and return structures of
111 the following format:
112 .Bd -literal
113 struct 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