OpenVPN
ping.h
Go to the documentation of this file.
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-2024 OpenVPN 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 along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 */
23
24#ifndef PING_H
25#define PING_H
26
27#include "init.h"
28#include "forward.h"
29
30/*
31 * Initial default --ping-restart before --pull
32 */
33#define PRE_PULL_INITIAL_PING_RESTART 120 /* in seconds */
34
35extern const uint8_t ping_string[];
36
37/* PING_STRING_SIZE must be sizeof (ping_string) */
38#define PING_STRING_SIZE 16
39
40static inline bool
41is_ping_msg(const struct buffer *buf)
42{
44}
45
52
53void check_ping_send_dowork(struct context *c);
54
55/*
56 * Should we exit or restart due to ping (or other authenticated packet)
57 * not received in n seconds?
58 */
59static inline void
72
73/*
74 * Should we ping the remote?
75 */
76static inline void
87
88#endif /* ifndef PING_H */
static bool buf_string_match(const struct buffer *src, const void *match, int size)
Compare src buffer contents with match.
Definition buffer.h:847
Interface functions to the internal and external multiplexers.
#define TO_LINK_DEF(c)
Definition forward.h:48
bool event_timeout_trigger(struct event_timeout *et, struct timeval *tv, const int et_const_retry)
This is the principal function for testing and triggering recurring timers.
Definition interval.c:43
#define ETT_DEFAULT
Definition interval.h:224
const uint8_t ping_string[]
Definition ping.c:42
#define PING_STRING_SIZE
Definition ping.h:38
static void check_ping_restart(struct context *c)
Definition ping.h:60
void trigger_ping_timeout_signal(struct context *c)
Trigger the correct signal on a –ping timeout depending if –ping-exit is set (SIGTERM) or not (SIGUSR...
Definition ping.c:48
void check_ping_send_dowork(struct context *c)
Definition ping.c:75
static bool is_ping_msg(const struct buffer *buf)
Definition ping.h:41
static void check_ping_send(struct context *c)
Definition ping.h:77
static bool link_socket_actual_defined(const struct link_socket_actual *act)
Definition socket.h:726
Wrapper structure for dynamically allocated memory.
Definition buffer.h:61
struct link_socket_addr * link_socket_addrs
Local and remote addresses on the external network.
Definition openvpn.h:158
struct event_timeout ping_send_interval
Definition openvpn.h:283
struct timeval timeval
Time to next event of timers and similar.
Definition openvpn.h:396
struct event_timeout ping_rec_interval
Definition openvpn.h:284
Contains all state information for one tunnel.
Definition openvpn.h:474
struct context_2 c2
Level 2 context.
Definition openvpn.h:514
struct options options
Options loaded from command line or configuration file.
Definition openvpn.h:475
struct context_1 c1
Level 1 context.
Definition openvpn.h:513
bool ping_timer_remote
Definition options.h:350
int ping_rec_timeout
Definition options.h:349
int ping_send_timeout
Definition options.h:348