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