MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3 / openvpn_client

Function openvpn_client

test/ovpncli/cli.cpp:564–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

562#endif
563
564int openvpn_client(int argc, char *argv[], const std::string* profile_content)
565{
566 static const struct option longopts[] = {
567 { "username", required_argument, nullptr, 'u' },
568 { "password", required_argument, nullptr, 'p' },
569 { "response", required_argument, nullptr, 'r' },
570 { "dc", required_argument, nullptr, 'D' },
571 { "proto", required_argument, nullptr, 'P' },
572 { "ipv6", required_argument, nullptr, '6' },
573 { "server", required_argument, nullptr, 's' },
574 { "port", required_argument, nullptr, 'R' },
575 { "timeout", required_argument, nullptr, 't' },
576 { "compress", required_argument, nullptr, 'c' },
577 { "pk-password", required_argument, nullptr, 'z' },
578 { "tvm-override", required_argument, nullptr, 'M' },
579 { "proxy-host", required_argument, nullptr, 'h' },
580 { "proxy-port", required_argument, nullptr, 'q' },
581 { "proxy-username", required_argument, nullptr, 'U' },
582 { "proxy-password", required_argument, nullptr, 'W' },
583 { "peer-info", required_argument, nullptr, 'I' },
584 { "gremlin", required_argument, nullptr, 'G' },
585 { "proxy-basic", no_argument, nullptr, 'B' },
586 { "alt-proxy", no_argument, nullptr, 'A' },
587 { "dco", no_argument, nullptr, 'd' },
588 { "eval", no_argument, nullptr, 'e' },
589 { "self-test", no_argument, nullptr, 'T' },
590 { "cache-password", no_argument, nullptr, 'C' },
591 { "no-cert", no_argument, nullptr, 'x' },
592 { "force-aes-cbc", no_argument, nullptr, 'f' },
593 { "google-dns", no_argument, nullptr, 'g' },
594 { "persist-tun", no_argument, nullptr, 'j' },
595 { "def-keydir", required_argument, nullptr, 'k' },
596 { "merge", no_argument, nullptr, 'm' },
597 { "version", no_argument, nullptr, 'v' },
598 { "auto-sess", no_argument, nullptr, 'a' },
599 { "auth-retry", no_argument, nullptr, 'Y' },
600 { "tcprof-override", required_argument, nullptr, 'X' },
601 { "ssl-debug", required_argument, nullptr, 1 },
602 { "epki-cert", required_argument, nullptr, 2 },
603 { "epki-ca", required_argument, nullptr, 3 },
604 { "epki-key", required_argument, nullptr, 4 },
605#ifdef OPENVPN_REMOTE_OVERRIDE
606 { "remote-override",required_argument, nullptr, 5 },
607#endif
608 { nullptr, 0, nullptr, 0 }
609 };
610
611 int ret = 0;
612 auto cleanup = Cleanup([]() {
613 the_client = nullptr;
614 });
615
616 try {
617 if (argc >= 2)
618 {
619 std::string username;
620 std::string password;
621 std::string response;

Callers 1

mainFunction · 0.85

Calls 15

CleanupFunction · 0.85
getopt_longFunction · 0.85
crypto_self_testFunction · 0.85
read_profileFunction · 0.85
get_passwordFunction · 0.85
read_text_utf8Function · 0.85
start_threadFunction · 0.85
eval_configMethod · 0.80
provide_credsMethod · 0.80
is_dynamic_challengeMethod · 0.80

Tested by

no test coverage detected