ia64/xen-unstable

view tools/vnet/vnet-module/vnet.h @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 06d84bf87159
children 71b0f00f6344
line source
1 /*
2 * Copyright (C) 2004 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_VNET_H__
20 #define __VNET_VNET_H__
22 #include <asm/atomic.h>
23 #include <linux/skbuff.h>
25 #include <tunnel.h>
26 #include <skb_context.h>
28 struct Vmac;
29 struct Vif;
30 struct net_device;
32 /** Vnet property record. */
33 typedef struct Vnet {
34 /** Reference count. */
35 atomic_t refcount;
36 /** Vnet id. */
37 struct VnetId vnet;
38 /** Security flag. If true the vnet requires ESP. */
39 int security;
40 char device[IFNAMSIZ];
42 struct net_device *dev;
43 struct net_device *bridge;
45 /** Max size of the header. */
46 int header_n;
47 /** Statistics. */
48 struct net_device_stats stats;
49 int recursion;
50 } Vnet;
52 extern void vnet_print(void);
53 extern void Vnet_print(Vnet *info);
55 extern int Vnet_lookup(struct VnetId *vnet, struct Vnet **info);
56 extern int Vnet_add(struct Vnet *info);
57 extern int Vnet_del(struct VnetId *vnet);
58 extern void Vnet_incref(struct Vnet *info);
59 extern void Vnet_decref(struct Vnet *info);
60 extern int Vnet_alloc(struct Vnet **info);
61 extern Vnet *vnet_physical;
63 extern int skb_xmit(struct sk_buff *skb);
64 extern int vnet_skb_send(struct sk_buff *skb, struct VnetId *vnet);
65 extern int vnet_skb_recv(struct sk_buff *skb, struct VnetId *vnet, struct Vmac *vmac);
67 extern int vnet_check_context(struct VnetId *vnet, SkbContext *context, Vnet **vinfo);
69 extern int vnet_tunnel_open(struct VnetId *vnet, struct VarpAddr *addr, Tunnel **tunnel);
70 extern int vnet_tunnel_lookup(struct VnetId *vnet, struct VarpAddr *addr, Tunnel **tunnel);
71 extern int vnet_tunnel_send(struct VnetId *vnet, struct VarpAddr *addr, struct sk_buff *skb);
73 extern int vnet_init(void);
75 extern int vnet_sa_security(u32 spi, int protocol, u32 addr);
76 struct SAState;
77 extern int vnet_sa_create(u32 spi, int protocol, u32 addr, struct SAState **sa);
79 enum {
80 VNET_PHYS = 1,
81 VNET_VIF = 2,
82 };
84 #endif /* !__VNET_VNET_H__ */