summaryrefslogtreecommitdiff
path: root/src/openvpn/occ-inline.h
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-12-27 18:25:47 +0100
commit3a2bbdb05ca6a6996e424c9fb225cb0d53804125 (patch)
treef29063da5bec4caf3853d49a22a09c8619eebd21 /src/openvpn/occ-inline.h
parentd53dba59e78da865c4fe820386ff2f4f76925f3b (diff)
New upstream version 2.4.0upstream/2.4.0
Diffstat (limited to 'src/openvpn/occ-inline.h')
-rw-r--r--src/openvpn/occ-inline.h63
1 files changed, 37 insertions, 26 deletions
diff --git a/src/openvpn/occ-inline.h b/src/openvpn/occ-inline.h
index 516eb4d..84fe1ac 100644
--- a/src/openvpn/occ-inline.h
+++ b/src/openvpn/occ-inline.h
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -32,54 +32,65 @@
*/
static inline int
-occ_reset_op ()
+occ_reset_op()
{
- return -1;
+ return -1;
}
/*
* Should we send an OCC_REQUEST message?
*/
static inline void
-check_send_occ_req (struct context *c)
+check_send_occ_req(struct context *c)
{
- void check_send_occ_req_dowork (struct context *c);
- if (event_timeout_defined (&c->c2.occ_interval)
- && event_timeout_trigger (&c->c2.occ_interval,
- &c->c2.timeval,
- (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
- check_send_occ_req_dowork (c);
+ void check_send_occ_req_dowork(struct context *c);
+
+ if (event_timeout_defined(&c->c2.occ_interval)
+ && event_timeout_trigger(&c->c2.occ_interval,
+ &c->c2.timeval,
+ (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
+ {
+ check_send_occ_req_dowork(c);
+ }
}
/*
* Should we send an MTU load test?
*/
static inline void
-check_send_occ_load_test (struct context *c)
+check_send_occ_load_test(struct context *c)
{
- void check_send_occ_load_test_dowork (struct context *c);
- if (event_timeout_defined (&c->c2.occ_mtu_load_test_interval)
- && event_timeout_trigger (&c->c2.occ_mtu_load_test_interval,
- &c->c2.timeval,
- (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
- check_send_occ_load_test_dowork (c);
+ void check_send_occ_load_test_dowork(struct context *c);
+
+ if (event_timeout_defined(&c->c2.occ_mtu_load_test_interval)
+ && event_timeout_trigger(&c->c2.occ_mtu_load_test_interval,
+ &c->c2.timeval,
+ (!TO_LINK_DEF(c) && c->c2.occ_op < 0) ? ETT_DEFAULT : 0))
+ {
+ check_send_occ_load_test_dowork(c);
+ }
}
/*
* Should we send an OCC message?
*/
static inline void
-check_send_occ_msg (struct context *c)
+check_send_occ_msg(struct context *c)
{
- void check_send_occ_msg_dowork (struct context *c);
- if (c->c2.occ_op >= 0)
+ void check_send_occ_msg_dowork(struct context *c);
+
+ if (c->c2.occ_op >= 0)
{
- if (!TO_LINK_DEF(c))
- check_send_occ_msg_dowork (c);
- else
- tv_clear (&c->c2.timeval); /* ZERO-TIMEOUT */
+ if (!TO_LINK_DEF(c))
+ {
+ check_send_occ_msg_dowork(c);
+ }
+ else
+ {
+ tv_clear(&c->c2.timeval); /* ZERO-TIMEOUT */
+ }
}
}
-#endif
-#endif
+#endif /* ifdef ENABLE_OCC */
+#endif /* ifndef OCC_INLINE_H */