diff options
author | Philipp Buehler <pb@cvs.openbsd.org> | 2004-06-25 18:24:24 +0000 |
---|---|---|
committer | Philipp Buehler <pb@cvs.openbsd.org> | 2004-06-25 18:24:24 +0000 |
commit | 1fef12e248eccc18fb9e2bc42a25274a6a608ca4 (patch) | |
tree | bd7cafab3b77f5a7f0ee17a0365cc604c676b9af /sys/net/if.h | |
parent | e7a05a23ee68d06836bb6b72fdca8a3512cae3d0 (diff) |
introduce "interface groups"
by "ifconfig fxp0 group foobar" "ifconfig xl0 group foobar"
these two interfaces are in one group.
Every interface has its if-family as default group.
idea/design from henning@, based on some work/disucssion from Joris Vink.
henning@, mcbride@ ok.
Diffstat (limited to 'sys/net/if.h')
-rw-r--r-- | sys/net/if.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sys/net/if.h b/sys/net/if.h index f67484436c2..ebcf9625a51 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.54 2004/06/20 00:38:21 beck Exp $ */ +/* $OpenBSD: if.h,v 1.55 2004/06/25 18:24:23 pb Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -174,6 +174,7 @@ struct ifnet { /* and the entries */ void *if_softc; /* lower-level data for this if */ TAILQ_ENTRY(ifnet) if_list; /* all struct ifnets are chained */ TAILQ_HEAD(, ifaddr) if_addrlist; /* linked list of addresses per if */ + TAILQ_HEAD(, ifgroup) if_groups; /* linked list of groups per if */ struct hook_desc_head *if_addrhooks; /* address change callbacks */ char if_xname[IFNAMSIZ]; /* external name (name + unit) */ int if_pcount; /* number of promiscuous listeners */ @@ -397,6 +398,31 @@ struct if_announcemsghdr { #define IFAN_DEPARTURE 1 /* interface departure */ /* + * The groups on an interface + */ +struct ifgroup { + char if_group[IFNAMSIZ]; + TAILQ_ENTRY(ifgroup) group_list; +}; + +/* + * Used to lookup groups for an interface + */ +struct ifgroupreq { + char if_name[IFNAMSIZ]; + u_int ifg_len; + + union { + char if_group[IFNAMSIZ]; + struct ifgroup *ifg; + } ifg_ifgu; + + TAILQ_ENTRY(ifgroupreq) next_if; +#define ifg_group ifg_ifgu.if_group +#define ifg_groups ifg_ifgu.ifg +}; + +/* * Interface request structure used for socket * ioctl's. All interface ioctl's must have parameter * definitions which begin with ifr_name. The @@ -619,6 +645,9 @@ int ifconf(u_long, caddr_t); void ifinit(void); int ifioctl(struct socket *, u_long, caddr_t, struct proc *); int ifpromisc(struct ifnet *, int); +int if_addgroup(struct ifgroupreq *, struct ifnet *); +int if_delgroup(struct ifgroupreq *, struct ifnet *); +int if_getgroup(caddr_t, struct ifnet *); struct ifnet *ifunit(const char *); struct ifaddr *ifa_ifwithaddr(struct sockaddr *); |