summaryrefslogtreecommitdiffstats
path: root/plugin/environment.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/environment.h')
-rw-r--r--plugin/environment.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/plugin/environment.h b/plugin/environment.h
new file mode 100644
index 0000000..a8355cb
--- /dev/null
+++ b/plugin/environment.h
@@ -0,0 +1,47 @@
+/* environment.h -- Function for extracting data from the OpenVPN environment table
+ *
+ * GPLv2 only - Copyright (C) 2008, 2009
+ * David Sommerseth <dazo@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * @file environment.h
+ * @author David Sommerseth <dazo@users.sourceforge.net>
+ * @date 2008-08-06
+ *
+ * @brief Function for extracting data from the OpenVPN environment table.
+ *
+ */
+
+#ifndef _ENVIRONMENT_H
+#define _ENVIRONMENT_H
+
+/**
+ * get_env() retrieve values from the openvpn environment table
+ *
+ * @param ctx eurephiaCTX context
+ * @param logmasking If 1, the value will be masked in the log files (eg. to hide password)
+ * @param len How many bytes to copy out of the environment variable
+ * @param envp the environment table
+ * @param fmt The key to look for (stdarg)
+ *
+ * @return Returns a const char * with the value, or NULL if not found
+ */
+char *get_env(eurephiaCTX *ctx, int logmasking, size_t len, const char *envp[], const char *fmt, ... );
+
+#endif