diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-09-10 22:40:37 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-09-10 22:40:37 +0000 |
commit | f4a29f27f10f769aa96175eedfb93b6fd630b886 (patch) | |
tree | b3b087c993b12c693973459773f19474ff79f365 /sys/net/if_trunk.h | |
parent | 57a6ae151f8522fd757545b3431245c991b8c315 (diff) |
update the trunk(4) driver
- add multicast support by passing multicast addresses to the ports.
this is a requirement for carp(4) over trunk(4).
- support the smallest common interface capabilities. ie., this adds
support for VLAN MTUs if all attached ports have this capability.
- add a port_destroy callback to the trunk protocol. this fixes a
potential crash if the master port has been detached while running.
discussed with deraadt@, brad@ and some others.
Diffstat (limited to 'sys/net/if_trunk.h')
-rw-r--r-- | sys/net/if_trunk.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/sys/net/if_trunk.h b/sys/net/if_trunk.h index d41497e5d1e..b67e3533d83 100644 --- a/sys/net/if_trunk.h +++ b/sys/net/if_trunk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.h,v 1.2 2005/05/24 07:51:53 reyk Exp $ */ +/* $OpenBSD: if_trunk.h,v 1.3 2005/09/10 22:40:36 reyk Exp $ */ /* * Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net> @@ -102,6 +102,28 @@ struct trunk_port { #define tp_ifname tp_if->if_xname /* interface name */ #define tp_link_state tp_if->if_link_state /* link state */ +#define tp_capabilities tp_if->if_capabilities /* capabilities */ + +struct trunk_mc { + union { + struct ether_multi *mcu_enm; + } mc_u; + struct sockaddr_storage mc_addr; + + SLIST_ENTRY(trunk_mc) mc_entries; +}; + +#define mc_enm mc_u.mcu_enm + +struct trunk_ifreq { + union { + struct ifreq ifreq; + struct { + char ifr_name[IFNAMSIZ]; + struct sockaddr_storage ifr_ss; + } ifreq_storage; + } ifreq; +}; struct trunk_softc { struct arpcom tr_ac; /* virtual interface */ @@ -115,16 +137,21 @@ struct trunk_softc { SLIST_HEAD(__tplhd, trunk_port) tr_ports; /* list of interfaces */ SLIST_ENTRY(trunk_softc) tr_entries; + SLIST_HEAD(__mclhd, trunk_mc) tr_mc_head; /* multicast addresses */ + /* Trunk protocol callbacks */ int (*tr_detach)(struct trunk_softc *); int (*tr_start)(struct trunk_softc *, struct mbuf *); int (*tr_watchdog)(struct trunk_softc *); int (*tr_input)(struct trunk_softc *, struct trunk_port *, struct ether_header *, struct mbuf *); + int (*tr_port_create)(struct trunk_port *); + void (*tr_port_destroy)(struct trunk_port *); }; -#define tr_ifflags tr_ac.ac_if.if_flags /* interface flags */ -#define tr_ifname tr_ac.ac_if.if_xname /* interface name */ +#define tr_ifflags tr_ac.ac_if.if_flags /* flags */ +#define tr_ifname tr_ac.ac_if.if_xname /* name */ +#define tr_capabilities tr_ac.ac_if.if_capabilities /* capabilities */ void trunk_port_ifdetach(struct ifnet *); int trunk_input(struct ifnet *, struct ether_header *, struct mbuf *); |