subtree.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "impl.h"
#include "error.h"
#include "trace.h"
#include "asn1.h"
#include "snmp.h"
#include "pdu.h"
#include "pagent.h"
#include "subtree.h"
/***** STATIC VARIABLES *****/
/***** STATIC FUNCTIONS *****/
extern int SSARegSubtree(SSA_Subtree *);
/****************************************************************/
/* currently, the index are processid(agentid) and local index */
{
/* call reg. api */
int ret;
{
error("BUG: subtree_add(): agent is NULL");
return -1;
}
{
error("malloc() failed");
return -1;
}
{
error("malloc() failed");
return -1;
}
{
if(ret == 0)
{
error("The subtree %s already belongs to the agent %s",
return -1;
}
else
if(ret < 0)
{
break;
}
}
{
first_subtree = new;
}
else
{
}
if(SSARegSubtree(new)==0)
{
return -1;
}
return 0;
}
/****************************************************************/
{
{
error("subtree_match(): name is NULL");
return NULL;
}
if(first_subtree == NULL)
{
/*
if(trace_level > 1)
{
trace("subtree_match() returned NULL\n\n");
}
*/
return NULL;
}
if(type == GETNEXT_REQ_MSG)
{
{
/*
if(trace_level > 1)
{
trace("subtree_match() returned %s supported by %s\n\n",
SSAOidString(&(first_subtree->name)),
first_subtree->agent->name);
}
*/
return first_subtree;
}
}
{
{
break;
}
{
int i;
{
{
continue;
}
{
break;
}
}
{
}
}
}
/*
if(trace_level > 1)
{
if(last)
{
trace("subtree_match() returned %s supported by %s\n\n",
SSAOidString(&(last->name)),
last->agent->name);
}
else
{
trace("subtree_match() returned NULL\n\n");
}
}
*/
return last;
}
/****************************************************************/
void trace_subtrees()
{
trace("SUBTREES:\n");
{
{
trace("\t%-30s %-30s %d\n",
}
else
{
trace("\t%-30s %-30s\n",
"NO AGENT!");
}
}
trace("\n");
}
/****************************************************************/
{
{
return;
}
{
}
}
/****************************************************************/
void subtree_list_delete()
{
while(sp)
{
}
return;
}
/****************************************************************/
{
{
{
break;
}
}
{
return;
}
{
}
else
{
}
return;
}