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

Function main

src/python/openvpn3/gen-python-constants.cpp:116–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116int main(int argc, char **argv)
117{
118
119 std::cout << "#" << std::endl
120 << "# Generated by " << argv[0] << std::endl
121 << "# as part of the project build." << std::endl
122 << "#" << std::endl
123 << "# This file is part of openvpn3-linux, licensed" << std::endl
124 << "# under AGPLv3. Please see the main COPYRIGHT.md" << std::endl
125 << "# file packaged with the project for more details." << std::endl
126 << "#" << std::endl
127 << "# Do not modify this file. This file needs to be" << std::endl
128 << "# regenerated each time any of the OpenVPN 3 Linux" << std::endl
129 << "# constants are modified." << std::endl
130 << "#" << std::endl
131 << std::endl;
132
133 // This requires Python 3.6 or newer
134 // Older Python releases are no longer supported
135 std::cout << "import dbus" << std::endl
136 << "from enum import Enum, IntFlag" << std::endl
137 << std::endl;
138
139 std::cout << "VERSION = '" << PACKAGE_GUIVERSION << "'"
140 << std::endl
141 << std::endl;
142
143 std::vector<ConstantMapping<StatusMajor>> maj;
144 MAP(StatusMajor, maj, "UNSET", UNSET);
145 MAP(StatusMajor, maj, "CFG_ERROR", CONFIG);
146 MAP(StatusMajor, maj, "CONNECTION", CONNECTION);
147 MAP(StatusMajor, maj, "SESSION", SESSION);
148 MAP(StatusMajor, maj, "PKCS11", PKCS11);
149 MAP(StatusMajor, maj, "PROCESS", PROCESS);
150 Generator("StatusMajor", maj);
151
152 std::vector<ConstantMapping<StatusMinor>> min;
153 MAP(StatusMinor, min, "UNSET", UNSET);
154 MAP(StatusMinor, min, "CFG_ERROR", CFG_ERROR);
155 MAP(StatusMinor, min, "CFG_OK", CFG_OK);
156 MAP(StatusMinor, min, "CFG_INLINE_MISSING", CFG_INLINE_MISSING);
157 MAP(StatusMinor, min, "CFG_REQUIRE_USER", CFG_REQUIRE_USER);
158 MAP(StatusMinor, min, "CONN_INIT", CONN_INIT);
159 MAP(StatusMinor, min, "CONN_CONNECTING", CONN_CONNECTING);
160 MAP(StatusMinor, min, "CONN_CONNECTED", CONN_CONNECTED);
161 MAP(StatusMinor, min, "CONN_DISCONNECTING", CONN_DISCONNECTING);
162 MAP(StatusMinor, min, "CONN_DISCONNECTED", CONN_DISCONNECTED);
163 MAP(StatusMinor, min, "CONN_FAILED", CONN_FAILED);
164 MAP(StatusMinor, min, "CONN_AUTH_FAILED", CONN_AUTH_FAILED);
165 MAP(StatusMinor, min, "CONN_RECONNECTING", CONN_RECONNECTING);
166 MAP(StatusMinor, min, "CONN_PAUSING", CONN_PAUSING);
167 MAP(StatusMinor, min, "CONN_PAUSED", CONN_PAUSED);
168 MAP(StatusMinor, min, "CONN_RESUMING", CONN_RESUMING);
169 MAP(StatusMinor, min, "CONN_DONE", CONN_DONE);
170 MAP(StatusMinor, min, "SESS_NEW", SESS_NEW);
171 MAP(StatusMinor, min, "SESS_BACKEND_COMPLETED", SESS_BACKEND_COMPLETED);
172 MAP(StatusMinor, min, "SESS_REMOVED", SESS_REMOVED);
173 MAP(StatusMinor, min, "SESS_AUTH_USERPASS", SESS_AUTH_USERPASS);

Callers

nothing calls this directly

Calls 1

GeneratorFunction · 0.70

Tested by

no test coverage detected