access.h 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 1998 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "impl.h"
#include "pdu.h"
#ifndef _ACCESS_H_
#define _ACCESS_H_
#define READ_ONLY 1
#define READ_WRITE 2
typedef struct _Community {
struct _Community *next_community;
char *name;
int type;
} Community;
typedef struct _AccessPolicy {
int access_type; /* one access type for all the communities */
int count;
} AccessPolicy;
typedef struct _AccessServer {
struct _AccessServer *next_acc_server;
int attached;
} AccessServer;
typedef struct _Manager {
struct _Manager *next_manager;
char *name;
} Manager;
/****************************************************
--------------
| Manager |-->
| xxxxxxx |
| :name |
| :ip_address |
--------------
|
V
---------- -------------- -------------
| Manager |-->| AccessServer |-->| AccessServer|-->
---------- -------------- -------------
| 0
0 (link to shared object)
V V
------------- --------- ---------
|AccessPolicy|-->|Community|-->|Community|-->
|xxxxxxxxxxxx| |xxxxxxxxx| ---------
|:access_type| |:name |
------------- ---------
1
******************************************************/
typedef struct _SubMember {
char *community_string;
int count;
} SubMember;
typedef struct _SubGroup {
struct _SubGroup *next_sub_group;
} SubGroup;
typedef struct _TrapSlot {
struct _TrapSlot *next_trap_slot;
int num;
} TrapSlot;
typedef struct _EFilter {
struct _EFilter *next_efilter;
char *name;
int type; /* generic or specific */
} EFilter;
/****************************************************
--------------
| EFilter |-->
| xxxxxxx |
| :enterprise |
--------------
| next_efilter
V
---------- first_trap_slot ----------- next_trap_slot ---------
|EFilter |--------------->| TrapSlot |---------------->| TrapSlot|-->
---------- | xxxxxxxxx | ---------
| | : num |
V -----------
| first_sub_group
V
------------------ ------------
| SubGroup |next_sub_group | SubGroup |
| xxxxxxxxxxxxxxxx|--------------> ----------
------------------
0 first_sub_member
0
V
-----------------
| SubMember |first_manager ---------
| xxxxxxxxxxxxxxx |------------>| Manager |
|:community_string| ---------
-----------------
******************************************************/
typedef struct _NameOidPair {
struct _NameOidPair *next;
char *name;
} NameOidPair;
/* routines for trap */
extern void trace_filter();
extern void init_manager_set();
extern Manager* get_curr_manager_set();
extern void delete_manager_list();
extern void trace_managers();
extern void delete_community_list();
extern void trace_communities(Community *c);
/* name oid pair loading */
extern void trace_name_oid_pair();
extern void load_enterprise_oid(char* filename);
#endif