diff options
-rw-r--r-- | sys/net/if_vlan_var.h | 17 | ||||
-rw-r--r-- | sys/netinet/if_ether.h | 23 |
2 files changed, 23 insertions, 17 deletions
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h index ef33d4374ee..d93a928406f 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.32 2016/03/03 09:27:51 dlg Exp $ */ +/* $OpenBSD: if_vlan_var.h,v 1.33 2016/03/14 03:48:47 dlg Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -34,21 +34,6 @@ #ifndef _NET_IF_VLAN_VAR_H_ #define _NET_IF_VLAN_VAR_H_ -struct ether_vlan_header { - u_char evl_dhost[ETHER_ADDR_LEN]; - u_char evl_shost[ETHER_ADDR_LEN]; - u_int16_t evl_encap_proto; - u_int16_t evl_tag; - u_int16_t evl_proto; -}; - -#define EVL_VLID_MASK 0x0FFF -#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK) -#define EVL_PRIOFTAG(tag) (((tag) >> EVL_PRIO_BITS) & 7) -#define EVL_ENCAPLEN 4 /* length in octets of encapsulation */ -#define EVL_PRIO_MAX 7 -#define EVL_PRIO_BITS 13 - /* sysctl(3) tags, for compatibility purposes */ #define VLANCTL_PROTO 1 #define VLANCTL_MAX 2 diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h index 2e40a4011cc..fe88c164288 100644 --- a/sys/netinet/if_ether.h +++ b/sys/netinet/if_ether.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.h,v 1.67 2016/03/01 01:48:14 dlg Exp $ */ +/* $OpenBSD: if_ether.h,v 1.68 2016/03/14 03:48:47 dlg Exp $ */ /* $NetBSD: if_ether.h,v 1.22 1996/05/11 13:00:00 mycroft Exp $ */ /* @@ -75,6 +75,27 @@ struct ether_header { u_int16_t ether_type; }; +/* + * VLAN headers. + */ + +struct ether_vlan_header { + u_char evl_dhost[ETHER_ADDR_LEN]; + u_char evl_shost[ETHER_ADDR_LEN]; + u_int16_t evl_encap_proto; + u_int16_t evl_tag; + u_int16_t evl_proto; +}; + +#define EVL_VLID_MASK 0x0FFF +#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK) + +#define EVL_PRIO_MAX 7 +#define EVL_PRIO_BITS 13 +#define EVL_PRIOFTAG(tag) (((tag) >> EVL_PRIO_BITS) & 7) + +#define EVL_ENCAPLEN 4 /* length in octets of encapsulation */ + #include <net/ethertypes.h> #define ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */ |