xref: /dflybsd-src/contrib/dhcpcd/src/privsep-bpf.h (revision c80c9bba1b2fa2824af94c686145cb7eb7db2cd5)
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_BPF_H
306e63cc1fSRoy Marples #define PRIVSEP_BPF_H
316e63cc1fSRoy Marples 
326e63cc1fSRoy Marples ssize_t ps_bpf_cmd(struct dhcpcd_ctx *,
336e63cc1fSRoy Marples     struct ps_msghdr *, struct msghdr *);
346e63cc1fSRoy Marples ssize_t ps_bpf_dispatch(struct dhcpcd_ctx *,
356e63cc1fSRoy Marples     struct ps_msghdr *, struct msghdr *);
366e63cc1fSRoy Marples 
376e63cc1fSRoy Marples #ifdef ARP
38d4fb1e02SRoy Marples ssize_t ps_bpf_openarp(const struct interface *, const struct in_addr *);
39d4fb1e02SRoy Marples ssize_t ps_bpf_closearp(const struct interface *, const struct in_addr *);
40d4fb1e02SRoy Marples ssize_t ps_bpf_sendarp(const struct interface *, const struct in_addr *,
41d4fb1e02SRoy Marples     const void *, size_t);
426e63cc1fSRoy Marples #endif
436e63cc1fSRoy Marples 
446e63cc1fSRoy Marples ssize_t ps_bpf_openbootp(const struct interface *);
456e63cc1fSRoy Marples ssize_t ps_bpf_closebootp(const struct interface *);
466e63cc1fSRoy Marples ssize_t ps_bpf_sendbootp(const struct interface *, const void *, size_t);
476e63cc1fSRoy Marples ssize_t ps_bpf_openbootpudp(const struct interface *);
486e63cc1fSRoy Marples ssize_t ps_bpf_closebootpudp(const struct interface *);
496e63cc1fSRoy Marples ssize_t ps_bpf_sendbootpudp(const struct interface *, const void *, size_t);
506e63cc1fSRoy Marples #endif
51