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

Method cb_pause

src/client/openvpn3-service-client.cpp:752–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

750
751
752 void cb_pause(GVariant *params)
753 {
754 // Pauses and suspends an on-going and connected VPN tunnel.
755 // The reason message provided with this call is sent to the
756 // log.
757
758 if (!registered || !vpnclient)
759 {
760 throw ClientException("Pause",
761 "Backend service is not initialized");
762 }
763
764 if (paused)
765 {
766 throw ClientException("Pause",
767 "Connection is already paused");
768 }
769
770 glib2::Utils::checkParams(__func__, params, "(s)", 1);
771 std::string reason = filter_ctrl_chars(
772 glib2::Value::Extract<std::string>(params, 0),
773 true);
774
775 signal->LogInfo("Pausing connection");
776 signal->StatusChange(Events::Status(StatusMajor::CONNECTION,
777 StatusMinor::CONN_PAUSING,
778 "Reason: " + reason));
779 vpnclient->pause(reason);
780 paused = true;
781 signal->StatusChange(Events::Status(StatusMajor::CONNECTION,
782 StatusMinor::CONN_PAUSED));
783 }
784
785
786 void cb_resume()

Callers 1

BackendClientObjectMethod · 0.95

Calls 5

ClientExceptionClass · 0.85
filter_ctrl_charsFunction · 0.85
StatusClass · 0.85
LogInfoMethod · 0.45
StatusChangeMethod · 0.45

Tested by

no test coverage detected