File: getnodebyaddr.3

package info (click to toggle)
dnprogs 2.18-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,896 kB
  • ctags: 3,051
  • sloc: ansic: 18,586; cpp: 9,436; makefile: 669; sh: 502; awk: 13
file content (64 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.TH GETNODEBYADDR 3 "July 28, 1998" "DECnet database functions"
.SH NAME
getnodebyaddr \- DECnet node entry retrieval by address

.SH SYNOPSIS
.B #include <netdnet/dn.h>
.br
.B #include <netdnet/dnetdb.h>
.br
.sp
.B struct nodeent *getnodebyaddr (char *addr, short len, const int family)
.sp
.SH DESCRIPTION

.B getnodebyaddr
searches the decnet hosts file for the DECnet node with address equal to
.B addr 
of
.B len
bytes, belonging to protocol family
.B family
(PF_DECnet) and returns node information into the
.B nodeent
structure.
.br
If no entry is found, returns 
.B NULL


.SH EXAMPLE
.nf

#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>

main(void)
{
    struct dn_naddr		binaddr;
    struct nodeent		*dp;

    binaddr->a_len = 2;
    binaddr->a_addr[0] = 0x02;
    binaddr->a_addr[1] = 0x04;

    if ( (dp=getnodebyaddr(binaddr->a_addr,binaddr->len, PF_DECnet)) == NULL)
	   printf("Error, cannot find node entry");
    else
	   printf("Node name is %s",dp->n_name);
}
.fi




.SH SEE ALSO

.BR dnet_htoa (3),
.BR dnet_ntoa (3),
.BR dnet_conn (3),
.BR dnet_addr (3),
.BR getnodebyname (3),
.BR getnodeadd (3),
.BR setnodeent (3)