OpenVPN 3 Core Library
Loading...
Searching...
No Matches
epoch.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#pragma once
13
14#include <time.h>
15
17
18namespace openvpn {
19
20typedef std::uint64_t nanotime_t;
21
22inline std::uint64_t milliseconds_since_epoch()
23{
24 struct timespec ts;
25 if (::clock_gettime(CLOCK_REALTIME, &ts))
26 return 0;
28}
29
31{
32 struct timespec ts;
33 if (::clock_gettime(CLOCK_REALTIME, &ts))
34 return 0;
36}
37
38} // namespace openvpn
nanotime_t nanoseconds_since_epoch(const struct timespec &ts)
Definition timespec.hpp:29
std::uint64_t milliseconds_since_epoch(const struct timespec &ts)
Definition timespec.hpp:23
Support deferred server-side state creation when client connects.
Definition ovpncli.cpp:95
std::uint64_t milliseconds_since_epoch()
Definition epoch.hpp:22
std::uint64_t nanotime_t
Definition epoch.hpp:20
nanotime_t nanoseconds_since_epoch()
Definition epoch.hpp:30