mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-02 11:21:12 +00:00
d3406045fd
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
83 lines
2.4 KiB
C
83 lines
2.4 KiB
C
/*
|
|
* Copyright (C) 2007-2010 Red Hat, Inc.
|
|
* Copyright (C) 2010 Satoru SATOH <satoru.satoh@gmail.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
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*
|
|
* based on iptables.h
|
|
*/
|
|
|
|
#ifndef __DNSMASQ_H__
|
|
# define __DNSMASQ_H__
|
|
|
|
# include "virsocketaddr.h"
|
|
|
|
typedef struct
|
|
{
|
|
/*
|
|
* Each entry holds a string, "<mac_addr>,<hostname>,<ip_addr>" such as
|
|
* "01:23:45:67:89:0a,foo,10.0.0.3".
|
|
*/
|
|
char *host;
|
|
|
|
} dnsmasqDhcpHost;
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int nhosts;
|
|
dnsmasqDhcpHost *hosts;
|
|
|
|
char *path; /* Absolute path of dnsmasq's hostsfile. */
|
|
} dnsmasqHostsfile;
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int nhostnames;
|
|
char *ip;
|
|
char **hostnames;
|
|
|
|
} dnsmasqAddnHost;
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int nhosts;
|
|
dnsmasqAddnHost *hosts;
|
|
|
|
char *path; /* Absolute path of dnsmasq's hostsfile. */
|
|
} dnsmasqAddnHostsfile;
|
|
|
|
typedef struct
|
|
{
|
|
char *config_dir;
|
|
dnsmasqHostsfile *hostsfile;
|
|
dnsmasqAddnHostsfile *addnhostsfile;
|
|
} dnsmasqContext;
|
|
|
|
dnsmasqContext * dnsmasqContextNew(const char *network_name,
|
|
const char *config_dir);
|
|
void dnsmasqContextFree(dnsmasqContext *ctx);
|
|
int dnsmasqAddDhcpHost(dnsmasqContext *ctx,
|
|
const char *mac,
|
|
virSocketAddr *ip,
|
|
const char *name);
|
|
int dnsmasqAddHost(dnsmasqContext *ctx,
|
|
virSocketAddr *ip,
|
|
const char *name);
|
|
int dnsmasqSave(const dnsmasqContext *ctx);
|
|
int dnsmasqDelete(const dnsmasqContext *ctx);
|
|
int dnsmasqReload(pid_t pid);
|
|
|
|
#endif /* __DNSMASQ_H__ */
|