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#ifndef _SH_TABLE_H_
27#define _SH_TABLE_H_
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#include <unistd.h>
32#include <stdio.h>
33#include <sys/types.h>
34#include <sys/stat.h>
35#include <sys/mman.h>
36#include <netinet/in.h>
37#include <fcntl.h>
38#include <dirent.h>
39#include <string.h>
40
41#include "impl.h"
42#include "error.h"
43#include "trace.h"
44#include "pdu.h"
45
46#include "snmprelay_msg.h"
47#include "agent.h"
48/*
49#ifndef _SUBTREE_H_
50#include "subtree.h"
51#endif
52*/
53
54#define TABLE_TO_OID_TRY 0
55#define TABLE_TO_OID_GO  1
56
57typedef struct _Table {
58	Integer regTblIndex;
59	Integer	regTblAgentID;
60        Oid name;
61        Subid first_column_subid; /* Subid may convert to Integer */
62        Subid last_column_subid;
63        Subid first_index_subid;
64        Subid last_index_subid;
65	Integer	regTblStatus;
66	String	regTblView;
67        Agent *agent;
68        struct _Table *next_table;
69	int mirror_flag;
70} Table;
71
72extern int is_first_entry(Table *table);
73extern void table_free(Table *tp);
74extern void table_list_delete();
75extern void trace_tables();
76extern void delete_all_tables_for_agent(Agent *agent);
77extern void table_detach(Table *tp);
78extern int activate_table(Table *tp);
79extern int delete_table(Table *tp);
80extern int activate_table_for_agent(Agent* agent);
81
82extern Table *first_table;
83extern Table *last_table;
84
85extern int single_table_to_subtrees(int pass,Table *tp, char* error_label);
86
87extern void delete_all_table_from_agent(Agent *agent);
88
89extern void create_mirror_table_from_subtree();
90
91#endif
92