2009-07-23 20:21:08 +00:00
|
|
|
/*
|
2010-03-02 21:19:24 +00:00
|
|
|
* esx_util.h: utility functions for the VMware ESX driver
|
2009-07-23 20:21:08 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
|
|
*
|
|
|
|
* 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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2009-07-23 20:21:08 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ESX_UTIL_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __ESX_UTIL_H__
|
2009-07-23 20:21:08 +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 <netdb.h>
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
2012-02-24 18:48:55 +00:00
|
|
|
# include "viruri.h"
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-07-30 20:08:35 +00:00
|
|
|
typedef struct _esxUtil_ParsedUri esxUtil_ParsedUri;
|
2010-06-03 18:04:15 +00:00
|
|
|
|
2010-07-30 20:08:35 +00:00
|
|
|
struct _esxUtil_ParsedUri {
|
2010-06-03 18:04:15 +00:00
|
|
|
char *transport;
|
|
|
|
char *vCenter;
|
|
|
|
bool noVerify;
|
|
|
|
bool autoAnswer;
|
2010-06-03 21:09:12 +00:00
|
|
|
bool proxy;
|
|
|
|
int proxy_type;
|
|
|
|
char *proxy_hostname;
|
|
|
|
int proxy_port;
|
2011-11-01 16:12:37 +00:00
|
|
|
char *path;
|
2010-06-03 18:04:15 +00:00
|
|
|
};
|
|
|
|
|
2012-02-24 18:48:55 +00:00
|
|
|
int esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri);
|
2010-06-03 18:04:15 +00:00
|
|
|
|
2010-07-30 20:08:35 +00:00
|
|
|
void esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int esxUtil_ParseVirtualMachineIDString(const char *id_string, int *id);
|
|
|
|
|
2010-08-01 17:53:00 +00:00
|
|
|
int esxUtil_ParseDatastorePath(const char *datastorePath, char **datastoreName,
|
2010-08-25 09:44:57 +00:00
|
|
|
char **directoryName, char **directoryAndFileName);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2010-01-15 22:05:26 +00:00
|
|
|
int esxUtil_ResolveHostname(const char *hostname,
|
2009-08-06 13:15:45 +00:00
|
|
|
char *ipAddress, size_t ipAddress_length);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-08-29 17:33:49 +00:00
|
|
|
int esxUtil_ReformatUuid(const char *input, char *output);
|
|
|
|
|
2010-10-12 17:37:39 +00:00
|
|
|
char *esxUtil_EscapeBase64(const char *string);
|
|
|
|
|
|
|
|
void esxUtil_ReplaceSpecialWindowsPathChars(char *string);
|
|
|
|
|
|
|
|
char *esxUtil_EscapeDatastoreItem(const char *string);
|
|
|
|
|
2011-03-03 21:11:24 +00:00
|
|
|
char *esxUtil_EscapeForXml(const char *string);
|
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
#endif /* __ESX_UTIL_H__ */
|