version 1, including all changes.
.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
GETNETENT |
| |
|
2 |
!!!GETNETENT |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
RETURN VALUE |
| |
|
7 |
FILES |
| |
|
8 |
CONFORMING TO |
| |
|
9 |
SEE ALSO |
| |
|
10 |
---- |
| |
|
11 |
!!NAME |
| |
|
12 |
|
| |
|
13 |
|
| |
|
14 |
getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent - get network entry |
| |
|
15 |
!!SYNOPSIS |
| |
|
16 |
|
| |
|
17 |
|
| |
|
18 |
__#include |
| |
|
19 |
__''name''__); |
| |
|
20 |
struct netent *getnetbyaddr(long__ ''net''__, int__ ''type''__); |
| |
|
21 |
void setnetent(int__ ''stayopen''__); |
| |
|
22 |
void endnetent(void); |
| |
|
23 |
__ |
| |
|
24 |
!!DESCRIPTION |
| |
|
25 |
|
| |
|
26 |
|
| |
|
27 |
The __getnetent()__ function reads the next line from the |
| |
|
28 |
file ''/etc/networks'' and returns a structure |
| |
|
29 |
''netent'' containing the broken out fields from the |
| |
|
30 |
line. The ''/etc/networks'' file is opened if |
| |
|
31 |
necessary. |
| |
|
32 |
|
| |
|
33 |
|
| |
|
34 |
The __getnetbyname()__ function returns a ''netent'' |
| |
|
35 |
structure for the line from ''/etc/networks'' that |
| |
|
36 |
matches the network ''name''. |
| |
|
37 |
|
| |
|
38 |
|
| |
|
39 |
The __getnetbyaddr()__ function returns a ''netent'' |
| |
|
40 |
structure for the line that matches the network number |
| |
|
41 |
''net'' of type ''type''. |
| |
|
42 |
|
| |
|
43 |
|
| |
|
44 |
The __setnetent()__ function opens and rewinds the |
| |
|
45 |
''/etc/networks'' file. If ''stayopen'' is true (1), |
| |
|
46 |
then the file will not be closed between calls to |
| |
|
47 |
__getnetbyname()__ and |
| |
|
48 |
__getnetbyaddr()__. |
| |
|
49 |
|
| |
|
50 |
|
| |
|
51 |
The __endservent()__ function closes |
| |
|
52 |
''/etc/networks''. |
| |
|
53 |
|
| |
|
54 |
|
| |
|
55 |
The ''netent'' structure is defined in |
| |
|
56 |
'''' as follows: |
| |
|
57 |
|
| |
|
58 |
|
| |
|
59 |
struct netent { |
| |
|
60 |
char *n_name; /* official network name */ |
| |
|
61 |
char **n_aliases; /* alias list */ |
| |
|
62 |
int n_addrtype; /* net address type */ |
| |
|
63 |
unsigned long int n_net; /* network number */ |
| |
|
64 |
} |
| |
|
65 |
|
| |
|
66 |
|
| |
|
67 |
The members of the ''netent'' structure are: |
| |
|
68 |
|
| |
|
69 |
|
| |
|
70 |
''n_name'' |
| |
|
71 |
|
| |
|
72 |
|
| |
|
73 |
The official name of the network. |
| |
|
74 |
|
| |
|
75 |
|
| |
|
76 |
''n_aliases'' |
| |
|
77 |
|
| |
|
78 |
|
| |
|
79 |
A zero terminated list of alternative names for the |
| |
|
80 |
network. |
| |
|
81 |
|
| |
|
82 |
|
| |
|
83 |
''n_addrtype'' |
| |
|
84 |
|
| |
|
85 |
|
| |
|
86 |
The type of the network number; always AF_INET. |
| |
|
87 |
|
| |
|
88 |
|
| |
|
89 |
''n_net'' |
| |
|
90 |
|
| |
|
91 |
|
| |
|
92 |
The network number in host byte order. |
| |
|
93 |
!!RETURN VALUE |
| |
|
94 |
|
| |
|
95 |
|
| |
|
96 |
The __getnetent()__, __getnetbyname()__ and |
| |
|
97 |
__getnetbyaddr()__ functions return the ''netent'' |
| |
|
98 |
structure, or a NULL pointer if an error occurs or the end |
| |
|
99 |
of the file is reached. |
| |
|
100 |
!!FILES |
| |
|
101 |
|
| |
|
102 |
|
| |
|
103 |
/etc/networks networks database file |
| |
|
104 |
!!CONFORMING TO |
| |
|
105 |
|
| |
|
106 |
|
| |
|
107 |
BSD 4.3 |
| |
|
108 |
!!SEE ALSO |
| |
|
109 |
|
| |
|
110 |
|
| |
|
111 |
getprotoent(3), getservent(3), |
| |
|
112 |
networks(5) |
| |
|
113 |
RFC 1101 |
| |
|
114 |
---- |