|
1 /* |
|
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
|
3 * |
|
4 * U.S. Government Rights - Commercial software. Government users are subject |
|
5 * to the Sun Microsystems, Inc. standard license agreement and applicable |
|
6 * provisions of the FAR and its supplements. |
|
7 * |
|
8 * |
|
9 * This distribution may include materials developed by third parties. Sun, |
|
10 * Sun Microsystems, the Sun logo and Solaris are trademarks or registered |
|
11 * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|
12 * |
|
13 */ |
|
14 |
|
15 #if !defined(lint) && !defined(NOID) |
|
16 #pragma ident "@(#)agent.h 2.26 00/05/01 SMI" |
|
17 #endif |
|
18 |
|
19 /**************************************************************************** |
|
20 * Copyright (c) 1989, 1990 Epilogue Technology Corporation |
|
21 * All rights reserved. |
|
22 * |
|
23 * This is unpublished proprietary source code of Epilogue Technology |
|
24 * Corporation. |
|
25 * |
|
26 * The copyright notice above does not evidence any actual or intended |
|
27 * publication of such source code. |
|
28 ****************************************************************************/ |
|
29 |
|
30 /* $Header $ */ |
|
31 |
|
32 /* |
|
33 * $Log $ |
|
34 * |
|
35 */ |
|
36 |
|
37 #if (!defined(agent_inc)) |
|
38 #define agent_inc |
|
39 |
|
40 #define AGENT_UDP_PORT 161 |
|
41 |
|
42 #define CONFIG_FILE "/etc/snmp/conf/snmpd.conf" |
|
43 #define MAX_CONFIG_FILE 128 |
|
44 extern char config_file[]; |
|
45 |
|
46 #if 0 |
|
47 /* Say how many minutes the agent can go without a packet before */ |
|
48 /* killing itself. Zero means forever. */ |
|
49 extern int refresh_minutes; |
|
50 #endif /* 0 */ |
|
51 |
|
52 extern int trace_level; |
|
53 extern int read_only; /* Set != 0 if writes are to be blocked */ |
|
54 extern int sun_os_ver; /* Set to 40, 41, ??? */ |
|
55 extern FILE * diagfh; |
|
56 |
|
57 extern time_t cache_now; /* Time of each query. */ |
|
58 |
|
59 #define PERROR(M) perror(M); |
|
60 #define PRNTF0(M) {printf(M);fflush(stdout);} |
|
61 #define PRNTF1(M,A) {printf(M,A);fflush(stdout);} |
|
62 #define PRNTF2(M,A,B) {printf(M,A,B);fflush(stdout);} |
|
63 #define TRC_PRT0(L,M) {if(trace_level>(L)){fprintf(diagfh,M);fflush(diagfh);}} |
|
64 #define TRC_PRT1(L,M,A) {if(trace_level>(L)){fprintf(diagfh,M,A);fflush(diagfh);}} |
|
65 #define TRC_PRT2(L,M,A,B) {if(trace_level>(L)){fprintf(diagfh,M,A,B);fflush(diagfh);}} |
|
66 #define SYSLOG0(M) syslog(LOG_ERR, M) |
|
67 #define SYSLOG1(M,A) syslog(LOG_ERR, M, A) |
|
68 #define SYSLOG2(M,A,B) syslog(LOG_ERR, M, A, B) |
|
69 |
|
70 #if defined(__STDC__) |
|
71 extern int agent_init(int, char *); |
|
72 extern void agent_body(int, char *); |
|
73 #else /* __STDC__ */ |
|
74 extern int agent_init(); |
|
75 extern void agent_body(); |
|
76 #endif /* __STDC__ */ |
|
77 |
|
78 #endif /* defined(agent_inc) */ |