OpengateM - a MAC address authentication system
module for getting parameters from conf file
+configuration file has XML form which is parsed by ezxml liblary.
+functions relating Extraset and authserver are not used in daemon program.
+
Copyright (C) 2006 Opengate Project Team
Written by Yoshiaki Watanabe
#include "opengatemd.h"
#include "../ezxml/ezxml.h"
-#define CONFIG_VERSION "0.6.0"
+#define CONFIG_VERSION "0.6.0" /* should match to the value in conf file */
#define SEPARATOR "/"
int debug=0;
/**************************************************/
/* Prepare Conf file to use */
-/* this is called before syslog setup */
+/* this should be called before syslog setup */
/**************************************************/
int openConfFile(void)
{
return -1;
}
- /* to check error, convert to xml */
+ /* try to convert to xml */
s=ezxml_toxml(xmlRoot); free(s);
/* if failed, show error message */
errMsg=(char *)ezxml_error(xmlRoot);
-
if(*errMsg!='\0'){
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
strlcat(buff, errMsg, BUFFMAXLN);
strlcat(buff, "<HR>", BUFFMAXLN);
PutMessageToClient(buff);
-
return -1;
}
strlcat(buff, CONFIGFILE, BUFFMAXLN);
strlcat(buff, ".sample.",BUFFMAXLN);
PutMessageToClient(buff);
-
return -1;
}
strlcat(buff, CONFIGFILE,BUFFMAXLN);
strlcat(buff, ". Call the administrator.</H3><BR>",BUFFMAXLN);
PutMessageToClient(buff);
-
return -1;
}
/**************************************************/
/* get a value for name from Conf file */
/* the name[aa/bb/cc] means the path */
-/* if ID is set, extraSet value is overlayed */
+/* if name is set in extraSet, the value is used */
/**************************************************/
char *getConfValue(char *name)
{
err_msg("ERR at %s#%d: cannot get %s from conf file",__FILE__,__LINE__,name);
}
- /* get value in extra set matched to ID */
+ /* get value in extra set matched to name */
/* if name is matched in first level, reset all child setting */
/* in this section, many parameters are not set */
if(!isNull(pValueExtra=getConfValueExtra(name))){
}
/************************************************/
-/* get the value in extra set matched to ID */
+/* get the value in extra set matched to name */
/************************************************/
char *getConfValueExtra(char *name)
{
/**********************************/
/* select next authserver setting */
+/* (move poiner to next server) */
/**********************************/
int selectNextAuthServer(void){
}
}
-/**********************************************
-reset pointer for auth server list
-**********************************************/
+/*********************************************/
+/* reset pointer for auth server list */
+/*********************************************/
void resetAuthServerPointer(void){
xmlAuthServer=NULL;
}
/***********************************************/
/* Convart the syslog facility id to raw value */
+/* in string form (only from local0 to local7)*/
/***********************************************/
char *convertToFacilityRaw(char *pValue)
{
}
/**************************************************/
-/* get the first value as previous call */
-/* (next node of the lowest level of tree) */
+/* get the first value for the name */
/**************************************************/
char *getFirstConfValue(char* name)
{
}
/**************************************************/
-/* get the next value as previous call */
-/* (next node of the lowest level of tree) */
+/* get the next value */
+/* need to call after getFirstConfValue() */
/**************************************************/
char *getNextConfValue(void)
{