MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / get_version

Function get_version

src/common/utils.cpp:103–129  ·  view source on GitHub ↗

* Returns a string containing a version reference of the build. * If a git checkout is discovered, flags identifying if there are * uncommitted changes will be present too. * * @param component An additional string identifying which component this * version reference belongs to. Normally argv[0]. * * @return A pre-formatted std::string containing the version reference

Source from the content-addressed store, hash-verified

101 * @return A pre-formatted std::string containing the version references
102 */
103std::string get_version(std::string component)
104{
105 std::stringstream ver;
106
107 ver << PACKAGE_NAME << " " << package_version;
108
109 // Simplistic basename() approach, extracting just the filename
110 // of the binary from argv[0]
111 ver << " (" << simple_basename(component) << ")"
112 << std::endl;
113
114#if defined(OPENVPN_TUN_BUILDER_BASE_H)
115 ver << ClientAPI::OpenVPNClient::platform() << std::endl;
116#else
117 ver << openvpn::platform_string();
118#if defined(OPENVPN_DEBUG)
119#if defined(ENABLE_OVPNDCO)
120 ver << " [DCO]";
121#endif
122 ver << " built on " __DATE__ " " __TIME__;
123#endif // OPENVPN_DEBUG
124#endif // OPENVPN_TUN_BUILDER_BASE_H
125 ver << std::endl
126 << openvpn_copyright;
127
128 return ver.str();
129}
130
131
132const std::string get_guiversion()

Callers 10

start_client_threadFunction · 0.85
backend_starterFunction · 0.85
config_managerFunction · 0.85
cmd_versionFunction · 0.85
cmd_version_servicesFunction · 0.85
netcfg_mainFunction · 0.85
session_managerFunction · 0.85
parse_commandlineMethod · 0.85
devposture_mainFunction · 0.85

Calls 2

simple_basenameFunction · 0.85
strMethod · 0.45

Tested by

no test coverage detected