diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:27:09 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-12-11 01:27:09 +0000 |
commit | 302f0ccd13b4435e574859c6defc8365e08001a2 (patch) | |
tree | 43ccc10d8d97e30fff216dfa51d12d82a8d6dbc7 /sys/netinet | |
parent | da1793edea7ce7c98ea343a907e74f8c919b3359 (diff) |
split ether_output into resolution, encapsulation, and output functions
if if_output can be overridden on ethernet interfaces, it will allow
things like vlan to do it's packet encapsulation during output
before putting the packet directly on the underlying interface for
output.
this has two benefits. first, it can avoid having ether_output on
pseudo interfaces recurse, which makes profiling of the network
stack a lot clearer. secondly, and more importantly, it allows
pseudo ethernet interface packet encapsulation to by run concurrently
by the stack, rather than having packets unnecessarily serialied
by an ifq.
this diff just splits ether_output up, it doesnt have any interface
take advantage of it yet.
tweaks and ok claudio@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index fdff5c8c1cf..441d2696176 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.h,v 1.73 2016/11/29 10:09:57 reyk Exp $ */ +/* $OpenBSD: if_ether.h,v 1.74 2018/12/11 01:27:08 dlg Exp $ */ /* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */ /* @@ -240,8 +240,13 @@ void ether_ifattach(struct ifnet *); void ether_ifdetach(struct ifnet *); int ether_ioctl(struct ifnet *, struct arpcom *, u_long, caddr_t); int ether_input(struct ifnet *, struct mbuf *, void *); -int ether_output(struct ifnet *, - struct mbuf *, struct sockaddr *, struct rtentry *); +int ether_resolve(struct ifnet *, struct mbuf *, struct sockaddr *, + struct rtentry *, struct ether_header *); +struct mbuf * + ether_encap(struct ifnet *, struct mbuf *, struct sockaddr *, + struct rtentry *, int *); +int ether_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct rtentry *); void ether_rtrequest(struct ifnet *, int, struct rtentry *); char *ether_sprintf(u_char *); |