annotate src/if.h @ 5557:e65d193a1960 draft

Linux: Support wireless IP roaming This is achieved by checking that the interface is wireless, IFF_UP and IFF_LOWER_UP are present, but IFF_RUNNING is missing. This gives exactly the same support as modern NetBSD when carrier loss is detected, but without the address verifications when the carrier comes back as that needs to be handled in the kernel. While IP setup is maintained, other configuration data is discarded. Note that this should be improved in the future. Thanks to Boris Krasnovskiy <borkra@gmail.com> for helping with this.
author Roy Marples <roy@marples.name>
date Sat, 12 Dec 2020 13:12:26 +0000
parents 6a2da5651841
children f32e37b1d371
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4548
c7df03794de3 Add SPDX identifiers to all dhcpcd source files.
Yegor Yefremov <yegorslists@googlemail.com>
parents: 4511
diff changeset
1 /* SPDX-License-Identifier: BSD-2-Clause */
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
2 /*
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
3 * dhcpcd - DHCP client daemon
4922
555d7d1a4939 Welcome to 2020!
Roy Marples <roy@marples.name>
parents: 4840
diff changeset
4 * Copyright (c) 2006-2020 Roy Marples <roy@marples.name>
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
5 * All rights reserved
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
6
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
7 * Redistribution and use in source and binary forms, with or without
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
8 * modification, are permitted provided that the following conditions
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
9 * are met:
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
10 * 1. Redistributions of source code must retain the above copyright
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
11 * notice, this list of conditions and the following disclaimer.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
15 *
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
26 * SUCH DAMAGE.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
27 */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
28
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
29 #ifndef INTERFACE_H
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
30 #define INTERFACE_H
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
31
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
32 #include <net/if.h>
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
33 #include <net/route.h> /* for RTM_ADD et all */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
34 #include <netinet/in.h>
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
35 #ifdef BSD
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
36 #include <netinet/in_var.h> /* for IN_IFF_TENTATIVE et all */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
37 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
38
4189
0b088d803b61 dhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples <roy@marples.name>
parents: 4076
diff changeset
39 #include <ifaddrs.h>
0b088d803b61 dhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples <roy@marples.name>
parents: 4076
diff changeset
40
5376
66bbeeebbe92 dhcpcd: Add an option to poll the interface carrier state
Roy Marples <roy@marples.name>
parents: 5310
diff changeset
41 /* If the interface does not support carrier status (ie PPP),
66bbeeebbe92 dhcpcd: Add an option to poll the interface carrier state
Roy Marples <roy@marples.name>
parents: 5310
diff changeset
42 * dhcpcd can poll it for the relevant flags periodically */
66bbeeebbe92 dhcpcd: Add an option to poll the interface carrier state
Roy Marples <roy@marples.name>
parents: 5310
diff changeset
43 #define IF_POLL_UP 100 /* milliseconds */
66bbeeebbe92 dhcpcd: Add an option to poll the interface carrier state
Roy Marples <roy@marples.name>
parents: 5310
diff changeset
44
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
45 /* Some systems have in-built IPv4 DAD.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
46 * However, we need them to do DAD at carrier up as well. */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
47 #ifdef IN_IFF_TENTATIVE
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
48 # ifdef __NetBSD__
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
49 # define NOCARRIER_PRESERVE_IP
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
50 # endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
51 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
52
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
53 /*
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
54 * Systems which handle 1 address per alias.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
55 * Currenly this is just Solaris.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
56 * While Linux can do aliased addresses, it is only useful for their
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
57 * legacy ifconfig(8) tool which cannot display >1 IPv4 address
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
58 * (it can display many IPv6 addresses which makes the limitation odd).
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
59 * Linux has ip(8) which is a more feature rich tool, without the above
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
60 * restriction.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
61 */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
62 #ifndef ALIAS_ADDR
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
63 # ifdef __sun
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
64 # define ALIAS_ADDR
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
65 # endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
66 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
67
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
68 #include "config.h"
4948
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
69
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
70 /* POSIX defines ioctl request as an int, which Solaris and musl use.
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
71 * Everyone else use an unsigned long, which happens to be the bigger one
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
72 * so we use that in our on wire API. */
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
73 #ifdef IOCTL_REQUEST_TYPE
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
74 typedef IOCTL_REQUEST_TYPE ioctl_request_t;
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
75 #else
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
76 typedef unsigned long ioctl_request_t;
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
77 #endif
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
78
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
79 #include "dhcpcd.h"
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
80 #include "ipv4.h"
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
81 #include "ipv6.h"
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
82 #include "route.h"
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
83
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
84 #define EUI64_ADDR_LEN 8
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
85 #define INFINIBAND_ADDR_LEN 20
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
86
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
87 /* Linux 2.4 doesn't define this */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
88 #ifndef ARPHRD_IEEE1394
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
89 # define ARPHRD_IEEE1394 24
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
90 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
91
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
92 /* The BSD's don't define this yet */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
93 #ifndef ARPHRD_INFINIBAND
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
94 # define ARPHRD_INFINIBAND 32
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
95 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
96
5028
c06163d3bc14 DHCP: Support jumbo frames
Roy Marples <roy@marples.name>
parents: 4958
diff changeset
97 /* Maximum frame length.
c06163d3bc14 DHCP: Support jumbo frames
Roy Marples <roy@marples.name>
parents: 4958
diff changeset
98 * Support jumbo frames and some extra. */
5029
f979cefdddcf ARP: Recalculate ARP buffer taking into account max frame length
Roy Marples <roy@marples.name>
parents: 5028
diff changeset
99 #define FRAMEHDRLEN_MAX 14 /* only ethernet support */
f979cefdddcf ARP: Recalculate ARP buffer taking into account max frame length
Roy Marples <roy@marples.name>
parents: 5028
diff changeset
100 #define FRAMELEN_MAX (FRAMEHDRLEN_MAX + 9216)
5028
c06163d3bc14 DHCP: Support jumbo frames
Roy Marples <roy@marples.name>
parents: 4958
diff changeset
101
5207
84b63f09c8a4 privsep: Handle all file IO in the Priviledged Actioneer
Roy Marples <roy@marples.name>
parents: 5204
diff changeset
102 #define UDPLEN_MAX 64 * 1024
84b63f09c8a4 privsep: Handle all file IO in the Priviledged Actioneer
Roy Marples <roy@marples.name>
parents: 5204
diff changeset
103
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
104 /* Work out if we have a private address or not
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
105 * 10/8
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
106 * 172.16/12
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
107 * 192.168/16
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
108 */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
109 #ifndef IN_PRIVATE
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
110 # define IN_PRIVATE(addr) (((addr & IN_CLASSA_NET) == 0x0a000000) || \
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
111 ((addr & 0xfff00000) == 0xac100000) || \
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
112 ((addr & IN_CLASSB_NET) == 0xc0a80000))
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
113 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
114
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
115 #ifndef CLLADDR
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
116 #ifdef AF_LINK
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
117 # define CLLADDR(sdl) (const void *)((sdl)->sdl_data + (sdl)->sdl_nlen)
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
118 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
119 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
120
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
121 #ifdef __sun
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
122 /* Solaris stupidly defines this for compat with BSD
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
123 * but then ignores it. */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
124 #undef RTF_CLONING
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
125
5279
cab28576ec7e Solaris: IP_RECVIF is busted on DilOS at least
Roy Marples <roy@marples.name>
parents: 5231
diff changeset
126 /* This interface is busted on DilOS at least.
cab28576ec7e Solaris: IP_RECVIF is busted on DilOS at least
Roy Marples <roy@marples.name>
parents: 5231
diff changeset
127 * It used to work, but lukily Solaris can fall back to
cab28576ec7e Solaris: IP_RECVIF is busted on DilOS at least
Roy Marples <roy@marples.name>
parents: 5231
diff changeset
128 * IP_PKTINFO. */
cab28576ec7e Solaris: IP_RECVIF is busted on DilOS at least
Roy Marples <roy@marples.name>
parents: 5231
diff changeset
129 #undef IP_RECVIF
cab28576ec7e Solaris: IP_RECVIF is busted on DilOS at least
Roy Marples <roy@marples.name>
parents: 5231
diff changeset
130
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
131 /* Solaris getifaddrs is very un-suitable for dhcpcd.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
132 * See if-sun.c for details why. */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
133 struct ifaddrs;
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
134 int if_getifaddrs(struct ifaddrs **);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
135 #define getifaddrs if_getifaddrs
4692
4a8c51be0604 Solaris: Get the subnet in ipv6 ifa handler
Roy Marples <roy@marples.name>
parents: 4605
diff changeset
136 int if_getsubnet(struct dhcpcd_ctx *, const char *, int, void *, size_t);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
137 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
138
4948
b664b38faf10 ioctl: The POSIX signature differs from BSD and glibc
Roy Marples <roy@marples.name>
parents: 4922
diff changeset
139 int if_ioctl(struct dhcpcd_ctx *, ioctl_request_t, void *, size_t);
5204
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
140 #ifdef HAVE_PLEDGE
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
141 #define pioctl(ctx, req, data, len) if_ioctl((ctx), (req), (data), (len))
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
142 #else
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
143 #define pioctl(ctx, req, data, len) ioctl((ctx)->pf_inet_fd, (req),(data),(len))
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
144 #endif
4958
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
145 int if_getflags(struct interface *);
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
146 int if_setflag(struct interface *, short, short);
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
147 #define if_up(ifp) if_setflag((ifp), (IFF_UP | IFF_RUNNING), 0)
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
148 #define if_down(ifp) if_setflag((ifp), 0, IFF_UP);
5499
6a2da5651841 dhcpcd: Simplify the link handling even more
Roy Marples <roy@marples.name>
parents: 5486
diff changeset
149 bool if_is_link_up(const struct interface *);
4076
9433864aa014 Hardware Address validation
Roy Marples <roy@marples.name>
parents: 4052
diff changeset
150 bool if_valid_hwaddr(const uint8_t *, size_t);
4189
0b088d803b61 dhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples <roy@marples.name>
parents: 4076
diff changeset
151 struct if_head *if_discover(struct dhcpcd_ctx *, struct ifaddrs **,
0b088d803b61 dhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples <roy@marples.name>
parents: 4076
diff changeset
152 int, char * const *);
4235
27bad70c0d9c link: detect buffer overflow / desync and relearn interface state
Roy Marples <roy@marples.name>
parents: 4218
diff changeset
153 void if_markaddrsstale(struct if_head *);
4189
0b088d803b61 dhcp6: don't listen on IPv6 addresses when not using DHCP6
Roy Marples <roy@marples.name>
parents: 4076
diff changeset
154 void if_learnaddrs(struct dhcpcd_ctx *, struct if_head *, struct ifaddrs **);
4235
27bad70c0d9c link: detect buffer overflow / desync and relearn interface state
Roy Marples <roy@marples.name>
parents: 4218
diff changeset
155 void if_deletestaleaddrs(struct if_head *);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
156 struct interface *if_find(struct if_head *, const char *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
157 struct interface *if_findindex(struct if_head *, unsigned int);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
158 struct interface *if_loopback(struct dhcpcd_ctx *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
159 void if_free(struct interface *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
160 int if_domtu(const struct interface *, short int);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
161 #define if_getmtu(ifp) if_domtu((ifp), 0)
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
162 #define if_setmtu(ifp, mtu) if_domtu((ifp), (mtu))
5486
8e2b8ce8c972 BSD: struct if_data->ifi_link_state is the single source of truth
Roy Marples <roy@marples.name>
parents: 5475
diff changeset
163 int if_carrier(struct interface *, const void *);
5557
e65d193a1960 Linux: Support wireless IP roaming
Roy Marples <roy@marples.name>
parents: 5499
diff changeset
164 bool if_roaming(struct interface *);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
165
4439
5ed513825ce5 if: Add a generic function to create an aliased address name
Roy Marples <roy@marples.name>
parents: 4433
diff changeset
166 #ifdef ALIAS_ADDR
5ed513825ce5 if: Add a generic function to create an aliased address name
Roy Marples <roy@marples.name>
parents: 4433
diff changeset
167 int if_makealias(char *, size_t, const char *, int);
5ed513825ce5 if: Add a generic function to create an aliased address name
Roy Marples <roy@marples.name>
parents: 4433
diff changeset
168 #endif
5ed513825ce5 if: Add a generic function to create an aliased address name
Roy Marples <roy@marples.name>
parents: 4433
diff changeset
169
4433
4262dbc903e8 sun: Fix carrier detection, MTU detection and plumbing
Roy Marples <roy@marples.name>
parents: 4374
diff changeset
170 int if_mtu_os(const struct interface *);
4262dbc903e8 sun: Fix carrier detection, MTU detection and plumbing
Roy Marples <roy@marples.name>
parents: 4374
diff changeset
171
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
172 /*
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
173 * Helper to decode an interface name of bge0:1 to
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
174 * devname = bge0, drvname = bge0, ppa = 0, lun = 1.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
175 * If ppa or lun are invalid they are set to -1.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
176 */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
177 struct if_spec {
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
178 char ifname[IF_NAMESIZE];
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
179 char devname[IF_NAMESIZE];
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
180 char drvname[IF_NAMESIZE];
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
181 int ppa;
5071
e09697275eda if: Decode vlid from the interface name
Roy Marples <roy@marples.name>
parents: 5057
diff changeset
182 int vlid;
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
183 int lun;
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
184 };
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
185 int if_nametospec(const char *, struct if_spec *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
186
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
187 /* The below functions are provided by if-KERNEL.c */
5458
dd8347a0ea1c Adjust prior so that message is logged before starting dev
Roy Marples <roy@marples.name>
parents: 5457
diff changeset
188 int os_init(void);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
189 int if_conf(struct interface *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
190 int if_init(struct interface *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
191 int if_getssid(struct interface *);
5310
0a6bde63868b privsep: Remove pledges inet and dns from the master process
Roy Marples <roy@marples.name>
parents: 5282
diff changeset
192 int if_ignoregroup(int, const char *);
4748
4cfd9d38741f BSD: Ignore interface groups as we would the interface name
Roy Marples <roy@marples.name>
parents: 4747
diff changeset
193 bool if_ignore(struct dhcpcd_ctx *, const char *);
5204
47f18579daae privsep: Implement pledge(2) support as found on OpenBSD
Roy Marples <roy@marples.name>
parents: 5153
diff changeset
194 int if_vimaster(struct dhcpcd_ctx *ctx, const char *);
4052
08038b46c0f5 Detect VLANID to use in IAID.
Roy Marples <roy@marples.name>
parents: 3983
diff changeset
195 unsigned short if_vlanid(const struct interface *);
5457
7fb0274b9127 Linux: detect network namespace and deny udev in one
Roy Marples <roy@marples.name>
parents: 5436
diff changeset
196 char * if_getnetworknamespace(char *, size_t);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
197 int if_opensockets(struct dhcpcd_ctx *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
198 int if_opensockets_os(struct dhcpcd_ctx *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
199 void if_closesockets(struct dhcpcd_ctx *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
200 void if_closesockets_os(struct dhcpcd_ctx *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
201 int if_handlelink(struct dhcpcd_ctx *);
4958
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
202 int if_randomisemac(struct interface *);
a120f447fe74 Implement Anonymity Profiles for DHCP Clients, RFC 7844
Roy Marples <roy@marples.name>
parents: 4948
diff changeset
203 int if_setmac(struct interface *ifp, void *, uint8_t);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
204
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
205 /* dhcpcd uses the same routing flags as BSD.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
206 * If the platform doesn't use these flags,
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
207 * map them in the platform interace file. */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
208 #ifndef RTM_ADD
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
209 #define RTM_ADD 0x1 /* Add Route */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
210 #define RTM_DELETE 0x2 /* Delete Route */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
211 #define RTM_CHANGE 0x3 /* Change Metrics or flags */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
212 #define RTM_GET 0x4 /* Report Metrics */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
213 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
214
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
215 /* Define SOCK_CLOEXEC and SOCK_NONBLOCK for systems that lack it.
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
216 * xsocket() in if.c will map them to fctnl FD_CLOEXEC and O_NONBLOCK. */
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
217 #ifdef SOCK_CLOEXEC
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
218 # define HAVE_SOCK_CLOEXEC
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
219 #else
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
220 # define SOCK_CLOEXEC 0x10000000
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
221 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
222 #ifdef SOCK_NONBLOCK
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
223 # define HAVE_SOCK_NONBLOCK
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
224 #else
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
225 # define SOCK_NONBLOCK 0x20000000
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
226 #endif
5231
a2c342295221 privsep: Enable Capsicum for all processes.
Roy Marples <roy@marples.name>
parents: 5207
diff changeset
227 #ifndef SOCK_CXNB
a2c342295221 privsep: Enable Capsicum for all processes.
Roy Marples <roy@marples.name>
parents: 5207
diff changeset
228 #define SOCK_CXNB SOCK_CLOEXEC | SOCK_NONBLOCK
a2c342295221 privsep: Enable Capsicum for all processes.
Roy Marples <roy@marples.name>
parents: 5207
diff changeset
229 #endif
5436
56c934c73aa8 if: introduce xsocketpair, similar to xsocket
Roy Marples <roy@marples.name>
parents: 5376
diff changeset
230 int xsocket(int, int, int);
56c934c73aa8 if: introduce xsocketpair, similar to xsocket
Roy Marples <roy@marples.name>
parents: 5376
diff changeset
231 int xsocketpair(int, int, int, int[2]);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
232
3983
45f0408b6c28 These functions are AF agnostic now.
Roy Marples <roy@marples.name>
parents: 3965
diff changeset
233 int if_route(unsigned char, const struct rt *rt);
4400
2d6a2c8c6b56 route: Remove kroutes and make froutes optional
Roy Marples <roy@marples.name>
parents: 4394
diff changeset
234 int if_initrt(struct dhcpcd_ctx *, rb_tree_t *, int);
3983
45f0408b6c28 These functions are AF agnostic now.
Roy Marples <roy@marples.name>
parents: 3965
diff changeset
235
5057
a5fd2097d40f BSD: Add support for RO_MISSFILTER route(4) socket option
Roy Marples <roy@marples.name>
parents: 5029
diff changeset
236 int if_missfilter(struct interface *, struct sockaddr *);
a5fd2097d40f BSD: Add support for RO_MISSFILTER route(4) socket option
Roy Marples <roy@marples.name>
parents: 5029
diff changeset
237 int if_missfilter_apply(struct dhcpcd_ctx *);
a5fd2097d40f BSD: Add support for RO_MISSFILTER route(4) socket option
Roy Marples <roy@marples.name>
parents: 5029
diff changeset
238
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
239 #ifdef INET
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
240 int if_address(unsigned char, const struct ipv4_addr *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
241 int if_addrflags(const struct interface *, const struct in_addr *,
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
242 const char *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
243
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
244 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
245
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
246 #ifdef INET6
4799
95842881a2ef BSD: Disable kernel RTADV sysctl earlier
Roy Marples <roy@marples.name>
parents: 4748
diff changeset
247 void if_disable_rtadv(void);
4218
f618f850efdc inet6: simplify setup of kernel
Roy Marples <roy@marples.name>
parents: 4197
diff changeset
248 void if_setup_inet6(const struct interface *);
4335
d0519e1f2f5f ip6: Implement IPv6 address sharing
Roy Marples <roy@marples.name>
parents: 4333
diff changeset
249 int ip6_forwarding(const char *ifname);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
250
4840
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
251 struct ra;
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
252 struct ipv6_addr;
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
253
4813
ef33eb73e97d INET6: Apply hoplimit, reachable and retrans timer values from RA.
Roy Marples <roy@marples.name>
parents: 4799
diff changeset
254 int if_applyra(const struct ra *);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
255 int if_address6(unsigned char, const struct ipv6_addr *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
256 int if_addrflags6(const struct interface *, const struct in6_addr *,
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
257 const char *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
258 int if_getlifetime6(struct ipv6_addr *);
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
259
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
260 #else
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
261 #define if_checkipv6(a, b, c) (-1)
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
262 #endif
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
263
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
264 int if_machinearch(char *, size_t);
4374
d67204739087 Fold all CMSG parsing into a common function.
Roy Marples <roy@marples.name>
parents: 4335
diff changeset
265 struct interface *if_findifpfromcmsg(struct dhcpcd_ctx *,
d67204739087 Fold all CMSG parsing into a common function.
Roy Marples <roy@marples.name>
parents: 4335
diff changeset
266 struct msghdr *, int *);
4840
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
267
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
268 #ifdef __linux__
5282
8afafcabcfa5 privsep: Drain the link socket as we can't re-open it.
Roy Marples <roy@marples.name>
parents: 5279
diff changeset
269 int if_linksocket(struct sockaddr_nl *, int, int);
4840
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
270 int if_getnetlink(struct dhcpcd_ctx *, struct iovec *, int, int,
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
271 int (*)(struct dhcpcd_ctx *, void *, struct nlmsghdr *), void *);
3932
e802a4235d75 Move the source files along with dev, crypt and comapt into src dir.
Roy Marples <roy@marples.name>
parents:
diff changeset
272 #endif
4840
073fcd86db9b privsep: Add support for priviledge separation
Roy Marples <roy@marples.name>
parents: 4813
diff changeset
273 #endif