summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraaron <>1999-07-03 18:41:51 +0000
committeraaron <>1999-07-03 18:41:51 +0000
commit305791ed8da9263e685988dfbe9b3b634fc1b558 (patch)
tree08db384fb8db5c16f45877dab01a9d6c641c471b
parent1ec483f7b70c12504c270c610cb3db3d4d8431ff (diff)
downloadopenbsd-305791ed8da9263e685988dfbe9b3b634fc1b558.tar.gz
openbsd-305791ed8da9263e685988dfbe9b3b634fc1b558.tar.bz2
openbsd-305791ed8da9263e685988dfbe9b3b634fc1b558.zip
man page for net_addrcmp(3)
-rw-r--r--src/lib/libc/net/net_addrcmp.364
1 files changed, 64 insertions, 0 deletions
diff --git a/src/lib/libc/net/net_addrcmp.3 b/src/lib/libc/net/net_addrcmp.3
new file mode 100644
index 0000000000..c29624dc87
--- /dev/null
+++ b/src/lib/libc/net/net_addrcmp.3
@@ -0,0 +1,64 @@
1.Dd July 3, 1999
2.Dt NET_ADDRCMP 3
3.Os
4.Sh NAME
5.Nm net_addrcmp
6.Nd compare socket address structures
7.Sh SYNOPSIS
8.Fd #include <netdb.h>
9.Ft int
10.Fn net_addrcmp "struct sockaddr *sa1" "struct sockaddr *sa2"
11.Sh DESCRIPTION
12The
13.Fn net_addrcmp
14function compares two socket address structures,
15.Fa sa1
16and
17.Fa sa2 .
18.Sh RETURN VALUES
19If
20.Fa sa1
21and
22.Fa sa2
23are for the same address,
24.Fn net_addrcmp
25returns 0.
26.Pp
27The
28.Fa sa_len
29fields are compared first. If they do not match,
30.Fn net_addrcmp
31returns \-1 or 1 if
32.Li sa1->sa_len
33is less than or greater than
34.Li sa2->sa_len ,
35respectively.
36.Pp
37Next, the
38.Fa sa_family
39members are compared. If they do not match,
40.Fn net_addrcmp
41returns \-1 or 1 if
42.Li sa1->sa_family
43is less than or greater than
44.Li sa2->sa_family ,
45respectively.
46.Pp
47Lastly, if each socket address structure's
48.Fa sa_len
49and
50.Fa sa_family
51fields match,
52the protocol-specific data (the
53.Fa sa_data
54field) is compared. If there's a match, both
55.Fa sa1
56and
57.Fa sa2
58must refer to the same address, and 0 is returned; otherwise, a value >0
59or <0 is returned.
60.Sh HISTORY
61A
62.Fn net_addrcmp
63function was added in
64.Ox 2.5 .