debuggers.hg

view tools/vnet/vnet-module/if_etherip.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 /*
2 * Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free software Foundation, Inc.,
16 * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19 #ifndef _VNET_IF_ETHERIP_H_
20 #define _VNET_IF_ETHERIP_H_
22 #ifdef __KERNEL__
23 #include <asm/byteorder.h>
24 #else
25 #define __KERNEL__
26 /* This include may cause a compile warning, which can be ignored.
27 * Can't use <endian.h> because it doesn't define
28 *__LITTLE_ENDIAN_BITFIELD or __BIG_ENDIAN_BITFIELD.
29 */
30 #include <asm/byteorder.h>
31 #undef __KERNEL__
32 #endif
34 #include <if_varp.h>
36 #define CONFIG_ETHERIP_EXT
38 #ifdef CONFIG_ETHERIP_EXT
40 /* Extended header with room for a longer vnet id. */
42 #define ETHERIP_VERSION 4
44 struct etheriphdr {
45 #if defined(__LITTLE_ENDIAN_BITFIELD)
46 __u16 reserved:12,
47 version:4;
48 #elif defined (__BIG_ENDIAN_BITFIELD)
49 __u16 version:4,
50 reserved:12;
51 #else
52 #error "Adjust your <asm/byteorder.h> defines"
53 #endif
54 __u8 vnet[VNETID_SIZE8];
55 } __attribute__ ((packed));
57 #else
59 /* Original header as in Etherip RFC. */
61 #define ETHERIP_VERSION 3
63 struct etheriphdr
64 {
65 #if defined(__LITTLE_ENDIAN_BITFIELD)
66 __u16 reserved:12,
67 version:4;
68 #elif defined (__BIG_ENDIAN_BITFIELD)
69 __u16 version:4,
70 reserved:12;
71 #else
72 #error "Adjust your <asm/byteorder.h> defines"
73 #endif
75 };
76 #endif
79 #ifndef IPPROTO_ETHERIP
80 #define IPPROTO_ETHERIP 97
81 #endif
83 #endif /* ! _VNET_IF_ETHERIP_H_ */