oid.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 1996 Sun Microsystems, Inc. All Rights Reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <syslog.h>
#include <string.h>
#include <netdb.h>
#include <nlist.h>
#include "snmp_msg.h"
#include "impl.h"
#include "trace.h"
#include "snmp.h"
#include "pdu.h"
#include "trap.h"
#include "error.h"
#define BUFSIZE 256
/* get_oid_from_file
it finds the first oid which enterprise string match the input.
*/
{
char *str;
char *name_ptr;
/* first " for name */
*str++;
/* second " for name */
*str = '\0';
*str++;
/* first " for oid_str*/
*str++;
/* second " for oid_str*/
*str = '\0';
}
return(oid);
}
{
char *snm_home;
"/etc/snmp/conf/enterprises.oid");
}
else {
"%s/agents/enterprise.oid", snm_home);
}
return (NULL);
}
else {
if(trace_level > 0) {
}
}
return(oid);
}
}
return (oid);
}
/* error return NULL, success variable */
{
int count;
char *s;
int i;
/* get the attribute name and the type */
return(NULL);
/* get the value */
/* everything after the '(' is the value field */
return(NULL);
s++;
count = 1;
for (; *s && *s == ' '; s++); /* skip leading blanks */
if (*s == ')')
count --;
if (*s == '(')
count ++;
if (count)
value[i] = *s;
else
value[i] = '\0';
}
if (i>= BUFSIZE) {
usage();
}
value[i] = '\0';
}
}
}
}
}
}
}
}
else return (NULL);
return(variable);
} /* get_variable */