From f5cde2819f76cb3f86ff02a0c422b289ce94a096 Mon Sep 17 00:00:00 2001 From: mlaier Date: Mon, 19 Jun 2006 22:20:45 +0000 Subject: Import interface groups from OpenBSD. This allows to group interfaces in order to - for example - apply firewall rules to a whole group of interfaces. This is required for importing pf from OpenBSD 3.9 Obtained from: OpenBSD (with changes) Discussed on: -net (back in April) --- sys/net/if.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'sys/net/if.h') diff --git a/sys/net/if.h b/sys/net/if.h index f669017..1116d4b 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -356,6 +356,37 @@ struct ifconf32 { #endif /* + * interface groups + */ + +#define IFG_ALL "all" /* group contains all interfaces */ +/* XXX: will we implement this? */ +#define IFG_EGRESS "egress" /* if(s) default route(s) point to */ + +struct ifg_req { + union { + char ifgrqu_group[IFNAMSIZ]; + char ifgrqu_member[IFNAMSIZ]; + } ifgrq_ifgrqu; +#define ifgrq_group ifgrq_ifgrqu.ifgrqu_group +#define ifgrq_member ifgrq_ifgrqu.ifgrqu_member +}; + +/* + * Used to lookup groups for an interface + */ +struct ifgroupreq { + char ifgr_name[IFNAMSIZ]; + u_int ifgr_len; + union { + char ifgru_group[IFNAMSIZ]; + struct ifg_req *ifgru_groups; + } ifgr_ifgru; +#define ifgr_group ifgr_ifgru.ifgru_group +#define ifgr_groups ifgr_ifgru.ifgru_groups +}; + +/* * Structure for SIOC[AGD]LIFADDR */ struct if_laddrreq { -- cgit v1.1