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