1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * 22 * Copyright 1996 Sun Microsystems, Inc. All Rights Reserved. 23 * Use is subject to license terms. 24 */ 25 26/* 27 * HISTORY 28 * 5-21-96 Jerry Yeung support MIB 29 * 6-4-96 Jerry Yeung support table 30 */ 31 32#ifndef _SUBTREE_H_ 33#define _SUBTREE_H_ 34 35#pragma ident "%Z%%M% %I% %E% SMI" 36 37#ifndef _SH_TABLE_H_ 38#include "sh_table.h" 39#endif 40 41#define TBL_TAG_TYPE_UNKNOWN 0 42#define TBL_TAG_TYPE_COL 1 43#define TBL_TAG_TYPE_LEAF 2 44 45typedef struct _TblTag { 46 int entry_index; /* lowest row index of the table */ 47 int type; /* col or leaf */ 48 Table *table; 49} TblTag; 50 51typedef struct _MirrorTag { 52 Table *table; 53} MirrorTag; 54 55typedef struct _Subtree { 56 Integer regTreeIndex; 57 Integer regTreeAgentID; 58 Oid name; 59/* rename regTreeOID to name, which has already used 60 Oid regTreeOID; 61*/ 62 Integer regTreeStatus; 63 String regTreeView; 64 Integer regTreePriority; 65 struct _Subtree *next_subtree; 66 struct _Agent *agent; 67 struct _Subtree *next_agent_subtree; 68 struct _TblTag *tbl_tag; 69 struct _MirrorTag *mirror_tag; 70 71/* things to be addeded 72 * char view_selected; 73 * char bulk_selected; 74 * int priority; 75 */ 76 77} Subtree; 78 79extern Subtree *first_subtree; 80 81extern int sap_reg_tree_index; 82 83int subtree_add(Agent *agent, Subid *subids, int len, TblTag *tbl_tag); 84 85/* if the the oid doesn't find, it will be created and inserted */ 86Subtree* subtree_find(Subid *subids, int len); 87 88Subtree *subtree_match(u_char type, Oid *oid); 89 90void subtree_list_delete(); 91 92void subtree_free(Subtree *sp); /* to be modified */ 93 94void subtree_detach(Subtree *sp); 95 96void trace_subtrees(); 97 98void subtree_remove_from_agent_list(Subtree *subtree); 99 100int subtree_is_valid(Subtree *subtree); 101 102Subtree* subtree_next(Subtree *subtree); 103 104void delete_all_subtree_from_agent(Agent* agent); 105 106int subtree_purge(Subid *subids, int len); 107 108int sync_subtrees_with_agent(Agent *agent); 109 110#endif 111