diff options
author | aaron <> | 1999-07-03 18:41:51 +0000 |
---|---|---|
committer | aaron <> | 1999-07-03 18:41:51 +0000 |
commit | 305791ed8da9263e685988dfbe9b3b634fc1b558 (patch) | |
tree | 08db384fb8db5c16f45877dab01a9d6c641c471b | |
parent | 1ec483f7b70c12504c270c610cb3db3d4d8431ff (diff) | |
download | openbsd-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.3 | 64 |
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 | ||
12 | The | ||
13 | .Fn net_addrcmp | ||
14 | function compares two socket address structures, | ||
15 | .Fa sa1 | ||
16 | and | ||
17 | .Fa sa2 . | ||
18 | .Sh RETURN VALUES | ||
19 | If | ||
20 | .Fa sa1 | ||
21 | and | ||
22 | .Fa sa2 | ||
23 | are for the same address, | ||
24 | .Fn net_addrcmp | ||
25 | returns 0. | ||
26 | .Pp | ||
27 | The | ||
28 | .Fa sa_len | ||
29 | fields are compared first. If they do not match, | ||
30 | .Fn net_addrcmp | ||
31 | returns \-1 or 1 if | ||
32 | .Li sa1->sa_len | ||
33 | is less than or greater than | ||
34 | .Li sa2->sa_len , | ||
35 | respectively. | ||
36 | .Pp | ||
37 | Next, the | ||
38 | .Fa sa_family | ||
39 | members are compared. If they do not match, | ||
40 | .Fn net_addrcmp | ||
41 | returns \-1 or 1 if | ||
42 | .Li sa1->sa_family | ||
43 | is less than or greater than | ||
44 | .Li sa2->sa_family , | ||
45 | respectively. | ||
46 | .Pp | ||
47 | Lastly, if each socket address structure's | ||
48 | .Fa sa_len | ||
49 | and | ||
50 | .Fa sa_family | ||
51 | fields match, | ||
52 | the protocol-specific data (the | ||
53 | .Fa sa_data | ||
54 | field) is compared. If there's a match, both | ||
55 | .Fa sa1 | ||
56 | and | ||
57 | .Fa sa2 | ||
58 | must refer to the same address, and 0 is returned; otherwise, a value >0 | ||
59 | or <0 is returned. | ||
60 | .Sh HISTORY | ||
61 | A | ||
62 | .Fn net_addrcmp | ||
63 | function was added in | ||
64 | .Ox 2.5 . | ||