viriptables.h 5.8 KB
Newer Older
1
/*
2 3
 * viriptables.h: helper APIs for managing iptables
 *
J
Jim Meyering 已提交
4
 * Copyright (C) 2007, 2008 Red Hat, Inc.
5 6 7 8 9 10 11 12 13 14 15 16
 *
 * 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
17
 * License along with this library.  If not, see
O
Osier Yang 已提交
18
 * <http://www.gnu.org/licenses/>.
19 20 21 22 23 24
 *
 * Authors:
 *     Mark McLoughlin <markmc@redhat.com>
 */

#ifndef __QEMUD_IPTABLES_H__
25
# define __QEMUD_IPTABLES_H__
26

27
# include "virsocketaddr.h"
28

R
Roman Bogorodskiy 已提交
29
int              iptablesAddTcpInput             (int family,
30 31
                                                  const char *iface,
                                                  int port);
R
Roman Bogorodskiy 已提交
32
int              iptablesRemoveTcpInput          (int family,
33 34 35
                                                  const char *iface,
                                                  int port);

R
Roman Bogorodskiy 已提交
36
int              iptablesAddUdpInput             (int family,
37 38
                                                  const char *iface,
                                                  int port);
R
Roman Bogorodskiy 已提交
39
int              iptablesRemoveUdpInput          (int family,
40 41 42
                                                  const char *iface,
                                                  int port);

R
Roman Bogorodskiy 已提交
43
int              iptablesAddForwardAllowOut      (virSocketAddr *netaddr,
44
                                                  unsigned int prefix,
45
                                                  const char *iface,
46
                                                  const char *physdev);
R
Roman Bogorodskiy 已提交
47
int              iptablesRemoveForwardAllowOut   (virSocketAddr *netaddr,
48
                                                  unsigned int prefix,
49
                                                  const char *iface,
50
                                                  const char *physdev);
51

R
Roman Bogorodskiy 已提交
52
int              iptablesAddForwardAllowRelatedIn(virSocketAddr *netaddr,
53
                                                  unsigned int prefix,
54 55
                                                  const char *iface,
                                                  const char *physdev);
R
Roman Bogorodskiy 已提交
56
int              iptablesRemoveForwardAllowRelatedIn(virSocketAddr *netaddr,
57
                                                  unsigned int prefix,
58 59
                                                  const char *iface,
                                                  const char *physdev);
60

R
Roman Bogorodskiy 已提交
61
int              iptablesAddForwardAllowIn       (virSocketAddr *netaddr,
62
                                                  unsigned int prefix,
63
                                                  const char *iface,
64
                                                  const char *physdev);
R
Roman Bogorodskiy 已提交
65
int              iptablesRemoveForwardAllowIn    (virSocketAddr *netaddr,
66
                                                  unsigned int prefix,
67
                                                  const char *iface,
68 69
                                                  const char *physdev);

R
Roman Bogorodskiy 已提交
70
int              iptablesAddForwardAllowCross    (int family,
71
                                                  const char *iface);
R
Roman Bogorodskiy 已提交
72
int              iptablesRemoveForwardAllowCross (int family,
73 74
                                                  const char *iface);

R
Roman Bogorodskiy 已提交
75
int              iptablesAddForwardRejectOut     (int family,
76
                                                  const char *iface);
R
Roman Bogorodskiy 已提交
77
int              iptablesRemoveForwardRejectOut  (int family,
78 79
                                                  const char *iface);

R
Roman Bogorodskiy 已提交
80
int              iptablesAddForwardRejectIn      (int family,
81
                                                  const char *iface);
R
Roman Bogorodskiy 已提交
82
int              iptablesRemoveForwardRejectIn   (int family,
83
                                                  const char *iface);
84

R
Roman Bogorodskiy 已提交
85
int              iptablesAddForwardMasquerade    (virSocketAddr *netaddr,
86
                                                  unsigned int prefix,
87
                                                  const char *physdev,
88 89
                                                  virSocketAddrRangePtr addr,
                                                  virPortRangePtr port,
90
                                                  const char *protocol);
R
Roman Bogorodskiy 已提交
91
int              iptablesRemoveForwardMasquerade (virSocketAddr *netaddr,
92
                                                  unsigned int prefix,
93
                                                  const char *physdev,
94 95
                                                  virSocketAddrRangePtr addr,
                                                  virPortRangePtr port,
96
                                                  const char *protocol);
97 98 99 100 101 102 103 104
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);
R
Roman Bogorodskiy 已提交
105
int              iptablesAddOutputFixUdpChecksum (const char *iface,
106
                                                  int port);
R
Roman Bogorodskiy 已提交
107
int              iptablesRemoveOutputFixUdpChecksum (const char *iface,
108
                                                     int port);
109 110

#endif /* __QEMUD_IPTABLES_H__ */