xref: /freebsd-src/sys/compat/linuxkpi/common/include/net/addrconf.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1095f018eSBjoern A. Zeeb /*-
2095f018eSBjoern A. Zeeb  * SPDX-License-Identifier: BSD-2-Clause
3095f018eSBjoern A. Zeeb  *
4095f018eSBjoern A. Zeeb  * Copyright (c) 2020 The FreeBSD Foundation
5095f018eSBjoern A. Zeeb  *
6095f018eSBjoern A. Zeeb  * This software was developed by Björn Zeeb under sponsorship from
7095f018eSBjoern A. Zeeb  * the FreeBSD Foundation.
8095f018eSBjoern A. Zeeb  *
9095f018eSBjoern A. Zeeb  * Redistribution and use in source and binary forms, with or without
10095f018eSBjoern A. Zeeb  * modification, are permitted provided that the following conditions
11095f018eSBjoern A. Zeeb  * are met:
12095f018eSBjoern A. Zeeb  * 1. Redistributions of source code must retain the above copyright
13095f018eSBjoern A. Zeeb  *    notice, this list of conditions and the following disclaimer.
14095f018eSBjoern A. Zeeb  * 2. Redistributions in binary form must reproduce the above copyright
15095f018eSBjoern A. Zeeb  *    notice, this list of conditions and the following disclaimer in the
16095f018eSBjoern A. Zeeb  *    documentation and/or other materials provided with the distribution.
17095f018eSBjoern A. Zeeb  *
18095f018eSBjoern A. Zeeb  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19095f018eSBjoern A. Zeeb  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20095f018eSBjoern A. Zeeb  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21095f018eSBjoern A. Zeeb  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22095f018eSBjoern A. Zeeb  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23095f018eSBjoern A. Zeeb  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24095f018eSBjoern A. Zeeb  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25095f018eSBjoern A. Zeeb  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26095f018eSBjoern A. Zeeb  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27095f018eSBjoern A. Zeeb  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28095f018eSBjoern A. Zeeb  * SUCH DAMAGE.
29095f018eSBjoern A. Zeeb  */
30095f018eSBjoern A. Zeeb 
31*307f78f3SVladimir Kondratyev #ifndef	_LINUXKPI_NET_ADDRCONF_H
32*307f78f3SVladimir Kondratyev #define	_LINUXKPI_NET_ADDRCONF_H
33095f018eSBjoern A. Zeeb 
34095f018eSBjoern A. Zeeb #include <sys/types.h>
35095f018eSBjoern A. Zeeb #include <netinet/in.h>
36095f018eSBjoern A. Zeeb 
37095f018eSBjoern A. Zeeb static __inline void
addrconf_addr_solict_mult(struct in6_addr * ia6,struct in6_addr * sol)38095f018eSBjoern A. Zeeb addrconf_addr_solict_mult(struct in6_addr *ia6, struct in6_addr *sol)
39095f018eSBjoern A. Zeeb {
40095f018eSBjoern A. Zeeb 
41095f018eSBjoern A. Zeeb 	sol->s6_addr16[0] = IPV6_ADDR_INT16_MLL;
42095f018eSBjoern A. Zeeb 	sol->s6_addr16[1] = 0;
43095f018eSBjoern A. Zeeb 	sol->s6_addr32[1] = 0;
44095f018eSBjoern A. Zeeb 	sol->s6_addr32[2] = IPV6_ADDR_INT32_ONE;
45095f018eSBjoern A. Zeeb 	sol->s6_addr32[3] = ia6->s6_addr32[3];
46095f018eSBjoern A. Zeeb 	sol->s6_addr8[12] = 0xff;
47095f018eSBjoern A. Zeeb }
48095f018eSBjoern A. Zeeb 
49*307f78f3SVladimir Kondratyev #endif	/* _LINUXKPI_NET_ADDRCONF_H */
50