diff options
author | 2019-04-27 04:46:03 +0000 | |
---|---|---|
committer | 2019-04-27 04:46:03 +0000 | |
commit | c1f77a6b17d5a799d322c329fb30e2aa20f19dc9 (patch) | |
tree | 9adab1e161d09ee5ff15257fdc2e0314825b3326 | |
parent | Fix comment regarding suspected problem when handling large negative integers. (diff) | |
download | wireguard-openbsd-c1f77a6b17d5a799d322c329fb30e2aa20f19dc9.tar.xz wireguard-openbsd-c1f77a6b17d5a799d322c329fb30e2aa20f19dc9.zip |
move the struct ifvlan (the vlan softc) definition into if_vlan.c.
nothing needs to see inside it, so it can move. the next steps are
to rename it to vlan_softc and all the variables to sc to make the
driver move consistent with the rest of the tree.
ok visa@ mpi@
-rw-r--r-- | sys/net/if_vlan.c | 38 | ||||
-rw-r--r-- | sys/net/if_vlan_var.h | 40 |
2 files changed, 38 insertions, 40 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 69108596bf9..46295c51552 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.186 2019/04/22 03:29:40 dlg Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.187 2019/04/27 04:46:03 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -57,6 +57,7 @@ #include <sys/systm.h> #include <sys/rwlock.h> #include <sys/percpu.h> +#include <sys/refcnt.h> #include <net/if.h> #include <net/if_dl.h> @@ -72,6 +73,41 @@ #include <net/bpf.h> #endif +struct vlan_mc_entry { + LIST_ENTRY(vlan_mc_entry) mc_entries; + union { + struct ether_multi *mcu_enm; + } mc_u; +#define mc_enm mc_u.mcu_enm + struct sockaddr_storage mc_addr; +}; + +struct ifvlan { + struct arpcom ifv_ac; /* make this an interface */ + unsigned int ifv_ifidx0; /* parent interface of this vlan */ + int ifv_rxprio; + struct ifv_linkmib { + int ifvm_prio; /* prio to apply on packet leaving if */ + u_int16_t ifvm_proto; /* encapsulation ethertype */ + u_int16_t ifvm_tag; /* tag to apply on packets leaving if */ + u_int16_t ifvm_type; /* non-standard ethertype or 0x8100 */ + } ifv_mib; + LIST_HEAD(__vlan_mchead, vlan_mc_entry) vlan_mc_listhead; + SRPL_ENTRY(ifvlan) ifv_list; + int ifv_flags; + struct refcnt ifv_refcnt; + void *lh_cookie; + void *dh_cookie; + struct ifih *ifv_ifih; +}; + +#define ifv_if ifv_ac.ac_if +#define ifv_tag ifv_mib.ifvm_tag +#define ifv_prio ifv_mib.ifvm_prio +#define ifv_type ifv_mib.ifvm_type +#define IFVF_PROMISC 0x01 /* the parent should be made promisc */ +#define IFVF_LLADDR 0x02 /* don't inherit the parents mac */ + #define TAG_HASH_BITS 5 #define TAG_HASH_SIZE (1 << TAG_HASH_BITS) #define TAG_HASH_MASK (TAG_HASH_SIZE - 1) diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index 4f35cdb996f..57c7e519f86 100644 --- a/sys/net/if_vlan_var.h +++ b/sys/net/if_vlan_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan_var.h,v 1.40 2019/04/19 04:36:12 dlg Exp $ */ +/* $OpenBSD: if_vlan_var.h,v 1.41 2019/04/27 04:46:03 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -47,44 +47,6 @@ struct vlanreq { }; #ifdef _KERNEL -#include <sys/refcnt.h> - -#define mc_enm mc_u.mcu_enm - -struct vlan_mc_entry { - LIST_ENTRY(vlan_mc_entry) mc_entries; - union { - struct ether_multi *mcu_enm; - } mc_u; - struct sockaddr_storage mc_addr; -}; - -struct ifvlan { - struct arpcom ifv_ac; /* make this an interface */ - unsigned int ifv_ifidx0; /* parent interface of this vlan */ - int ifv_rxprio; - struct ifv_linkmib { - int ifvm_prio; /* prio to apply on packet leaving if */ - u_int16_t ifvm_proto; /* encapsulation ethertype */ - u_int16_t ifvm_tag; /* tag to apply on packets leaving if */ - u_int16_t ifvm_type; /* non-standard ethertype or 0x8100 */ - } ifv_mib; - LIST_HEAD(__vlan_mchead, vlan_mc_entry) vlan_mc_listhead; - SRPL_ENTRY(ifvlan) ifv_list; - int ifv_flags; - struct refcnt ifv_refcnt; - void *lh_cookie; - void *dh_cookie; - struct ifih *ifv_ifih; -}; - -#define ifv_if ifv_ac.ac_if -#define ifv_tag ifv_mib.ifvm_tag -#define ifv_prio ifv_mib.ifvm_prio -#define ifv_type ifv_mib.ifvm_type -#define IFVF_PROMISC 0x01 /* the parent should be made promisc */ -#define IFVF_LLADDR 0x02 /* don't inherit the parents mac */ - struct mbuf *vlan_inject(struct mbuf *, uint16_t, uint16_t); #endif /* _KERNEL */ |