1 GETNETENT(3) BSD Library Functions Manual GETNETENT(3)
4 g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt, g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br, g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be, s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt, e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt - get net‐
7 S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
8 #
\b#i
\bin
\bnc
\bcl
\blu
\bud
\bde
\be <
\b<n
\bne
\bet
\btd
\bdb
\bb.
\b.h
\bh>
\b>
10 _
\bs_
\bt_
\br_
\bu_
\bc_
\bt _
\bn_
\be_
\bt_
\be_
\bn_
\bt _
\b*
11 g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt();
13 _
\bs_
\bt_
\br_
\bu_
\bc_
\bt _
\bn_
\be_
\bt_
\be_
\bn_
\bt _
\b*
14 g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be(_
\bc_
\bh_
\ba_
\br _
\bn_
\ba_
\bm_
\be);
16 _
\bs_
\bt_
\br_
\bu_
\bc_
\bt _
\bn_
\be_
\bt_
\be_
\bn_
\bt _
\b*
17 g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br(_
\bu_
\bn_
\bs_
\bi_
\bg_
\bn_
\be_
\bd _
\bl_
\bo_
\bn_
\bg _
\bn_
\be_
\bt, _
\bi_
\bn_
\bt _
\bt_
\by_
\bp_
\be);
20 s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt(_
\bi_
\bn_
\bt _
\bs_
\bt_
\ba_
\by_
\bo_
\bp_
\be_
\bn);
23 e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt();
25 D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
26 The g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt(), g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be(), and g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br() subroutines each
27 return a pointer to an object with the following structure containing the
28 broken-out fields of a line in the _
\bn_
\be_
\bt_
\bw_
\bo_
\br_
\bk_
\bs database.
31 char *n_name; /* official name of net */
32 char **n_aliases; /* alias list */
33 int n_addrtype; /* net number type */
34 long n_net; /* net number */
37 The members of this structure are:
39 n_name The official name of the network.
41 n_aliases A zero-terminated list of alternate names for the network.
43 n_addrtype The type of the network number returned: AF_INET.
45 n_net The network number. Network numbers are returned in machine
48 If the _
\bs_
\bt_
\ba_
\by_
\bo_
\bp_
\be_
\bn flag on a s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() subroutine is NULL, the _
\bn_
\be_
\bt_
\bw_
\bo_
\br_
\bk_
\bs
49 database is opened. Otherwise, the s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() has the effect of rewind‐
50 ing the _
\bn_
\be_
\bt_
\bw_
\bo_
\br_
\bk_
\bs database. The e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt() subroutine may be called to
51 close the _
\bn_
\be_
\bt_
\bw_
\bo_
\br_
\bk_
\bs database when processing is complete.
53 The g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() subroutine simply reads the next line while
54 g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be() and g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br() search until a matching _
\bn_
\ba_
\bm_
\be or _
\bn_
\be_
\bt
55 number is found (or until EOF is encountered). The _
\bt_
\by_
\bp_
\be _
\bm_
\bu_
\bs_
\bt _
\bb_
\be AF_INET.
56 The g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() subroutine keeps a pointer in the database, allowing suc‐
57 cessive calls to be used to search the entire file.
59 Before a w
\bwh
\bhi
\bil
\ble
\be loop using g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt(), a call to s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() must be made
60 in order to perform initialization; a call to e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt() must be used
61 after the loop. Both g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be() and g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br() make calls to
62 s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt() and e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt().
65 _
\b/_
\be_
\bt_
\bc_
\b/_
\bn_
\be_
\bt_
\bw_
\bo_
\br_
\bk_
\bs
67 D
\bDI
\bIA
\bAG
\bGN
\bNO
\bOS
\bST
\bTI
\bIC
\bCS
\bS
68 Null pointer (0) returned on EOF or error.
70 S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO
71 networks(5), RFC 1101.
73 H
\bHI
\bIS
\bST
\bTO
\bOR
\bRY
\bY
74 The g
\bge
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt(), g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\bya
\bad
\bdd
\bdr
\br(), g
\bge
\bet
\btn
\bne
\bet
\btb
\bby
\byn
\bna
\bam
\bme
\be(), s
\bse
\bet
\btn
\bne
\bet
\bte
\ben
\bnt
\bt(), and
75 e
\ben
\bnd
\bdn
\bne
\bet
\bte
\ben
\bnt
\bt() functions appeared in 4.2BSD.
78 The data space used by these functions is static; if future use requires
79 the data, it should be copied before any subsequent calls to these func‐
80 tions overwrite it. Only Internet network numbers are currently under‐
81 stood. Expecting network numbers to fit in no more than 32 bits is prob‐
84 4th Berkeley Distribution May 20, 1996 4th Berkeley Distribution