diff options
Diffstat (limited to 'src/lib/libc/net/getifaddrs.3')
-rw-r--r-- | src/lib/libc/net/getifaddrs.3 | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/src/lib/libc/net/getifaddrs.3 b/src/lib/libc/net/getifaddrs.3 deleted file mode 100644 index 8ea08fa3da..0000000000 --- a/src/lib/libc/net/getifaddrs.3 +++ /dev/null | |||
@@ -1,157 +0,0 @@ | |||
1 | .\" $OpenBSD: getifaddrs.3,v 1.23 2022/03/29 18:15:52 naddy Exp $ | ||
2 | .\" BSDI getifaddrs.3,v 2.5 2000/02/23 14:51:59 dab Exp | ||
3 | .\" | ||
4 | .\" Copyright (c) 1995, 1999 | ||
5 | .\" Berkeley Software Design, Inc. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" 1. Redistributions of source code must retain the above copyright | ||
11 | .\" notice, this list of conditions and the following disclaimer. | ||
12 | .\" | ||
13 | .\" THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND | ||
14 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
15 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
16 | .\" ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE | ||
17 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
18 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
19 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
20 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
21 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
22 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
23 | .\" SUCH DAMAGE. | ||
24 | .Dd $Mdocdate: March 29 2022 $ | ||
25 | .Dt GETIFADDRS 3 | ||
26 | .Os | ||
27 | .Sh NAME | ||
28 | .Nm getifaddrs , | ||
29 | .Nm freeifaddrs | ||
30 | .Nd get interface addresses | ||
31 | .Sh SYNOPSIS | ||
32 | .In sys/types.h | ||
33 | .In sys/socket.h | ||
34 | .In ifaddrs.h | ||
35 | .Ft int | ||
36 | .Fn getifaddrs "struct ifaddrs **ifap" | ||
37 | .Ft void | ||
38 | .Fn freeifaddrs "struct ifaddrs *ifap" | ||
39 | .Sh DESCRIPTION | ||
40 | The | ||
41 | .Fn getifaddrs | ||
42 | function stores a reference to a linked list of the network interfaces | ||
43 | on the local machine in the memory referenced by | ||
44 | .Fa ifap . | ||
45 | The list consists of | ||
46 | .Vt ifaddrs | ||
47 | structures, as defined in the include file | ||
48 | .In ifaddrs.h . | ||
49 | The | ||
50 | .Vt ifaddrs | ||
51 | structure contains at least the following entries: | ||
52 | .Bd -literal | ||
53 | struct ifaddrs *ifa_next; /* Pointer to next struct */ | ||
54 | char *ifa_name; /* Interface name */ | ||
55 | u_int ifa_flags; /* Interface flags */ | ||
56 | struct sockaddr *ifa_addr; /* Interface address */ | ||
57 | struct sockaddr *ifa_netmask; /* Interface netmask */ | ||
58 | struct sockaddr *ifa_broadaddr; /* Interface broadcast address */ | ||
59 | struct sockaddr *ifa_dstaddr; /* P2P interface destination */ | ||
60 | void *ifa_data; /* Address specific data */ | ||
61 | .Ed | ||
62 | .Bl -tag -width ifa_broadaddr | ||
63 | .It Fa ifa_next | ||
64 | Contains a pointer to the next structure on the list. | ||
65 | This field is set to | ||
66 | .Dv NULL | ||
67 | in the last structure on the list. | ||
68 | .It Fa ifa_name | ||
69 | Contains the interface name. | ||
70 | .It Fa ifa_flags | ||
71 | Contains the interface flags, as set by | ||
72 | .Xr ifconfig 8 . | ||
73 | .It Fa ifa_addr | ||
74 | References either the address of the interface or the link level | ||
75 | address of the interface, if one exists, otherwise it is | ||
76 | .Dv NULL . | ||
77 | (The | ||
78 | .Fa sa_family | ||
79 | field of the | ||
80 | .Fa ifa_addr | ||
81 | field should be consulted to determine the format of the | ||
82 | .Fa ifa_addr | ||
83 | address.) | ||
84 | .It Fa ifa_netmask | ||
85 | References the netmask associated with | ||
86 | .Fa ifa_addr , | ||
87 | if one is set, otherwise it is | ||
88 | .Dv NULL . | ||
89 | .It Fa ifa_broadaddr | ||
90 | This field, which should only be referenced for non-P2P interfaces, | ||
91 | references the broadcast address associated with | ||
92 | .Fa ifa_addr , | ||
93 | if one exists, otherwise it is | ||
94 | .Dv NULL . | ||
95 | .It Fa ifa_dstaddr | ||
96 | This field, which should only be referenced for P2P interfaces, | ||
97 | references the destination address on a P2P interface, | ||
98 | if one exists, otherwise it is | ||
99 | .Dv NULL . | ||
100 | .It Fa ifa_data | ||
101 | References address family specific data. | ||
102 | For | ||
103 | .Dv AF_LINK | ||
104 | addresses it contains a pointer to the | ||
105 | .Vt struct if_data | ||
106 | (as defined in include file | ||
107 | .In net/if.h ) | ||
108 | which contains various interface attributes and statistics. | ||
109 | For all other address families, | ||
110 | .Fa ifa_data | ||
111 | is | ||
112 | .Dv NULL . | ||
113 | .El | ||
114 | .Pp | ||
115 | The data returned by | ||
116 | .Fn getifaddrs | ||
117 | is dynamically allocated and should be freed using | ||
118 | .Fn freeifaddrs | ||
119 | when no longer needed. | ||
120 | .Sh RETURN VALUES | ||
121 | .Rv -std | ||
122 | .Sh ERRORS | ||
123 | The | ||
124 | .Fn getifaddrs | ||
125 | function may fail and set | ||
126 | .Va errno | ||
127 | for any of the errors specified for the library routines | ||
128 | .Xr ioctl 2 , | ||
129 | .Xr socket 2 , | ||
130 | .Xr malloc 3 , | ||
131 | or | ||
132 | .Xr sysctl 2 . | ||
133 | .Sh SEE ALSO | ||
134 | .Xr ioctl 2 , | ||
135 | .Xr socket 2 , | ||
136 | .Xr sysctl 2 , | ||
137 | .Xr netintro 4 , | ||
138 | .Xr ifconfig 8 | ||
139 | .Sh HISTORY | ||
140 | The | ||
141 | .Fn getifaddrs | ||
142 | function first appeared in BSDI | ||
143 | .Bsx . | ||
144 | The function has been available on | ||
145 | .Ox | ||
146 | since | ||
147 | .Ox 2.7 . | ||
148 | .Sh BUGS | ||
149 | If both | ||
150 | .In net/if.h | ||
151 | and | ||
152 | .In ifaddrs.h | ||
153 | are being included, | ||
154 | .In net/if.h | ||
155 | .Em must | ||
156 | be included before | ||
157 | .In ifaddrs.h . | ||