config.y revision 6e93b38e61e2cf3c36f56dc2dac897f37b908dfe
%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* HISTORY
* 5-13-96 Jerry Yeung parse security config. file
* 6-25-96 Jerry Yeung parse trap info.
* 6-27-96 Jerry Yeung optional port stmt
* 6-28-96 Jerry Yeung add setuid support
* 7-03-96 Jerry Yeung add watchdog, maxAgentTimeOut
* pollInterval
* 7-13-96 Jerry Yeung remove resource_name
* 7-17-96 Jerry Yeung change reg file suffix
* 7-17-96 Jerry Yeung change personal to registration_file
*/
%}
/* support SNMP security(5-13-96) */
/* support resource */
%{
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
#include "impl.h"
#include "error.h"
#include "trace.h"
#include "pdu.h"
#include "snmprelay_msg.h"
#include "agent.h"
#include "subtree.h"
#include "session.h"
#include "dispatcher.h"
/** SNMP security (5-13-96) */
#include "trap.h"
#include "access.h"
#include "res.h"
#include "sh_table.h"
/***** DEFINE *****/
/*
#define DEBUG_YACC(string) printf("\t\tYACC: %s: %s at line %d\n", string, yytext, yylineno);
*/
#define DEBUG_YACC(string)
/*
#define SNMPRELAY_SUFFIX ".snmprelay"
*/
#define SNMPRELAY_SUFFIX ".reg"
#define SNMPRESOURCE_SUFFIX ".rsrc"
#define SNMPRELAY_REG_FILE "snmpdx.reg"
#define SNMPACL_SUFFIX ".acl"
/***** TYPEDEF *****/
typedef struct _Macro {
struct _Macro *next_macro;
char *label;
} Macro;
/***** GLOBAL VARIABLES *****/
/***** STATIC VARIABLES AND FUNCTIONS *****/
/*(6-18) reconfig */
#define RES_PARSING_STATE_FROM_SCRATCH 0
#define RES_PARSING_STATE_RE_READ 1
static time_t last_res_modify_time=0;
static int res_parsing_state =0; /* 0:init */
/* access control(6-20-96) */
/* trap filter (6-25-96) */
static int static_trap_low=-1;
static int static_trap_high=-1;
/* snmp security(5-13-96) */
static int community_type = 0;
static char *current_filename = NULL;
/* lexinput points to the current focus point in the config file */
static char *lexinput;
/* first_macro is the begining of the list */
/* of the user defined macros */
/* the boolean parsing_oid is used to */
/* know if we are parsing an */
/* object identifier or not. */
static int parsing_oid = False;
/* here are the values of the predifined macros */
/* that can be used in the configuration file */
static int mib2_len = 6;
static int enterprise_len = 6;
static int sun_len = 7;
/* the 2 static variables static_subids and */
/* static_len are used when parsing an */
/* object identifier. Then the boolean */
/* parsing_oid should be true. When a new sub- */
/* identifier (or a list of sub-identifiers) */
/* is found, we use the function */
/* subids_cat to append it to the static_subids.*/
static int static_len = 0;
/* macro_add() is used to append a macro to */
/* the macro list. macro_find is used to find */
/* a macro in the macro list */
static void macro_list_delete();
static void trace_macros();
/* static_label is used when parsing a macro */
static char *static_label = NULL;
/* static_agent is used when parsing an agent */
/* resource support */
/* static_table is used when parsing n table */
/* static_inf_value and static_max_value are */
/* used when parsing a range */
static int static_inf_value = -1;
static int static_sup_value = -1;
char *save_string = NULL;
char *com_string = NULL;
char *host_string = NULL;
int found_comma=FALSE;
%}
%%
{
DEBUG_YACC("configuration")
}
/******************* SNMP security (5-13-96) *********/
{
DEBUG_YACC("security configuration")
}
/***************/
/* accesscontrol */
/***************/
{
DEBUG_YACC("acls_list1")
}
{
DEBUG_YACC("acls_listError")
if(static_access_policy != NULL){
}
}
{
DEBUG_YACC("acls_list2")
}
{
if(static_access_policy == NULL)
{
error("malloc() failed");
}
{
if(static_access_policy!=NULL)
{
/* create AccessServer */
/* put the AccessPolicy into AccessServer */
/* put AccessServer into corresponding manager */
{
/* Hack to send last community string which is a dot string */
if (com_string != NULL)
{ /* add community into AccessPolicy */
if(static_community == NULL)
{
error("malloc() failed");
}
found_comma = FALSE;
}
/* Hack to send last manager host string which is a dot string */
if (host_string != NULL)
{
error("error in %s at line %d: %s",
"???",
}
if(static_access_server == NULL)
{
error("malloc() failed");
}
if(static_access_policy!=NULL)
found_comma = FALSE;
}
}
community_type = 0;
}
{
DEBUG_YACC("communities_stmt");
}
{
DEBUG_YACC("communities_set");
}
{
DEBUG_YACC("community_elem")
}
{
DEBUG_YACC("community_item")
if(static_access_policy==NULL){
error("acl statement error");
}
{
if(static_community == NULL)
{
error("malloc() failed");
}
}
{
/* com_string= strdup(save_string);*/
/* first part of community string */
if(com_string == NULL){
error("malloc() failed");
}
}
if (found_dot )
{
if (com_string == NULL)
/* allow a dot in community string */
/* add part after the dot */
}
}
{
DEBUG_YACC("acl_access")
}
{
DEBUG_YACC("acl_access_type")
}
{
DEBUG_YACC("hosts")
}
{
DEBUG_YACC("hosts_list");
}
{
DEBUG_YACC("host_elem");
}
{
/* add the host item to manager list */
/* it should return the pointer if exists */
DEBUG_YACC("manager_item")
{
{
error("error in %s at line %d: %s",
"???",
}
if(static_access_server == NULL)
{
error("malloc() failed");
}
if(static_access_policy!=NULL)
found_comma = FALSE;
}
if (host_string == NULL)
{
/* host_string= strdup(save_string);*/
/* first part of host string */
if(host_string == NULL){
error("malloc() failed");
}
}
if (found_dot )
{
}
}
/***************/
/* communities */
/***************/
/*
communities : t_communities t_equal t_openbracket communities_list t_closebracket
{
DEBUG_YACC("communities")
}
| t_communities t_equal t_openbracket error t_closebracket
{
error("BUG: community stmt parsing error at line %d",yylineno);
if(community_name != NULL) free(community_name);
}
communities_list : | communities_list community_item
{
DEBUG_YACC("communities_list")
}
community_item : ct_identifier
{
DEBUG_YACC("community_item 1")
if(community_name)
{
error("BUG: community_name is not NULL in community_item");
}
community_name = strdup(yytext);
if(community_name == NULL)
{
error(ERR_MSG_ALLOC);
YYERROR;
}
}
communitytype
{
int res;
DEBUG_YACC("community_item 2")
if(community_name == NULL)
{
error("BUG: community_name is NULL in community_item");
}
res = community_add(community_name, community_type, error_label);
switch(res)
{
case 0:
break;
case 1:
error("error in %s at line %d: %s",
current_filename? current_filename: "???",
yylineno, error_label);
break;
default:
error("fatal error in %s at line %d: %s",
current_filename? current_filename: "???",
yylineno, error_label);
YYERROR;
}
free(community_name);
community_name = NULL;
}
communitytype : t_readonly | t_readwrite
{
DEBUG_YACC("community_type")
}
*/
/************/
/* managers */
/************/
/*
managers : t_managers t_equal t_openbracket managers_list t_closebracket
{
DEBUG_YACC("agents")
}
| t_managers t_equal t_openbracket error t_closebracket
{
error("BUG: managers stmt parsing error at line %d",yylineno);
}
managers_list : | managers_list list_separator manager_item
{
DEBUG_YACC("managers_list")
}
manager_item : ct_identifier
{
Manager *res;
DEBUG_YACC("manager_item")
res = manager_add(yytext, error_label);
if(res==NULL){
error("error in %s at line %d: %s",
current_filename? current_filename:
"???",
yylineno, error_label);
}
}
*/
/*** trap hanlding (6-25-96) */
{
DEBUG_YACC("trap_block")
found_comma = FALSE;
}
{
/* clean up */
if(static_sub_member != NULL){
}
}
{
DEBUG_YACC("trap_list")
}
{
/* create submember */
if(static_sub_member == NULL)
{
error("malloc() failed");
}
{
/* attach submember to subgroup */
{
}
{
/* set the community field in submember */
if(static_sub_member != NULL)
{
if(static_sub_member == NULL)
{
}
}else{
error("BUG: missing trap community name");
}
}
{
DEBUG_YACC("trap_interest_hosts")
}
{
DEBUG_YACC("trap_interest_hosts_list")
}
{
DEBUG_YACC("trap_interest_host_item")
/* attach host to the submember */
if(static_sub_member==NULL){
error("trap statement error");
}else{
if(static_host == NULL)
{
error("malloc() failed");
}
}
}
}
{
DEBUG_YACC("enterprise_list")
}
{
DEBUG_YACC("enterprise_item")
}
{
/* currently, it supports single enterprise */
DEBUG_YACC("enterprise_stmt")
/* add or find the enterprise */
if(static_filter==NULL){
error("error in %s at line %d: %s",
}
}
{
DEBUG_YACC("trap_number_stmt")
}
{
DEBUG_YACC("trap_number_list")
}
{
DEBUG_YACC("trap_number_list")
}
{
DEBUG_YACC("trap_number_item")
enterprise, and add_tailthe subgroup
to each trap */
if(static_filter!=NULL){
/* expand the trap */
}else{
error("error in enterprise statement");
}
}
{
/* starting trap num */
}
{
/* ending trap num */
}
| NUMBER
{
/* start & end num the same */
DEBUG_YACC("trap_range")
}
/*
trapcommunity : t_trapcommunity t_equal ct_identifier
{
DEBUG_YACC("trap_community")
if(trap_community)
{
error("BUG: trap_community not NULL in trap_community");
}
trap_community = strdup(yytext);
if(trap_community == NULL)
{
error(ERR_MSG_ALLOC);
YYERROR;
}
}
*/
/*******************/
/* trapdestinators */
/*******************/
/*
trapdestinators : t_trapdestinators t_equal t_openbracket trapdestinators_list t_closebracket
{
DEBUG_YACC("trapdestinators")
}
| t_trapdestinators t_equal t_openbracket error t_closebracket
{
error("BUG: trapdestinators stmt parsing error at line %d",yylineno);
}
trapdestinators_list : | trapdestinators_list list_separator trapdestinator_item
{
DEBUG_YACC("trapdestinators_list")
}
trapdestinator_item : ct_identifier
{
int res;
DEBUG_YACC("trapdestinator_item")
res = trap_destinator_add(yytext, error_label);
switch(res)
{
case 0:
break;
case 1:
error("error in %s at line %d: %s",
current_filename? current_filename:
"???",
yylineno, error_label);
break;
default:
error("fatal error in %s at line %d: %s",
current_filename? current_filename:
"???",
yylineno, error_label);
YYERROR;
}
}
*/
/******************* SNMP security (5-13-96) *********/
/**********/
/* macros */
/**********/
{
DEBUG_YACC("macros")
}
parsing_oid = False;
static_label = NULL;
static_len = 0;
}
{
DEBUG_YACC("macros_list")
}
{
if(parsing_oid != False)
{
}
parsing_oid = True;
if(static_subids != NULL)
{
}
if(static_len != 0)
{
}
}
{
DEBUG_YACC("macro_item")
{
}
parsing_oid = False;
static_label = NULL;
static_len = 0;
}
{
DEBUG_YACC("label")
if(static_label != NULL)
{
}
if(static_label == NULL)
{
error("malloc() failed");
}
}
/************/
/* environment */
/************/
{
DEBUG_YACC("environment")
}
{
DEBUG_YACC("environment_list")
}
{
DEBUG_YACC("environment_item")
}
{
DEBUG_YACC("poll_interval")
}
{
DEBUG_YACC("max_agent_time_out")
}
/***********/
/* resouces */
/************/
{
DEBUG_YACC("resources")
}
{
DEBUG_YACC("resources_list")
}
{
if(static_res != NULL)
if(static_res == NULL)
{
error("malloc() failed");
}
}
{
DEBUG_YACC("agent_item")
if(reconfig_first_res == NULL)
{
}
else
{
}
}else{
{
}
else
{
}
}
static_res = NULL;
}
{
if(static_res != NULL){
}
static_res = NULL;
}
{
DEBUG_YACC("fileslist");
}
{
DEBUG_YACC("file_item");
}
{
DEBUG_YACC("personal_file")
error("malloc() failed");
}
}
{
DEBUG_YACC("sec_file")
error("malloc() failed");
}
}
{
DEBUG_YACC("directory_file")
error("malloc() failed");
}
}
{
DEBUG_YACC("policy")
error("malloc() failed");
}
}
{
DEBUG_YACC("user")
error("malloc() failed");
}
}
{
DEBUG_YACC("res_type")
error("malloc() failed");
}
}
{
DEBUG_YACC("start_cmd")
error("malloc() failed");
}
}
{
DEBUG_YACC("t_resource");
}
{
DEBUG_YACC("t_registration_file");
}
{
DEBUG_YACC("t_sec_file");
}
{
DEBUG_YACC("t_dir_fname");
}
{
DEBUG_YACC("t_policy");
}
{
DEBUG_YACC("t_res_type");
}
{
DEBUG_YACC("t_user");
}
{
DEBUG_YACC("t_command");
}
/**********/
/* agents */
/**********/
{
DEBUG_YACC("agents")
}
{
DEBUG_YACC("agents_list")
}
{
if(static_agent != NULL)
{
}
if(static_agent == NULL)
{
error("malloc() failed");
}
/* Bug fix 4145620 - The subagents listen on the loopback driver */
}
{
DEBUG_YACC("agent_item");
if(first_agent == NULL)
{
}
else
{
}
static_agent = NULL;
}
{
if(static_agent != NULL){
}
}
static_agent = NULL;
}
/* clean up */
}
{
DEBUG_YACC("name")
{
}
{
error("malloc() failed");
}
}
{
DEBUG_YACC("subtrees_tables")
}
{
if(parsing_oid != False)
{
}
parsing_oid = True;
if(static_subids != NULL)
{
}
if(static_len != 0)
{
}
}
{
DEBUG_YACC("subtrees")
if(parsing_oid != True)
{
}
parsing_oid = False;
}
{
DEBUG_YACC("subtrees_list")
}
{
DEBUG_YACC("subtrees_list_comma_separated")
}
{
DEBUG_YACC("subtree_item")
if(parsing_oid != True)
{
}
{
}
/* add the mirror table(mibpatch) */
/* assume that the subtree is the first agent
subtree */
static_len = 0;
found_comma = FALSE;
}
{
DEBUG_YACC("tables")
}
{
DEBUG_YACC("tables_list")
}
{
if(static_agent == NULL)
{
}
if(static_table)
{
}
if(static_table == NULL)
{
error("malloc() failed");
}
/*
static_table->indexs.subids = NULL;
static_table->indexs.len = 0;
*/
}
{
DEBUG_YACC("table_item")
if(static_table == NULL)
{
}else{
/* check for the validation of the table,
* if insertion is ok, then put it into the
* table lists
*/
/* may need more elaboration in error */
error("Table %d insertion failed",
}
if(first_table==NULL){
}else{
}
}
}
static_table = NULL;
}
{
if(parsing_oid != False)
{
}
parsing_oid = True;
}
{
DEBUG_YACC("table")
if(parsing_oid != True)
{
}
parsing_oid = False;
if(static_table == NULL)
{
}
static_len = 0;
}
{
DEBUG_YACC("columns")
if(static_table == NULL)
{
}
static_inf_value = -1;
static_sup_value = -1;
}
/*
indexs : t_indexs t_equal
{
if(parsing_oid != False)
{
error("BUG at line %d: parsing_oid is not False in indexs", yylineno);
}
parsing_oid = True;
}
subids_list
{
DEBUG_YACC("indexs")
if(parsing_oid != True)
{
error("BUG at line %d: parsing_oid is not True in indexs", yylineno);
}
parsing_oid = False;
if(static_table == NULL)
{
error_exit("BUG at line %d: static_table is NULL in indexs", yylineno);
}
static_table->indexs.subids = static_subids;
static_subids = NULL;
static_table->indexs.len = static_len;
static_len = 0;
}
*/
{
DEBUG_YACC("indexs")
if(static_inf_value == -1)
{
}
if(static_sup_value == -1)
{
}
static_inf_value = -1;
static_sup_value = -1;
}
{
if(static_inf_value != -1)
{
error("BUG at line %d: static_inf_value (%d) is not -1 in range",
}
}
{
if(static_sup_value != -1)
{
error("BUG at line %d: static_sup_value (%d) is not -1 in range",
}
}
{
DEBUG_YACC("range")
}
| t_number
{
if(static_inf_value != -1)
{
error("BUG at line %d: static_inf_value (%d) is not -1 in range",
}
if(static_sup_value != -1)
{
error("BUG at line %d: static_sup_value (%d) is not -1 in range",
}
}
{
DEBUG_YACC("subtree")
}
{
DEBUG_YACC("optional_watch_dog_time")
}
{
DEBUG_YACC("optional_port")
}
{
DEBUG_YACC("port")
if(token_value > 0xFFFF)
{
error("error at line %d: the port number (%d) should not be greater than %d", yylineno, token_value, 0xFFFF);
}
{
error("error at line %d: the port number %d is already used by another agent", yylineno, token_value);
}
}
/***************/
/* subids_list */
/***************/
{
DEBUG_YACC("subids_list")
}
{
DEBUG_YACC("subid")
}
/*******************/
/* terminal tokens */
/*******************/
/**************** SNMP security (5-13-96) ***/
{
DEBUG_YACC("ct_indentifier")
/*
if(save_string == NULL)
{
error("malloc() failed");
YYERROR;
}
*/
}
{
DEBUG_YACC("t_communities")
}
{
DEBUG_YACC("t_hosts")
}
{
DEBUG_YACC("t_acls")
}
{
DEBUG_YACC("t_access")
}
{
DEBUG_YACC("t_readonly")
}
{
DEBUG_YACC("t_readwrite")
}
{
DEBUG_YACC("t_managers")
}
{
DEBUG_YACC("t_trap")
}
{
DEBUG_YACC("t_trap_num")
}
{
DEBUG_YACC("t_trapcommunity")
}
/*
t_trapdestinators : TRAPDESTINATORS
{
DEBUG_YACC("t_trapdestinators")
}
list_separator : | t_comma
{
DEBUG_YACC("list_separator")
}
*/
/**************** SNMP security (5-13-96) ***/
{
DEBUG_YACC("t_number")
if(parsing_oid == True)
{
{
}
}
}
{
DEBUG_YACC("t_macros")
}
{
DEBUG_YACC("t_equal")
}
{
DEBUG_YACC("t_minus")
}
{
DEBUG_YACC("t_openbracket")
}
{
DEBUG_YACC("t_closebracket")
}
{
DEBUG_YACC("t_opensquarebracket")
}
{
DEBUG_YACC("t_closesquarebracket")
}
{
DEBUG_YACC("t_identifier")
if(parsing_oid == True)
{
{
}
{
}
}
}
{
DEBUG_YACC("t_mib2")
if(parsing_oid == False)
{
}
{
}
}
{
DEBUG_YACC("t_sun")
if(parsing_oid == False)
{
}
{
}
}
{
DEBUG_YACC("t_enterprise")
if(parsing_oid == False)
{
}
{
}
}
{
DEBUG_YACC("t_dot")
}
{
DEBUG_YACC("t_agents")
}
{
DEBUG_YACC("t_name")
}
{
DEBUG_YACC("t_subtrees")
}
{
DEBUG_YACC("t_tables")
}
{
DEBUG_YACC("t_table")
}
{
DEBUG_YACC("t_columns")
}
{
DEBUG_YACC("t_indexs")
}
{
DEBUG_YACC("t_timeout")
}
{
DEBUG_YACC("t_environment")
}
{
DEBUG_YACC("t_watch_dog_time")
}
{
DEBUG_YACC("t_poll_interval")
}
{
DEBUG_YACC("t_max_agent_time_out")
}
{
DEBUG_YACC("t_port")
}
{
DEBUG_YACC("t_quotedstring\n")
}
{
DEBUG_YACC("t_comma")
}
%%
#include "config.lex.c"
/****************************************************************/
{
int new_len;
if(new_subids == NULL)
{
error("malloc() failed");
if(static_subids)
{
}
static_len = 0;
return -1;
}
if(static_subids)
{
}
return 0;
}
/****************************************************************/
{
{
return NULL;
}
{
error("malloc() failed");
return NULL;
}
{
error("malloc() failed");
return NULL;
}
{
error("malloc() failed");
return NULL;
}
first_macro = new;
return new;
}
/****************************************************************/
{
{
{
return mp;
}
}
return NULL;
}
/****************************************************************/
{
{
return;
}
{
}
{
}
return;
}
/****************************************************************/
static void macro_list_delete()
{
while(mp)
{
macro_free(mp);
}
first_macro = NULL;
return;
}
/****************************************************************/
static void trace_macros()
{
trace("MACROS:\n");
{
trace("\t%-30s %-30s\n",
}
trace("\n");
}
/****************************************************************/
int yyerror(char *s)
{
return (0);
}
/****************************************************************/
/*
* filename is the file to be read
* file_time is the modified time of the file, this argument can be NULL
*/
{
int fd;
char *fileaddr;
int error_free = TRUE;
yylineno = 1;
{
error_free = FALSE;
return (error_free);
}
/*
* get the size of the file
*/
{
error_free = FALSE;
return(error_free);
}
{
error_free = FALSE;
return(error_free);
}
/* file time stamp */
/*
* and map it into my address space
*/
{
MAP_PRIVATE, fd, 0)) <= (char *) 0)
{
error_free = FALSE;
return(error_free);
}
/*
* set current lex focus on the file
*/
/*
* and parse the file
*/
if(yyparse() == 1)
{
error_free = FALSE;
}
/*
* Parsing is finished
*
* unmap the file and close it
*/
{
}
} else {
/* empty file, ignore it */
error_free = FALSE;
}
{
}
return(error_free);
}
{
static char file[100];
int error_free;
file[0] = '\0';
else
return(error_free);
}
/* If we have a serious problem, this function will */
/* terminate (<==> exit) the program */
/* now it won't call error_exit, call error only and
return FALSE */
int config_init(char *dirname)
{
int error_free = TRUE;
{
dirname, errno_string());
error_free = FALSE;
return error_free;
}
{
dirname, errno_string());
error_free = FALSE;
return error_free;
}
{
continue;
error_free = FALSE;
continue;
}
config_file_4_res[0] = '\0';
}
{
}
/*
if(tables_to_subtrees(error_label))
{
error("tables_to_subtrees() failed: %s", error_label);
error_free = FALSE;
}
table_list_delete();
*/
if(first_agent == NULL)
{
error("No SNMP agent configured");
error_free = FALSE;
}
if(trace_level > 0)
{
trace_agents();
}
return(error_free);
}
/****************************************************************/
/*
* if pass is TRY, see can we add all the subtrees of the table
* if pass is GO, we really go ahead and add the subtrees
*/
{
/* update the columnar object for the table */
error_label[0] = '\0';
if(static_subids)
{
error("BUG: tables_to_subtrees(): static_subids not NULL");
}
if(static_len)
{
error("BUG: tables_to_subtrees(): static_len not 0");
static_len = 0;
}
{
{
if(pass == TABLE_TO_OID_GO){
}
}
{
return -1;
}
{
return -1;
}
{
return -1;
}
{
return -1;
}
{
if(static_subids)
{
}
if(tbl_tag)
static_len = 0;
return -1;
}
if(pass == TABLE_TO_OID_TRY &&
!= NULL){
return -1;
}
if(static_subids)
{
}
static_len = 0;
}
}
return 0;
}
/* This function translates the tables in subtrees */
/*********** SNMP security (5-13-96) ******/
/* If we have a serious problem, this function will */
/* terminate (<==> exit) the program */
int sec_config_init(char *filename)
{
int error_free = TRUE;
if(trap_community)
{
}
if(trace_level > 0)
{
trace("\n");
trace_filter();
}
return(error_free);
}
{
int error_free = TRUE;
{
dirname, errno_string());
error_free = FALSE;
return error_free;
}
{
int pos;
if( (pos<0) ||
continue;
error_free = FALSE;
continue;
}
config_file_4_res[0] = '\0';
}
{
}
return(error_free);
}
/*********** SNMP security (5-13-96) ******/
void res_config_init(char *dirname)
{
int error_free;
/* delete_resource_list() */
/* if recovery , delete all processes in the pid file */
/* MRF */
/* parsing the resource files in the default directory */
/* last_res_modify_time should be the largest one */
}
read_acl();
/* should update pid file */
}
int resource_update(char *dirname)
{
int error_free = TRUE;
/* MRF: find out the largest latest time stamp of resource files */
/* mark the resouce element to be kept */
/* MRF: reading all resource file again */
/* parsing the resource file */
if(error_free==FALSE){
error("parsing error in reading the resouce file %s:%s",
return FALSE;
}
read_acl();
return TRUE;
}
int read_acl()
{
int error_free=TRUE;
while (sp) {
}
}
init_manager_set ();
while (sp) {
if(trace_level > 0)
{
trace("\n");
trace_agents();
trace_filter();
}
if (error_free) {
init_manager_set ();
}
}
}
return TRUE;
}
{
int error_free=TRUE;
if (sp) {
}
}
init_manager_set ();
if (sp) {
if(trace_level > 0)
{
trace("\n");
trace_agents();
trace_filter();
}
if (error_free) {
init_manager_set ();
}
}
}
return TRUE;
}
{
return 1;
}
if (trace_level > 0)
trace ("read_agent_files() agent -%s- ipaddr %s timeout %d id %d status %d pid %d mgr %X\n",
return 1;
}
/* find an existing SapResource - if found, update the acl
** for this agent
*/
if (sp) {
read_agent_acl (sp);
return 0;
}
if (static_res) {
}
static_res = NULL;
/* see if the agent has a personal resource file - if found,
** create a new SapResource with this
** agentPersonalFile is the .reg file
** agentConfigFile is the .rsrc file
*/
static_res = NULL;
return 0;
}
}
/* else, parse all the resource files in the default directory
** to find one whose agent name matches this one, and use it
*/
while (sp) {
break;
else if (sp->personal_file && ap->agentPersonalFile.chars && !strcmp (sp->personal_file, (char *) (ap->agentPersonalFile.chars)))
break;
else
}
if (sp) {
}
while (sp) {
resource_free (sp);
}
return 0;
}