1 /* $OpenBSD: if.h,v 1.91 2007/06/25 16:37:58 henning Exp $ */
5 * Copyright (c) 1982, 1986, 1989, 1993
6 * The Regents of the University of California. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * @(#)if.h 8.1 (Berkeley) 6/10/93
35 #ifndef _NET_IF_COMPAT_H_
36 #define _NET_IF_COMPAT_H_
38 #include <sys/queue.h>
44 #define IFG_ALL "all" /* group contains all interfaces */
45 #define IFG_EGRESS "egress" /* if(s) default route(s) point to */
48 char ifg_group
[IFNAMSIZ
];
52 TAILQ_HEAD(, ifg_member
) ifg_members
;
53 TAILQ_ENTRY(ifg_group
) ifg_next
;
57 TAILQ_ENTRY(ifg_member
) ifgm_next
;
58 struct ifnet
*ifgm_ifp
;
62 struct ifg_group
*ifgl_group
;
63 TAILQ_ENTRY(ifg_list
) ifgl_next
;
66 TAILQ_HEAD(ifg_list_head
, ifg_list
);
70 char ifgrqu_group
[IFNAMSIZ
];
71 char ifgrqu_member
[IFNAMSIZ
];
73 #define ifgrq_group ifgrq_ifgrqu.ifgrqu_group
74 #define ifgrq_member ifgrq_ifgrqu.ifgrqu_member
82 * Used to lookup groups for an interface
85 char ifgr_name
[IFNAMSIZ
];
88 char ifgru_group
[IFNAMSIZ
];
89 struct ifg_req
*ifgru_groups
;
90 struct ifg_attrib ifgru_attrib
;
92 #define ifgr_group ifgr_ifgru.ifgru_group
93 #define ifgr_groups ifgr_ifgru.ifgru_groups
94 #define ifgr_attrib ifgr_ifgru.ifgru_attrib
98 void if_init_groups(struct ifnet
*);
99 void if_destroy_groups(struct ifnet
*);
100 struct ifg_list_head
*if_get_groups(struct ifnet
*);
102 struct ifg_group
*if_creategroup(const char *);
103 int if_addgroup(struct ifnet
*, const char *);
104 int if_delgroup(struct ifnet
*, const char *);
105 void if_group_routechange(struct sockaddr
*, struct sockaddr
*);
108 #endif /* !_NET_IF_COMPAT_H_ */