OSDN Git Service

71a8cc81c4e1eb83211d6cb56c22b807f5b80daa
[ultramonkey-l7/sslproxy.git] / parameter / parameter_impl.cpp
1 /*
2  * @file  parameter_impl.cpp
3  * @brief parameter module implementation class.
4  *
5  * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6  * Copyright (C) 2008  NTT COMWARE Corporation.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  **********************************************************************/
24
25 #include <vector>
26 #include <fstream>
27 #include <stdexcept>
28 #include "parameter_impl.h"
29 #include "logger_wrapper.h"
30
31 #include <boost/lexical_cast.hpp>
32
33 #ifndef INIT_PARAMETER_FILE
34 #define INIT_PARAMETER_FILE "/etc/l7vs/sslproxy/sslproxy.logger_init.cf"
35 #endif //INIT_PARAMETER_FILE
36
37 #define LINE_LENGTH     4096
38
39 LOG_CATEGORY_TAG parameter_cat = LOG_CAT_SSLPROXY_PARAMETER;
40
41 void    loadLoggerConf(){
42         l7vs::Logger::getInstance().loadConf();
43 }
44
45 /*!
46  * ParameterImpl class Constructor
47  */
48 l7vs::ParameterImpl::ParameterImpl()
49 {
50 }
51
52 /*!
53  * Initialize ParameterImpl class
54  */
55 bool    l7vs::ParameterImpl::init()
56 {
57         bool    retbool = true;
58         //clrear map objects
59         compTable.clear();
60         stringMap.clear();
61         intMap.clear();
62
63         //add member to component table
64         compTable[PARAM_COMP_ALL]       = component("all", NULL);
65         compTable[PARAM_COMP_NOCAT]     = component("nocategory", NULL);
66         compTable[PARAM_COMP_LOGGER]    = component("logger", loadLoggerConf);
67         compTable[PARAM_COMP_SSLPROXY]  = component("sslproxy", NULL);
68
69         //read all parameters
70         retbool = rereadFile( PARAM_COMP_ALL, INIT_PARAMETER_FILE);
71         /*-------- DEBUG LOG for sslproxy --------*/
72         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
73                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 4,
74                         "function : bool l7vs::ParameterImpl::init() : "
75                         "rereadFile() END. "
76                         "retbool = %d",
77                         retbool);
78         }
79         /*------ DEBUG LOG END for sslproxy ------*/
80
81         return  retbool;
82 }
83
84 /*!
85  * checks that an argument is a numeric.
86  * @param[in]   const std::string
87  * @return              is numeric = true / not numeric = false
88  */
89 bool    l7vs::ParameterImpl::isNumeric(const std::string& val)
90 {
91         try {
92                 boost::lexical_cast<int>(val);
93         }
94         catch (boost::bad_lexical_cast& ex) {
95                 return false;
96         }
97         return true;
98 }
99
100 /*!
101  * delete blank before and behind a sentence
102  * @param[in]   const std::string
103  * @return              std::string
104  */
105 std::string     l7vs::ParameterImpl::removebrank( const std::string& val )
106 {
107         std::string     str = val;
108         //remove brank(head of the sentence and end of the sentence)
109         std::string::iterator its;
110         its = str.begin();
111         while( its != str.end() ){
112                 if( ( ' ' == *its ) || ( '\t' == *its ) ){
113                         str.erase(its);
114                 }else break;
115         }
116         if( "" == str )return str;
117         //remove brank(head of the sentence and end of the sentence)
118         its = str.end() - 1;
119         while( its != str.begin() ){
120                 if( ( ' ' == *its ) || ( '\t' == *its ) ){
121                         str.erase(its);
122                         its--;
123                 }else break;
124         }
125         return str;
126 }
127
128 /*!
129  * Read Parameter from file
130  * @param[in]   const std::string
131  * @return              success = true / fail = false
132  */
133 bool    l7vs::ParameterImpl::readParameterFile( const std::string& val )
134 {
135         bool    retval = true;
136         char    readbuf[LINE_LENGTH];
137
138         LOGGER_PUT_LOG_INFO( parameter_cat,1, "read parameter file : %s", val.c_str() );
139
140         std::vector<std::string>        paramlines;
141         try{
142                 paramlines.clear();
143                 preparse.clear();
144
145                 std::ifstream   ifs( val.c_str() );
146                 if( ifs.fail() ){
147                         return false;
148                 }
149                 while( !ifs.eof() ){
150                         memset( readbuf, 0, LINE_LENGTH );
151                         ifs.getline( readbuf, ( LINE_LENGTH - 1 ) );
152                         std::string     str = readbuf;
153                         str = removebrank( str );
154                         //remove coment line
155                         if( '#' == str[0] )continue;
156                         //remove brank
157                         if( !str.empty() )paramlines.push_back( str );
158                 }
159                 std::string     sectionname = compTable[PARAM_COMP_NOCAT].section;
160                 for( std::vector<std::string>::iterator it = paramlines.begin();
161                         it != paramlines.end(); it++ ){
162                         //pre-parse
163                         std::string str = *it;
164                         if( '[' == str[0] ){
165                                 std::string     tmpstr = str.substr( str.rfind("]")+1 );
166                                 tmpstr = removebrank( tmpstr.substr( 0, tmpstr.find( "#" ) ) );
167                                 if( !tmpstr.empty() )continue;
168                                 //section string validity check
169                                 //invalid "#","[","]","\" character
170                                 tmpstr = removebrank( str.substr( str.find( "[" )+1, str.rfind( "]", str.length() )-1 ) );
171                                 if( std::string::npos != tmpstr.find( "[" ) )tmpstr = compTable[PARAM_COMP_NOCAT].section;
172                                 if( std::string::npos != tmpstr.find( "]" ) )tmpstr = compTable[PARAM_COMP_NOCAT].section;
173                                 if( std::string::npos != tmpstr.find( "\\" ) )tmpstr = compTable[PARAM_COMP_NOCAT].section;
174                                 if( std::string::npos != tmpstr.find( "#" ) )tmpstr = compTable[PARAM_COMP_NOCAT].section;
175                                 if( std::string::npos != tmpstr.find( "=" ) )tmpstr = compTable[PARAM_COMP_NOCAT].section;
176                                 sectionname = tmpstr;
177                         }else{
178                                 preparse.insert( std::pair<std::string,std::string>( sectionname,str ) );
179                         }
180                 }
181         }
182         catch( ... ){
183                 preparse.clear();
184                 retval  = false;
185         }
186         if( preparse.empty() )retval = false;
187         return  retval;
188 }
189
190 /*!
191  * read parameter and parse
192  * @param[in]   comp    PARAMETER_COMPONENT_TAG
193  * @param[in]   filename        config file name
194  * @return              success = true / fail = false
195  */
196 bool    l7vs::ParameterImpl::rereadFile(PARAMETER_COMPONENT_TAG comp, const std::string& filename)
197 {
198         bool    retbool = true;
199
200         LOGGER_PUT_LOG_INFO( parameter_cat,2, "read parameter : COMPONENT = %s", compTable[comp].section.c_str() );
201
202         if( !readParameterFile( filename ) )return false;
203
204         stringMap.clear();
205         intMap.clear();
206
207         /*-------- DEBUG LOG for sslproxy --------*/
208         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
209                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 5,
210                         "function : bool l7vs::ParameterImpl::rereadFile("
211                         "PARAMETER_COMPONENT_TAG comp, "
212                         "const std::string& filename) : "
213                         "comp = %s, "
214                         "filename = %s",
215                         compTable[comp].section.c_str(),
216                         filename.c_str());
217         }
218         /*------ DEBUG LOG END for sslproxy ------*/
219
220         std::multimap<std::string,std::string>::iterator        it;
221         std::multimap<std::string,std::string>::iterator        ite;
222         if( PARAM_COMP_ALL == comp ){
223                 it = preparse.begin();
224         }else{
225                 it = preparse.find( compTable[comp].section );
226         }
227         ite = preparse.end();
228                 
229         for( std::multimap<std::string,std::string>::iterator its = it; its !=ite; its++ ){
230                 //be made an invalid line if there is no = in a setting line.
231                 if( std::string::npos == its->second.find( "=" ) )continue;
232                 std::string     key = removebrank( its->second.substr( 0, its->second.find( "=" ) ) );
233                 //Key string validity check
234                 if( key.empty() )continue;
235                 //invalid "#","[","]","\" character
236                 if( std::string::npos != key.find( "[" ))continue;
237                 if( std::string::npos != key.find( "]" ))continue;
238                 if( std::string::npos != key.find( "\\" ))continue;
239                 if( std::string::npos != key.find( "#" ) )continue;
240
241                 key     = its->first + "." + key;
242
243                 std::string     value = removebrank( its->second.substr( its->second.find( "=" )+1, std::string::npos ) );
244                 //Value string validity check
245                 if( '"' == value[0] ) {
246                         if( std::string::npos == value.find( "\"", 1 ) )continue;
247                         std::string tmpstr = removebrank( value.substr( value.find( "\"", 1 )+1, value.find( "#", value.find( "\"", 1 )+1  ) ) );
248                         if( !tmpstr.empty() )continue;
249                         tmpstr = removebrank( value.substr( 1, value.find( "\"", 1 )-1 ) );
250                         stringMap.insert( std::pair<std::string, std::string>( key, tmpstr ) );
251                         /*-------- DEBUG LOG for sslproxy --------*/
252                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
253                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 6,
254                                         "function : bool l7vs::ParameterImpl::rereadFile() : "
255                                         "stringMap.insert("
256                                         "key = %s, "
257                                         "tmpstr = %s)",
258                                         key.c_str(),
259                                         tmpstr.c_str());
260                         }
261                         /*------ DEBUG LOG END for sslproxy ------*/
262                 }else{
263                         value = value.substr( 0, value.find_first_of( "#", 0 ) );
264                         if( std::string::npos != value.find( "\\" ))continue;
265                         if( std::string::npos != value.find( "=" ))continue;
266                         if( value.empty() )continue;
267                         if( isNumeric( value ) ){
268                                 try{
269                                         intMap.insert( std::pair<std::string, int>( key, boost::lexical_cast<int>( value ) ) );
270                                         /*-------- DEBUG LOG for sslproxy --------*/
271                                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
272                                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 7,
273                                                         "function : bool l7vs::ParameterImpl::rereadFile() : "
274                                                         "intMap.insert("
275                                                         "key = %s, "
276                                                         "value = %s)",
277                                                         key.c_str(),
278                                                         value.c_str());
279                                         }
280                                         /*------ DEBUG LOG END for sslproxy ------*/
281                                 }
282                                 catch (boost::bad_lexical_cast& ex) {
283                                         stringMap.insert( std::pair<std::string, std::string>( key, value ) );
284                                         /*-------- DEBUG LOG for sslproxy --------*/
285                                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
286                                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 8,
287                                                         "function : bool l7vs::ParameterImpl::rereadFile() : "
288                                                         "stringMap.insert("
289                                                         "key = %s, "
290                                                         "value = %s)",
291                                                         key.c_str(),
292                                                         value.c_str());
293                                         }
294                                         /*------ DEBUG LOG END for sslproxy ------*/
295                                 }
296                         }else{
297                                 stringMap.insert( std::pair<std::string, std::string>( key, value ) );
298                                 /*-------- DEBUG LOG for sslproxy --------*/
299                                 if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat)) {
300                                         LOGGER_PUT_LOG_DEBUG(parameter_cat, 9,
301                                                 "function : bool l7vs::ParameterImpl::rereadFile() : "
302                                                 "stringMap.insert("
303                                                 "key = %s, "
304                                                 "value = %s)",
305                                                 key.c_str(),
306                                                 value.c_str());
307                                 }
308                                 /*------ DEBUG LOG END for sslproxy ------*/
309                         }
310                 }
311         }
312         //set parameter
313         std::map<PARAMETER_COMPONENT_TAG, component>::iterator itr = compTable.find( comp );
314         if( itr != compTable.end() ){
315                 try{
316                         if( NULL != itr->second.function )itr->second.function();
317                 }
318                 catch( const std::logic_error& err ){
319                         LOGGER_PUT_LOG_ERROR( parameter_cat,1, "set parameter function failure at category: %s", itr->second.section.c_str() );
320                         retbool = false;
321                 }
322         }
323         if( PARAM_COMP_ALL == comp ){
324                 for( itr = compTable.begin(); itr != compTable.end(); ++itr ){
325                         try{
326                                 if( NULL != itr->second.function )itr->second.function();
327                         }
328                         catch( const std::logic_error& err ){
329                                 LOGGER_PUT_LOG_ERROR( parameter_cat,2, "set parameter function failure at category: %s", itr->second.section.c_str() );
330                                 retbool = false;
331                         }
332                 }
333         }
334
335         return  retbool;
336 }
337
338 /*!
339  * Existence of a integer parameter is checked
340  * @param[in]   comp    PARAMETER_COMPONENT_TAG
341  * @param[in]   key     key string
342  * @return              exist = true / not exist = false
343  */
344 bool    l7vs::ParameterImpl::isIntExist(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
345 {
346         bool    retval = false;
347         std::string comp_key = compTable[comp].section + "." + key;
348         if( intMap.end() != intMap.find( comp_key ) ){
349                 retval = true;
350         }
351         return  retval;
352 }
353
354 /*!
355  * Existence of a string parameter is checked
356  * @param[in]   comp    PARAMETER_COMPONENT_TAG
357  * @param[in]   key     key string
358  * @return              exist = true / not exist = false
359  */
360 bool    l7vs::ParameterImpl::isStringExist(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
361 {
362         bool    retval = false;
363         std::string comp_key = compTable[comp].section + "." + key;
364         if( stringMap.end() != stringMap.find( comp_key ) ){
365                 retval = true;
366         }
367         return  retval;
368 }
369
370 /*!
371  * get a integer parameter
372  * @param[in]   comp    PARAMETER_COMPONENT_TAG
373  * @param[in]   key     key string
374  * @return              integer data
375  */
376 int     l7vs::ParameterImpl::getIntValue(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
377 {
378         /*-------- DEBUG LOG for sslproxy --------*/
379         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
380             comp != PARAM_COMP_LOGGER) {
381                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 10,
382                         "in_function : int l7vs::ParameterImpl::getIntValue("
383                         "const PARAMETER_COMPONENT_TAG comp, "
384                         "const std::string& key) : "
385                         "comp = %s, "
386                         "key = %s",
387                         compTable[comp].section.c_str(),
388                         key.c_str());
389         }
390         /*------ DEBUG LOG END for sslproxy ------*/
391
392         int retint = 0;
393         std::string comp_key = compTable[comp].section + "." + key;
394         std::multimap<std::string, int>::iterator it = intMap.begin();
395         std::multimap<std::string, int>::iterator ite = intMap.end();
396
397         for( std::multimap<std::string, int>::iterator its = it; its !=ite; its++ ) {
398                 /*-------- DEBUG LOG for sslproxy --------*/
399                 if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
400                     comp != PARAM_COMP_LOGGER) {
401                         LOGGER_PUT_LOG_DEBUG(parameter_cat, 11,
402                                 "function : int l7vs::ParameterImpl::getIntValue() : "
403                                 "Search intMap [%s][%d]",
404                                 its->first.c_str(),
405                                 its->second);
406                 }
407                 /*------ DEBUG LOG END for sslproxy ------*/
408                 if (its->first == comp_key) {
409                         /*-------- DEBUG LOG for sslproxy --------*/
410                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
411                             comp != PARAM_COMP_LOGGER) {
412                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 12,
413                                         "function : int l7vs::ParameterImpl::getIntValue() : "
414                                         "Key matched.");
415                         }
416                         /*------ DEBUG LOG END for sslproxy ------*/
417                         retint = its->second;
418                 }
419         }
420
421         /*-------- DEBUG LOG for sslproxy --------*/
422         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
423             comp != PARAM_COMP_LOGGER) {
424                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 13,
425                         "out_function : int l7vs::ParameterImpl::getIntValue("
426                         "const PARAMETER_COMPONENT_TAG comp, "
427                         "const std::string& key) : "
428                         "retint = %d",
429                         retint);
430         }
431         /*------ DEBUG LOG END for sslproxy ------*/
432         return retint;
433 }
434
435 /*!
436  * get a string parameter
437  * @param[in]   comp    PARAMETER_COMPONENT_TAG
438  * @param[in]   key     key string
439  * @return              string data
440  */
441 std::string     l7vs::ParameterImpl::getStringValue(const PARAMETER_COMPONENT_TAG comp, const std::string& key)
442 {
443         /*-------- DEBUG LOG for sslproxy --------*/
444         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
445             comp != PARAM_COMP_LOGGER) {
446                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 14,
447                         "in_function : std::string l7vs::ParameterImpl::getStringValue("
448                         "const PARAMETER_COMPONENT_TAG comp, "
449                         "const std::string& key) : "
450                         "comp = %s, "
451                         "key = %s",
452                         compTable[comp].section.c_str(),
453                         key.c_str());
454         }
455         /*------ DEBUG LOG END for sslproxy ------*/
456
457         std::string     retstr = "";
458         std::string     comp_key = compTable[comp].section + "." + key;
459         std::multimap<std::string, std::string>::iterator it = stringMap.begin();
460         std::multimap<std::string, std::string>::iterator ite = stringMap.end();
461
462         for( std::multimap<std::string, std::string>::iterator its = it; its !=ite; its++ ) {
463                 /*-------- DEBUG LOG for sslproxy --------*/
464                 if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
465                     comp != PARAM_COMP_LOGGER) {
466                         LOGGER_PUT_LOG_DEBUG(parameter_cat, 15,
467                                 "function : std::string l7vs::ParameterImpl::getStringValue() : "
468                                 "Search stringMap [%s][%s]",
469                                 its->first.c_str(),
470                                 its->second.c_str());
471                 }
472                 /*------ DEBUG LOG END for sslproxy ------*/
473                 if (its->first == comp_key) {
474                         /*-------- DEBUG LOG for sslproxy --------*/
475                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
476                             comp != PARAM_COMP_LOGGER) {
477                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 16,
478                                         "function : std::string l7vs::ParameterImpl::getStringValue() : "
479                                         "Key matched.");
480                         }
481                         /*------ DEBUG LOG END for sslproxy ------*/
482                         retstr = its->second;
483                 }
484         }
485
486         /*-------- DEBUG LOG for sslproxy --------*/
487         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
488             comp != PARAM_COMP_LOGGER) {
489                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 17,
490                         "out_function : std::string l7vs::ParameterImpl::getStringValue("
491                         "const PARAMETER_COMPONENT_TAG comp, "
492                         "const std::string& key) : "
493                         "retstr = %s",
494                         retstr.c_str());
495         }
496         /*------ DEBUG LOG END for sslproxy ------*/
497         return retstr;
498 }
499
500 /*!
501  * get map parameter
502  * @param[in]   comp    PARAMETER_COMPONENT_TAG
503  * @param[in]   key     key string
504  * @param[out]  retMap  map data
505  */
506 void    l7vs::ParameterImpl::getStringMapValue(const PARAMETER_COMPONENT_TAG comp, const std::string& key, std::multimap<std::string, std::string>& retMap)
507 {
508         /*-------- DEBUG LOG for sslproxy --------*/
509         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
510             comp != PARAM_COMP_LOGGER) {
511                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 18,
512                         "in_function : void l7vs::ParameterImpl::getStringMapValue("
513                         "const PARAMETER_COMPONENT_TAG comp, "
514                         "const std::string& key, "
515                         "std::multimap<std::string, std::string>& retMap) : "
516                         "comp = %s, "
517                         "key = %s",
518                         compTable[comp].section.c_str(),
519                         key.c_str());
520         }
521         /*------ DEBUG LOG END for sslproxy ------*/
522
523         std::string     comp_key = compTable[comp].section + "." + key;
524         std::multimap<std::string, std::string>::iterator it = stringMap.begin();
525         std::multimap<std::string, std::string>::iterator ite = stringMap.end();
526
527         for( std::multimap<std::string, std::string>::iterator its = it; its !=ite; its++ ) {
528                 /*-------- DEBUG LOG for sslproxy --------*/
529                 if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
530                     comp != PARAM_COMP_LOGGER) {
531                         LOGGER_PUT_LOG_DEBUG(parameter_cat, 19,
532                                 "function : void l7vs::ParameterImpl::getStringMapValue() : "
533                                 "Search stringMap [%s][%s]",
534                                 its->first.c_str(),
535                                 its->second.c_str());
536                 }
537                 /*------ DEBUG LOG END for sslproxy ------*/
538                 if (its->first == comp_key) {
539                         /*-------- DEBUG LOG for sslproxy --------*/
540                         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
541                             comp != PARAM_COMP_LOGGER) {
542                                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 20,
543                                         "function : void l7vs::ParameterImpl::getStringMapValue() : "
544                                         "Key matched. Insert map.");
545                         }
546                         /*------ DEBUG LOG END for sslproxy ------*/
547                         retMap.insert( std::pair<std::string, std::string>( key, its->second ) );
548                 }
549         }
550
551         /*-------- DEBUG LOG for sslproxy --------*/
552         if (LOG_LV_DEBUG == logger_get_log_level(parameter_cat) &&
553             comp != PARAM_COMP_LOGGER) {
554                 LOGGER_PUT_LOG_DEBUG(parameter_cat, 21,
555                         "out_function : void l7vs::ParameterImpl::getStringMapValue("
556                         "const PARAMETER_COMPONENT_TAG comp, "
557                         "const std::string& key, "
558                         "std::multimap<std::string, std::string>& retMap)");
559         }
560         /*------ DEBUG LOG END for sslproxy ------*/
561 }
562
563 /*!
564  * set-parameter function pointer relates component-tag
565  * @param[in]   comp    section TAG
566  * @param[in]   p_func  function pointer
567  */
568 void    l7vs::ParameterImpl::registerFunctionPointer( const PARAMETER_COMPONENT_TAG comp, void (*p_func)() )
569 {
570         compTable[comp].function = p_func;
571 }
572