~ubuntu-branches/ubuntu/saucy/openvpn/saucy-proposed

« back to all changes in this revision

Viewing changes to pf.h

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2013-05-24 17:42:45 UTC
  • mfrom: (1.1.19) (10.2.22 sid)
  • Revision ID: package-import@ubuntu.com-20130524174245-g9y6wlforycufqy5
Tags: 2.3.1-2ubuntu1
* Merge from Debian unstable. Remaining changes:
  - debian/openvpn.init.d:
    + Do not use start-stop-daemon and </dev/null to avoid blocking boot.
    + Show per-VPN result messages.
    + Add "--script-security 2" by default for backwards compatabliity.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  OpenVPN -- An application to securely tunnel IP networks
3
 
 *             over a single TCP/UDP port, with support for SSL/TLS-based
4
 
 *             session authentication and key exchange,
5
 
 *             packet encryption, packet authentication, and
6
 
 *             packet compression.
7
 
 *
8
 
 *  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
9
 
 *
10
 
 *  This program is free software; you can redistribute it and/or modify
11
 
 *  it under the terms of the GNU General Public License version 2
12
 
 *  as published by the Free Software Foundation.
13
 
 *
14
 
 *  This program is distributed in the hope that it will be useful,
15
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 *  GNU General Public License for more details.
18
 
 *
19
 
 *  You should have received a copy of the GNU General Public License
20
 
 *  along with this program (see the file COPYING included with this
21
 
 *  distribution); if not, write to the Free Software Foundation, Inc.,
22
 
 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
 
 */
24
 
 
25
 
/* packet filter functions */
26
 
 
27
 
#if defined(ENABLE_PF) && !defined(OPENVPN_PF_H)
28
 
#define OPENVPN_PF_H
29
 
 
30
 
#include "list.h"
31
 
#include "mroute.h"
32
 
 
33
 
#define PF_MAX_LINE_LEN 256
34
 
 
35
 
struct context;
36
 
 
37
 
struct ipv4_subnet {
38
 
  bool exclude;
39
 
  in_addr_t network;
40
 
  in_addr_t netmask;
41
 
};
42
 
 
43
 
struct pf_subnet {
44
 
  struct pf_subnet *next;
45
 
  struct ipv4_subnet rule;
46
 
};
47
 
 
48
 
struct pf_subnet_set {
49
 
  bool default_allow;
50
 
  struct pf_subnet *list;
51
 
};
52
 
 
53
 
struct pf_cn {
54
 
  bool exclude;
55
 
  char *cn;
56
 
};
57
 
 
58
 
struct pf_cn_elem {
59
 
  struct pf_cn_elem *next;
60
 
  struct pf_cn rule;
61
 
};
62
 
 
63
 
struct pf_cn_set {
64
 
  bool default_allow;
65
 
  struct pf_cn_elem *list;
66
 
  struct hash *hash_table;
67
 
};
68
 
 
69
 
struct pf_set {
70
 
  bool kill;
71
 
  struct pf_subnet_set sns;
72
 
  struct pf_cn_set cns;
73
 
};
74
 
 
75
 
struct pf_context {
76
 
  bool enabled;
77
 
  struct pf_set *pfs;
78
 
#ifdef PLUGIN_PF
79
 
  char *filename;
80
 
  time_t file_last_mod;
81
 
  unsigned int n_check_reload;
82
 
  struct event_timeout reload;
83
 
#endif
84
 
};
85
 
 
86
 
void pf_init_context (struct context *c);
87
 
 
88
 
void pf_destroy_context (struct pf_context *pfc);
89
 
 
90
 
#ifdef PLUGIN_PF
91
 
void pf_check_reload (struct context *c);
92
 
#endif
93
 
 
94
 
#ifdef MANAGEMENT_PF
95
 
bool pf_load_from_buffer_list (struct context *c, const struct buffer_list *config);
96
 
#endif
97
 
 
98
 
#ifdef ENABLE_DEBUG
99
 
void pf_context_print (const struct pf_context *pfc, const char *prefix, const int lev);
100
 
#endif
101
 
 
102
 
#endif