summaryrefslogtreecommitdiff
path: root/src/openvpn/occ-inline.h
diff options
context:
space:
mode:
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 */