environment.h

Go to the documentation of this file.
00001 /* environment.h  --  Function for extracting data from the OpenVPN environment table
00002  *
00003  *  GPLv2 only - Copyright (C) 2008 - 2010
00004  *               David Sommerseth <dazo@users.sourceforge.net>
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; version 2
00009  *  of the License.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *
00020  */
00021 
00036 #ifndef _ENVIRONMENT_H
00037 #define _ENVIRONMENT_H
00038 
00050 char *get_env(eurephiaCTX *ctx, int logmasking, size_t len, const char *envp[], const char *fmt, ... );
00051 
00052 
00053 #define MAXLEN_TLSID 2048      
00064 #define GETENV_TLSID(ctx, env, id) get_env(ctx, 0, MAXLEN_TLSID, env, "tls_id_%i", id)
00065 
00066 #define MAXLEN_TLSDIGEST 60    
00077 #define GETENV_TLSDIGEST(ctx, env, id) get_env(ctx, 0, MAXLEN_TLSDIGEST, env, "tls_digest_%i", id)
00078 
00079 #define MAXLEN_UNTRUSTEDIP 34  
00090 #define GETENV_UNTRUSTEDIP(ctx, env) get_env(ctx, 0, MAXLEN_UNTRUSTEDIP, env, "untrusted_ip")
00091 
00092 #define MAXLEN_USERNAME 34     
00102 #define GETENV_USERNAME(ctx, env) get_env(ctx, 0, MAXLEN_USERNAME, env, "username")
00103 
00104 #define MAXLEN_PASSWORD 64     
00114 #define GETENV_PASSWORD(ctx, env) get_env(ctx, 1, MAXLEN_PASSWORD, env, "password")
00115 
00116 #define MAXLEN_BYTESRECEIVED 21  
00127 #define GETENV_BYTESRECEIVED(ctx, env) get_env(ctx, 0, MAXLEN_BYTESRECEIVED, env, "bytes_received");
00128 
00129 #define MAXLEN_BYTESSENT 21    
00140 #define GETENV_BYTESSENT(ctx, env) get_env(ctx, 0, MAXLEN_BYTESSENT, env, "bytes_sent");
00141 
00142 #define MAXLEN_TIMEDURATION 21 
00153 #define GETENV_TIMEDURATION(ctx, env) get_env(ctx, 0, MAXLEN_TIMEDURATION, env, "time_duration");
00154 
00155 #define MAXLEN_POOLNETMASK 34  
00165 #define GETENV_POOLNETMASK(ctx, env) get_env(ctx, 0, MAXLEN_POOLNETMASK, env, "ifconfig_pool_netmask");
00166 
00167 #define MAXLEN_POOLIPADDR 34   
00177 #define GETENV_POOLIPADDR(ctx, env) get_env(ctx, 0, MAXLEN_POOLIPADDR, env, "ifconfig_pool_remote_ip");
00178 
00179 #define MAXLEN_TRUSTEDIP 34    
00190 #define GETENV_TRUSTEDIP(ctx, env) get_env(ctx, 0, MAXLEN_TRUSTEDIP, env, "trusted_ip");
00191 
00192 #define MAXLEN_PROTO1 4        
00202 #define GETENV_PROTO1(ctx, env) get_env(ctx, 0, MAXLEN_PROTO1, env, "proto_1");
00203 
00204 #define MAXLEN_CNAME 64        
00214 #define GETENV_CNAME(ctx, env) get_env(ctx, 0, MAXLEN_CNAME, env, "common_name");
00215 
00216 #define MAXLEN_TRUSTEDPORT 6   
00226 #define GETENV_TRUSTEDPORT(ctx, env) get_env(ctx, 0, MAXLEN_TRUSTEDPORT, env, "trusted_port");
00227 
00228 #define MAXLEN_UNTRUSTEDPORT 6 
00238 #define GETENV_UNTRUSTEDPORT(ctx, env) get_env(ctx, 0, MAXLEN_UNTRUSTEDPORT, env, "untrusted_port");
00239 
00240 #define MAXLEN_DAEMON 32       
00250 #define GETENV_DAEMON(env) get_env(NULL, 0, MAXLEN_DAEMON, env, "daemon");
00251 
00252 #define MAXLEN_DAEMONLOGREDIR 32 
00262 #define GETENV_DAEMONLOGREDIR(env) get_env(NULL, 0, MAXLEN_DAEMONLOGREDIR, env, "daemon_log_redirect");
00263 
00264 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines