~ubuntu-branches/ubuntu/hardy/openvpn/hardy-security

« back to all changes in this revision

Viewing changes to ping-inline.h

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Gonzalez Iniesta
  • Date: 2005-01-05 19:03:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050105190311-mvqzpuhmlvobg9nh
Tags: 1.99+2.rc6-1
* The 'Three Wise Men' release.
* New upstream release.
* Update README.Debian with comments on changed string remapping.
  Thanks ron@debian.org for noting this first. (Closes: #288669)

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-2004 James Yonan <jim@yonan.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 as published by
 
12
 *  the Free Software Foundation; either version 2 of the License, or
 
13
 *  (at your option) any later version.
 
14
 *
 
15
 *  This program is distributed in the hope that it will be useful,
 
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 *  GNU General Public License for more details.
 
19
 *
 
20
 *  You should have received a copy of the GNU General Public License
 
21
 *  along with this program (see the file COPYING included with this
 
22
 *  distribution); if not, write to the Free Software Foundation, Inc.,
 
23
 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
24
 */
 
25
 
 
26
#ifndef PING_INLINE_H
 
27
#define PING_INLINE_H
 
28
 
 
29
/*
 
30
 * Should we exit or restart due to ping (or other authenticated packet)
 
31
 * not received in n seconds?
 
32
 */
 
33
static inline void
 
34
check_ping_restart (struct context *c)
 
35
{
 
36
  void check_ping_restart_dowork (struct context *c);
 
37
  if (c->options.ping_rec_timeout
 
38
      && event_timeout_trigger (&c->c2.ping_rec_interval,
 
39
                                &c->c2.timeval,
 
40
                                (!c->options.ping_timer_remote
 
41
                                 || addr_defined (&c->c1.link_socket_addr.actual))
 
42
                                ? ETT_DEFAULT : 15))
 
43
    check_ping_restart_dowork (c);
 
44
}
 
45
 
 
46
/*
 
47
 * Should we ping the remote?
 
48
 */
 
49
static inline void
 
50
check_ping_send (struct context *c)
 
51
{
 
52
  void check_ping_send_dowork (struct context *c);
 
53
  if (c->options.ping_send_timeout
 
54
      && event_timeout_trigger (&c->c2.ping_send_interval,
 
55
                                &c->c2.timeval,
 
56
                                !TO_LINK_DEF(c) ? ETT_DEFAULT : 1))
 
57
    check_ping_send_dowork (c);
 
58
}
 
59
 
 
60
#endif