16e63cc1fSRoy Marples /* SPDX-License-Identifier: BSD-2-Clause */ 26e63cc1fSRoy Marples /* 36e63cc1fSRoy Marples * Privilege Separation for dhcpcd 4*80aa9461SRoy Marples * Copyright (c) 2006-2023 Roy Marples <roy@marples.name> 56e63cc1fSRoy Marples * All rights reserved 66e63cc1fSRoy Marples 76e63cc1fSRoy Marples * Redistribution and use in source and binary forms, with or without 86e63cc1fSRoy Marples * modification, are permitted provided that the following conditions 96e63cc1fSRoy Marples * are met: 106e63cc1fSRoy Marples * 1. Redistributions of source code must retain the above copyright 116e63cc1fSRoy Marples * notice, this list of conditions and the following disclaimer. 126e63cc1fSRoy Marples * 2. Redistributions in binary form must reproduce the above copyright 136e63cc1fSRoy Marples * notice, this list of conditions and the following disclaimer in the 146e63cc1fSRoy Marples * documentation and/or other materials provided with the distribution. 156e63cc1fSRoy Marples * 166e63cc1fSRoy Marples * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 176e63cc1fSRoy Marples * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 186e63cc1fSRoy Marples * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 196e63cc1fSRoy Marples * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 206e63cc1fSRoy Marples * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 216e63cc1fSRoy Marples * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 226e63cc1fSRoy Marples * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 236e63cc1fSRoy Marples * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 246e63cc1fSRoy Marples * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 256e63cc1fSRoy Marples * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 266e63cc1fSRoy Marples * SUCH DAMAGE. 276e63cc1fSRoy Marples */ 286e63cc1fSRoy Marples 296e63cc1fSRoy Marples #ifndef PRIVSEP_INET_H 306e63cc1fSRoy Marples #define PRIVSEP_INET_H 316e63cc1fSRoy Marples 3293ddca5eSRoy Marples bool ps_inet_canstart(const struct dhcpcd_ctx *); 336e63cc1fSRoy Marples pid_t ps_inet_start(struct dhcpcd_ctx *); 346e63cc1fSRoy Marples int ps_inet_stop(struct dhcpcd_ctx *); 356e63cc1fSRoy Marples ssize_t ps_inet_cmd(struct dhcpcd_ctx *, struct ps_msghdr *, struct msghdr *); 366e63cc1fSRoy Marples ssize_t ps_inet_dispatch(void *, struct ps_msghdr *, struct msghdr *); 376e63cc1fSRoy Marples 386e63cc1fSRoy Marples #ifdef INET 396e63cc1fSRoy Marples struct ipv4_addr; 406e63cc1fSRoy Marples ssize_t ps_inet_openbootp(struct ipv4_addr *); 416e63cc1fSRoy Marples ssize_t ps_inet_closebootp(struct ipv4_addr *); 42d4fb1e02SRoy Marples ssize_t ps_inet_sendbootp(struct interface *, const struct msghdr *); 436e63cc1fSRoy Marples #endif 446e63cc1fSRoy Marples 456e63cc1fSRoy Marples #ifdef INET6 466e63cc1fSRoy Marples struct ipv6_addr; 476e63cc1fSRoy Marples #ifdef __sun 486e63cc1fSRoy Marples ssize_t ps_inet_opennd(struct interface *); 496e63cc1fSRoy Marples ssize_t ps_inet_closend(struct interface *); 506e63cc1fSRoy Marples #endif 516e63cc1fSRoy Marples ssize_t ps_inet_sendnd(struct interface *, const struct msghdr *); 526e63cc1fSRoy Marples #ifdef DHCP6 536e63cc1fSRoy Marples ssize_t ps_inet_opendhcp6(struct ipv6_addr *); 546e63cc1fSRoy Marples ssize_t ps_inet_closedhcp6(struct ipv6_addr *); 55d4fb1e02SRoy Marples ssize_t ps_inet_senddhcp6(struct interface *, const struct msghdr *); 566e63cc1fSRoy Marples #endif /* DHCP6 */ 576e63cc1fSRoy Marples #endif /* INET6 */ 586e63cc1fSRoy Marples #endif 59