ia64/xen-unstable

view tools/vnet/vnet-module/vif.h @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children 06d84bf87159
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_VIF_H_
20 #define _VNET_VIF_H_
22 #include <if_varp.h>
23 struct net_device;
25 /** Key for entries in the vif table. */
26 typedef struct VifKey {
27 VnetId vnet;
28 Vmac vmac;
29 } VifKey;
31 typedef struct Vif {
32 VnetId vnet;
33 Vmac vmac;
34 struct net_device *dev;
35 atomic_t refcount;
36 } Vif;
38 struct HashTable;
39 extern struct HashTable *vif_table;
41 extern void vif_print(void);
43 extern void vif_decref(Vif *vif);
44 extern void vif_incref(Vif *vif);
46 extern int vif_create(struct VnetId *vnet, Vmac *vmac, Vif **vif);
48 extern int vif_create(VnetId *vnet, Vmac *vmac, Vif **vif);
49 extern int vif_add(struct VnetId *vnet, Vmac *vmac, Vif **vif);
50 extern int vif_lookup(struct VnetId *vnet, Vmac *vmac, Vif **vif);
51 extern int vif_remove(struct VnetId *vnet, Vmac *vmac);
52 extern void vif_purge(void);
54 extern int vif_init(void);
55 extern void vif_exit(void);
57 #endif