let ipkg fail when a package file to be installed is not found
[openwrt/staging/wigyori.git] / openwrt / package / wificonf / include / proto / vlan.h
1 /*
2 * 802.1Q VLAN protocol definitions
3 *
4 * Copyright 2005, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 *
12 * $Id$
13 */
14
15 #ifndef _vlan_h_
16 #define _vlan_h_
17
18 /* enable structure packing */
19 #if defined(__GNUC__)
20 #define PACKED __attribute__((packed))
21 #else
22 #pragma pack(1)
23 #define PACKED
24 #endif
25
26 #define VLAN_VID_MASK 0xfff /* low 12 bits are vlan id */
27 #define VLAN_CFI_SHIFT 12 /* canonical format indicator bit */
28 #define VLAN_PRI_SHIFT 13 /* user priority */
29
30 #define VLAN_PRI_MASK 7 /* 3 bits of priority */
31
32 #define VLAN_TAG_LEN 4
33 #define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN)
34
35 struct ethervlan_header {
36 uint8 ether_dhost[ETHER_ADDR_LEN];
37 uint8 ether_shost[ETHER_ADDR_LEN];
38 uint16 vlan_type; /* 0x8100 */
39 uint16 vlan_tag; /* priority, cfi and vid */
40 uint16 ether_type;
41 };
42
43 #define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN)
44
45 #undef PACKED
46 #if !defined(__GNUC__)
47 #pragma pack()
48 #endif
49
50 #endif /* _vlan_h_ */