xref: /onnv-gate/usr/src/cmd/agents/snmp/agent/pagent.h (revision 0:68f95e015346)
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 /*
23  * Copyright (c) 1998, 2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef _PAGENT_H
28 #define	_PAGENT_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	SSA_OPER_STATUS_ACTIVE			1
37 #define	SSA_OPER_STATUS_NOT_IN_SERVICE		2
38 #define	SSA_OPER_STATUS_NOT_READY		3
39 #define	SSA_OPER_STATUS_CREATE_AND_WAIT		4
40 #define	SSA_OPER_STATUS_DESTROY			5
41 
42 /*
43  * This macro depends on the AgentStatus field in MIB object in the
44  * relay agent
45  */
46 
47 typedef struct _Agent {
48 	int		timeout;
49 	int		agent_id;
50 	int		agent_status;
51 	char		*personal_file;
52 	char		*config_file;
53 	char		*executable;
54 	char		*version_string;
55 	char		*protocol;
56 	int		process_id;
57 	char		*name;
58 	int		system_up_time;
59 	int		watch_dog_time;
60 
61 	Address		address;
62 	struct _Agent	*next_agent;
63 	struct _Subtree	*first_agent_subtree;
64 
65 	int 	tree_index;
66 	int	table_index;
67 } Agent;
68 
69 
70 /* the agent list */
71 extern Agent *first_agent;
72 
73 /* the address is a unique key for an agent */
74 extern Agent *agent_find(Address *address);
75 
76 /* We must invoke subtree_list_delete() before invoking */
77 /* this function because the first_agent_subtree member */
78 /* of the agent structures should be NULL */
79 extern void agent_list_delete(void);
80 extern void trace_agents(void);
81 
82 #ifdef	__cplusplus
83 }
84 #endif
85 
86 #endif /* _PAGENT_H */
87