4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _INET_IP_LISTUTILS_H
28 #define _INET_IP_LISTUTILS_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 boolean_t
lists_are_different(const slist_t
*, const slist_t
*);
39 boolean_t
list_has_addr(const slist_t
*, const in6_addr_t
*);
40 void l_intersection(const slist_t
*, const slist_t
*, slist_t
*);
41 void l_difference(const slist_t
*, const slist_t
*, slist_t
*);
42 void l_remove(slist_t
*, const in6_addr_t
*);
43 slist_t
*l_alloc_copy(const slist_t
*);
44 void l_copy(const slist_t
*, slist_t
*);
45 void l_union_in_a(slist_t
*, const slist_t
*, boolean_t
*);
46 void l_intersection_in_a(slist_t
*, const slist_t
*);
47 void l_difference_in_a(slist_t
*, const slist_t
*);
49 void l_free(slist_t
*);
51 #define SLIST_IS_EMPTY(sl) (((sl) == NULL) || ((sl)->sl_numsrc == 0))
52 #define SLIST_CNT(sl) (((sl) == NULL) ? 0 : ((sl)->sl_numsrc))
53 #define CLEAR_SLIST(sl) if ((sl) != NULL) (sl)->sl_numsrc = 0
54 #define FREE_SLIST(sl) if ((sl) != NULL) l_free((sl))
55 #define COPY_SLIST(sl, newsl) \
56 if ((newsl) == NULL) \
57 (newsl) = l_alloc_copy((sl)); \
67 #endif /* _INET_IP_LISTUTILS_H */