2007-02-14 16:26:42 +00:00
|
|
|
/*
|
2012-12-12 17:42:44 +00:00
|
|
|
* viriptables.h: helper APIs for managing iptables
|
|
|
|
*
|
2008-11-07 16:43:23 +00:00
|
|
|
* Copyright (C) 2007, 2008 Red Hat, Inc.
|
2007-02-14 16:26:42 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
2007-02-14 16:26:42 +00:00
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Mark McLoughlin <markmc@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __QEMUD_IPTABLES_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __QEMUD_IPTABLES_H__
|
2007-02-14 16:26:42 +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 "virsocketaddr.h"
|
Convert virNetwork to use virSocketAddr everywhere
Instead of storing the IP address string in virNetwork related
structs, store the parsed virSocketAddr. This will make it
easier to add IPv6 support in the future, by letting driver
code directly check what address family is present
* src/conf/network_conf.c, src/conf/network_conf.h,
src/network/bridge_driver.c: Convert to use virSocketAddr
in virNetwork, instead of char *.
* src/util/bridge.c, src/util/bridge.h,
src/util/dnsmasq.c, src/util/dnsmasq.h,
src/util/iptables.c, src/util/iptables.h: Convert to
take a virSocketAddr instead of char * for any IP
address parameters
* src/util/network.h: Add macros to determine if an address
is set, and what address family is set.
2010-10-21 12:14:33 +00:00
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddTcpInput (int family,
|
2007-02-14 16:26:42 +00:00
|
|
|
const char *iface,
|
|
|
|
int port);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveTcpInput (int family,
|
2007-02-14 16:26:42 +00:00
|
|
|
const char *iface,
|
|
|
|
int port);
|
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddUdpInput (int family,
|
2007-02-14 16:26:42 +00:00
|
|
|
const char *iface,
|
|
|
|
int port);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveUdpInput (int family,
|
2007-02-14 16:26:42 +00:00
|
|
|
const char *iface,
|
|
|
|
int port);
|
|
|
|
|
2013-12-17 17:56:28 +00:00
|
|
|
int iptablesAddUdpOutput (int family,
|
|
|
|
const char *iface,
|
|
|
|
int port);
|
|
|
|
int iptablesRemoveUdpOutput (int family,
|
|
|
|
const char *iface,
|
|
|
|
int port);
|
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardAllowOut (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2007-03-13 22:43:22 +00:00
|
|
|
const char *iface,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *physdev);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardAllowOut (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2007-03-13 22:43:22 +00:00
|
|
|
const char *iface,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *physdev);
|
2008-03-28 20:38:21 +00:00
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardAllowRelatedIn(virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2008-03-28 20:38:21 +00:00
|
|
|
const char *iface,
|
|
|
|
const char *physdev);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardAllowRelatedIn(virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2008-03-28 20:38:21 +00:00
|
|
|
const char *iface,
|
|
|
|
const char *physdev);
|
2007-02-14 16:26:42 +00:00
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardAllowIn (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2007-03-13 22:43:22 +00:00
|
|
|
const char *iface,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *physdev);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardAllowIn (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2007-03-13 22:43:22 +00:00
|
|
|
const char *iface,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *physdev);
|
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardAllowCross (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardAllowCross (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardRejectOut (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardRejectOut (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardRejectIn (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardRejectIn (int family,
|
2007-04-10 23:17:46 +00:00
|
|
|
const char *iface);
|
2007-02-14 16:26:42 +00:00
|
|
|
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddForwardMasquerade (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2010-06-10 16:50:38 +00:00
|
|
|
const char *physdev,
|
2013-02-19 10:44:16 +00:00
|
|
|
virSocketAddrRangePtr addr,
|
|
|
|
virPortRangePtr port,
|
2010-06-10 16:50:38 +00:00
|
|
|
const char *protocol);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveForwardMasquerade (virSocketAddr *netaddr,
|
2010-11-30 19:35:58 +00:00
|
|
|
unsigned int prefix,
|
2010-06-10 16:50:38 +00:00
|
|
|
const char *physdev,
|
2013-02-19 10:44:16 +00:00
|
|
|
virSocketAddrRangePtr addr,
|
|
|
|
virPortRangePtr port,
|
2010-06-10 16:50:38 +00:00
|
|
|
const char *protocol);
|
2013-09-25 10:45:25 +00:00
|
|
|
int iptablesAddDontMasquerade (virSocketAddr *netaddr,
|
|
|
|
unsigned int prefix,
|
|
|
|
const char *physdev,
|
|
|
|
const char *destaddr);
|
|
|
|
int iptablesRemoveDontMasquerade (virSocketAddr *netaddr,
|
|
|
|
unsigned int prefix,
|
|
|
|
const char *physdev,
|
|
|
|
const char *destaddr);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesAddOutputFixUdpChecksum (const char *iface,
|
2010-07-13 02:59:58 +00:00
|
|
|
int port);
|
2013-06-28 04:52:30 +00:00
|
|
|
int iptablesRemoveOutputFixUdpChecksum (const char *iface,
|
2010-07-13 02:59:58 +00:00
|
|
|
int port);
|
2007-02-14 16:26:42 +00:00
|
|
|
|
|
|
|
#endif /* __QEMUD_IPTABLES_H__ */
|