2010-02-15 15:58:13 +00:00
|
|
|
/*
|
2011-05-17 11:26:09 +00:00
|
|
|
* Copyright (C) 2011 Red Hat, Inc.
|
2010-02-15 15:58:13 +00:00
|
|
|
* Copyright (C) 2010 IBM Corporation
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Stefan Berger <stefanb@us.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UTIL_MACVTAP_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __UTIL_MACVTAP_H__
|
2010-02-15 15:58:13 +00:00
|
|
|
|
Split src/util/network.{c,h} into 5 pieces
The src/util/network.c file is a dumping ground for many different
APIs. Split it up into 5 pieces, along functional lines
- src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
- src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
- src/util/virsocketaddr.c: virSocketAddr and APIs
- src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
for virNetDevBandwidth
- src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
for virNetDevVPortProfile
* src/util/network.c, src/util/network.h: Split into 5 pieces
* src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
* daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
src/conf/domain_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/conf/nwfilter_conf.h,
src/esx/esx_util.h, src/network/bridge_driver.c,
src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
src/util/virnetdev.h, src/util/virnetdevtap.c,
tools/virsh.c: Update include files
2011-11-02 15:40:08 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "virsocketaddr.h"
|
|
|
|
# include "virnetdevbandwidth.h"
|
|
|
|
# include "virnetdevvportprofile.h"
|
2010-02-15 15:58:13 +00:00
|
|
|
|
2011-06-20 16:08:41 +00:00
|
|
|
/* the mode type for macvtap devices */
|
Rename Macvtap management APIs
In preparation for code re-organization, rename the Macvtap
management APIs to have the following patterns
virNetDevMacVLanXXXXX - macvlan/macvtap interface management
virNetDevVPortProfileXXXX - virtual port profile management
* src/util/macvtap.c, src/util/macvtap.h: Rename APIs
* src/conf/domain_conf.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_command.h,
src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
src/qemu/qemu_process.h: Update for renamed APIs
2011-11-02 16:51:01 +00:00
|
|
|
enum virNetDevMacVLanMode {
|
|
|
|
VIR_NETDEV_MACVLAN_MODE_VEPA,
|
|
|
|
VIR_NETDEV_MACVLAN_MODE_PRIVATE,
|
|
|
|
VIR_NETDEV_MACVLAN_MODE_BRIDGE,
|
|
|
|
VIR_NETDEV_MACVLAN_MODE_PASSTHRU,
|
2011-06-20 16:08:41 +00:00
|
|
|
|
Rename Macvtap management APIs
In preparation for code re-organization, rename the Macvtap
management APIs to have the following patterns
virNetDevMacVLanXXXXX - macvlan/macvtap interface management
virNetDevVPortProfileXXXX - virtual port profile management
* src/util/macvtap.c, src/util/macvtap.h: Rename APIs
* src/conf/domain_conf.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_command.h,
src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
src/qemu/qemu_process.h: Update for renamed APIs
2011-11-02 16:51:01 +00:00
|
|
|
VIR_NETDEV_MACVLAN_MODE_LAST,
|
2011-06-20 16:08:41 +00:00
|
|
|
};
|
2011-11-02 17:11:02 +00:00
|
|
|
VIR_ENUM_DECL(virNetDevMacVLanMode)
|
2010-12-01 14:43:40 +00:00
|
|
|
|
2011-11-02 17:34:41 +00:00
|
|
|
int virNetDevMacVLanCreate(const char *ifname,
|
|
|
|
const char *type,
|
|
|
|
const unsigned char *macaddress,
|
|
|
|
const char *srcdev,
|
|
|
|
uint32_t macvlan_mode,
|
|
|
|
int *retry)
|
|
|
|
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
|
|
|
|
ATTRIBUTE_RETURN_CHECK;
|
|
|
|
|
|
|
|
int virNetDevMacVLanDelete(const char *ifname)
|
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
|
|
|
|
2011-11-02 17:19:48 +00:00
|
|
|
int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
|
|
|
|
const unsigned char *macaddress,
|
|
|
|
const char *linkdev,
|
|
|
|
enum virNetDevMacVLanMode mode,
|
2011-11-10 10:29:09 +00:00
|
|
|
bool withTap,
|
2011-11-02 17:19:48 +00:00
|
|
|
int vnet_hdr,
|
|
|
|
const unsigned char *vmuuid,
|
|
|
|
virNetDevVPortProfilePtr virtPortProfile,
|
|
|
|
char **res_ifname,
|
|
|
|
enum virNetDevVPortProfileOp vmop,
|
|
|
|
char *stateDir,
|
|
|
|
virNetDevBandwidthPtr bandwidth)
|
2011-11-10 10:29:09 +00:00
|
|
|
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(7)
|
|
|
|
ATTRIBUTE_NONNULL(9) ATTRIBUTE_NONNULL(11) ATTRIBUTE_RETURN_CHECK;
|
2010-02-15 15:58:13 +00:00
|
|
|
|
2011-11-02 17:19:48 +00:00
|
|
|
int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
|
|
|
|
const unsigned char *macaddress,
|
|
|
|
const char *linkdev,
|
|
|
|
int mode,
|
|
|
|
virNetDevVPortProfilePtr virtPortProfile,
|
|
|
|
char *stateDir)
|
Rename Macvtap management APIs
In preparation for code re-organization, rename the Macvtap
management APIs to have the following patterns
virNetDevMacVLanXXXXX - macvlan/macvtap interface management
virNetDevVPortProfileXXXX - virtual port profile management
* src/util/macvtap.c, src/util/macvtap.h: Rename APIs
* src/conf/domain_conf.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/qemu/qemu_command.h,
src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
src/qemu/qemu_process.h: Update for renamed APIs
2011-11-02 16:51:01 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
|
|
|
ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;
|
2010-02-15 15:58:13 +00:00
|
|
|
|
|
|
|
#endif /* __UTIL_MACVTAP_H__ */
|