original files of m241
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/backstop/common.h,v 1.1.1.1 2001/11/05 17:47:18 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: common.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.5 2001/01/19 22:21:24 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.4 2000/03/17 00:16:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.3 1998/02/25 04:43:22 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.2 1998/02/05 22:01:27 josh
|
||||
* moved top-level backstop include files into common/backstop
|
||||
*
|
||||
* Revision 1.1 1997/08/21 17:23:40 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Backstop common.h.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_PREAMBLE
|
||||
|
||||
#else /* CONFIG_PREAMBLE */
|
||||
|
||||
#endif /* CONFIG_PREAMBLE */
|
||||
@@ -0,0 +1,68 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/backstop/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Backstop type definitions file. Just gets size_t from the standard place.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Log: oemtypes.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:19 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:21:24 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:16:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 1998/02/25 04:43:23 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.1 1998/02/05 22:01:28 josh
|
||||
* moved top-level backstop include files into common/backstop
|
||||
*
|
||||
* Revision 1.3 1997/03/20 06:58:18 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.2 1997/02/25 10:57:29 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 1.1 1993/06/17 16:21:50 dab
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The now standard place to find size_t's definition.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/bug.h,v 1.3 2003/01/16 18:20:10 josh Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998-1999 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bug.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:10 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:08 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:17 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.7 2001/01/19 22:21:26 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.6 2000/03/17 00:16:33 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.5 2000/03/09 17:15:38 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.4 1999/03/08 22:12:52 paul
|
||||
* added BUG_TRACE
|
||||
*
|
||||
* Revision 1.3 1998/02/25 04:43:23 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.2 1998/02/05 22:34:41 josh
|
||||
* have to make sure bug.h includes common/h/bugdef.h
|
||||
*
|
||||
* Revision 1.1 1998/02/05 22:19:27 josh
|
||||
* moving commonly used include files into common/h from top-level directory
|
||||
*
|
||||
* Revision 3.11 1997/05/30 16:58:59 lowell
|
||||
* spelling nit that's been bothering me for months
|
||||
*
|
||||
* Revision 3.10 1997/03/20 06:58:17 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 3.9 1997/03/19 04:11:35 sra
|
||||
* BUG() now common to all products, so move the associated .h files.
|
||||
*
|
||||
* Revision 3.8 1996/03/22 10:04:12 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 3.7 1996/03/14 20:16:39 sra
|
||||
* Get rid of default definition of BUG_OUT, I had it right the first
|
||||
* time....
|
||||
*
|
||||
* Revision 3.6 1996/03/11 20:07:33 sra
|
||||
* Add default definition of BUG_OUT to avoid preprocessor problems.
|
||||
*
|
||||
* Revision 3.5 1995/11/24 23:21:04 sra
|
||||
* Add BUG_OUT token to BUG() macros.
|
||||
*
|
||||
* Revision 3.4 1995/06/28 19:43:16 sra
|
||||
* Add cookie argument to BUG() macro.
|
||||
*
|
||||
* Revision 3.3 1995/06/27 06:20:23 sra
|
||||
* Add some debugging code to catch botched packet buffer allocs/frees.
|
||||
*
|
||||
* Revision 3.2 1995/06/26 21:50:52 sra
|
||||
* Soup up a few of the macros. Change the include-protection macro name
|
||||
* to ATTACHE_BUG_H (this file never had anything to do with a certain
|
||||
* DOS network software package, but my fingers slipped and the old macro
|
||||
* name might have confused people...).
|
||||
*
|
||||
* Revision 3.1 1995/06/26 05:12:25 sra
|
||||
* Invert test in BUG_ASSERT().
|
||||
*
|
||||
* Revision 3.0 1995/05/10 22:36:18 sra
|
||||
* Release 3.0.
|
||||
*
|
||||
* Revision 2.2 1995/04/26 01:05:13 sra
|
||||
* Move bug definitions themselves to separate file bugdef.h.
|
||||
*
|
||||
* Revision 2.1 1995/04/10 23:40:30 sra
|
||||
* Initial revision.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef EPILOGUE_BUG_H
|
||||
#define EPILOGUE_BUG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This file defines the framework of the BUG() macro mechanism.
|
||||
*
|
||||
* This is intended to be an extremely general way of handling code
|
||||
* tracing, exception processing, and debugging code, with support
|
||||
* both for arbitrary documentation strings and for making the entire
|
||||
* business go away if you want to save space in production code. The
|
||||
* format is a little strange, mostly because of the relative
|
||||
* weaknesses of C (in particular, of its macro processor).
|
||||
*
|
||||
* There are some sample BUG() macro definitions at the end of this file.
|
||||
*
|
||||
* The general form of an invocation of the BUG() macro is
|
||||
*
|
||||
* BUG( <bug-code>, <fatal-flag>, <cookie>, ( BUG_OUT, <printf-stuff> ));
|
||||
*
|
||||
* <bug-code> (enum bug_codes) indicates the bug that occurred
|
||||
*
|
||||
* <fatal-flag> (enum bug_actions) indicates "fatal" errors
|
||||
*
|
||||
* <cookie> (void *) is for bug-specific useful data, if any
|
||||
*
|
||||
* <printf-stuff> is a parenthesised list of arguments suitable
|
||||
* for passing to a printf()-like function if you want a debugging log.
|
||||
*
|
||||
* In general, bug codes should be unique. The only case where it makes
|
||||
* sense to use the same bug code in multiple places is if both the failure
|
||||
* and any recovery action are identical among the multiple invocations.
|
||||
* The bug codes themselves are defined in a separate file, bugdef.h.
|
||||
*
|
||||
* "fatal" errors means errors serious enough that Attache's attempts
|
||||
* to clean up after the problem may not be sufficent. Attache will
|
||||
* always -try- to continue operation, but you may want to consider
|
||||
* just restarting your system if a "fatal" error occurs.
|
||||
*
|
||||
* The <cookie> is to allow particular BUG() invocations to pass
|
||||
* useful information up to your bug handler code. Most BUG()
|
||||
* invocations will probably just pass a zero (null pointer).
|
||||
* NB: We make no promises whatsoever about consistancy of data passed
|
||||
* in this pointer between releases unless explictly documented in our
|
||||
* manuals. So, in most cases, you should just ignore this field.
|
||||
*
|
||||
* <printf-stuff> has to be handled by in-line code if it's handled at all,
|
||||
* due to limitations of the C macro preprocessor. It should probably
|
||||
* be ignored in a production system, it's just there to ease debugging.
|
||||
*
|
||||
* BUG_OUT is sort of a macro-level cookie; all invocations of BUG()
|
||||
* include this token, you can define it as a macro or an automatic
|
||||
* variable or whatever's convenient. If you're just trying to get
|
||||
* basic output to work in a normal C environment, defining BUG_OUT
|
||||
* as a macro that expands to "stderr" might be a good choice.
|
||||
*/
|
||||
|
||||
/*
|
||||
* <fatal-flag> values.
|
||||
*/
|
||||
enum bug_actions {
|
||||
BUG_FATAL, /* serious bug, consider rebooting now */
|
||||
BUG_CONTINUABLE, /* normal operation can continue, we think */
|
||||
BUG_TRACE /* not a bug, execution trace information */
|
||||
};
|
||||
|
||||
/*
|
||||
* <bug-code> values. Check these with a switch() or if() statement,
|
||||
* don't depend on specific numeric values.
|
||||
*/
|
||||
|
||||
enum bug_codes {
|
||||
|
||||
#define BUGDEF(x) x ,
|
||||
#include <wrn/wm/common/bugdef.h>
|
||||
#undef BUGDEF
|
||||
|
||||
BUG_MAX /* Number of bugs currently defined */
|
||||
};
|
||||
|
||||
/*
|
||||
* I haven't figured out yet whether BUG() should be under a makmak
|
||||
* installation option or not. This will do the right thing for now.
|
||||
*/
|
||||
#ifndef INSTALL_BUG
|
||||
#ifdef BUG
|
||||
#define INSTALL_BUG 1
|
||||
#else
|
||||
#define INSTALL_BUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Variant on BUG() which includes a test condition.
|
||||
*/
|
||||
#ifndef BUG_IF
|
||||
#if INSTALL_BUG
|
||||
#define BUG_IF(v,w,x,y,z) \
|
||||
do { if (v) BUG(w,x,y,z); } while (0)
|
||||
#else
|
||||
#define BUG_IF(v,w,x,y,z)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Variant on standard C "assert()" mechanism.
|
||||
*/
|
||||
#ifndef BUG_ASSERT
|
||||
#if INSTALL_BUG
|
||||
#define BUG_ASSERT(x) \
|
||||
BUG_IF((!(x)), BUG_ASSERTION_FAILED, BUG_FATAL, 0,\
|
||||
(BUG_OUT, "Assertion \"%s\" failed, file %s line %d",\
|
||||
#x, __FILE__, __LINE__))
|
||||
#else
|
||||
#define BUG_ASSERT(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Wrapper for support code for things like BUG_ASSERT().
|
||||
* Useful for declaring variables or adding code that is not itself
|
||||
* a BUG() statement but that will only be used when debugging is enabled.
|
||||
*
|
||||
* Eg:
|
||||
*
|
||||
* void foo_init(void)
|
||||
* {
|
||||
* BUG_SUPPORT(static count = 0);
|
||||
* BUG_IF(count++, BUG_HORRIBLE_BOTCH_IN_FOO_INIT, BUG_FATAL, 0,
|
||||
* (BUG_OUT, "Arg, you called foo_init() again!"));
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
#ifndef BUG_SUPPORT
|
||||
#if INSTALL_BUG
|
||||
#define BUG_SUPPORT(x) x
|
||||
#else
|
||||
#define BUG_SUPPORT(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default definition of BUG() if customer doesn't provide one.
|
||||
* Does nothing at all.
|
||||
*/
|
||||
#ifndef BUG
|
||||
#define BUG(w,x,y,z)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The rest of this file is a couple of sample definitions of the BUG()
|
||||
* macro that might be useful in your environment.
|
||||
*/
|
||||
#if 0
|
||||
|
||||
/*
|
||||
* Sample BUG() that just passes error indication to customer code.
|
||||
*/
|
||||
#define BUG(w,x,y,z) \
|
||||
glue_bug(w,x)
|
||||
|
||||
/*
|
||||
* Sample BUG() that logs errors and handles the fatal flag.
|
||||
* Logging depends on some POSIX-like features that are available on
|
||||
* many but not all systems.
|
||||
* Something like this might be useful in a debugging environment.
|
||||
*
|
||||
* NB: "fprintf z;" is not a typo.
|
||||
*/
|
||||
#define BUG_OUT stderr
|
||||
#define BUG(w,x,y,z) \
|
||||
do {\
|
||||
char now_[30];\
|
||||
time_t now_time_ = time(0);\
|
||||
struct tm *now_tm_ = localtime(&now_time_);\
|
||||
strftime(now_, sizeof(now_), "%H:%M:%S", now_tm_);\
|
||||
fprintf(BUG_OUT, "%s: ", now_);\
|
||||
fprintf z ;\
|
||||
fputc('\n', BUG_OUT);\
|
||||
if ((x) == BUG_FATAL)\
|
||||
fprintf(BUG_OUT, "%s: Fatal error, cannot continue\n", now_);\
|
||||
fflush(BUG_OUT);\
|
||||
if ((x) == BUG_FATAL)\
|
||||
abort();\
|
||||
} while (0)
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPILOGUE_BUG_H */
|
||||
@@ -0,0 +1,417 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/bugdef.h,v 1.2 2003/01/16 18:20:10 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998-1999 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bugdef.h,v $
|
||||
* Revision 1.2 2003/01/16 18:20:10 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:17 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.32 2001/06/12 08:06:02 paul
|
||||
* Added BUG_SOCKET_UPCALL_BAD_CV, BUG_SOCKET_UPCALL_CLOSING.
|
||||
*
|
||||
* Revision 1.31 2001/06/08 19:11:48 paul
|
||||
* Added BUG_ATTACHE_PSOS_THREAD_INFO.
|
||||
*
|
||||
* Revision 1.30 2001/05/31 17:12:18 paul
|
||||
* Added BUG_MEMPOOL_TRACE.
|
||||
*
|
||||
* Revision 1.29 2001/01/19 22:21:27 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.28 2000/12/02 20:23:56 sar
|
||||
* Added a series of bugdefs for v6 stuff
|
||||
* Added bug_pkt_dup_alloc_failed as it got lost somewhere
|
||||
*
|
||||
* Revision 1.27 2000/10/16 19:21:43 paul
|
||||
* Restore sockets and mempool code.
|
||||
*
|
||||
* Revision 1.26 2000/03/17 07:13:38 paul
|
||||
* Roll IPv6 back to the last released state.
|
||||
*
|
||||
* Revision 1.25 2000/03/17 00:16:34 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.24 2000/03/13 21:21:44 paul
|
||||
* Removed some code that we are no longer working on.
|
||||
*
|
||||
* Revision 1.23 2000/02/01 22:01:14 tneale
|
||||
* Added BUG_SNMP_RCV_TRACE
|
||||
*
|
||||
* Revision 1.22 1999/11/10 21:57:09 paul
|
||||
* Added BUG_IF_SEND_TRACE
|
||||
*
|
||||
* Revision 1.14 1999/03/08 22:12:58 paul
|
||||
* added a bunch of socket bugdefs
|
||||
*
|
||||
* Revision 1.13 1999/02/18 04:41:22 wes
|
||||
* Sockets merge: Everything Else
|
||||
* - memory pools
|
||||
* - thread support
|
||||
* - port-specific headers
|
||||
*
|
||||
* Revision 1.12 1998/11/23 20:52:59 wes
|
||||
* Make MEDIA_CTL_CHECK_ADDRESS succeed rather than die.
|
||||
* Die using BUG instead of abort() for unknown media_ctl ops.
|
||||
*
|
||||
* Revision 1.11.2.4 1998/10/21 20:22:41 wes
|
||||
* Correct comments to reflect new usage of SOCKET_{TRACE,INFO}
|
||||
*
|
||||
* Revision 1.11.2.3 1998/10/01 22:43:46 wes
|
||||
* May the Fleas of a Thousand Camels infest the Nether Regions of
|
||||
* Whoever thought of Trigraphs.
|
||||
*
|
||||
* Revision 1.11.2.2 1998/10/01 21:52:05 wes
|
||||
* Use the BUG macro closer to how it was intended to be used
|
||||
*
|
||||
* Revision 1.11.2.1 1998/09/30 22:05:56 wes
|
||||
* Add THREAD_TRACE bugdef
|
||||
*
|
||||
* Revision 1.11 1998/09/06 08:11:05 sra
|
||||
* Packet filtering hooks in Attache, rudimentary firewall
|
||||
* implementation in Snark.
|
||||
*
|
||||
* Revision 1.10 1998/08/07 23:56:47 meister
|
||||
* added BUG_ARP_SEND_REQUEST BUG_ARP_SEND BUG_ET_ARP_SEND_TRACE
|
||||
* BUG_ARP_RCV_TRACE
|
||||
*
|
||||
* Revision 1.9 1998/07/30 22:11:49 meister
|
||||
* added BUG_SNARK_PSOSTTY_INFO
|
||||
*
|
||||
* Revision 1.8 1998/07/24 16:53:02 meister
|
||||
* Added BUG_ATTACHE_PSOS_NIDRV_INFO
|
||||
*
|
||||
* Revision 1.7 1998/07/03 18:37:32 sra
|
||||
* Add trace calls to route_host_lookup().
|
||||
*
|
||||
* Revision 1.6 1998/06/29 22:25:56 sra
|
||||
* More trace symbols.
|
||||
*
|
||||
* Revision 1.5 1998/06/29 03:07:46 sra
|
||||
* Add tracing code to et_rcv().
|
||||
*
|
||||
* Revision 1.4 1998/04/24 18:42:37 wes
|
||||
* Two new bug codes for DHCP
|
||||
*
|
||||
* Revision 1.3 1998/04/16 15:57:46 josh
|
||||
* two new bug definitions for Envoy
|
||||
*
|
||||
* Revision 1.2 1998/02/25 04:43:24 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.1 1998/02/05 22:19:28 josh
|
||||
* moving commonly used include files into common/h from top-level directory
|
||||
*
|
||||
* Revision 3.26 1997/11/20 17:33:15 sra
|
||||
* Clear out a bunch of unused PAP and CHAP bug codes.
|
||||
*
|
||||
* Revision 3.25 1997/11/19 21:14:42 josh
|
||||
* Liaison bug definitions
|
||||
*
|
||||
* Revision 3.24 1997/11/18 03:18:24 sra
|
||||
* Brand new PAP and CHAP code for PPP.
|
||||
*
|
||||
* Revision 3.23 1997/10/28 00:51:48 sra
|
||||
* Convert PPP code to use BUG() macro.
|
||||
* Bang on CHAP and PAP code some more.
|
||||
* Create test driver for PPP under Snark/BSD.
|
||||
*
|
||||
* Revision 3.22 1997/10/15 19:49:36 sra
|
||||
* Preliminary cleanup of PPP PAP and CHAP modules.
|
||||
*
|
||||
* Revision 3.21 1997/08/15 22:14:57 lowell
|
||||
* PAP/CHAP polishing
|
||||
*
|
||||
* Revision 3.20 1997/08/14 16:04:33 lowell
|
||||
* boilerplate
|
||||
*
|
||||
* Revision 3.19 1997/07/29 00:18:41 lowell
|
||||
* PAP/CHAP messages for logging already in file
|
||||
*
|
||||
* Revision 3.18 1997/07/17 02:15:56 alan
|
||||
* New errors for a new Decorum
|
||||
*
|
||||
* Revision 3.17 1997/06/17 19:00:20 lowell
|
||||
* more extensive TFTP debugging
|
||||
*
|
||||
* Revision 3.16 1997/05/30 17:00:18 lowell
|
||||
* TFTP (got rid of old TFTP_DEBUG)
|
||||
*
|
||||
* Revision 3.15 1997/05/23 04:13:32 sra
|
||||
* Add BUG_IPADDR_TEST_UNKNOWN_CODE.
|
||||
*
|
||||
* Revision 3.14 1997/05/22 03:35:25 sra
|
||||
* Get rid of struct udp_hdr. Change pkt_rcv_info into an array, convert
|
||||
* receive path to use it instead of passing pointer arguments in upcalls.
|
||||
*
|
||||
* Revision 3.13 1997/05/17 07:39:02 sra
|
||||
* Change IP protocol dispatch to use ip_listener table.
|
||||
*
|
||||
* Revision 3.12 1997/03/20 06:58:16 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 3.11 1997/03/19 04:11:35 sra
|
||||
* BUG() now common to all products, so move the associated .h files.
|
||||
*
|
||||
* Revision 3.10 1997/02/24 14:43:18 josh
|
||||
* new bug definitions for Courier RIP and Attache Plus TCP
|
||||
*
|
||||
* Revision 3.9 1996/10/28 18:19:01 lowell
|
||||
* Decorum messages
|
||||
* Looks like this needs to be freed of its ownership by Attache...
|
||||
*
|
||||
* Revision 3.8 1996/03/22 10:04:12 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 3.7 1996/03/14 17:51:55 lowell
|
||||
* DHCP packet dumper code
|
||||
*
|
||||
* Revision 3.6 1995/12/02 09:15:04 sra
|
||||
* Add a bunch of Courier stuff.
|
||||
*
|
||||
* Revision 3.5 1995/09/28 23:06:59 sra
|
||||
* Fix Courier identifiers and copyrights for release packaging.
|
||||
*
|
||||
* Revision 3.4 1995/06/30 23:24:10 sra
|
||||
* Back out hairy interface to RCI TRACE() to a simpler scheme.
|
||||
*
|
||||
* Revision 3.3 1995/06/30 22:44:00 sra
|
||||
* Add RCI trace bug codes.
|
||||
*
|
||||
* Revision 3.2 1995/06/30 16:10:40 lowell
|
||||
* first few ARP and DHCP bug definitions (more to come)
|
||||
*
|
||||
* Revision 3.1 1995/06/27 06:20:23 sra
|
||||
* Add some debugging code to catch botched packet buffer allocs/frees.
|
||||
*
|
||||
* Revision 3.0 1995/05/10 22:36:18 sra
|
||||
* Release 3.0.
|
||||
*
|
||||
* Revision 1.1 1995/04/25 21:39:43 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* BUGDEF() table (see bug.h)
|
||||
*
|
||||
* NB: This file intentionally does NOT protect against multiple inclusion.
|
||||
*
|
||||
* Bug symbol definitions. This file is included by bug.h,
|
||||
* and may be included by other modules as necessary. It's a separate
|
||||
* file to make it easy to build a translation tables, bitvectors, and
|
||||
* so forth.
|
||||
*
|
||||
* There should not be anything in this file except comments and
|
||||
* invocations of the BUGDEF() macro.
|
||||
*
|
||||
* We'll probably add more of these in every release. Check these
|
||||
* with a switch() or if() statement, don't depend on specific numeric
|
||||
* values.
|
||||
*/
|
||||
|
||||
BUGDEF(BUG_ASSERTION_FAILED) /* bug.h */
|
||||
BUGDEF(BUG_RIP_MBZ_WASNT) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_BAD_ENTRY) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_COULDNT_CREATE_ROUTE) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_COULDNT_CREATE_ROUTE_EXT) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_DURCV) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_NO_BUFFERS) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_SKIPPING_ADDRESS) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_SKIPPING_BROADCAST_ADDRESS) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_ROUTE_CHANGE) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_CLEAR_ROUTE_CACHE) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_RIP_BAD_BROADCAST_ADDRESS) /* attache/net/rip.c */
|
||||
BUGDEF(BUG_IPOPT_TOO_LONG) /* attache/net/ip_opt.c */
|
||||
BUGDEF(BUG_PKT_INIT_NO_MEMORY) /* attache/net/packet.c */
|
||||
BUGDEF(BUG_PKT_ALLOC_ALREADY) /* attache/net/packet.c */
|
||||
BUGDEF(BUG_PKT_FREE_ALREADY) /* attache/net/packet.c */
|
||||
BUGDEF(BUG_IP_SEND_FREED) /* attache/net/ip_send.c */
|
||||
BUGDEF(BUG_ARP_NULL_POINTER) /* attache/net/arp.c */
|
||||
BUGDEF(BUG_DHCP_BAD_PACKET) /* (unused?) */
|
||||
BUGDEF(BUG_DHCP_PACKET_DUMP) /* attache/net/dhcp.c */
|
||||
BUGDEF(BUG_COURIER_TRACE) /* courier/common/trace_ut.h */
|
||||
BUGDEF(BUG_COURIER_IPI_ENABLE_FAILED) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_IPI_INIT_FAILED) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_IPI_REENABLE_FAILED) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_OSPF_INIT_FAILED) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_OSPF_RCV_NO_IFB) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_OSPF_RCV_IFB_DOWN) /* courier/common/epilogue.c */
|
||||
BUGDEF(BUG_COURIER_RIP_RCV_NO_IFB) /* courier/common/udp_ut.c */
|
||||
BUGDEF(BUG_COURIER_RIP_RCV_IFB_DOWN) /* courier/common/udp_ut.c */
|
||||
BUGDEF(BUG_IF_ATTACH_IFB_CREATE_FAILED) /* attache/net/if.c */
|
||||
BUGDEF(BUG_COURIER_TCP_CANT_ALLOCATE_TCB) /* courier/common/tcp_ut.c */
|
||||
BUGDEF(BUG_COURIER_TCP_CANT_BIND_HOST_PASSIVE) /* courier/common/tcp_ut.c */
|
||||
BUGDEF(BUG_COURIER_TCP_MULTIPLE_LISTENS) /* courier/common/tcp_ut.c */
|
||||
BUGDEF(BUG_COURIER_TCP_START_FAILED) /* courier/common/tcp_ut.c */
|
||||
BUGDEF(BUG_COURIER_FATAL_ERROR) /* courier/sys_incl.h */
|
||||
BUGDEF(BUG_DECORUM_BAD_DATE_TYPE) /* decorum/http/date.c */
|
||||
BUGDEF(BUG_DECORUM_BAD_VERSION) /* (unused) */
|
||||
BUGDEF(BUG_DECORUM_CLIENT_ERROR) /* decorum/http/http.c */
|
||||
BUGDEF(BUG_DECORUM_ENV_DUPLICATE_NAME) /* decorum/http/envcfg.c */
|
||||
BUGDEF(BUG_DECORUM_INFO) /* decorum/http/xxx.c */
|
||||
BUGDEF(BUG_DECORUM_MISSING_INBUF) /* (unused) */
|
||||
BUGDEF(BUG_DECORUM_NO_DATE) /* decorum/http/date.c */
|
||||
BUGDEF(BUG_DECORUM_UNEXPECTED_ERR) /* decorum/http/xxx.c */
|
||||
BUGDEF(BUG_DECORUM_XATTACHE_ERROR) /* decorum/http/xattache.c */
|
||||
BUGDEF(BUG_DECORUM_XATTACHE_INFO) /* decorum/http/xattache.c */
|
||||
BUGDEF(BUG_LIAISON_CANT_BIND_OBJECT) /* liaison/xrmon/xsnmp.c */
|
||||
BUGDEF(BUG_LIAISON_UNKNOWN_OBJECT) /* liaison/xrmon/xsnmp.c */
|
||||
BUGDEF(BUG_LIAISON_CANT_ENCODE_TRAP) /* liaison/xrmon/xsnmp.c */
|
||||
BUGDEF(BUG_SNARK_UNEXPECTED_EOF) /* snark/test/main.c */
|
||||
BUGDEF(BUG_TCP_ACK_DATA_FREEING) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_ACK_DATA_HUSHING) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_ACK_DATA_SQUEEZING) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_ACK_DATA_FAST_RETRANSMIT_DONE) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_CLOSE_INVALID_CONNECTION) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_CLOSE_INVALID_STATE) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_ENTER_FUNC) /* attache/net/tcpintnl.h */
|
||||
BUGDEF(BUG_TCP_GET_SND_MSS) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_HANDLE_ACK_DALLY) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_HANDLE_SWS_DALLY) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_POST_DATA_AHEAD) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_POST_DATA_OBSOLETE) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_POST_DATA_POSTING) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_PRINT_PKTHDR) /* attache/net/tcpintnl.h */
|
||||
BUGDEF(BUG_TCP_RCV_ACKED_UNSENT_DATA) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_ACKING_UNACCEPTABLE) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_LOG_PKT) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_REUSING_SAVED_PKT) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_SAVING_EARLY_PKT) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_SCHEDULING_ZERO_WINDOW_PROBE) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_FAST_RETRANSMIT_EQUAL) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RCV_FAST_RETRANSMIT_GREATER) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RETRANSMIT_HANDLER) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_RTT_LOG_1) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_RTT_LOG_2) /* attache/net/tcp_rcv.c */
|
||||
BUGDEF(BUG_TCP_SEND_COPYING) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_DECIDED_TO_SEND) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_ENTRY_LOG) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_FORBIDDEN_BY_SWS) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_LOG_PKT) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_NEW_DATA_BEYOND_WINDOW) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_NOTHING_TO_DO) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_PKTALLOC_FAILED) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SEND_SCHEDULING_RETRANSMISSION) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SET_ACK_DALLY) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_SET_RCV_MSS) /* attache/net/tcp_send.c */
|
||||
BUGDEF(BUG_TCP_SET_SWS_DALLY) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TCP_SET_TIME_WAIT) /* attache/net/tcp.c */
|
||||
BUGDEF(BUG_TFTP_BAD_PORT) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_CNXN_NOTFOUND) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_ALLOC_PKT_FAIL) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_ALLOC_MEM_FAIL) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_TIMEOUT) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_WRONG_ACK) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_TFTP_WRONG_BLOCK) /* attache/net/tftpc.c */
|
||||
BUGDEF(BUG_IP_RCV_UNRECOGNIZED_IP_VERSION) /* attache/net/ip_rcv.c */
|
||||
BUGDEF(BUG_PKT_APPEND_OVERFLOW) /* attache/h/packet.h */
|
||||
BUGDEF(BUG_IPADDR_TEST_UNKNOWN_CODE) /* attache/net/ipaddr.c */
|
||||
BUGDEF(BUG_PPP_CHAP_PKT_ALLOC_FAILED) /* attache/net/pppchap.c */
|
||||
BUGDEF(BUG_ATTACHE_PPP_LCP_BAD_TIMEOUT) /* attache/net/ppp.c */
|
||||
BUGDEF(BUG_ATTACHE_PPP_IPCP_BAD_TIMEOUT) /* attache/net/ppp.c */
|
||||
BUGDEF(BUG_ATTACHE_PPP_LCP_EVENT) /* attache/net/ppp.c */
|
||||
BUGDEF(BUG_ATTACHE_PPP_IPCP_EVENT) /* attache/net/ppp.c */
|
||||
BUGDEF(BUG_SNARK_PPP_AUTH_STATUS) /* snark/lib/netconf.c */
|
||||
BUGDEF(BUG_PPP_CHAP_CHALLENGE_TIMEOUT) /* attache/net/pppchap.c */
|
||||
BUGDEF(BUG_PPP_CHAP_SERVER_UNEXPECTED_STATE) /* attache/net/pppchap.c */
|
||||
BUGDEF(BUG_PPP_CHAP_CLIENT_UNEXPECTED_STATE) /* attache/net/pppchap.c */
|
||||
BUGDEF(BUG_PPP_AUTH_ALLOC_FAILED) /* attache/net/pppauth.c */
|
||||
BUGDEF(BUG_PPP_AUTH_BAD_FLAGS) /* attache/net/pppauth.c */
|
||||
BUGDEF(BUG_PPP_CHAP_SERVER_ENABLED) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_PAP_SERVER_ENABLED) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_NEGOTIATING_CHAP) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_NEGOTIATING_PAP) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_LCP_UNKNOWN_NAK) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_LCP_UNKNOWN_REQ) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_LCP_RCV) /* attache/net/ppplcp.c */
|
||||
BUGDEF(BUG_PPP_PAP_CLIENT_UNEXPECTED_STATE) /* attache/net/ppppap.c */
|
||||
BUGDEF(BUG_PPP_PAP_PKT_ALLOC_FAILED) /* attache/net/ppppap.c */
|
||||
BUGDEF(BUG_PPP_PAP_REQUEST_TIMEOUT) /* attache/net/ppppap.c */
|
||||
BUGDEF(BUG_PPP_PAP_SERVER_UNEXPECTED_STATE) /* attache/net/ppppap.c */
|
||||
BUGDEF(BUG_ENVOY_LOCKING) /* envoy/snmp */
|
||||
BUGDEF(BUG_ENVOY_INSUFFICIENT_MEMORY) /* envoy/snmp */
|
||||
BUGDEF(BUG_DHCP_STATE_TRACE) /* attache/net/dhcp.c */
|
||||
BUGDEF(BUG_DHCP_TIMER_TRACE) /* attache/net/dhcp.c */
|
||||
BUGDEF(BUG_ET_RCV_TRACE) /* attache/net/et_rcv.c */
|
||||
BUGDEF(BUG_ET_SEND_TRACE) /* attache/net/et_send.c */
|
||||
BUGDEF(BUG_IF_SEND_TRACE) /* attache/net/if.c */
|
||||
BUGDEF(BUG_IP_RCV_TRACE) /* attache/net/ip_rcv.c */
|
||||
BUGDEF(BUG_IP_SEND_TRACE) /* attache/net/ip_send.c */
|
||||
BUGDEF(BUG_ICMP_RCV_TRACE) /* attache/net/icmp.c */
|
||||
BUGDEF(BUG_ICMP_SEND_TRACE) /* attache/net/icmp.c */
|
||||
BUGDEF(BUG_IP_RTE_TRACE) /* attache/net/ip_rte.c */
|
||||
BUGDEF(BUG_ATTACHE_PSOS_NIDRV_INFO) /* attache/psos support */
|
||||
BUGDEF(BUG_SNARK_PSOSTTY_INFO) /* snark/psostty.c */
|
||||
BUGDEF(BUG_ARP_SEND_REQUEST) /* attache/net/arp.c */
|
||||
BUGDEF(BUG_ARP_SEND) /* attache/net/arp.c */
|
||||
BUGDEF(BUG_ET_ARP_SEND_TRACE) /* attache/net/et_send.c*/
|
||||
BUGDEF(BUG_ARP_RCV_TRACE) /* attache/net/arp.c */
|
||||
BUGDEF(BUG_SNARK_FIREWALL_CONFIG_ALLOC_FAILED) /* snark/lib/firewall.c */
|
||||
BUGDEF(BUG_SNARK_FIREWALL_CONFIG_PARSE_ERROR) /* snark/lib/firewall.c */
|
||||
BUGDEF(BUG_SNARK_FIREWALL_ALLOW_PKT) /* snark/lib/firewall.c */
|
||||
BUGDEF(BUG_SNARK_FIREWALL_DROP_PKT) /* snark/lib/firewall.c */
|
||||
BUGDEF(BUG_SNARK_FIREWALL_RESET_PKT) /* snark/lib/firewall.c */
|
||||
BUGDEF(BUG_SNARK_TUN_ERROR) /* snark/lib/tun.c */
|
||||
BUGDEF(BUG_THREAD_TRACE) /* common/lib/thread_debug.c */
|
||||
BUGDEF(BUG_SOCKET_ENTER_FUNC) /* attache/sockets/sockintl.h */
|
||||
BUGDEF(BUG_SOCKET_TRACE) /* attache/sockets/sockintl.h */
|
||||
BUGDEF(BUG_SOCKET_ACCEPT_EMFILE) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_ALLOC) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_LISTEN_BACKLOG) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_RCVQ_EMPTY) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_BAD_SOCKET) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_BAD_STATE) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_BAD_CV) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_DFQ_FULL) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_RCVQ_FULL) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_SHUTDOWN) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_UPCALL_CLOSING) /* attache/sockets/socktcp.c */
|
||||
BUGDEF(BUG_SOCKET_IOCTL_ADD_ROUTE) /* attache/sockets/sockif.c */
|
||||
BUGDEF(BUG_SOCKET_IOCTL_DEL_ROUTE) /* attache/sockets/sockif.c */
|
||||
BUGDEF(BUG_SNMP_RCV_TRACE) /* attache/net/snmpfunc.c */
|
||||
BUGDEF(BUG_IPV6_SEND_TRACE) /* attache/net/ip6_send.c */
|
||||
BUGDEF(BUG_IPV6_SEND_ERROR) /* attache/net/ip6_send.c */
|
||||
BUGDEF(BUG_IPV6_RCV_TRACE) /* attache/net/ip6_rcv.c */
|
||||
BUGDEF(BUG_IPV6_RCV_ERROR) /* attache/net/ip6_rcv.c */
|
||||
BUGDEF(BUG_IPV6_CKSUM_TRACE) /* attache/net/ip6_cksum.c */
|
||||
BUGDEF(BUG_IPV6_ICMP_TRACE) /* attache/net/icmpv6.c */
|
||||
BUGDEF(BUG_IPV6_ICMP_ERROR) /* attache/net/icmpv6.c */
|
||||
BUGDEF(BUG_IPV6_DAD_TRACE) /* attache/net/ip6_cfg.c */
|
||||
BUGDEF(BUG_IPV6_DAD_ERROR) /* attache/net/ip6_cfg.c */
|
||||
BUGDEF(BUG_IPV6_ND_TRACE) /* attache/net/ip6_nd.c */
|
||||
BUGDEF(BUG_IPV6_ND_ERROR) /* attache/net/ip6_nd.c */
|
||||
BUGDEF(BUG_IPV6_RD_TRACE) /* attache/net/ip6_rd.c */
|
||||
BUGDEF(BUG_IPV6_RD_ERROR) /* attache/net/ip6_rd.c */
|
||||
BUGDEF(BUG_IPV6_RDRT_TRACE) /* attache/net/ip6_rdrt.c */
|
||||
BUGDEF(BUG_IPV6_RDRT_ERROR) /* attache/net/ip6_rdrt.c */
|
||||
BUGDEF(BUG_IPV6_FRAG_TRACE) /* attache/net/ip6_frag.c */
|
||||
BUGDEF(BUG_IPV6_FRAG_ERROR) /* attache/net/ip6_frag.c */
|
||||
BUGDEF(BUG_PKT_DUP_ALLOC_FAILED) /* attache/net/ip_rcv.c */
|
||||
BUGDEF(BUG_MEMPOOL_TRACE) /* snark/lib/pool.c */
|
||||
BUGDEF(BUG_ATTACHE_PSOS_THREAD_INFO) /* attache/psos/thread.c */
|
||||
/* End of bugdef.h */
|
||||
@@ -0,0 +1,118 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/cmn_init.h,v 1.3 2003/01/16 18:20:11 josh Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: cmn_init.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:11 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:09 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.10 2001/01/19 22:21:27 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.9 2000/03/17 00:16:35 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.8 2000/03/09 19:09:22 josh
|
||||
* changes so we don't shoot ourselves in the foot if we're building
|
||||
* Emissary or Liaison
|
||||
*
|
||||
* Revision 1.7 1998/09/11 16:30:40 paul
|
||||
* Auto-initialize common library.
|
||||
*
|
||||
* Revision 1.6 1998/06/19 20:46:29 sra
|
||||
* Minor cleanups to crypto code installation options.
|
||||
*
|
||||
* Revision 1.5 1998/02/25 04:43:25 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.4 1997/10/30 16:44:29 sra
|
||||
* Fix copyright date.
|
||||
*
|
||||
* Revision 1.3 1997/10/15 19:45:14 sra
|
||||
* Cleanup.
|
||||
*
|
||||
* Revision 1.2 1997/08/14 16:04:37 lowell
|
||||
* boilerplate
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
extern void etc_common_init(void); /* init the common library */
|
||||
|
||||
/*
|
||||
* The purpose of the following incantations is to make sure that exactly
|
||||
* one Epilogue product initializes the common library. The decision of
|
||||
* which product should do the initialization is made at compile time,
|
||||
* according to the following if/else-if/else chain. The intent is to
|
||||
* keep all of the control of how this happens localized in one place.
|
||||
*/
|
||||
|
||||
#if defined(INSTALL_ATTACHE) && INSTALL_ATTACHE
|
||||
#define COMMON_INIT_FROM_ATTACHE() etc_common_init()
|
||||
#elif defined(INSTALL_ENVOY) && INSTALL_ENVOY
|
||||
#define COMMON_INIT_FROM_ENVOY() etc_common_init()
|
||||
#elif defined(INSTALL_COURIER) && INSTALL_COURIER
|
||||
#define COMMON_INIT_FROM_COURIER() etc_common_init()
|
||||
#elif defined(INSTALL_DECORUM) && INSTALL_DECORUM
|
||||
#define COMMON_INIT_FROM_DECORUM() etc_common_init()
|
||||
#elif defined(INSTALL_LIAISON) && INSTALL_LIAISON
|
||||
#define COMMON_INIT_FROM_LIAISON() etc_common_init()
|
||||
#elif defined(INSTALL_EMISSARY) && INSTALL_EMISSARY
|
||||
/* We don't care in this case... */
|
||||
#else
|
||||
#error Internal error! Nobody calls etc_common_init()!
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_INIT_FROM_ATTACHE
|
||||
#define COMMON_INIT_FROM_ATTACHE()
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_INIT_FROM_ENVOY
|
||||
#define COMMON_INIT_FROM_ENVOY()
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_INIT_FROM_COURIER
|
||||
#define COMMON_INIT_FROM_COURIER()
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_INIT_FROM_DECORUM
|
||||
#define COMMON_INIT_FROM_DECORUM()
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_INIT_FROM_LIAISON
|
||||
#define COMMON_INIT_FROM_LIAISON()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/config.h,v 1.3 2003/01/16 18:20:11 josh Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: config.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:11 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:09 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.9 2001/01/19 22:21:27 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.8 2000/03/17 00:16:35 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.7 1998/02/25 04:43:25 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.6 1998/02/05 22:37:35 josh
|
||||
* Changing references to types.h so we include common/h/types.h instead
|
||||
*
|
||||
* Revision 1.5 1997/08/21 17:23:42 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
* Revision 1.4 1997/08/14 16:04:38 lowell
|
||||
* boilerplate
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_CONFIG_H
|
||||
#define COMMON_CONFIG_H
|
||||
|
||||
/*
|
||||
* Grab the standard top-level includes.
|
||||
*/
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Load the preamble portion of the customer's common.h file.
|
||||
*/
|
||||
|
||||
#define CONFIG_PREAMBLE 1
|
||||
#include <common.h>
|
||||
#undef CONFIG_PREAMBLE
|
||||
|
||||
#endif /* COMMON_CONFIG_H */
|
||||
@@ -0,0 +1,93 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/des.h,v 1.3 2003/01/16 18:20:11 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* this DES implementation derived from Phil Karns public domain DES.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef EPILOGUE_DES_H
|
||||
#define EPILOGUE_DES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
typedef bits32_t DES_KS[16][2]; /* Single-key DES key schedule */
|
||||
typedef bits32_t DES3_KS[48][2]; /* Triple-DES key schedule */
|
||||
|
||||
typedef struct
|
||||
{ int decrypt;
|
||||
DES_KS keysched;
|
||||
bits8_t iv [8];
|
||||
} DES_CTX;
|
||||
|
||||
#if INSTALL_COMMON_3DES
|
||||
|
||||
typedef struct
|
||||
{ int decrypt;
|
||||
DES3_KS keysched;
|
||||
bits8_t iv [8];
|
||||
} DES3_CTX;
|
||||
|
||||
#endif /* INSTALL_COMMON_3DES */
|
||||
|
||||
#ifndef _EXCLUDE_PROTOTYPES_
|
||||
|
||||
int des_is_real(void);
|
||||
void deskey (DES_KS, bits8_t *,int);
|
||||
void des (DES_KS, bits8_t *, bits8_t *);
|
||||
void desecb_block_encrypt (DES_CTX *ctx, bits8_t *in, bits8_t *out);
|
||||
void descbc_block_decrypt (DES_CTX *ctx, bits8_t *in, bits8_t *out);
|
||||
void descbc_block_encrypt (DES_CTX *ctx, bits8_t *in, bits8_t *out);
|
||||
void descbc_init_context (void *ctx, bits8_t *key, int decrypt);
|
||||
void descbc_iv_context (void *ctx, bits8_t *iv);
|
||||
void descbc_crypt (void *ctx, bits8_t *in, bits8_t *out, bits32_t n);
|
||||
|
||||
#if INSTALL_COMMON_3DES
|
||||
void des3key (DES3_KS, bits8_t *,int);
|
||||
void des3 (DES3_KS, bits8_t *, bits8_t *);
|
||||
void des3cbc_block_decrypt (DES3_CTX *ctx, bits8_t *in, bits8_t *out);
|
||||
void des3cbc_block_encrypt (DES3_CTX *ctx, bits8_t *in, bits8_t *out);
|
||||
void des3cbc_init_context (void *ctx, bits8_t *key, int decrypt);
|
||||
void des3cbc_iv_context (void *ctx, bits8_t *iv);
|
||||
void des3cbc_crypt (void *ctx, bits8_t *in, bits8_t *out, bits32_t n);
|
||||
#endif /* INSTALL_COMMON_3DES */
|
||||
|
||||
#endif /* ifndef _EXCLUDE_PROTOTYPES_ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPILOGUE_DES_H */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,333 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/dyncfg.h,v 1.2 2003/01/16 18:20:11 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: dyncfg.h,v $
|
||||
* Revision 1.2 2003/01/16 18:20:11 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_DYNCFG_H
|
||||
# define COMMON_DYNCFG_H 1
|
||||
|
||||
/*
|
||||
* see example of usage at end of file
|
||||
*/
|
||||
|
||||
#if INSTALL_COMMON_DYNAMIC_COMP_CONFIG
|
||||
|
||||
/*
|
||||
* macros for declaring the function pointers which will be used by
|
||||
* the dynamic component code. Each is of the form
|
||||
* DYNCFG_FUNCPTR<n_args>(<function_name>,<return_type>,<argtype>,<argtype>...)
|
||||
*
|
||||
* Variants for declaring it to be global, static to file, or extern.
|
||||
* Current code which references a function which may be in a component which
|
||||
* may not be loaded, must be changed to call the function via a pointer
|
||||
* dereference, the pointer having been declared via one of these macros.
|
||||
*
|
||||
* These macros evaluate to nothing if INSTALL_COMMON_DYNAMIC_COMP_CONFIG
|
||||
* is turned off.
|
||||
*/
|
||||
|
||||
#define DYNCFG_FUNCPTR0(X,rval) \
|
||||
rval (*DYN_PTR_##X) ();
|
||||
#define DYNCFG_STATIC_FUNCPTR0(X,rval) \
|
||||
static rval (*DYN_PTR_##X) ();
|
||||
#define DYNCFG_EXTERN_FUNCPTR0(X,rval) \
|
||||
extern rval (*DYN_PTR_##X) ();
|
||||
|
||||
#define DYNCFG_FUNCPTR1(X,rval,a1) \
|
||||
rval (*DYN_PTR_##X) (a1);
|
||||
#define DYNCFG_STATIC_FUNCPTR1(X,rval,a1) \
|
||||
static rval (*DYN_PTR_##X) (a1);
|
||||
#define DYNCFG_EXTERN_FUNCPTR1(X,rval,a1) \
|
||||
extern rval (*DYN_PTR_##X) (a1);
|
||||
|
||||
#define DYNCFG_FUNCPTR2(X,rval,a1,a2) \
|
||||
rval (*DYN_PTR_##X) (a1, a2);
|
||||
#define DYNCFG_STATIC_FUNCPTR2(X,rval,a1,a2) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2);
|
||||
#define DYNCFG_EXTERN_FUNCPTR2(X,rval,a1,a2) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2);
|
||||
|
||||
#define DYNCFG_FUNCPTR3(X,rval,a1,a2,a3) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3);
|
||||
#define DYNCFG_STATIC_FUNCPTR3(X,rval,a1,a2,a3) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3);
|
||||
#define DYNCFG_EXTERN_FUNCPTR3(X,rval,a1,a2,a3) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3);
|
||||
|
||||
#define DYNCFG_FUNCPTR4(X,rval,a1,a2,a3, a4) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4);
|
||||
#define DYNCFG_STATIC_FUNCPTR4(X,rval,a1,a2,a3,a4) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4);
|
||||
#define DYNCFG_EXTERN_FUNCPTR4(X,rval,a1,a2,a3,a4) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4);
|
||||
|
||||
#define DYNCFG_FUNCPTR5(X,rval,a1,a2,a3,a4,a5) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5);
|
||||
#define DYNCFG_STATIC_FUNCPTR5(X,rval,a1,a2,a3,a4,a5) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5);
|
||||
#define DYNCFG_EXTERN_FUNCPTR5(X,rval,a1,a2,a3,a4,a5) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5);
|
||||
|
||||
#define DYNCFG_FUNCPTR6(X,rval,a1,a2,a3,a4,a5,a6) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6);
|
||||
#define DYNCFG_STATIC_FUNCPTR6(X,rval,a1,a2,a3,a4,a5,a6) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6);
|
||||
#define DYNCFG_EXTERN_FUNCPTR6(X,rval,a1,a2,a3,a4,a5,a6) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6);
|
||||
|
||||
#define DYNCFG_FUNCPTR7(X,rval,a1,a2,a3,a4,a5,a6,a7) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7);
|
||||
#define DYNCFG_STATIC_FUNCPTR7(X,rval,a1,a2,a3,a4,a5,a6,a7) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7);
|
||||
#define DYNCFG_EXTERN_FUNCPTR7(X,rval,a1,a2,a3,a4,a5,a6,a7) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7);
|
||||
|
||||
#define DYNCFG_FUNCPTR8(X,rval,a1,a2,a3,a4,a5,a6,a7,a8) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
#define DYNCFG_STATIC_FUNCPTR8(X,rval,a1,a2,a3,a4,a5,a6,a7,a8) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
#define DYNCFG_EXTERN_FUNCPTR8(X,rval,a1,a2,a3,a4,a5,a6,a7,a8) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
|
||||
#define DYNCFG_FUNCPTR9(X,rval,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
#define DYNCFG_STATIC_FUNCPTR9(X,rval,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
#define DYNCFG_EXTERN_FUNCPTR9(X,rval,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||
|
||||
#define DYNCFG_FUNCPTR10(X, rval, a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
|
||||
rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
|
||||
#define DYNCFG_STATIC_FUNCPTR10(X,rval,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
|
||||
static rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
|
||||
#define DYNCFG_EXTERN_FUNCPTR10(X,rval,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
|
||||
extern rval (*DYN_PTR_##X) (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
|
||||
|
||||
/*
|
||||
* This macro provides the mechanism for calling a function which may be in a
|
||||
* non-installed component. If INSTALL_COMMON_DYNAMIC_COMP_CONFIG is not
|
||||
* installed, it evaluates to a normal function call, calling X in the usual
|
||||
* way.
|
||||
*/
|
||||
|
||||
#define DYNCFG_FUNCALL(X) (*DYN_PTR_##X)
|
||||
|
||||
/*
|
||||
* This macro returns the actual function pointer itself.
|
||||
*/
|
||||
|
||||
#define DYNCFG_FUNCPTR(X) DYN_PTR_##X
|
||||
|
||||
/*
|
||||
* this macro sets a previously declared (by DYNCFG_*_FUNCPTR?()) to its
|
||||
* most likely default, the name of the function we named it after.
|
||||
*/
|
||||
|
||||
#define DYNCFG_FUNCPTR_SET_DEFAULT(X) DYN_PTR_##X = X
|
||||
|
||||
/*
|
||||
* this macro sets a previously declared (by DYNCFG_*_FUNCPTR?()) to
|
||||
* something other than the probable default
|
||||
*/
|
||||
|
||||
#define DYNCFG_FUNCPTR_SET(X,Y) DYN_PTR_##X = Y
|
||||
|
||||
|
||||
/*
|
||||
* these macros are for declaring variable pointers which will be used by
|
||||
* dynamic component code, which may need to reference a variable which will
|
||||
* only exist if a specific component is included.
|
||||
*
|
||||
* Variants for declaring it to be global, static to file, or extern.
|
||||
* Current code which references a variable which may be in a component which
|
||||
* may not be loaded, must be changed to reference the variable via a pointer
|
||||
* dereference, the pointer having been declared via one of these macros.
|
||||
*
|
||||
* These macros evaluate to nothing if INSTALL_COMMON_DYNAMIC_COMP_CONFIG
|
||||
* is turned off.
|
||||
*/
|
||||
|
||||
#define DYNCFG_VBLPTR(X,type) type *DYNCFG_VPTR_##X;
|
||||
#define DYNCFG_VBLPTR_STATIC(X,type) static type *DYNCFG_VPTR_##X;
|
||||
#define DYNCFG_VBLPTR_EXTERN(X,type) extern type *DYNCFG_VPTR_##X;
|
||||
|
||||
/*
|
||||
* This macro provides the mechanism for referring to a variable which may be
|
||||
* in a non-installed component.
|
||||
* If INSTALL_COMMON_DYNAMIC_COMP_CONFIG is not
|
||||
* installed, it evaluates to a normal variable reference.
|
||||
*/
|
||||
|
||||
#define DYNCFG_VREF(X) (*DYNCFG_VPTR_##X)
|
||||
|
||||
/*
|
||||
* these macros are for delimiting blocks of code which are currently delimited
|
||||
* by #if <install_option> directives. They arrange for the block of code to
|
||||
* be enclosed by a if (DYNCFG_VBL_label) { } construct. You then compile the
|
||||
* code for the dynamic component case by turning on both the <install_option>
|
||||
* and INSTALL_COMMON_DYNAMIC_COMP_CONFIG.
|
||||
* These macros evaluate to nothing if INSTALL_COMMON_DYNAMIC_COMP_CONFIG is
|
||||
* turned off.
|
||||
*
|
||||
* DYNCFG_IFCFGVBL_END(X) and DYNCFG_IFNOTCFGVBL_END(X) both take an argument
|
||||
* solely to make the code more readable.
|
||||
*/
|
||||
|
||||
#define DYNCFG_IFCFGVBL_BEGIN(X) if (DYNCFG_VBL_##X) {
|
||||
#define DYNCFG_IFNOTCFGVBL_BEGIN(X) if (!DYNCFG_VBL_##X) {
|
||||
#define DYNCFG_IFCFGVBL_ELSE(X) } else {
|
||||
#define DYNCFG_IFNOTCFGVBL_ELSE(X) } else {
|
||||
#define DYNCFG_IFCFGVBL_ELSEDEFAULT(X) } else { goto default; }
|
||||
#define DYNCFG_IFCFGVBL_END(X) }
|
||||
#define DYNCFG_IFNOTCFGVBL_END(X) }
|
||||
|
||||
/*
|
||||
* These macros provide the mechanism to declare the variables which are
|
||||
* used in the above code enclusure macros. They evaluate to nothing if
|
||||
* INSTALL_COMMON_DYNAMIC_COMP_CONFIG is turned off.
|
||||
*/
|
||||
|
||||
#define DYNCFG_VBL_DECLARE_EXTERN(X) extern int DYNCFG_VBL_##X;
|
||||
#define DYNCFG_VBL_DECLARE_GLOBAL(X) int DYNCFG_VBL_##X;
|
||||
#define DYNCFG_VBL_DECLARE_STATIC(X) static int DYNCFG_VBL_##X;
|
||||
|
||||
/*
|
||||
* Use this macro to set one of these config variables to some value "val"
|
||||
*/
|
||||
|
||||
#define DYNCFG_VBL_SET(X,val) DYNCFG_VBL_##X = val
|
||||
|
||||
/*
|
||||
* this macro returns the actual variable itself
|
||||
*/
|
||||
|
||||
#define DYNCFG_VBL(X) DYNCFG_VBL_##X
|
||||
|
||||
#else
|
||||
|
||||
#define DYNCFG_FUNCPTR0(X,rval)
|
||||
#define DYNCFG_STATIC_FUNCPTR0(X,rval)
|
||||
#define DYNCFG_EXTERN_FUNCPTR0(X,rval)
|
||||
|
||||
#define DYNCFG_FUNCPTR1(X,rval,a1)
|
||||
#define DYNCFG_STATIC_FUNCPTR1(X,rval,a1)
|
||||
#define DYNCFG_EXTERN_FUNCPTR1(X,rval,a1)
|
||||
|
||||
#define DYNCFG_FUNCPTR2(X,rval,a1,a2)
|
||||
#define DYNCFG_STATIC_FUNCPTR2(X,rval,a1,a2)
|
||||
#define DYNCFG_EXTERN_FUNCPTR2(X,rval,a1,a2)
|
||||
|
||||
#define DYNCFG_FUNCPTR3(X,rval,a1,a2,a3)
|
||||
#define DYNCFG_STATIC_FUNCPTR3(X,rval,a1,a2,a3)
|
||||
#define DYNCFG_EXTERN_FUNCPTR3(X,rval,a1,a2,a3)
|
||||
|
||||
#define DYNCFG_FUNCPTR4(X,rval,a1,a2,a3, a4)
|
||||
#define DYNCFG_STATIC_FUNCPTR4(X,rval,a1,a2,a3, a4)
|
||||
#define DYNCFG_EXTERN_FUNCPTR4(X,rval,a1,a2,a3, a4)
|
||||
|
||||
#define DYNCFG_FUNCPTR5(X,rval,a1,a2,a3, a4, a5)
|
||||
#define DYNCFG_STATIC_FUNCPTR5(X,rval,a1,a2,a3, a4, a5)
|
||||
#define DYNCFG_EXTERN_FUNCPTR5(X,rval,a1,a2,a3, a4, a5)
|
||||
|
||||
#define DYNCFG_FUNCPTR6(X,rval,a1,a2,a3, a4, a5, a6)
|
||||
#define DYNCFG_STATIC_FUNCPTR6(X,rval,a1,a2,a3, a4, a5, a6)
|
||||
#define DYNCFG_EXTERN_FUNCPTR6(X,rval,a1,a2,a3, a4, a5, a6)
|
||||
|
||||
#define DYNCFG_FUNCPTR7(X,rval,a1,a2,a3, a4, a5, a6, a7)
|
||||
#define DYNCFG_STATIC_FUNCPTR7(X,rval,a1,a2,a3, a4, a5, a6, a7)
|
||||
#define DYNCFG_EXTERN_FUNCPTR7(X,rval,a1,a2,a3, a4, a5, a6, a7)
|
||||
|
||||
#define DYNCFG_FUNCPTR8(X,rval,a1,a2,a3, a4, a5, a6, a7, a8)
|
||||
#define DYNCFG_STATIC_FUNCPTR8(X,rval,a1,a2,a3, a4, a5, a6, a7, a8)
|
||||
#define DYNCFG_EXTERN_FUNCPTR8(X,rval,a1,a2,a3, a4, a5, a6, a7, a8)
|
||||
|
||||
#define DYNCFG_FUNCPTR9(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9)
|
||||
#define DYNCFG_STATIC_FUNCPTR9(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9)
|
||||
#define DYNCFG_EXTERN_FUNCPTR9(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9)
|
||||
|
||||
#define DYNCFG_FUNCPTR10(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9, a10)
|
||||
#define DYNCFG_STATIC_FUNCPTR10(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9, a10)
|
||||
#define DYNCFG_EXTERN_FUNCPTR10(X,rval,a1,a2,a3, a4, a5, a6, a7, a8, a9, a10)
|
||||
|
||||
#define DYNCFG_FUNCALL(X) X
|
||||
|
||||
#define DYNCFG_VBLPTR(X,type)
|
||||
#define DYNCFG_VBLPTR_STATIC(X,type)
|
||||
#define DYNCFG_VBLPTR_EXTERN(X,type)
|
||||
|
||||
#define DYNCFG_VREF(X) X
|
||||
|
||||
#define DYNCFG_IFCFGVBL_BEGIN(X)
|
||||
#define DYNCFG_IFNOTCFGVBL_BEGIN(X)
|
||||
#define DYNCFG_IFCFGVBL_ELSE(X)
|
||||
#define DYNCFG_IFNOTCFGVBL_ELSE(X)
|
||||
#define DYNCFG_IFCFGVBL_ELSEDEFAULT(X)
|
||||
#define DYNCFG_IFCFGVBL_END(X)
|
||||
#define DYNCFG_IFNOTCFGVBL_END(X)
|
||||
|
||||
#define DYNCFG_VBL_DECLARE_EXTERN(X)
|
||||
#define DYNCFG_VBL_DECLARE_GLOBAL(X)
|
||||
#define DYNCFG_VBL_DECLARE_STATIC(X)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_DYNCFG_H */
|
||||
|
||||
/*
|
||||
* Example of usage: code which looked like:
|
||||
* #if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
* case SNMP_VERSION_3:
|
||||
* Call_Func_In_V3_Component (a, b);
|
||||
* break;
|
||||
* #endif
|
||||
* becomes:
|
||||
* #if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
* DYNCFG_IFCFGVBL_BEGIN(snmpv3_component)
|
||||
* case SNMP_VERSION_3:
|
||||
* DYN_FUNCALL(Call_Func_In_V3_Component) (a, b);
|
||||
* break;
|
||||
* DYNCFG_IFCFGVBL_BEGIN(snmpv3_component)
|
||||
* #endif
|
||||
*
|
||||
* In order for the above to work, earlier in the same file we must have
|
||||
* declarations for the test variables and function pointers. If
|
||||
*
|
||||
* If Call_Function_In_SNMPV3_Component () took 2 args, say, an (SNMP_PKT_T *)
|
||||
* and an integer, and returns void:
|
||||
*
|
||||
* DYNCFG_EXTERN_FUNCPTR2(Call_Func_In_V3_Component,void,SNMP_PKT_T *, int)
|
||||
* DYNCFG_VBL_DECLARE_EXTERN(snmpv3_component)
|
||||
*
|
||||
* Elsewhere in some other module, these must be declared with the non-EXTERN
|
||||
* form of the macro, and initialized at startup by come component init
|
||||
* routine.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/fixed64.h,v 1.3 2003/01/16 18:20:11 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1999 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Fixed-point 64-bit math routines, intended primarily for time conversion
|
||||
* between Attache milliseconds and pSOSystem "ticks". These routines
|
||||
* are in the common library because they may be useful for other
|
||||
* applications, but these functions are not a full-fleged 64-bit math
|
||||
* library.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Log: fixed64.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:11 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:09 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:21:27 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:16:36 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 2000/03/09 17:15:39 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.1 1999/03/01 20:08:56 sra
|
||||
* Add fixed-point 64-bit math routines; these are primarily intended for
|
||||
* converting between Attache and pSOSystem clock values, but the
|
||||
* functions themselves aren't specific to that.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_FIXED64_H
|
||||
#define COMMON_FIXED64_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
extern bits32_t fixed64_mul(bits32_t, bits32_t, bits32_t, bits32_t);
|
||||
extern void fixed64_div(bits32_t, bits32_t, bits32_t *, bits32_t *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_FIXED64_H */
|
||||
@@ -0,0 +1,95 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/fldmacro.h,v 1.2 2003/01/16 18:20:12 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: fldmacro.h,v $
|
||||
* Revision 1.2 2003/01/16 18:20:12 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:21:27 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:16:37 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 1998/12/15 05:45:58 sra
|
||||
* Get new NI interface code working on pSOS/X86.
|
||||
*
|
||||
* Revision 1.1 1998/12/09 21:48:44 sra
|
||||
* Initial revision.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_FLDMACRO_H
|
||||
#define COMMON_FLDMACRO_H
|
||||
|
||||
/*
|
||||
* Primative macros to get and set bitfields in an array of integers.
|
||||
* Should work for either signed or unsigned integers, which means that
|
||||
* these macros have to be very careful about right-shift operations.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* _a_: "array" (name of array)
|
||||
* _i_: "index" (offset into array)
|
||||
* _w_: "width" (width in bits of the field)
|
||||
* _p_: "position" (bit offset of field)
|
||||
* _n_: "new_value" (replacement value, for sets)
|
||||
*
|
||||
* Macros:
|
||||
*
|
||||
* FLD_MSK() Construct mask _w_ bits wide, left shifted _p_ bits
|
||||
* FLD_GET() Extract field to right justified value
|
||||
* FLD_SET() Replace field content with right-justified value
|
||||
*
|
||||
* I would have preferred the index-and-mask mechanism we used back
|
||||
* when all real programmers rode dinosaurs (bareback), because the
|
||||
* masks are easier to sight-read than this position-and-width values,
|
||||
* but the mask stuff is just too horrid when coded for the ANSI C
|
||||
* preprocessor. I miss MIDAS....
|
||||
*
|
||||
* These macros are intended primarily for use with IPC mechanisms like
|
||||
* pSOS message queues. For network packets, see the layout directory.
|
||||
*/
|
||||
|
||||
#define FLD_MAX_WIDTH 32
|
||||
|
||||
#define FLD_MSK(_w_, _p_) ((~((~0UL) << (_w_))) << (_p_))
|
||||
|
||||
#define FLD_GET(_m_, _i_, _w_, _p_) \
|
||||
(((_w_) == FLD_MAX_WIDTH) \
|
||||
? ((_m_)[_i_]) \
|
||||
: ((((_m_)[_i_]) >> (_p_)) & FLD_MSK(_w_, 0)))
|
||||
|
||||
#define FLD_SET(_m_, _i_, _w_, _p_, _n_) \
|
||||
(((_m_)[_i_]) = (((_w_) == FLD_MAX_WIDTH) \
|
||||
? (_n_) \
|
||||
: ((((_m_)[_i_]) & ~FLD_MSK(_w_, _p_)) | \
|
||||
(((_n_) & FLD_MSK(_w_, 0)) << (_p_)))))
|
||||
|
||||
#endif /* COMMON_FLDMACRO_H */
|
||||
@@ -0,0 +1,194 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/glue.h,v 1.3 2003/01/16 18:20:12 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: glue.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:12 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:09 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.11 2001/01/19 22:21:28 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.10 2000/03/17 00:16:37 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.9 2000/03/09 19:09:22 josh
|
||||
* changes so we don't shoot ourselves in the foot if we're building
|
||||
* Emissary or Liaison
|
||||
*
|
||||
* Revision 1.8 1999/05/21 16:28:06 sra
|
||||
* Fix snprintf() installation test.
|
||||
*
|
||||
* Revision 1.7 1999/05/20 22:14:50 wes
|
||||
* If we're using the common snprintf, include its declaration here
|
||||
*
|
||||
* Revision 1.6 1999/05/20 21:05:54 sra
|
||||
* Add SNPRINTF and VSNPRINTF.
|
||||
*
|
||||
* Revision 1.5 1998/07/03 20:19:22 sra
|
||||
* Add etc_memcmp().
|
||||
*
|
||||
* Revision 1.4 1998/06/05 17:14:11 meister
|
||||
* STRNICMP takes 3 args, not two.
|
||||
*
|
||||
* Revision 1.3 1998/06/03 20:10:33 sar
|
||||
* Added some common string functions. stdf.h has the externs for them
|
||||
* while glue.h will use them if the user installs them and doesn't
|
||||
* specify other functions to use.
|
||||
*
|
||||
* Revision 1.2 1998/02/25 04:43:25 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.1 1997/08/21 17:23:43 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_GLUE_H
|
||||
#define COMMON_GLUE_H
|
||||
|
||||
/*
|
||||
* Load the postamble portion of the customer's common.h file.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <wrn/wm/common/stdf.h>
|
||||
|
||||
#if INSTALL_COMMON_SNPRINTF
|
||||
#include <wrn/wm/common/snprintf.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default definitions for macros that stand in for ANSI functions.
|
||||
* These may need to be fine-tuned after we've run some compilation tests.
|
||||
*/
|
||||
|
||||
#ifndef MEMCHR
|
||||
#define MEMCHR(x,y,z) memchr(x,y,z)
|
||||
#endif
|
||||
|
||||
#ifndef MEMCMP
|
||||
#if INSTALL_COMMON_MEMCMP
|
||||
#define MEMCMP(x,y,z) etc_memcmp(x,y,z)
|
||||
#else
|
||||
#define MEMCMP(x,y,z) memcmp(x,y,z)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MEMCPY
|
||||
#define MEMCPY(x,y,z) memcpy(x,y,z)
|
||||
#endif
|
||||
|
||||
#ifndef MEMSET
|
||||
#define MEMSET(x,y,z) memset(x,y,z)
|
||||
#endif
|
||||
|
||||
#ifndef STRCMP
|
||||
#define STRCMP(x,y) strcmp(x,y)
|
||||
#endif
|
||||
|
||||
#ifndef STRCPY
|
||||
#define STRCPY(x,y) strcpy(x,y)
|
||||
#endif
|
||||
|
||||
#ifndef STRLEN
|
||||
#define STRLEN(x) strlen(x)
|
||||
#endif
|
||||
|
||||
#ifndef STRNCMP
|
||||
#define STRNCMP(x,y,z) strncmp(x,y,z)
|
||||
#endif
|
||||
|
||||
#ifndef STRTOL
|
||||
#if (INSTALL_COMMON_STRTOL)
|
||||
#define STRTOL(S, E, R) etc_strtol(S, E, R)
|
||||
#else
|
||||
#define STRTOL(S, E, R) strtol(S, E, R)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STRTOUL
|
||||
#if (INSTALL_COMMON_STRTOUL)
|
||||
#define STRTOUL(S, E, R) etc_strtoul(S, E, R)
|
||||
#else
|
||||
#define STRTOUL(S, E, R) strtoul(S, E, R)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These two aren't ANSI functions, but their ANSI equivilents have a
|
||||
* serious design flaw: there's no way to specify the length of the
|
||||
* output buffer, so careless use of the ANSI function can ruin your
|
||||
* whole day. Get a clue, ANSI.
|
||||
*
|
||||
* We provide implementations of these in the common library.
|
||||
*/
|
||||
|
||||
#ifndef SNPRINTF
|
||||
#if INSTALL_COMMON_SNPRINTF
|
||||
#define SNPRINTF etc_snprintf
|
||||
#else
|
||||
#define SNPRINTF snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef VSNPRINTF
|
||||
#if INSTALL_COMMON_SNPRINTF
|
||||
#define VSNPRINTF etc_vsnprintf
|
||||
#else
|
||||
#define VSNPRINTF vsnprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These two aren't ANSI functions, but most systems have equivilents.
|
||||
* They're case-insensitive versions of the corresponding ANSI functions.
|
||||
* We provide implementations of these in the common library. */
|
||||
|
||||
#ifndef STRICMP
|
||||
#if (INSTALL_COMMON_STRICMP)
|
||||
#define STRICMP(x, y) etc_stricmp(x, y)
|
||||
#else
|
||||
#define STRICMP(x, y) strcasecmp(x, y)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef STRNICMP
|
||||
#if (INSTALL_COMMON_STRNICMP)
|
||||
#define STRNICMP(x, y, z) etc_strnicmp(x, y, z)
|
||||
#else
|
||||
#define STRNICMP(x, y, z) strncasecmp(x, y, z)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_GLUE_H */
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/hmac.h,v 1.3 2003/01/16 18:20:12 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: hmac.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:12 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:10 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.5 2001/01/19 22:21:28 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.4 2000/03/17 00:16:37 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.3 2000/03/09 17:15:39 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.2 1998/06/18 04:11:24 sar
|
||||
* clean up some type info, make the lengths be bits32_t
|
||||
*
|
||||
* Revision 1.1 1998/05/22 17:59:58 sar
|
||||
* Adding include files for hmac and sha
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef HMAC_H
|
||||
#define HMAC_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* get the installation options */
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif /* EPILOGUE_INSTALL_H */
|
||||
|
||||
/* get the Epilogue types */
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
|
||||
/* Data structure for HMAC computation */
|
||||
|
||||
#define HMAC_STATESIZ_MAX 128
|
||||
#define HMAC_HASHSIZ_MAX 24 /* keep them 64-bit aligned */
|
||||
|
||||
typedef void (*hashfcn_init_t)(void *state);
|
||||
typedef void (*hashfcn_update_t)(void *state, bits8_t *data, bits32_t datalen);
|
||||
typedef void (*hashfcn_final_t)(void *state, bits8_t *output);
|
||||
|
||||
typedef struct {
|
||||
bits8_t hmac_state [HMAC_STATESIZ_MAX];
|
||||
bits8_t hmac_tmp [HMAC_HASHSIZ_MAX];
|
||||
hashfcn_init_t hmac_hashinit;
|
||||
hashfcn_update_t hmac_hashupdate;
|
||||
hashfcn_final_t hmac_hashfinal;
|
||||
bits32_t hmac_hashlen;
|
||||
} HMAC_CTX;
|
||||
|
||||
/* Initialize an HMAC context. Needs the three hash function interface calls,
|
||||
the size of the output hash, and the size of the state block needed by the
|
||||
underlying hash function. */
|
||||
|
||||
void InitHmacCTX __((HMAC_CTX *ctx,
|
||||
hashfcn_init_t init,
|
||||
hashfcn_update_t update,
|
||||
hashfcn_final_t final,
|
||||
bits32_t hashsiz));
|
||||
|
||||
void hmac_init __((HMAC_CTX *ctx, bits8_t *key, bits32_t keylen));
|
||||
void hmac_update __((HMAC_CTX *ctx, bits8_t *data, bits32_t datalen));
|
||||
void hmac_final __((HMAC_CTX *ctx, bits8_t *key, bits32_t keylen,
|
||||
bits8_t *output));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HMAC_H */
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*****************************************************************
|
||||
*
|
||||
* This file automatically generated - DO NOT EDIT!
|
||||
*
|
||||
*****************************************************************/
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#define EPILOGUE_INSTALL_H
|
||||
|
||||
#define INSTALL_ON_LITTLE_ENDIAN 0
|
||||
#define INSTALL_ON_BIG_ENDIAN 0
|
||||
#define INSTALL_OEM_LAYOUT_GLUE_MACROS 0
|
||||
#define INSTALL_TYPECHECKING_LAYOUT_GLUE_MACROS 0
|
||||
#define INSTALL_UNALIGNED_BIGENDIAN_LAYOUT_GLUE_MACROS 0
|
||||
#define INSTALL_COMMON 1
|
||||
#define INSTALL_COMMON_FIXED64 1
|
||||
#define INSTALL_COMMON_PRNG 0
|
||||
#define INSTALL_COMMON_MD4 0
|
||||
#define INSTALL_COMMON_MD5 1
|
||||
#define INSTALL_COMMON_SHA 1
|
||||
#define INSTALL_COMMON_HMAC 1
|
||||
#define INSTALL_COMMON_DES 1
|
||||
#define INSTALL_COMMON_3DES 0
|
||||
#define INSTALL_COMMON_ESP_3DES 0
|
||||
#define INSTALL_COMMON_DES_TEST 0
|
||||
#define INSTALL_COMMON_DES_FAKE 0
|
||||
#define INSTALL_COMMON_STRTOL 0
|
||||
#define INSTALL_COMMON_STRTOUL 0
|
||||
#define INSTALL_COMMON_STRICMP 0
|
||||
#define INSTALL_COMMON_STRNICMP 0
|
||||
#define INSTALL_COMMON_MEMCMP 0
|
||||
#define INSTALL_COMMON_SNPRINTF 0
|
||||
#define INSTALL_COMMON_DYNAMIC_COMP_CONFIG 1
|
||||
#define INSTALL_ENVOY 1
|
||||
#define INSTALL_ENVOY_SNMP_GROUP_V1 1
|
||||
#define INSTALL_ENVOY_SNMP_GROUP_V2 1
|
||||
#define INSTALL_ENVOY_SNMP_VERSION_1 1
|
||||
#define INSTALL_ENVOY_SNMP_VERSION_2 1
|
||||
#define INSTALL_ENVOY_SNMP_VERSION_3 1
|
||||
#define INSTALL_ENVOY_USE_MIBCOMPILER 1
|
||||
#define INSTALL_ENVOY_MAIN_AGENT 1
|
||||
#define INSTALL_ENVOY_SNMP_UTIL_MACROS 0
|
||||
#define INSTALL_ENVOY_MD5 1
|
||||
#define INSTALL_ENVOY_SHA 1
|
||||
#define INSTALL_ENVOY_DES 1
|
||||
#define INSTALL_ENVOY_AESCFB128 1
|
||||
#define INSTALL_ENVOY_SNMP_RFC1445_VIEWS 0
|
||||
#define INSTALL_ENVOY_SNMP_RFC2275_VIEWS 1
|
||||
#define INSTALL_ENVOY_TWO_CHAR_MACROS 0
|
||||
#define INSTALL_ENVOY_SNMP_V3_TARGET 1
|
||||
#define INSTALL_ENVOY_SNMP_V3_NOTIFY 1
|
||||
#define INSTALL_ENVOY_SNMP_V3_PROXY 1
|
||||
#define INSTALL_ENVOY_SNMP_COEXISTENCE 1
|
||||
#define INSTALL_SNMP_V3_DIFFIE_HELLMAN 0
|
||||
#define INSTALL_ENVOY_SNMP_PROXY 0
|
||||
#define INSTALL_ENVOY_AGENTX 1
|
||||
#define INSTALL_ENVOY_AGENTX_MASTER 1
|
||||
#define INSTALL_ENVOY_AGENTX_SUB 1
|
||||
#define INSTALL_ENVOY_AGENTX_INDEX 1
|
||||
#define INSTALL_ENVOY_AGENTX_NEXT_CHECK 1
|
||||
#define INSTALL_ENVOY_AGENTX_2257_RANGE 0
|
||||
#define INSTALL_ENVOY_ENTITY_MIB 0
|
||||
#define INSTALL_ENVOY_SNMP_LOCK 1
|
||||
#define INSTALL_ENVOY_LOCK_INDEPENDENT 0
|
||||
#define INSTALL_ENVOY_CONTINUE_REENTRANT 1
|
||||
#define INSTALL_ENVOY_SNMP_SERIALIZE 0
|
||||
#define INSTALL_SNMP_VXWORKS_VIRTUAL_STACK 0
|
||||
#define INSTALL_SNMP_VXWORKS_VS_ENTITY 0
|
||||
#define INSTALL_SNMP_VXWORKS_MESSAGE_CHANNELS 0
|
||||
#define INSTALL_ENVOY_HEAP_LARGE_VARS 0
|
||||
#define INSTALL_ENVOY_SNMP_USE_V2_TYPES 1
|
||||
#define INSTALL_ENVOY_PSOS 0
|
||||
#define INSTALL_ENVOY_PSOS_CONFIG 0
|
||||
#define INSTALL_INETV6 0
|
||||
#define INSTALL_INETV4 1
|
||||
#define INSTALL_ENVOY_TEST 0
|
||||
#define INSTALL_ATTACHE 0
|
||||
#define INSTALL_ATTACHE_MIB 0
|
||||
#define INSTALL_ENVOY_VXWORKS_RFC2233 1
|
||||
#define INSTALL_ENVOY_VXWORKS 1
|
||||
#define INSTALL_SNARK_LIB 0
|
||||
|
||||
#endif /* EPILOGUE_INSTALL_H */
|
||||
@@ -0,0 +1,99 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/md4.h,v 1.3 2003/01/16 18:20:12 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: md4.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:12 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:10 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:21:28 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:16:38 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 2000/03/09 17:15:40 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.1 1999/08/11 21:16:57 bala
|
||||
* MD4 functions
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD4 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD4 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MD4_INCLUDE__
|
||||
#define __MD4_INCLUDE__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* get the Epilogue types */
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
|
||||
/* MD4 context. */
|
||||
typedef struct {
|
||||
bits32_t state[4]; /* state (ABCD) */
|
||||
bits32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
bits8_t buffer[64]; /* input buffer */
|
||||
} MD4_CTX;
|
||||
|
||||
void MD4Init __((MD4_CTX *));
|
||||
void MD4Update __((MD4_CTX *, bits8_t *, bits32_t));
|
||||
void MD4Final __((bits8_t *, MD4_CTX *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MD4_INCLUDE__ */
|
||||
@@ -0,0 +1,131 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/md5.h,v 1.3 2003/01/16 18:20:13 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005,2007 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: md5.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:13 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:10 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.8 2001/01/19 22:21:28 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.7 2000/03/17 00:16:38 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.6 2000/03/09 17:15:40 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.5 1998/02/25 04:43:26 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.4 1998/02/05 22:37:35 josh
|
||||
* Changing references to types.h so we include common/h/types.h instead
|
||||
*
|
||||
* Revision 1.3 1997/10/30 16:44:29 sra
|
||||
* Fix copyright date.
|
||||
*
|
||||
* Revision 1.2 1997/08/14 16:04:38 lowell
|
||||
* boilerplate
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,31aug07,jbl fix symbol conflicts
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/*
|
||||
***********************************************************************
|
||||
** md5.h -- header file for implementation of MD5 **
|
||||
** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
|
||||
** Created: 2/17/90 RLR **
|
||||
** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
|
||||
** Revised (for MD5): RLR 4/27/91 **
|
||||
** -- G modified to have y&~z instead of y&z **
|
||||
** -- FF, GG, HH modified to add in last register done **
|
||||
** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
|
||||
** -- distinct additive constant for each step **
|
||||
** -- round 4 added, working mod 7 **
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
***********************************************************************
|
||||
** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
|
||||
** **
|
||||
** License to copy and use this software is granted provided that **
|
||||
** it is identified as the "RSA Data Security, Inc. MD5 Message- **
|
||||
** Digest Algorithm" in all material mentioning or referencing this **
|
||||
** software or this function. **
|
||||
** **
|
||||
** License is also granted to make and use derivative works **
|
||||
** provided that such works are identified as "derived from the RSA **
|
||||
** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
|
||||
** material mentioning or referencing the derived work. **
|
||||
** **
|
||||
** RSA Data Security, Inc. makes no representations concerning **
|
||||
** either the merchantability of this software or the suitability **
|
||||
** of this software for any particular purpose. It is provided "as **
|
||||
** is" without express or implied warranty of any kind. **
|
||||
** **
|
||||
** These notices must be retained in any copies of any part of this **
|
||||
** documentation and/or software. **
|
||||
***********************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __MD5_INCLUDE__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* get the Epilogue types */
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
|
||||
/* Data structure for MD5 (Message-Digest) computation */
|
||||
typedef struct {
|
||||
bits32_t i[2]; /* number of _bits_ handled mod 2^64 */
|
||||
bits32_t buf[4]; /* scratch buffer */
|
||||
bits8_t in[64]; /* input buffer */
|
||||
bits8_t digest[16]; /* actual digest after MD5Final call */
|
||||
} MD5_CTX;
|
||||
|
||||
void WrsnmpCommonMD5Init __((MD5_CTX *));
|
||||
void WrsnmpCommonMD5Update __((MD5_CTX *, bits8_t *, bits32_t));
|
||||
void WrsnmpCommonMD5Final __((MD5_CTX *));
|
||||
|
||||
#define MD5Init WrsnmpCommonMD5Init
|
||||
#define MD5Update WrsnmpCommonMD5Update
|
||||
#define MD5Final WrsnmpCommonMD5Final
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define __MD5_INCLUDE__
|
||||
#endif /* __MD5_INCLUDE__ */
|
||||
@@ -0,0 +1,80 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/prng.h,v 1.3 2003/01/16 18:20:13 josh Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: prng.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:13 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:10 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.9 2001/01/19 22:21:28 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.8 2000/03/17 00:16:39 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.7 2000/03/09 17:15:41 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.6 1998/02/25 04:43:26 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.5 1998/02/05 22:37:35 josh
|
||||
* Changing references to types.h so we include common/h/types.h instead
|
||||
*
|
||||
* Revision 1.4 1997/10/30 16:44:29 sra
|
||||
* Fix copyright date.
|
||||
*
|
||||
* Revision 1.3 1997/08/14 16:04:38 lowell
|
||||
* boilerplate
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#ifndef COMMON_PRNG_H
|
||||
#define COMMON_PRNG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
|
||||
void prng_get_seed(bits8_t **buffer, int * bufsize);
|
||||
void prng_random(bits8_t *buffer, int length);
|
||||
void prng_inject_random8(bits8_t newdata );
|
||||
bits8_t prng_random8(void );
|
||||
void prng_init(void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_PRNG_H */
|
||||
@@ -0,0 +1,97 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/sha.h,v 1.3 2003/01/16 18:20:13 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1998 Integrated Systems Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: sha.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:13 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:11 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.5 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.4 2000/03/17 00:16:40 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.3 2000/03/09 17:15:41 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.2 1998/06/16 05:12:27 sar
|
||||
* Clean up some type questions
|
||||
*
|
||||
* Revision 1.1 1998/05/22 17:59:58 sar
|
||||
* Adding include files for hamc and sha
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/* NIST Secure Hash Algorithm */
|
||||
/* heavily modified by Uwe Hollerbach <uh@alumni.caltech edu> */
|
||||
/* from Peter C. Gutmann's implementation as found in */
|
||||
/* Applied Cryptography by Bruce Schneier */
|
||||
|
||||
/* This code is in the public domain */
|
||||
|
||||
#ifndef EPILOGUE_SHA_H
|
||||
#define EPILOGUE_SHA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* get the installation options */
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif /* EPILOGUE_INSTALL_H */
|
||||
|
||||
/* get the Epilogue types */
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
|
||||
#define SHA_BLOCKSIZE 64
|
||||
#define SHA_DIGESTSIZE 20
|
||||
|
||||
typedef struct {
|
||||
bits32_t count_lo, count_hi; /* 64-bit bit count */
|
||||
bits32_t buf[5]; /* scratch buffer */
|
||||
bits8_t data[SHA_BLOCKSIZE]; /* SHA data (input) buffer */
|
||||
bits8_t digest[20]; /* message digest after sha_final call */
|
||||
size_t local; /* unprocessed amount in data */
|
||||
} SHA_CTX;
|
||||
|
||||
void sha_init __((SHA_CTX *));
|
||||
void sha_update __((SHA_CTX *, bits8_t *, bits32_t));
|
||||
void sha_final __((SHA_CTX *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EPILOGUE_SHA_H */
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/snprintf.h,v 1.3 2003/01/16 18:20:13 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1999 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snprintf.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:13 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:11 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.5 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.4 2000/03/17 00:16:40 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.3 2000/03/09 17:15:42 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.2 1999/05/21 14:46:33 sra
|
||||
* Include <stdarg.h>.
|
||||
*
|
||||
* Revision 1.1 1999/05/20 20:28:14 sra
|
||||
* Add etc_snprintf() and etc_vsnprintf().
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#ifndef COMMON_SNPRINTF_H
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If va_arg exists, it's a macro (can't be a function).
|
||||
*/
|
||||
#ifndef va_arg
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
int etc_snprintf (char *str, size_t count, const char *fmt, ...);
|
||||
int etc_vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_SNPRINTF_H */
|
||||
@@ -0,0 +1,87 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/stdf.h,v 1.3 2003/01/16 18:20:13 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: stdf.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:13 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:13:33 meister
|
||||
* rework pathnames
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.7 2001/02/09 20:13:33 paul
|
||||
* Added our own version of strncpy(), just in case the user doesn't have one.
|
||||
*
|
||||
* Revision 1.6 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.5 2000/03/17 00:16:41 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.4 2000/03/09 17:15:42 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.3 1999/04/09 20:33:47 wes
|
||||
* re-constify. let's see what, if anything, blows up
|
||||
*
|
||||
* Revision 1.2 1998/07/03 20:19:20 sra
|
||||
* Add etc_memcmp().
|
||||
*
|
||||
* Revision 1.1 1998/06/03 20:10:34 sar
|
||||
* Added some common string functions. stdf.h has the externs for them
|
||||
* while glue.h will use them if the user installs them and doesn't
|
||||
* specify other functions to use.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef COMMON_STDF_H
|
||||
#define COMMON_STDF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* pick up size_t (via oemtypes.h and sttdef.h) */
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
long etc_strtol (char *string, char **endptr, int radix);
|
||||
unsigned long etc_strtoul (char *string, char **endptr, int radix);
|
||||
int etc_stricmp (const char *s, const char *t);
|
||||
int etc_strnicmp (const char *s, const char *t, size_t len);
|
||||
int etc_memcmp (const void *x, const void *y, size_t len);
|
||||
char * etc_strncpy (char *dst, const char *src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* COMMON_STDF_H */
|
||||
@@ -0,0 +1,258 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/thread.h,v 1.2 2003/01/16 18:20:14 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1998-1999 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: thread.h,v $
|
||||
* Revision 1.2 2003/01/16 18:20:14 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.13 2001/06/12 08:06:07 paul
|
||||
* Mutex priorities are unsigned.
|
||||
* Added debugging to condition variable routines.
|
||||
*
|
||||
* Revision 1.12 2001/03/22 20:29:38 paul
|
||||
* The diab compiler is pickier than gcc.
|
||||
*
|
||||
* Revision 1.11 2001/03/22 16:54:08 paul
|
||||
* Mutex and condition variable functions now return errors.
|
||||
*
|
||||
* Revision 1.10 2001/03/20 17:11:14 paul
|
||||
* Removed unused timeout macros.
|
||||
*
|
||||
* Revision 1.9 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.8 2000/10/16 19:21:43 paul
|
||||
* Restore sockets and mempool code.
|
||||
*
|
||||
* Revision 1.6 2000/03/17 00:16:41 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.5 2000/03/09 17:15:43 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.4 1999/12/20 23:21:33 qli
|
||||
* added ETC_GET_SEL_CONDVAR and ETC_REL_SEL_CONDVAR
|
||||
*
|
||||
* Revision 1.3 1999/04/28 23:53:24 sra
|
||||
* Clean up various minor installation option glitches.
|
||||
*
|
||||
* Revision 1.2 1999/02/18 04:41:22 wes
|
||||
* Sockets merge: Everything Else
|
||||
* - memory pools
|
||||
* - thread support
|
||||
* - port-specific headers
|
||||
*
|
||||
* Revision 1.1.6.12 1999/01/25 21:08:01 paul
|
||||
* added the first half of the copyright notice (oops)
|
||||
*
|
||||
* Revision 1.1.6.11 1999/01/22 19:48:50 paul
|
||||
* Added this_thread(), copyright notice.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#ifndef COMMON_THREAD_H
|
||||
#define COMMON_THREAD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#include <thdport.h>
|
||||
|
||||
#define ETC_MUTEX_PRIO_MIN GLUE_MUTEX_PRIO_MIN
|
||||
#define ETC_MUTEX_PRIO_LOW GLUE_MUTEX_PRIO_LOW
|
||||
#define ETC_MUTEX_PRIO_MID GLUE_MUTEX_PRIO_MID
|
||||
#define ETC_MUTEX_PRIO_HIGH GLUE_MUTEX_PRIO_HIGH
|
||||
#define ETC_MUTEX_PRIO_MAX GLUE_MUTEX_PRIO_MAX
|
||||
|
||||
#if defined(INSTALL_THREAD_DEBUG) && INSTALL_THREAD_DEBUG
|
||||
|
||||
/*
|
||||
* See the non-debug side of this #ifdef of this for documentation on
|
||||
* what the various functions do.
|
||||
*/
|
||||
|
||||
/*
|
||||
* other things to consider..
|
||||
* mutex names. __FILE__, __LINE__; last-lock/last-unlock info
|
||||
* thread names, cond names.
|
||||
* yield before/after lock/unlock, signal, cond wait,
|
||||
* per thread storage for current lock prio, chain of held locks..
|
||||
* How the heck do we deal with META_LOCK/UNLOCK() after cond_wait?
|
||||
* (release user lock, take meta_lock, retake user lock?)
|
||||
*/
|
||||
|
||||
typedef struct etc_mutex_t
|
||||
{
|
||||
int magic;
|
||||
glue_mutex_t m;
|
||||
char *lock_name;
|
||||
void *lock_owner;
|
||||
unsigned lock_prio;
|
||||
struct etc_mutex_t *next_lock;
|
||||
char *last_lock_file;
|
||||
int last_lock_line;
|
||||
char *last_unlock_file;
|
||||
int last_unlock_line;
|
||||
} etc_mutex_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
glue_cond_t c;
|
||||
etc_mutex_t *m;
|
||||
} etc_cond_t;
|
||||
|
||||
extern glue_mutex_t etc_meta_mutex;
|
||||
|
||||
int etc_mutex_init(etc_mutex_t *lock, unsigned prio, char *name);
|
||||
int etc_mutex_lock(etc_mutex_t *lock, unsigned prio, char *file, int line);
|
||||
int etc_mutex_unlock(etc_mutex_t *lock, unsigned prio, char *file, int line);
|
||||
void etc_mutex_lock_assert (etc_mutex_t *lock, unsigned prio, char *file, int line);
|
||||
int etc_mutex_destroy (etc_mutex_t *lock, char *file, int line);
|
||||
|
||||
int etc_cond_init(etc_cond_t *cond, etc_mutex_t *mutex, char *file, int line);
|
||||
int etc_cond_wait(etc_cond_t *cond, etc_mutex_t *mutex, char *file, int line);
|
||||
int etc_cond_wakeup(etc_cond_t *cond, etc_mutex_t *mutex, char *file, int line);
|
||||
int etc_cond_broadcast(etc_cond_t *cond, etc_mutex_t *mutex, char *file, int line);
|
||||
int etc_cond_destroy(etc_cond_t *cond, char *file, int line);
|
||||
|
||||
#define ETC_LOCK_MAGIC 0x19661008
|
||||
|
||||
#define ETC_META_LOCK() \
|
||||
GLUE_MUTEX_LOCK(&etc_meta_mutex, GLUE_MUTEX_PRIO_MIN);
|
||||
|
||||
#define ETC_META_UNLOCK() \
|
||||
GLUE_MUTEX_UNLOCK(&etc_meta_mutex, GLUE_MUTEX_PRIO_MIN);
|
||||
|
||||
#define ETC_MUTEX_INIT(lock, prio, name) \
|
||||
etc_mutex_init(lock, prio, name)
|
||||
|
||||
#define ETC_MUTEX_LOCK(lock, prio) \
|
||||
etc_mutex_lock(lock, prio, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_MUTEX_UNLOCK(lock, prio) \
|
||||
etc_mutex_unlock(lock, prio, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_MUTEX_LOCK_ASSERT(lock, prio) \
|
||||
etc_mutex_lock_assert(lock, prio, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_MUTEX_DESTROY(lock) \
|
||||
etc_mutex_destroy(lock, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_COND_INIT(cond, mutex) \
|
||||
etc_cond_init(cond, mutex, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_COND_WAIT(cond, mutex) \
|
||||
etc_cond_wait(cond, mutex, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_COND_WAKEUP(cond, mutex) \
|
||||
etc_cond_wakeup(cond, mutex, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_COND_BROADCAST(cond, mutex) \
|
||||
etc_cond_broadcast(cond, mutex, __FILE__, __LINE__)
|
||||
|
||||
#define ETC_COND_DESTROY(cond) \
|
||||
etc_cond_destroy(cond, __FILE__, __LINE__)
|
||||
|
||||
/* Initialize thread system (if necessary) */
|
||||
extern void common_thread_init(void);
|
||||
|
||||
#define ETC_THREAD_INIT() common_thread_init()
|
||||
|
||||
void *this_thread(void);
|
||||
|
||||
#else /* INSTALL_THREAD_DEBUG */
|
||||
|
||||
/* Initialize thread system (if necessary) */
|
||||
#define ETC_THREAD_INIT() GLUE_THREAD_INIT()
|
||||
|
||||
/*
|
||||
* Mutex locks.
|
||||
*/
|
||||
|
||||
typedef glue_mutex_t etc_mutex_t;
|
||||
|
||||
/* Initialize mutex */
|
||||
#define ETC_MUTEX_INIT(lock, prio, name) GLUE_MUTEX_INIT(lock, prio)
|
||||
|
||||
/* Lock, unlock mutex */
|
||||
#define ETC_MUTEX_LOCK(lock, prio) GLUE_MUTEX_LOCK(lock, prio)
|
||||
#define ETC_MUTEX_UNLOCK(lock, prio) GLUE_MUTEX_UNLOCK(lock, prio)
|
||||
/* Destroy mutex */
|
||||
#define ETC_MUTEX_DESTROY(lock) GLUE_MUTEX_DESTROY(lock)
|
||||
|
||||
/* Try to lock a mutex; return 1 if successful, 0 if not (already locked) */
|
||||
#define ETC_MUTEX_TRYLOCK(lock, prio) GLUE_MUTEX_TRYLOCK(lock)
|
||||
|
||||
/* Bug-check if we don't hold the mutex */
|
||||
#define ETC_MUTEX_LOCK_ASSERT(lock, prio)
|
||||
|
||||
/*
|
||||
* Condition variables:
|
||||
*/
|
||||
|
||||
typedef glue_cond_t etc_cond_t;
|
||||
|
||||
/* initialize condition variable */
|
||||
#define ETC_COND_INIT(cond, mutex) GLUE_COND_INIT(cond, mutex)
|
||||
|
||||
/* wait for condition to happen */
|
||||
#define ETC_COND_WAIT(cond, mutex) GLUE_COND_WAIT(cond, mutex)
|
||||
#define ETC_COND_DESTROY(cond) GLUE_COND_DESTROY(cond)
|
||||
|
||||
#define ETC_COND_WAKEUP(cond, mutex) GLUE_COND_WAKEUP(cond, mutex)
|
||||
#define ETC_COND_BROADCAST(cond, mutex) GLUE_COND_BROADCAST(cond, mutex)
|
||||
|
||||
#endif
|
||||
|
||||
typedef glue_thread_t etc_thread_t;
|
||||
|
||||
/* Return a per-thread cookie */
|
||||
#define ETC_THD_SELF() GLUE_THD_SELF()
|
||||
/* Yield the processor */
|
||||
#define ETC_THD_YIELD() GLUE_THD_YIELD()
|
||||
|
||||
/*
|
||||
* the following are mostly for the benefit of snark and similar test code.
|
||||
*/
|
||||
|
||||
/* Create a thread */
|
||||
#define ETC_THD_CREATE(thread, func, arg) GLUE_THD_CREATE(thread, func, arg)
|
||||
#define ETC_THD_WAIT(thread) GLUE_THD_WAIT(thread)
|
||||
|
||||
/* Cause the current thread to go poof */
|
||||
#define ETC_THD_EXIT() GLUE_THD_EXIT()
|
||||
|
||||
#define ETC_GET_SEL_CONDVAR(cookie) (etc_cond_t *)GLUE_GET_SEL_CONDVAR(cookie)
|
||||
#define ETC_REL_SEL_CONDVAR(cond, cookie) GLUE_REL_SEL_CONDVAR(cond, cookie)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,175 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/types.h,v 1.2 2003/01/16 18:20:14 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2010 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: types.h,v $
|
||||
* Revision 1.2 2003/01/16 18:20:14 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.9 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.8 2000/03/17 00:16:42 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.7 2000/03/13 21:21:46 paul
|
||||
* Removed some code that we are no longer working on.
|
||||
*
|
||||
* Revision 1.4 1999/05/12 21:41:33 niqbal
|
||||
* Changes for Redefinition protection
|
||||
*
|
||||
* Revision 1.3 1998/03/11 22:40:02 josh
|
||||
* epilogue_char_t is now a char instead of bits8_t
|
||||
*
|
||||
* Revision 1.2 1998/02/25 04:43:27 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.1 1998/02/05 22:19:28 josh
|
||||
* moving commonly used include files into common/h from top-level directory
|
||||
*
|
||||
* Revision 1.9 1997/04/20 01:32:00 alan
|
||||
* Add ldb_int{8,16,32}_t types for the benefit of layout/ldbglue.h.
|
||||
*
|
||||
* Revision 1.8 1997/03/20 06:58:18 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.7 1997/02/25 10:57:03 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 1.6 1996/10/28 22:52:57 sar
|
||||
* correction added epilogue_size_t and epilogue_char_t
|
||||
*
|
||||
* Revision 1.5 1996/10/28 22:51:08 sar
|
||||
* Added epilogue_types_h epilogue_char_h
|
||||
*
|
||||
* Revision 1.4 1993/04/21 15:39:23 dab
|
||||
* No longer have cookie_t and renamed cardinal_t to fastint_t.
|
||||
*
|
||||
* Revision 1.3 1993/03/20 19:09:52 dab
|
||||
* changed pvoid_t to ptr_t
|
||||
*
|
||||
* Revision 1.2 1993/02/26 16:54:21 dab
|
||||
* Changed htypes.h to porttype.h
|
||||
*
|
||||
* Revision 1.1 1993/02/19 22:28:01 dab
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,08jun10,y_t update for LP64
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#define EPILOGUE_TYPES_H
|
||||
|
||||
/* <porttype.h> is defined in the hardware specific part of the port.
|
||||
* It must supply a typedef for size_t since we can't do that one
|
||||
* portably. It can override any typedef here by defining
|
||||
* __TYPES_HAVE_<type-name>_t_.
|
||||
*/
|
||||
#include <oemtypes.h>
|
||||
|
||||
/* Internal data types
|
||||
*/
|
||||
#ifndef __TYPES_HAVE_bits8_t_
|
||||
#define __TYPES_HAVE_bits8_t_ 1
|
||||
typedef unsigned char bits8_t; /* 8 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_bits16_t_
|
||||
#define __TYPES_HAVE_bits16_t_ 1
|
||||
typedef unsigned short bits16_t; /* 16 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_bits32_t_
|
||||
#define __TYPES_HAVE_bits32_t_ 1
|
||||
typedef unsigned int bits32_t; /* 32 bits */
|
||||
#endif
|
||||
|
||||
#ifndef __TYPES_HAVE_sbits8_t_
|
||||
#define __TYPES_HAVE_sbits8_t_ 1
|
||||
typedef signed char sbits8_t; /* signed 8 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_sbits16_t_
|
||||
#define __TYPES_HAVE_sbits16_t_ 1
|
||||
typedef signed short sbits16_t; /* signed 16 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_sbits32_t_
|
||||
#define __TYPES_HAVE_sbits32_t_ 1
|
||||
typedef signed int sbits32_t; /* signed 32 bits */
|
||||
#endif
|
||||
|
||||
#ifndef __TYPES_HAVE_inaddr_t_
|
||||
#define __TYPES_HAVE_inaddr_t_ 1
|
||||
typedef bits32_t inaddr_t; /* IP address */
|
||||
#endif
|
||||
|
||||
#ifndef __TYPES_HAVE_ptr_t_
|
||||
#define __TYPES_HAVE_ptr_t_ 1
|
||||
typedef void * ptr_t; /* generic pointer */
|
||||
#endif
|
||||
|
||||
#ifndef __TYPES_HAVE_fastint_t_
|
||||
#define __TYPES_HAVE_fastint_t_ 1
|
||||
typedef int fastint_t; /* a loop counter (should be at least 15 bits) */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_boolean_t_
|
||||
#define __TYPES_HAVE_boolean_t_ 1
|
||||
typedef int boolean_t; /* an efficient boolean variable */
|
||||
#endif
|
||||
|
||||
/* These next three types are needed by the layout glue macros.
|
||||
* These are the unsigned integer types that your C implementation
|
||||
* normally converts 8, 16 and 32 bit quantities into in expressions.
|
||||
* The following typedefs are correct for most C implementations
|
||||
* (with 16 or 32 bit integers), but may need to be changed in sufficiently
|
||||
* unusual environments.
|
||||
*/
|
||||
#ifndef __TYPES_HAVE_ldb_int8_t_
|
||||
typedef unsigned char ldb_int8_t; /* 8 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_ldb_int16_t_
|
||||
typedef unsigned short ldb_int16_t; /* 16 bits */
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_ldb_int32_t_
|
||||
typedef unsigned int ldb_int32_t; /* 32 bits */
|
||||
#endif
|
||||
|
||||
/* yes, we know these two types are not what they should be
|
||||
they are here to make some of the code happy and will be
|
||||
updated when that code is fixed. */
|
||||
#ifndef __TYPES_HAVE_epilogue_size_t_
|
||||
typedef sbits16_t epilogue_size_t;
|
||||
#endif
|
||||
#ifndef __TYPES_HAVE_epilogue_char_t_
|
||||
typedef char epilogue_char_t;
|
||||
#endif
|
||||
|
||||
#if !defined(NO_PP)
|
||||
#define __(x) x
|
||||
#else
|
||||
#define __(x) ()
|
||||
#endif
|
||||
|
||||
#endif /* EPILOGUE_TYPES_H */
|
||||
@@ -0,0 +1,87 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/common/weakprng.h,v 1.3 2003/01/16 18:20:14 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: weakprng.h,v $
|
||||
* Revision 1.3 2003/01/16 18:20:14 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 00:07:11 meister
|
||||
* Rework pathnames again
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:18 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.7 2001/01/19 22:21:29 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.6 2000/03/17 00:16:42 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.5 2000/03/09 17:15:43 tneale
|
||||
* Added #idef C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 1.4 1998/02/25 22:08:28 mrf
|
||||
* Correct copyright dates.
|
||||
*
|
||||
* Revision 1.3 1998/02/25 04:43:27 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.2 1998/02/21 23:38:33 sra
|
||||
* Minor changes to WeakPRNG module.
|
||||
*
|
||||
* Revision 1.1 1998/02/21 22:05:35 mrf
|
||||
* Added weak random number generator.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_CONFIG_H
|
||||
#include <wrn/wm/common/config.h>
|
||||
#endif
|
||||
|
||||
#ifndef COMMON_GLUE_H
|
||||
#include <wrn/wm/common/glue.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include file for cryptographically weak random number generator
|
||||
* found in common/lib/weakprng.c.
|
||||
*/
|
||||
/* Function prototypes */
|
||||
void ep_seed_weak_prng(bits8_t *, size_t);
|
||||
bits32_t ep_weak_prng(bits32_t);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/bpf.h,v 1.1 2001/11/08 16:00:56 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bpf.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:56 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.7 2001/01/19 22:23:39 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.6 2000/03/17 00:12:36 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:21 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/04/25 01:02:26 sra
|
||||
* Fix code to set explicit MAC addresses for BPF, allow non-promiscuous mode.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:52:51 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:30 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* BPF interface to ethernet for attache testing under 386BSD/NetBSD/FreeBSD.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BPF_H_
|
||||
#define _BPF_H_
|
||||
|
||||
extern int bpf_open (char *, unsigned, unsigned char *, int);
|
||||
extern int bpf_write (int, unsigned char *, unsigned);
|
||||
extern void bpf_close (int);
|
||||
extern void bpf_find (void (*)(char *, void *), void *);
|
||||
extern int bpf_read (int, unsigned,
|
||||
void (*)(unsigned char *, unsigned, unsigned, void *),
|
||||
void *);
|
||||
|
||||
#endif /* _BPF_H_ */
|
||||
@@ -0,0 +1,78 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/bpfdrive.h,v 1.1 2001/11/08 16:00:56 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bpfdrive.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:56 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:39 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:37 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:22 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:52:53 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 06:13:38 sra
|
||||
* Clean up antique type names and install macros.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Berkeley Packet Filter (BPF) network interface for snark package.
|
||||
*
|
||||
* This has only been tested on NetBSD 0.8, it will probably work on other
|
||||
* BSD-Net2-derived systems, and may work with minor modifications on other
|
||||
* BSD-related systems with BPF (eg, SunOS with the BPF additions supplied
|
||||
* with the tcpdump program distributed by LBL).
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BPFDRIVE_H_
|
||||
#define _BPFDRIVE_H_
|
||||
|
||||
extern void bpf_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _BPFDRIVE_H_ */
|
||||
@@ -0,0 +1,85 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/bsdif.h,v 1.1 2001/11/08 16:00:57 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bsdif.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:57 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.7 2001/01/19 22:23:39 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.6 2000/03/17 00:12:37 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:22 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/03/20 06:52:53 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.2 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:30 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* File descriptor based network interfaces for snark under BSD.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BSDIF_H_
|
||||
#define _BSDIF_H_
|
||||
|
||||
struct bsdif {
|
||||
struct bsdif *next;
|
||||
void *net;
|
||||
int fd;
|
||||
unsigned flags;
|
||||
void (*handler) __((int, void *, unsigned));
|
||||
void *private;
|
||||
};
|
||||
|
||||
#define BSDIF_READ 0x1
|
||||
#define BSDIF_WRITE 0x2
|
||||
|
||||
#endif /* _BSDIF_H_ */
|
||||
@@ -0,0 +1,147 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/bug_conf.h,v 1.3 2003/01/15 13:58:29 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/* Run-time configuration of the BUG() macro and friends. */
|
||||
|
||||
/*
|
||||
* $Log: bug_conf.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:29 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:43 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.12 2001/01/19 22:23:34 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.11 2000/10/16 19:21:48 paul
|
||||
* Restore sockets and mempool code.
|
||||
*
|
||||
* Revision 1.10 2000/03/17 00:12:11 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.9 2000/03/13 21:21:59 paul
|
||||
* Removed some code that we are no longer working on.
|
||||
*
|
||||
* Revision 1.8 1999/02/18 04:41:30 wes
|
||||
* Sockets merge: Everything Else
|
||||
* - memory pools
|
||||
* - thread support
|
||||
* - port-specific headers
|
||||
*
|
||||
* Revision 1.7.12.1 1998/10/01 21:45:19 wes
|
||||
* sockets port: add new configurable bug action: yield the processor
|
||||
*
|
||||
* Revision 1.7 1998/02/25 15:21:44 sra
|
||||
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
|
||||
*
|
||||
* Revision 1.6 1998/02/25 04:57:14 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.5 1997/05/15 07:54:05 sra
|
||||
* Add IDENT option.
|
||||
*
|
||||
* Revision 1.4 1997/03/20 06:53:19 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.3 1997/03/19 04:11:35 sra
|
||||
* BUG() now common to all products, so move the associated .h files.
|
||||
*
|
||||
* Revision 1.2 1997/02/24 00:56:59 sra
|
||||
* Support for run-time configuration of BUG() macros.
|
||||
*
|
||||
* Revision 1.1 1997/02/23 21:58:43 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SNARK_BUG_CONF_H
|
||||
#define SNARK_BUG_CONF_H
|
||||
|
||||
/*
|
||||
* Notes on the following weirdness:
|
||||
*
|
||||
* If we're going to define BUG(), we have to
|
||||
* do it before bug.h is included.
|
||||
*
|
||||
* "sty_printf z ;" is not a typo.
|
||||
*/
|
||||
|
||||
#if INSTALL_SNARK_BUG_CONF
|
||||
|
||||
#ifndef BUG_OUT
|
||||
#define BUG_OUT cty
|
||||
#endif
|
||||
|
||||
#define BUG(_code_, _continuable_, _cookie_, _format_) \
|
||||
do {\
|
||||
unsigned _flags_ = bug_flags[(int)(_code_)];\
|
||||
int _fatal_ = ((_continuable_) == BUG_FATAL);\
|
||||
if ((_flags_ & BUG_FLAG_PRINT) != 0) {\
|
||||
bug_timestamp(BUG_OUT);\
|
||||
if ((_flags_ & BUG_FLAG_IDENT) != 0)\
|
||||
sty_printf(BUG_OUT, "%s:%d: ", __FILE__, __LINE__);\
|
||||
sty_printf _format_ ;\
|
||||
sty_putc(BUG_OUT, '\n');\
|
||||
}\
|
||||
if ((_flags_ & BUG_FLAG_FATAL) != 0)\
|
||||
_fatal_ = !_fatal_;\
|
||||
if ((_flags_ & BUG_FLAG_BREAK) != 0)\
|
||||
_fatal_ = bug_breakpoint((_code_), (_cookie_), _fatal_);\
|
||||
if ((_flags_ & BUG_FLAG_YIELD) != 0)\
|
||||
bug_yield((_code_), __FILE__, __LINE__); \
|
||||
if (_fatal_) {\
|
||||
sty_puts(BUG_OUT, "Fatal error, aborting.\n");\
|
||||
abort();\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#endif /* INSTALL_SNARK_BUG_CONF */
|
||||
|
||||
#ifndef EPILOGUE_BUG_H
|
||||
#include <wrn/wm/common/bug.h>
|
||||
#endif
|
||||
|
||||
#ifndef _SNARK_STY_H_
|
||||
#include <wrn/wm/demo/sty.h>
|
||||
#endif
|
||||
|
||||
#define BUG_FLAG_PRINT 0x01
|
||||
#define BUG_FLAG_BREAK 0x02
|
||||
#define BUG_FLAG_SYSLOG 0x04
|
||||
#define BUG_FLAG_FATAL 0x08
|
||||
#define BUG_FLAG_IDENT 0x10
|
||||
#define BUG_FLAG_YIELD 0x20
|
||||
|
||||
extern unsigned bug_flags[];
|
||||
extern int bug_breakpoint(enum bug_codes, void *, int);
|
||||
extern void bug_config(void);
|
||||
extern void bug_timestamp(struct sty *);
|
||||
extern void bug_yield(enum bug_codes, char *, int);
|
||||
|
||||
#endif /* SNARK_BUG_CONF_H */
|
||||
@@ -0,0 +1,61 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/dlpi.h,v 1.1 2001/11/08 16:00:57 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: dlpi.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:57 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.3 2001/01/19 22:23:40 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.2 2000/03/17 00:12:38 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.1 1998/07/29 20:54:51 wes
|
||||
* First cut of the Solaris port.
|
||||
* (DLPI support, termios, minor tweaks to libraries and port header files)
|
||||
*
|
||||
* Revision 1.1.2.1 1998/07/24 21:45:43 wes
|
||||
* Initial implementation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* DLPI interface to ethernet for Attache testing under Solaris 2.x
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DLPI_H_
|
||||
#define _DLPI_H_
|
||||
|
||||
extern int dlpi_open (char *, unsigned, unsigned char *);
|
||||
extern int dlpi_write (int, unsigned char *, unsigned);
|
||||
extern void dlpi_close (int);
|
||||
extern void dlpi_find (void (*)(char *, void *), void *);
|
||||
extern int dlpi_read (int, unsigned,
|
||||
void (*)(unsigned char *, unsigned, unsigned, void *),
|
||||
void *);
|
||||
|
||||
#endif /* _DLPI_H_ */
|
||||
@@ -0,0 +1,59 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/dlpidrv.h,v 1.1 2001/11/08 16:00:57 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: dlpidrv.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:57 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.4 2001/01/19 22:23:41 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.3 2000/03/17 00:12:38 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.2 1998/09/14 20:13:43 wes
|
||||
* make DLPI driver filenames 8.3 safe..
|
||||
*
|
||||
* Revision 2.1 1998/07/29 20:54:52 wes
|
||||
* First cut of the Solaris port.
|
||||
* (DLPI support, termios, minor tweaks to libraries and port header files)
|
||||
*
|
||||
* Revision 1.1.2.1 1998/07/24 21:45:46 wes
|
||||
* Initial implementation
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Attache code for interfacing to ethernet via the Data Link Protocol Interface
|
||||
* on Solaris 2.x
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DLPIDRV_H_
|
||||
#define _DLPIDRV_H_
|
||||
|
||||
extern void dlpi_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _DLPIDRV_H_ */
|
||||
@@ -0,0 +1,142 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/dsmemcfg.h,v 1.2 2001/11/07 14:27:44 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: dsmemcfg.h,v $
|
||||
* Revision 1.2 2001/11/07 14:27:44 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.4.4.1 2001/10/31 20:04:57 paul
|
||||
* Removed unneeded udptable.h
|
||||
*
|
||||
* Revision 2.4 2001/01/19 22:23:34 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.3 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.2 1999/04/05 23:03:41 qli
|
||||
* updated to use the new memory pool identifier names
|
||||
*
|
||||
* Revision 2.1 1999/02/18 04:41:31 wes
|
||||
* Sockets merge: Everything Else
|
||||
* - memory pools
|
||||
* - thread support
|
||||
* - port-specific headers
|
||||
*
|
||||
* Revision 1.1.2.1 1998/12/02 20:47:35 qli
|
||||
* data structure memory pools configuration options
|
||||
* should be included by sys_conf.h file since it is application specific in
|
||||
* the case of pSOS
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NC_DSMEMCFG_H
|
||||
#define _NC_DSMEMCFG_H
|
||||
|
||||
#include <wrn/wm/attache/config.h>
|
||||
#include <wrn/wm/attache/arp.h>
|
||||
#include <wrn/wm/attache/ip_rte.h>
|
||||
#include <wrn/wm/attache/ip4_rd.h>
|
||||
#include <wrn/wm/attache/tcp.h>
|
||||
#include <wrn/wm/attache/udp.h>
|
||||
|
||||
#define NC_IF_ARP_INSTANCE 5
|
||||
#define NC_IF_ARP_ENTRIES 5 /* each entry contains (MAX_ARP_ENTRIES * size) */
|
||||
#define NC_IF_ARP_IPADDRESS 20
|
||||
|
||||
#define NC_RTE_TABLE_DISPATCH 20
|
||||
#define NC_RTE_TABLE_HEAD 20
|
||||
#define NC_RTE_TABLE_AVLNODE 20
|
||||
#define NC_RTE_TABLE_ROUTEHEAD 20
|
||||
#define NC_RTE_TABLE_RTENTRY_NHGATEWAY 20 /* each entry is (route_entry_t + nh_gateway_t) */
|
||||
#define NC_RTE_TABLE_FIXEDEXT 20
|
||||
#define NC_RTE_TABLE_ADDREXT 20
|
||||
#define NC_RTE_TABLE_OWNER 20
|
||||
|
||||
#define NC_RTE_DISC_DISPATCH 20
|
||||
#define NC_RTE_DISC_HEAD 20
|
||||
#define NC_IF_RD_ROUTERCONF 20
|
||||
#define NC_IF_RD_HOSTCONF 20
|
||||
#define NC_RTE_DISC_AVLNODE 20
|
||||
#define NC_RTE_DISC_RDCENTRY 20
|
||||
#define NC_RTE_DISC_NHBLOCK 20
|
||||
|
||||
#define NC_SNMP_TMP_ENTRY 20
|
||||
#define NC_SNMP_ROUTEEXT 20
|
||||
#define NC_SNMP_RTENTRY_NHGATEWAY 20
|
||||
|
||||
#define NC_TCP_TCB 10
|
||||
|
||||
#define NC_UDP_TABENT 10
|
||||
|
||||
|
||||
/*
|
||||
* size of each configured data structure
|
||||
*/
|
||||
#define SZ_NC_IF_ARP_INSTANCE sizeof(struct arp_instance)
|
||||
#define SZ_NC_IF_ARP_ENTRIES (sizeof(struct arp_entry) + MAX_HW_ADDR_LENGTH + MAX_ARP_MISC_SIZE) * MAX_ARP_ENTRIES
|
||||
#define SZ_NC_IF_ARP_IPADDRESS sizeof(struct arp_ip_addr)
|
||||
|
||||
#define SZ_NC_RTE_TABLE_DISPATCH sizeof(avl_dispatch_t)
|
||||
#define SZ_NC_RTE_TABLE_HEAD sizeof(avl_head_t)
|
||||
#define SZ_NC_RTE_TABLE_AVLNODE sizeof(avl_node_t)
|
||||
#define SZ_NC_RTE_TABLE_ROUTEHEAD sizeof(route_head_t)
|
||||
#define SZ_NC_RTE_TABLE_RTENTRY_NHGATEWAY sizeof(route_entry_t) + sizeof(nh_gateway_t)
|
||||
#define SZ_NC_RTE_TABLE_FIXEDEXT sizeof(fixed_route_ext_t)
|
||||
#define SZ_NC_RTE_TABLE_ADDREXT sizeof(addr_route_ext_t)
|
||||
#define SZ_NC_RTE_TABLE_OWNER sizeof(route_owner_t)
|
||||
|
||||
#define SZ_NC_RTE_DISC_DISPATCH sizeof(avl_dispatch_t)
|
||||
#define SZ_NC_RTE_DISC_HEAD sizeof(avl_head_t)
|
||||
#if INSTALL_ATTACHE_IP_FORWARDING
|
||||
#define SZ_NC_IF_RD_ROUTERCONF sizeof(rd_router_conf_t)
|
||||
#else
|
||||
#define SZ_NC_IF_RD_ROUTERCONF 0
|
||||
#endif
|
||||
#if ((!INSTALL_ATTACHE_IP_FORWARDING) || INSTALL_ATTACHE_KEEP_RD_CACHE_ON_ROUTER)
|
||||
#define SZ_NC_IF_RD_HOSTCONF sizeof(rd_host_conf_t)
|
||||
#else
|
||||
#define SZ_NC_IF_RD_HOSTCONF 0
|
||||
#endif
|
||||
#define SZ_NC_RTE_DISC_AVLNODE sizeof(avl_node_t)
|
||||
#define SZ_NC_RTE_DISC_RDCENTRY sizeof(rdc_entry_t)
|
||||
#define SZ_NC_RTE_DISC_NHBLOCK sizeof(nh_block_t)
|
||||
|
||||
extern tmp_route_entry_t;
|
||||
#define SZ_NC_SNMP_TMP_ENTRY sizeof(tmp_route_entry_t) /* snmpcidr.c */
|
||||
|
||||
#define SZ_NC_SNMP_ROUTEEXT sizeof(route_ext_t)
|
||||
#define SZ_NC_SNMP_RTENTRY_NHGATEWAY sizeof(route_entry_t) + sizeof(nh_gateway_t)
|
||||
|
||||
#define SZ_NC_TCP_TCB sizeof(struct tcb)
|
||||
|
||||
#define SZ_NC_UDP_TABENT sizeof(udp_handle_t)
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/firewall.h,v 1.2 2001/11/07 14:27:44 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Rudimentary firewall built on top of Attache.
|
||||
* This is a work in progress, I need the basic functionality to solve
|
||||
* a short term problem but the code will need more work to make
|
||||
* it as general as it should be.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Log: firewall.h,v $
|
||||
* Revision 1.2 2001/11/07 14:27:44 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.3 2001/01/19 22:23:34 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.2 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.1 1998/09/06 08:11:07 sra
|
||||
* Packet filtering hooks in Attache, rudimentary firewall
|
||||
* implementation in Snark.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SNARK_FIREWALL_H
|
||||
#define SNARK_FIREWALL_H
|
||||
|
||||
#include <wrn/wm/attache/config.h>
|
||||
#include <wrn/wm/attache/packet.h>
|
||||
|
||||
extern int snark_firewall_inbound_filter (packet *);
|
||||
extern int snark_firewall_forward_filter (packet *);
|
||||
extern int snark_firewall_outbound_filter(packet *);
|
||||
|
||||
extern void snark_firewall_init(void);
|
||||
|
||||
#if INSTALL_SNARK_FIREWALL_INBOUND
|
||||
#define GLUE_IP_RCV_PKT_FILTER(_P_) snark_firewall_inbound_filter(_P_)
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNARK_FIREWALL_FORWARD
|
||||
#define GLUE_IP_FWD_PKT_FILTER(_P_) snark_firewall_forward_filter(_P_)
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNARK_FIREWALL_OUTBOUND
|
||||
#define GLUE_IP_SEND_PKT_FILTER(_P_) snark_firewall_outbound_filter(_P_)
|
||||
#endif
|
||||
|
||||
#endif /* SNARK_FIREWALL_H */
|
||||
@@ -0,0 +1,57 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/if_ether.h,v 1.3 2003/01/15 13:58:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: if_ether.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:30 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:44 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.2 2001/01/19 22:23:34 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.1 2000/07/10 15:55:15 mrf
|
||||
* Add configuration for Cygnus NT environment with associated changes.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/* Include file to include netinet/if_ether.h on machines that
|
||||
* have it, not on machines that don't.
|
||||
*/
|
||||
|
||||
#include <wrn/wm/common/config.h>
|
||||
|
||||
#if (!INSTALL_on_ntgcc)
|
||||
#include <netinet/if_ether.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/keyboard.h,v 1.1.1.1 2001/11/05 17:47:32 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Declarations for system-independent low-level keyboard handler
|
||||
* and associated output device (ie, the local console, if any).
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Log: keyboard.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:35 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:14 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:20 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.4 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.3 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.2 1993/07/31 23:25:22 sra
|
||||
* Add keyboard_write().
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_KEYBOARD_H_
|
||||
#define _SNARK_KEYBOARD_H_
|
||||
|
||||
extern void keyboard_handler (void (*)(unsigned char *, size_t));
|
||||
extern void keyboard_write (unsigned char *, size_t);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,84 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/keyword.h,v 1.1.1.1 2001/11/05 17:47:32 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: keyword.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.7 2001/01/19 22:23:35 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.6 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.5 1998/02/25 04:57:15 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.4 1997/03/20 06:53:20 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.3 1997/03/09 18:39:25 sra
|
||||
* Fix some compiler warnings, change from compile-time to run-time init
|
||||
* macros for keyword tables.
|
||||
*
|
||||
* Revision 1.2 1997/02/24 00:56:59 sra
|
||||
* Support for run-time configuration of BUG() macros.
|
||||
*
|
||||
* Revision 1.1 1997/02/19 08:13:05 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SNARK_KEYWORD_H
|
||||
#define SNARK_KEYWORD_H
|
||||
|
||||
enum keyword_error {
|
||||
KEYWORD_ERROR_OK,
|
||||
KEYWORD_ERROR_NOT_FOUND,
|
||||
KEYWORD_ERROR_AMBIGUOUS
|
||||
};
|
||||
|
||||
struct keyword_table {
|
||||
void *table;
|
||||
size_t table_length;
|
||||
size_t entry_size;
|
||||
enum keyword_error error;
|
||||
void *result;
|
||||
unsigned flags;
|
||||
};
|
||||
|
||||
#define KEYWORD_ERROR(_table_) \
|
||||
((_table_)->error)
|
||||
|
||||
#define KEYWORD_INIT(_table_, _array_) \
|
||||
keyword_init((_table_), (_array_), \
|
||||
sizeof(_array_)/sizeof(*(_array_)), \
|
||||
sizeof(*(_array_)))
|
||||
|
||||
extern void keyword_init(struct keyword_table *, void *, size_t, size_t);
|
||||
extern void *keyword_find(struct keyword_table *, const char *);
|
||||
|
||||
#endif /* SNARK_KEYWORD_H */
|
||||
@@ -0,0 +1,88 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/main.h,v 1.1.1.1 2001/11/05 17:47:32 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: main.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:32 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.6 2001/01/19 22:23:35 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.5 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.4 1998/02/25 04:57:15 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.3 1997/03/20 06:53:21 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.2 1997/02/24 00:56:59 sra
|
||||
* Support for run-time configuration of BUG() macros.
|
||||
*
|
||||
* Revision 1.1 1997/02/19 08:13:05 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SNARK_MAIN_H
|
||||
#define SNARK_MAIN_H
|
||||
|
||||
/*
|
||||
* snark_main() is Snark's equivilent to the C main() function:
|
||||
* once the snark universe has been initialized, snark calls
|
||||
* a function by this name, which must exist, and assumes that
|
||||
* this function is the starting point of the real application.
|
||||
*/
|
||||
|
||||
extern void snark_main(struct task *initial_task, void *cookie);
|
||||
|
||||
/*
|
||||
* snark_exit() is like exit() but it first does a clean shutdown
|
||||
* of all the Snark stuff, which might matter if you're running under Purify
|
||||
* and care about memory leaks, or if you're running under DOS and ever want
|
||||
* to use your machine again without rebooting it first.
|
||||
*/
|
||||
|
||||
extern void snark_exit(int value);
|
||||
|
||||
/*
|
||||
* Default argblock format for snark_main(). You can override this
|
||||
* by defining one of the user-exits SNARK_PRE_INIT_HOOK() or
|
||||
* SNARK_POST_INIT_HOOK().
|
||||
*/
|
||||
|
||||
struct snark_main_args {
|
||||
int argc;
|
||||
char **argv;
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal variables used by snark_exit() and tasks_run().
|
||||
*/
|
||||
extern int snark_exit_flag, snark_exit_value;
|
||||
|
||||
#endif /* SNARK_MAIN_H */
|
||||
@@ -0,0 +1,114 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/netconf.h,v 1.2 2002/02/27 21:42:08 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: netconf.h,v $
|
||||
* Revision 1.2 2002/02/27 21:42:08 josh
|
||||
* fix include path
|
||||
*
|
||||
* Revision 1.1 2001/11/08 16:00:57 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.10 2001/01/19 22:23:46 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.9 2000/03/17 00:12:40 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.8 1998/02/25 04:57:27 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.7 1997/05/20 02:08:06 mrf
|
||||
* ipaddr_t, ldb macro and routing api conversion of media layer and arp code
|
||||
*
|
||||
* Revision 2.6 1997/03/20 06:52:58 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.5 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.4 1996/05/08 18:18:09 lowell
|
||||
* "gratuitous ARP" shouldn't break non-ARP nets now
|
||||
*
|
||||
* Revision 2.3 1996/04/30 20:29:33 josh
|
||||
* Damage control -- forcing SNARK_GRATUITOUS_ARPt to 0
|
||||
*
|
||||
* Revision 2.2 1996/04/23 22:05:58 lowell
|
||||
* added ARP-for-my-own-address on startup
|
||||
* (to solve problems associated with making up ethernet addresses
|
||||
* out of thin air)
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.4 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.3 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.2 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:30 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic network initialization routines for snark.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NETCONF_H_
|
||||
#define _NETCONF_H_
|
||||
|
||||
/*
|
||||
* Stuff provided by generic snark code.
|
||||
*/
|
||||
extern void netconfig (void);
|
||||
extern boolean_t netconfig_if (struct net *);
|
||||
|
||||
/*
|
||||
* Each port of snark has to provide this routine.
|
||||
*/
|
||||
extern void netconfig_find (void);
|
||||
|
||||
/*
|
||||
* The BPF code needs to send out ARPs because it gets a new hardware
|
||||
* address every time it starts up. If any other systems need to do
|
||||
* this too, they can be added here.
|
||||
*/
|
||||
#if INSTALL_SNARK_BSD_BPF
|
||||
#define SNARK_GRATUITOUS_ARP 1
|
||||
void snark_gratuitous_arp(net_if *, ipaddr_t *);
|
||||
#include <wrn/wm/attache/arp.h>
|
||||
#else
|
||||
#define SNARK_GRATUITOUS_ARP 0
|
||||
#endif /* INSTALL_SNARK_BSD_BPF */
|
||||
|
||||
#endif /* _NETCONF_H_ */
|
||||
@@ -0,0 +1,84 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/nit.h,v 1.1 2001/11/08 16:00:57 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: nit.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:57 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.8 2001/01/19 22:23:46 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.7 2000/03/17 00:12:40 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.6 1998/07/31 19:45:46 wes
|
||||
* Put packet filtering into NIT driver...
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:28 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/05/02 02:45:50 sra
|
||||
* Support NIT in promiscuous mode, for IPv6 multicast.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:52:59 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* NIT interface to ethernet for Attache testing under SunOS 4.1.2.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NIT_H_
|
||||
#define _NIT_H_
|
||||
|
||||
extern int nit_open (char *, unsigned, unsigned char *);
|
||||
extern int nit_write (int, unsigned char *, unsigned);
|
||||
extern void nit_close (int);
|
||||
extern void nit_find (void (*)(char *, void *), void *);
|
||||
extern int nit_read (int, unsigned,
|
||||
void (*)(unsigned char *, unsigned, unsigned, void *),
|
||||
void *);
|
||||
|
||||
#endif /* _NIT_H_ */
|
||||
@@ -0,0 +1,74 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/nitdrive.h,v 1.1 2001/11/08 16:00:58 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: nitdrive.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:58 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:47 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:41 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:29 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:01 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 06:13:38 sra
|
||||
* Clean up antique type names and install macros.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Attache code for interfacing to ethernet via the Network Interface Tap
|
||||
* on SunOS 4.1.2.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NITDRIVE_H_
|
||||
#define _NITDRIVE_H_
|
||||
|
||||
extern void nit_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _NITDRIVE_H_ */
|
||||
@@ -0,0 +1,604 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/nvutils.h,v 1.3 2002/05/23 18:51:11 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: nvutils.h,v $
|
||||
* Revision 1.3 2002/05/23 18:51:11 josh
|
||||
* code modifications to support the entity MIB
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:44 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:36 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 7.16.4.3 2001/09/18 19:07:55 josh
|
||||
* base-level support for proxy and coexistence nvram routines
|
||||
*
|
||||
* Revision 7.16.4.2 2001/07/20 20:36:58 josh
|
||||
* nvutils support for community objects
|
||||
*
|
||||
* Revision 7.16.4.1 2001/06/28 18:24:11 josh
|
||||
* Seeding the Cormorant branch with the code from the old
|
||||
* cormorant branch
|
||||
*
|
||||
* Revision 7.16 2001/04/13 19:52:04 josh
|
||||
* overwriting the trunk version of this file with the one from
|
||||
* the kingfisher branch
|
||||
*
|
||||
* Revision 7.15 2001/01/19 22:23:35 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 7.14 2000/06/09 15:00:28 josh
|
||||
* updated for new proxy code and new installation options
|
||||
*
|
||||
* Revision 7.13.4.1 2001/04/13 19:50:33 josh
|
||||
* preserving special proxy-related changes to this file
|
||||
* on the cormorant branch
|
||||
*
|
||||
* Revision 7.13.2.3 2001/03/12 22:09:28 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 7.13.2.2 2001/01/19 21:38:28 josh
|
||||
* a new mechanism for hardcoding traps with arbitrary varbind lists
|
||||
* into an agent. useful for testing purposes
|
||||
*
|
||||
* Revision 7.13.2.1 2000/09/20 19:05:40 josh
|
||||
* bringing branch into line with root tree
|
||||
*
|
||||
* Revision 7.13 2000/03/17 00:12:12 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 7.12 1999/10/19 15:16:31 josh
|
||||
* adding support for new sections: target_addr, target_params, notify,
|
||||
* notify_filter_profile, and notify_filter.
|
||||
*
|
||||
* Revision 7.11 1998/09/16 19:56:46 sar
|
||||
* Added some user exits for the v3 method routines to use in the binary code
|
||||
*
|
||||
* Revision 7.10 1998/06/28 00:21:58 sar
|
||||
* Corrected type signature for nv_view_add_mod
|
||||
*
|
||||
* Revision 7.9 1998/06/23 20:46:18 sar
|
||||
* Update the calling arguments for the config routine
|
||||
*
|
||||
* Revision 7.8 1998/06/16 05:34:53 sar
|
||||
* clean up some type info
|
||||
* return the 1445 routines to their previous state
|
||||
* return the proper errors for v3 routines
|
||||
*
|
||||
* Revision 7.7 1998/06/09 22:14:08 sar
|
||||
* Added TV3CONTEXT and TV3CNAME
|
||||
*
|
||||
* Revision 7.6 1998/06/07 02:10:34 sar
|
||||
* Move the global configuration arguments here and renamed them
|
||||
* (NV_Config_Static et al).
|
||||
*
|
||||
* Revision 7.5 1998/05/23 19:11:33 sar
|
||||
* Modified the view routines to include rfc2275 and added other
|
||||
* routines to deal with v3 mibs (access, groups, users, engineids etc).
|
||||
*
|
||||
* Revision 7.4 1998/02/25 04:57:59 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 7.3 1997/03/20 06:53:51 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.1 1997/01/08 01:58:11 sar
|
||||
* Removed no_pp stuff and updated copyrights
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:19:20 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.2 1996/01/10 16:41:40 sar
|
||||
* Usec updates - added a new set of options to the config file
|
||||
* for use with the usec agentid, access, context and user info.
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:39:59 sar
|
||||
* Cut nvutils down to only have the routines for dealing with views.
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:50:18 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.2 1994/11/01 17:54:49 sar
|
||||
* Added a flag to the mod list entry to allow us to determine if the
|
||||
* entry was being deleted and therefore shouldn't be written out.
|
||||
*
|
||||
* Revision 5.1 1994/09/23 19:29:50 sar
|
||||
* Removed the old non volatile scheme and added a new one that is hopefully
|
||||
* easier to use and allows for some new options such as a read only
|
||||
* flag to prohibit creating a new config file. The config stuff will
|
||||
* only be included if needed.
|
||||
* In snmptalk and snmpint added a next function.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:57:40 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 17:14:56 sar
|
||||
* Updated rev to 4.0 and copyright to 93
|
||||
*
|
||||
* Revision 1.4 1993/06/02 23:23:10 dab
|
||||
* since this file gets included by other things, it needs to include
|
||||
* envoy files with <envoy/h/file.h> not just <file.h>
|
||||
*
|
||||
* Revision 1.3 1993/05/31 19:07:48 sar
|
||||
* changed to use a text rather than binary format for non volatile
|
||||
* storage, this allows me to use an editor to change the config files.
|
||||
*
|
||||
* Revision 1.2 1993/05/13 22:00:33 sar
|
||||
* changed stat to statflg to avoid conflicts elsewhere.
|
||||
*
|
||||
* Revision 1.1 1993/05/13 19:08:06 sar
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*****************************************************************************
|
||||
|
||||
Note well: some of these definitions are used in the pSOS examples as part of
|
||||
the api. Don't make changes without understanding which parts are in use.
|
||||
|
||||
*****************************************************************************
|
||||
****************************************************************************/
|
||||
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if !defined(nvutils_inc)
|
||||
#define nvutils_inc
|
||||
|
||||
#define NV_VIEW_MAXNAMELEN 32
|
||||
|
||||
typedef struct TB_S
|
||||
{
|
||||
int token_tag; /* Tag for this token */
|
||||
char *token_string; /* String representation for this token */
|
||||
} TB_T;
|
||||
|
||||
typedef struct MODS_S
|
||||
{
|
||||
struct MODS_S *next; /* The next entry in the linked list */
|
||||
PTR_T data; /* The structure for the entity */
|
||||
PTR_T newdata; /* new info for the entry */
|
||||
INT_32_T flags; /* Flags to describe what to do with
|
||||
this entity. Currently only
|
||||
destroy is defined */
|
||||
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
bits8_t name[NV_VIEW_MAXNAMELEN]; /* the name of the view */
|
||||
ALENGTH_T namelen; /* length of the name */
|
||||
#endif
|
||||
} MODS_T;
|
||||
|
||||
#define NV_MOD_DESTROY 1
|
||||
|
||||
#define TVERSION 1
|
||||
|
||||
#define TCOMMENT 1
|
||||
#define TPREAMBLE 2
|
||||
#define TVIEW 3
|
||||
#define TMYAGENT 4
|
||||
#define TAGENT 5
|
||||
#define TACCESS 6
|
||||
#define TCONTEXT 7
|
||||
#define TUSER 8
|
||||
#define TV3MYENGINE 9
|
||||
#define TV3ENGINE 10
|
||||
#define TV3USER 11
|
||||
#define TV3GROUP 12
|
||||
#define TV3ACCESS 13
|
||||
#define TV3CONTEXT 14
|
||||
#define TV3TADDR 15
|
||||
#define TV3TPARM 16
|
||||
#define TV3NTFY 17
|
||||
#define TV3NPROF 18
|
||||
#define TV3NFILT 19
|
||||
#define TV3TRAP 20
|
||||
#define TV3PROXY 21
|
||||
#define TCOMMUNITY 22
|
||||
#define TENTLOGIC 23
|
||||
|
||||
#define TVID 1
|
||||
#define TVSTATUS 2
|
||||
#define TVSTORAGE 3
|
||||
#define TVMASK 4
|
||||
#define TVTYPE 5
|
||||
|
||||
#define TAGID 1
|
||||
#define TAGBOOTS 2
|
||||
|
||||
#define TACID 1
|
||||
#define TACUNAME 2
|
||||
#define TACCNAME 3
|
||||
#define TACQOS 4
|
||||
#define TACPRIV 5
|
||||
#define TACRIND 6
|
||||
#define TACWIND 7
|
||||
|
||||
#define TCID 1
|
||||
#define TCCNAME 2
|
||||
#define TCFLAGS 3
|
||||
|
||||
#define TUID 1
|
||||
#define TUUNAME 2
|
||||
#define TUAUTHPROT 3
|
||||
#define TUAUTHKEY 4
|
||||
|
||||
#define TENGID 1
|
||||
#define TENGBOOTS 2
|
||||
#define TENGTADDR 3
|
||||
|
||||
#define TV3UID 1
|
||||
#define TV3UUNAME 2
|
||||
#define TV3UAUTHPROT 3
|
||||
#define TV3UAUTHKEY 4
|
||||
#define TV3UPRIVPROT 5
|
||||
#define TV3UPRIVKEY 6
|
||||
#define TV3USTATUS 7
|
||||
#define TV3USTORAGE 8
|
||||
|
||||
#define TV3GUSER 1
|
||||
#define TV3GMODEL 2
|
||||
#define TV3GGROUP 3
|
||||
#define TV3GSTATUS 4
|
||||
#define TV3GSTORAGE 5
|
||||
|
||||
#define TV3ACGROUP 1
|
||||
#define TV3ACPREFIX 2
|
||||
#define TV3ACMATCH 3
|
||||
#define TV3ACMODEL 4
|
||||
#define TV3ACLEVEL 5
|
||||
#define TV3ACREAD 6
|
||||
#define TV3ACWRITE 7
|
||||
#define TV3ACNOTIFY 8
|
||||
#define TV3ACSTATUS 9
|
||||
#define TV3ACSTORAGE 10
|
||||
|
||||
#define TV3CNAME 1
|
||||
|
||||
#define TV3TADDRNAME 1
|
||||
#define TV3TADDRTDOM 2
|
||||
#define TV3TADDRTADDR 3
|
||||
#define TV3TADDRTMASK 4
|
||||
#define TV3TADDRTMOUT 5
|
||||
#define TV3TADDRRETRY 6
|
||||
#define TV3TADDRTLIST 7
|
||||
#define TV3TADDRTMMS 8
|
||||
#define TV3TADDRPARMS 9
|
||||
#define TV3TADDRSTORAGE 10
|
||||
#define TV3TADDRSTATUS 11
|
||||
|
||||
#define TV3TPARMNAME 1
|
||||
#define TV3TPARMMPMOD 2
|
||||
#define TV3TPARMSECMOD 3
|
||||
#define TV3TPARMSECNAM 4
|
||||
#define TV3TPARMSECLVL 5
|
||||
#define TV3TPARMSTORAGE 6
|
||||
#define TV3TPARMSTATUS 7
|
||||
|
||||
#define TV3NTFYNAME 1
|
||||
#define TV3NTFYTAG 2
|
||||
#define TV3NTFYTYPE 3
|
||||
#define TV3NTFYSTORAGE 4
|
||||
#define TV3NTFYSTATUS 5
|
||||
|
||||
#define TV3NPROFPARM 1
|
||||
#define TV3NPROFNAME 2
|
||||
#define TV3NPROFSTORAGE 3
|
||||
#define TV3NPROFSTATUS 4
|
||||
|
||||
#define TV3NFILTPNAME 1
|
||||
#define TV3NFILTSTREE 2
|
||||
#define TV3NFILTMASK 3
|
||||
#define TV3NFILTTYPE 4
|
||||
#define TV3NFILTSTORAGE 5
|
||||
#define TV3NFILTSTATUS 6
|
||||
|
||||
#define TV3TRAPNAME 1
|
||||
#define TV3TRAPOID 2
|
||||
#define TV3TRAPTYPE 3
|
||||
#define TV3TRAPVALUE 4
|
||||
#define TV3TRAPCOUNT 5
|
||||
|
||||
#define TV3PROXYNAME 1
|
||||
#define TV3PROXYTYPE 2
|
||||
#define TV3PROXYCONID 3
|
||||
#define TV3PROXYCONNAME 4
|
||||
#define TV3PROXYPARAMSIN 5
|
||||
#define TV3PROXYSINGLE 6
|
||||
#define TV3PROXYMULTIPLE 7
|
||||
#define TV3PROXYSTORAGE 8
|
||||
#define TV3PROXYSTATUS 9
|
||||
|
||||
#define TCOMMINDEX 1
|
||||
#define TCOMMNAME 2
|
||||
#define TCOMMSECNAME 3
|
||||
#define TCOMMCONID 4
|
||||
#define TCOMMCONNAME 5
|
||||
#define TCOMMTAG 6
|
||||
#define TCOMMSTORAGE 7
|
||||
#define TCOMMSTATUS 8
|
||||
|
||||
#define TENTLOGICINDEX 1
|
||||
#define TENTLOGICDESCR 2
|
||||
#define TENTLOGICTYPE 3
|
||||
#define TENTLOGICCOMMUNITY 4
|
||||
#define TENTLOGICTADDRESS 5
|
||||
#define TENTLOGICTDOMAIN 6
|
||||
#define TENTLOGICCONID 7
|
||||
#define TENTLOGICCONNAME 8
|
||||
|
||||
extern int SNMP_NV_Config (char *);
|
||||
extern void SNMP_NV_Clean (void);
|
||||
extern int SNMP_NV_Write (int);
|
||||
extern void SNMP_NV_Doit (void);
|
||||
|
||||
struct SNMP_PKT_S;
|
||||
struct VB_S;
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_V3_TARGET) && (INSTALL_ENVOY_SNMP_V3_NOTIFY)
|
||||
typedef struct SNMPV3_TRAP_S
|
||||
{
|
||||
struct SNMPV3_TRAP_S *next;
|
||||
EBUFFER_T trap_name;
|
||||
VBL_T *vblp;
|
||||
} SNMPV3_TRAP_T;
|
||||
|
||||
extern SNMPV3_TRAP_T *trap_root;
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
|
||||
struct VIEWLEAF_S;
|
||||
extern int SNMP_NV_View_Add_Mod (struct VIEWLEAF_S *, INT_32_T);
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
struct VIEWLEAF_S;
|
||||
extern sbits32_t SNMP_NV_View_2275_Add_Mod (struct VIEWLEAF_S *,
|
||||
struct VIEWLEAF_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_view_2275_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct VIEWLEAF_S *,
|
||||
struct VIEWLEAF_S *);
|
||||
extern void snmp_view_2275_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct VIEWLEAF_S *,
|
||||
struct VIEWLEAF_S *);
|
||||
extern void snmp_view_2275_backout (struct VIEWLEAF_S *,
|
||||
struct VIEWLEAF_S *);
|
||||
extern int snmp_view_2275_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct VIEWLEAF_S *,
|
||||
struct VIEWLEAF_S *);
|
||||
extern void snmp_view_2275_finished (void);
|
||||
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
struct SNMP_GROUP_S;
|
||||
extern sbits32_t SNMP_NV_V3_Group_Add_Mod (struct SNMP_GROUP_S *,
|
||||
struct SNMP_GROUP_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_group_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_GROUP_S *,
|
||||
struct SNMP_GROUP_S *);
|
||||
extern void snmp_v3_group_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_GROUP_S *,
|
||||
struct SNMP_GROUP_S *);
|
||||
extern void snmp_v3_group_backout (struct SNMP_GROUP_S *,
|
||||
struct SNMP_GROUP_S *);
|
||||
extern int snmp_v3_group_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_GROUP_S *,
|
||||
struct SNMP_GROUP_S *);
|
||||
extern void snmp_v3_group_finished (void);
|
||||
|
||||
|
||||
struct SNMP_ACCESS_S;
|
||||
extern sbits32_t SNMP_NV_V3_Access_Add_Mod (struct SNMP_ACCESS_S *,
|
||||
struct SNMP_ACCESS_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_access_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_ACCESS_S *,
|
||||
struct SNMP_ACCESS_S *);
|
||||
extern void snmp_v3_access_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_ACCESS_S *,
|
||||
struct SNMP_ACCESS_S *);
|
||||
extern void snmp_v3_access_backout (struct SNMP_ACCESS_S *,
|
||||
struct SNMP_ACCESS_S *);
|
||||
extern int snmp_v3_access_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_ACCESS_S *,
|
||||
struct SNMP_ACCESS_S *);
|
||||
extern void snmp_v3_access_finished (void);
|
||||
|
||||
|
||||
struct SNMP_USER_S;
|
||||
extern sbits32_t SNMP_NV_V3_User_Add_Mod (struct SNMP_USER_S *,
|
||||
struct SNMP_USER_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_user_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_USER_S *,
|
||||
struct SNMP_USER_S *);
|
||||
extern void snmp_v3_user_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_USER_S *,
|
||||
struct SNMP_USER_S *);
|
||||
extern void snmp_v3_user_backout (struct SNMP_USER_S *,
|
||||
struct SNMP_USER_S *);
|
||||
extern int snmp_v3_user_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_USER_S *,
|
||||
struct SNMP_USER_S *);
|
||||
extern void snmp_v3_user_finished (void);
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_V3_TARGET)
|
||||
|
||||
struct SNMP_TARGET_ADDR_S;
|
||||
extern sbits32_t SNMP_NV_V3_TAddr_Add_Mod (struct SNMP_TARGET_ADDR_S *,
|
||||
struct SNMP_TARGET_ADDR_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_taddr_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_ADDR_S *,
|
||||
struct SNMP_TARGET_ADDR_S *);
|
||||
extern void snmp_v3_taddr_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_ADDR_S *,
|
||||
struct SNMP_TARGET_ADDR_S *);
|
||||
extern void snmp_v3_taddr_backout (struct SNMP_TARGET_ADDR_S *,
|
||||
struct SNMP_TARGET_ADDR_S *);
|
||||
extern int snmp_v3_taddr_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_ADDR_S *,
|
||||
struct SNMP_TARGET_ADDR_S *);
|
||||
extern void snmp_v3_taddr_finished (void);
|
||||
|
||||
struct SNMP_TARGET_PARAMS_S;
|
||||
extern sbits32_t SNMP_NV_V3_TParam_Add_Mod (struct SNMP_TARGET_PARAMS_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_tparam_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *);
|
||||
extern void snmp_v3_tparam_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *);
|
||||
extern void snmp_v3_tparam_backout (struct SNMP_TARGET_PARAMS_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *);
|
||||
extern int snmp_v3_tparam_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *,
|
||||
struct SNMP_TARGET_PARAMS_S *);
|
||||
extern void snmp_v3_tparam_finished (void);
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_V3_NOTIFY)
|
||||
|
||||
struct SNMP_NOTIFY_S;
|
||||
extern sbits32_t SNMP_NV_V3_Notify_Add_Mod (struct SNMP_NOTIFY_S *,
|
||||
struct SNMP_NOTIFY_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_notify_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_S *,
|
||||
struct SNMP_NOTIFY_S *);
|
||||
extern void snmp_v3_notify_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_S *,
|
||||
struct SNMP_NOTIFY_S *);
|
||||
extern void snmp_v3_notify_backout (struct SNMP_NOTIFY_S *,
|
||||
struct SNMP_NOTIFY_S *);
|
||||
extern int snmp_v3_notify_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_S *,
|
||||
struct SNMP_NOTIFY_S *);
|
||||
extern void snmp_v3_notify_finished (void);
|
||||
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S;
|
||||
extern sbits32_t SNMP_NV_V3_NProf_Add_Mod (struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_nprof_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *);
|
||||
extern void snmp_v3_nprof_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *);
|
||||
extern void snmp_v3_nprof_backout (struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *);
|
||||
extern int snmp_v3_nprof_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *,
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *);
|
||||
extern void snmp_v3_nprof_finished (void);
|
||||
|
||||
struct SNMP_NOTIFY_FILTER_S;
|
||||
extern sbits32_t SNMP_NV_V3_NFilt_Add_Mod (struct SNMP_NOTIFY_FILTER_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_nfilt_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *);
|
||||
extern void snmp_v3_nfilt_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *);
|
||||
extern void snmp_v3_nfilt_backout (struct SNMP_NOTIFY_FILTER_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *);
|
||||
extern int snmp_v3_nfilt_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *,
|
||||
struct SNMP_NOTIFY_FILTER_S *);
|
||||
extern void snmp_v3_nfilt_finished (void);
|
||||
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_V3_NOTIFY) */
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_V3_PROXY)
|
||||
|
||||
struct SNMP_PROXY_S;
|
||||
extern sbits32_t SNMP_NV_V3_Proxy_Add_Mod (struct SNMP_PROXY_S *,
|
||||
struct SNMP_PROXY_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_v3_proxy_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_PROXY_S *,
|
||||
struct SNMP_PROXY_S *);
|
||||
extern void snmp_v3_proxy_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_PROXY_S *,
|
||||
struct SNMP_PROXY_S *);
|
||||
extern void snmp_v3_proxy_backout (struct SNMP_PROXY_S *,
|
||||
struct SNMP_PROXY_S *);
|
||||
extern int snmp_v3_proxy_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_PROXY_S *,
|
||||
struct SNMP_PROXY_S *);
|
||||
extern void snmp_v3_proxy_finished (void);
|
||||
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_V3_PROXY) */
|
||||
#if (INSTALL_ENVOY_SNMP_COEXISTENCE)
|
||||
|
||||
struct SNMP_COMMUNITY_S;
|
||||
extern sbits32_t SNMP_NV_Community_Add_Mod (struct SNMP_COMMUNITY_S *,
|
||||
struct SNMP_COMMUNITY_S *,
|
||||
sbits32_t);
|
||||
extern sbits32_t snmp_community_test (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_COMMUNITY_S *,
|
||||
struct SNMP_COMMUNITY_S *);
|
||||
extern void snmp_community_set (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_COMMUNITY_S *,
|
||||
struct SNMP_COMMUNITY_S *);
|
||||
extern void snmp_community_backout (struct SNMP_COMMUNITY_S *,
|
||||
struct SNMP_COMMUNITY_S *);
|
||||
extern int snmp_community_undo (struct SNMP_PKT_S *, struct VB_S *,
|
||||
struct SNMP_COMMUNITY_S *,
|
||||
struct SNMP_COMMUNITY_S *);
|
||||
extern void snmp_community_finished (void);
|
||||
|
||||
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_COEXISTENCE */
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_V3_TARGET) */
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_VERSION_3) */
|
||||
|
||||
#define MAX_NVF 128
|
||||
extern char NV_Config_Static[];
|
||||
extern char NV_Old_Config_Static[];
|
||||
extern char NV_Temp_Config_Static[];
|
||||
|
||||
extern char *NV_Config_File;
|
||||
extern char *NV_Old_Config_File;
|
||||
extern char *NV_Temp_Config_File;
|
||||
|
||||
extern int NV_Read_Only;
|
||||
extern int NV_Views_From_Config;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/parse.h,v 1.1.1.1 2001/11/05 17:47:36 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: parse.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:36 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:36 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:16 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:22 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.2 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_PARSE_H_
|
||||
#define _SNARK_PARSE_H_
|
||||
|
||||
extern int parse_line(char *, char *[], int);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,309 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/pktd.h,v 1.1 2001/11/08 16:00:58 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1992-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: pktd.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:58 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.9 2001/01/19 22:23:48 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.8 2000/03/17 00:12:42 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.7 1998/02/25 04:57:30 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.6 1998/02/20 23:07:23 sra
|
||||
* Add multicast and IPv6 support.
|
||||
*
|
||||
* Revision 2.5 1998/02/19 07:46:10 sra
|
||||
* Preliminary multicast support.
|
||||
*
|
||||
* Revision 2.4 1997/07/22 20:33:47 mrf
|
||||
* put constants in correct include file
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:05 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1993/07/31 02:00:54 sra
|
||||
* Flush boolean_t from this file.
|
||||
*
|
||||
* Revision 1.1 1993/07/30 02:41:24 sra
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Revision 1.3 1992/12/10 19:32:36 dab
|
||||
* Added fake PPP stuff for compatibility with FTP's router.
|
||||
*
|
||||
* Revision 1.2 1992/10/13 15:59:35 dab
|
||||
* Fixes for SLIP
|
||||
*
|
||||
* Revision 1.1 92/09/18 15:54:43 dab
|
||||
* Initial revision
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PKTD_H_
|
||||
#define _PKTD_H_
|
||||
|
||||
/*
|
||||
* The following definitions are from the FTP Software Packet Driver
|
||||
* specification.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Range in which the packet driver interrupt may lie
|
||||
*/
|
||||
#define PKTDRVR_MIN_INT 0x60
|
||||
#define PKTDRVR_MAX_INT 0x7F
|
||||
|
||||
/*
|
||||
* The interface classes
|
||||
*/
|
||||
#define IC_ETHERNET 1
|
||||
#define IC_PRONET10 2
|
||||
#define IC_TOKENRING 3
|
||||
#define IC_OMNINET 4
|
||||
#define IC_APPLETALK 5
|
||||
#define IC_SERIAL_LINE 6
|
||||
#define IC_STARLAN 7
|
||||
#define IC_ARCNET 8
|
||||
#define IC_AX25 9
|
||||
#define IC_KISS 10
|
||||
#define IC_8023 11
|
||||
#define IC_FDDI 12
|
||||
#define IC_X25 13
|
||||
#define IC_LANSTAR 14
|
||||
#define IC_FPPP 16 /* "Fake" PPP (Niwot card) */
|
||||
|
||||
/* packet driver code still needs types byte-swapped */
|
||||
#define PD_ET_IP 0x0008
|
||||
#define PD_ET_ARP 0x0608
|
||||
#define PD_ET_IP6 0xDD86
|
||||
|
||||
/*
|
||||
* Packet driver error codes.
|
||||
*/
|
||||
#define PDE_NO_ERROR 0 /* Added */
|
||||
#define PDE_BAD_HANDLE 1
|
||||
#define PDE_NO_CLASS 2
|
||||
#define PDE_NO_TYPE 3
|
||||
#define PDE_NO_NUMBER 4
|
||||
#define PDE_BAD_TYPE 5
|
||||
#define PDE_NO_MULTICAST 6
|
||||
#define PDE_CANT_TERMINATE 7
|
||||
#define PDE_BAD_MODE 8
|
||||
#define PDE_NO_SPACE 9 /* Added */
|
||||
#define PDE_TYPE_INUSE 10 /* Added */
|
||||
#define PDE_BAD_COMMAND 11 /* Added */
|
||||
#define PDE_CANT_SEND 12 /* Added */
|
||||
#define PDE_NO_PKT_DRVR 128 /* Added */
|
||||
|
||||
/*
|
||||
* Interface types (within each class)
|
||||
*/
|
||||
#define IT_ANY 0xFFFF
|
||||
|
||||
/*
|
||||
* Devices in the Ethernet class
|
||||
*/
|
||||
#define _3COM_3C501 1
|
||||
#define _3COM_3C505 2
|
||||
#define INTERLAN_NI5010 3
|
||||
#define BICC_4110 4
|
||||
#define BICC_4117 5
|
||||
#define INTERLAN_NP600 6
|
||||
#define UB_NIC 8
|
||||
#define UNIVATION 9
|
||||
#define TRW_PC2000 10
|
||||
#define INTERLAN_NI5210 11
|
||||
#define _3COM_3C503 12
|
||||
#define _3COM_3C523 13
|
||||
#define WESTERN_DIGITAL_WD8003 14
|
||||
|
||||
/*
|
||||
* ProNET-10
|
||||
*/
|
||||
#define PROTEON_P1300 1
|
||||
|
||||
/*
|
||||
* IEEE 802.5 & IBM Token Ring
|
||||
*/
|
||||
#define IBM_TOKEN_RING 1
|
||||
#define PROTEON_P1340 2
|
||||
#define PROTEON_P1344 2
|
||||
|
||||
/*
|
||||
* Driver Functionality Codes (bit-mapped, sort of)
|
||||
*/
|
||||
#define PDFC_BASIC 1 /* this one isn't bit-mapped */
|
||||
#define PDFC_EXTENDED 2
|
||||
#define PDFC_HIGH_PERFORMANCE 4
|
||||
|
||||
/*
|
||||
* Extended driver receive modes
|
||||
*/
|
||||
#define PKT_RCVR_OFF 1
|
||||
#define PKT_RCVR_UNICAST 2 /* unicast only */
|
||||
#define PKT_RCVR_BCAST 3 /* unicast + b'cast */
|
||||
#define PKT_RCVR_LIM_MCAST 4 /* unicast + b'cast + some m-cast */
|
||||
#define PKT_RCVR_ALL_MCAST 5 /* unicast + b'cast + all m-cast */
|
||||
#define PKT_RCVR_PROMISCUOUS 6 /* everything */
|
||||
|
||||
/*
|
||||
* Define the pkt driver function codes
|
||||
*/
|
||||
#define PF_DRIVER_INFO 1
|
||||
#define PF_ACCESS_TYPE 2
|
||||
#define PF_RELEASE_TYPE 3
|
||||
#define PF_SEND_PKT 4
|
||||
#define PF_TERMINATE 5
|
||||
#define PF_GET_ADDRESS 6
|
||||
#define PF_RESET_INTERFACE 7
|
||||
#define PF_SET_RCV_MODE 20
|
||||
#define PF_GET_RCV_MODE 21
|
||||
#define PF_SET_MULTICAST_LIST 22
|
||||
#define PF_GET_MULTICAST_LIST 23
|
||||
#define PF_GET_STATISTICS 24
|
||||
|
||||
typedef struct {
|
||||
int version;
|
||||
int pdtype;
|
||||
unsigned char class;
|
||||
unsigned char number;
|
||||
char far *name;
|
||||
char basic_flag;
|
||||
} pkt_driver_info_t;
|
||||
|
||||
typedef struct {
|
||||
long int pkts_in;
|
||||
long int pkts_out;
|
||||
long int bytes_in;
|
||||
long int bytes_out;
|
||||
long int errors_in;
|
||||
long int errors_out;
|
||||
long int packets_dropped;
|
||||
long int pad[4]; /* Space for FTP Software to add new items. */
|
||||
|
||||
/*
|
||||
* The remaining fields are TRW PC-2000 extensions
|
||||
*/
|
||||
long int ints; /* Interrupts */
|
||||
|
||||
/*
|
||||
* XMIT errors...
|
||||
*/
|
||||
long int cd_lost; /* Lost Carrier Detect on XMIT */
|
||||
long int cts_lost; /* Lost Clear-to-send on XMIT */
|
||||
long int xmit_dma_under; /* XMIT DMA underrun */
|
||||
long int deferred; /* XMITs deferred */
|
||||
long int sqe_lost; /* SQE failed to follow XMIT */
|
||||
long int collisions; /* Collisions during XMIT */
|
||||
long int ex_collisions; /* XMITs terminated due to excess collisions */
|
||||
long int toobig; /* User packet too big to XMIT */
|
||||
long int refused; /* User packet refused, no XMIT resources */
|
||||
int max_send_pend; /* High water mark of pending transmissions. */
|
||||
int place_holder_0; /* Place holder for future use */
|
||||
|
||||
/*
|
||||
* RCV errors ...
|
||||
*/
|
||||
long int shorts; /* RCVD packets < min length */
|
||||
long int longs; /* RCVD packets > max length */
|
||||
long int skipped; /* RCVD packets discarded by software. */
|
||||
long int crcerrs; /* RCVD packets with CRC errors */
|
||||
long int alnerrs; /* RCVD pkts w/ alignment errors*/
|
||||
long int rscerrs; /* RCVD pkts but no 82586 rcv resources */
|
||||
long int ovrnerrs; /* RCVD pkts lost due to rcv DMA overruns
|
||||
/* (occurs often using 82586 in loopback) */
|
||||
long int unwanted; /* RCVD packets skipped by software because */
|
||||
/* no user wants that type. */
|
||||
long int user_drops; /* RCVD packets skipped by software because */
|
||||
/* user would not provide a buffer. */
|
||||
} pkt_driver_statistics_t;
|
||||
|
||||
struct pd_net {
|
||||
int pd_int;
|
||||
int handle;
|
||||
PD_UPCALL_RTN_T *device_receive_rtn;
|
||||
pkt_driver_info_t drvr_info;
|
||||
};
|
||||
|
||||
/*
|
||||
* Packet driver routines.
|
||||
*/
|
||||
|
||||
extern int pd_check_int
|
||||
(int pd_int);
|
||||
|
||||
extern int pd_driver_info
|
||||
(int handle,
|
||||
struct pd_net *pd_net);
|
||||
|
||||
extern int pd_access_type
|
||||
(struct pd_net *pd_net,
|
||||
int *handle,
|
||||
unsigned char far *type,
|
||||
int type_length);
|
||||
|
||||
extern int pd_release_type
|
||||
(struct pd_net *pd_net,
|
||||
int handle);
|
||||
|
||||
extern int pd_get_address
|
||||
(struct pd_net *pdnet,
|
||||
unsigned char far *address_buffer,
|
||||
int buffer_length);
|
||||
|
||||
extern int pd_send_pkt
|
||||
(struct pd_net *pd_net,
|
||||
unsigned char far *buffer,
|
||||
unsigned int buffer_length);
|
||||
|
||||
extern char *pd_perror
|
||||
(int error_code);
|
||||
|
||||
extern int pd_get_rcv_mode
|
||||
(struct pd_net *pdn,
|
||||
int *mode);
|
||||
|
||||
extern int pd_set_rcv_mode
|
||||
(struct pd_net *pdn,
|
||||
int mode);
|
||||
|
||||
#endif /* _PKTD_H_ */
|
||||
@@ -0,0 +1,114 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/pktd_bcc.h,v 1.1 2001/11/08 16:00:58 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1992-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: pktd_bcc.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:58 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:48 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:42 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:31 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:06 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.2 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.1 1993/07/30 02:41:24 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains system and compiler specific information so that the
|
||||
* source doesn't have to be ifdef'd for all the various compilers
|
||||
* we try and support.
|
||||
*
|
||||
* This file is for Borland C++ version 3.1.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compiler include files - these are development-system dependent
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dos.h>
|
||||
|
||||
/*
|
||||
* Each compiler defines what its saveregs structure looks like.
|
||||
* The packet driver code requires that it have fields named like below.
|
||||
*/
|
||||
struct saveregs {
|
||||
unsigned int es;
|
||||
unsigned int ds;
|
||||
unsigned int di;
|
||||
unsigned int si;
|
||||
unsigned int bp;
|
||||
unsigned int sp;
|
||||
unsigned int bx;
|
||||
unsigned int dx;
|
||||
unsigned int cx;
|
||||
unsigned int ax;
|
||||
};
|
||||
|
||||
/*
|
||||
* This macro expands into a routine which can be the upcalled routine from
|
||||
* a packet driver. It should save all its registers on entry into a structure
|
||||
* and pass that structure, along with a handle argument up to an upcall
|
||||
* routine argument.
|
||||
*/
|
||||
#define PD_UPCALL(routine_name, handle, upcall) \
|
||||
void far _saveregs _loadds routine_name(struct saveregs r) \
|
||||
{ \
|
||||
struct saveregs far *rp; \
|
||||
unsigned char far *ret; \
|
||||
\
|
||||
rp = (struct saveregs far *) \
|
||||
((char *)(&r) - (sizeof(struct saveregs) + 4)); \
|
||||
ret = upcall(rp, handle); \
|
||||
rp->es = FP_SEG(ret); \
|
||||
rp->di = FP_OFF(ret); \
|
||||
}
|
||||
|
||||
/*
|
||||
* This typedef must define PD_UPCALL_RTN_T to be a routine of the same type
|
||||
* as the PD_UPCALL macro generates.
|
||||
*/
|
||||
typedef void far _saveregs _loadds PD_UPCALL_RTN_T(struct saveregs r);
|
||||
@@ -0,0 +1,124 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/pktd_msc.h,v 1.1 2001/11/08 16:00:58 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: pktd_msc.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:58 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.7 2001/01/19 22:23:49 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.6 2000/03/17 00:12:42 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:31 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/03/20 06:53:06 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.2 1996/10/30 16:29:13 sra
|
||||
* Conditionalize definition of MK_FP. I no longer remember why we were
|
||||
* defining this ourselves in the first place.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.2 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.1 1993/07/30 02:41:24 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file contains system and compiler specific information so that the
|
||||
* source doesn't have to be ifdef'd for all the various compilers
|
||||
* we try and support.
|
||||
*
|
||||
* This file is for Microsoft C++.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compiler include files - these are development-system dependent
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dos.h>
|
||||
|
||||
/*
|
||||
* Each compiler defines what its saveregs structure looks like. The packet
|
||||
* driver code requires that it have fields named like below.
|
||||
*/
|
||||
struct saveregs {
|
||||
unsigned int es;
|
||||
unsigned int ds;
|
||||
unsigned int di;
|
||||
unsigned int si;
|
||||
unsigned int bp;
|
||||
unsigned int sp;
|
||||
unsigned int bx;
|
||||
unsigned int dx;
|
||||
unsigned int cx;
|
||||
unsigned int ax;
|
||||
};
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MK_FP
|
||||
#define MK_FP(seg,ofs) \
|
||||
((void far *)( (((unsigned long)seg) << 16) + (unsigned long)ofs))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This macro expands into a routine which can be the upcalled routine from
|
||||
* a packet driver. It should save all its registers on entry into a structure
|
||||
* and pass that structure, along with a handle argument up to an upcall
|
||||
* routine argument.
|
||||
*/
|
||||
#define PD_UPCALL(routine_name, handle, upcall) \
|
||||
void far _saveregs _loadds routine_name(struct saveregs r) \
|
||||
{ \
|
||||
struct saveregs far *rp; \
|
||||
unsigned char far *ret; \
|
||||
\
|
||||
rp = (struct saveregs far *) \
|
||||
((char *)(&r) - (sizeof(struct saveregs) + 4)); \
|
||||
ret = upcall(rp, handle); \
|
||||
rp->es = FP_SEG(ret); \
|
||||
rp->di = FP_OFF(ret); \
|
||||
}
|
||||
|
||||
/*
|
||||
* This typedef must define PD_UPCALL_RTN_T to be a routine of the same type
|
||||
* as the PD_UPCALL macro generates.
|
||||
*/
|
||||
typedef void far _saveregs _loadds PD_UPCALL_RTN_T(struct saveregs r);
|
||||
@@ -0,0 +1,74 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/pktdrive.h,v 1.1 2001/11/08 16:00:58 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: pktdrive.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:58 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.9 2001/01/19 22:23:49 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.8 2000/03/17 00:12:43 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.7 1998/02/25 04:57:34 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.6 1997/07/23 01:42:34 mrf
|
||||
* remove redundant constants
|
||||
*
|
||||
* Revision 2.5 1997/07/22 20:33:47 mrf
|
||||
* put constants in correct include file
|
||||
*
|
||||
* Revision 2.4 1997/07/01 02:23:00 mrf
|
||||
* packet drivers still need packet types byteswapped.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:08 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.2 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.1 1993/07/30 02:41:24 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PKTDRIVE_H_
|
||||
#define _PKTDRIVE_H_
|
||||
|
||||
extern void pktd_driver_find(boolean_t (*config)(struct net *));
|
||||
|
||||
#endif /* _PKTDRIVE_H_ */
|
||||
@@ -0,0 +1,60 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/pppbsd.h,v 1.1 2001/11/08 16:00:59 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: pppbsd.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:59 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.4 2001/01/19 22:23:50 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.3 2000/03/17 00:12:43 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.2 1998/02/25 04:57:35 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.1 1997/10/28 00:51:55 sra
|
||||
* Convert PPP code to use BUG() macro.
|
||||
* Bang on CHAP and PAP code some more.
|
||||
* Create test driver for PPP under Snark/BSD.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Point-to-Point Protocol (PPP) interface for snark under BSD-derived systems.
|
||||
*
|
||||
* This code has only been tested under FreeBSD 2.x. It should work on
|
||||
* any BSD-derived system with minor modifications.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PPPBSD_H_
|
||||
#define _PPPBSD_H_
|
||||
|
||||
extern void ppp_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _PPPBSD_H_ */
|
||||
@@ -0,0 +1,128 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/read_ini.h,v 1.3 2003/01/15 13:58:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: read_ini.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:30 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:44 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:36 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.8 2001/01/19 22:23:36 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.7 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.6 1998/06/28 20:09:37 sra
|
||||
* Add support for SNARK_READ_INI_FROM_MEMORY.
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:16 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/03/20 06:53:22 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.2 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.1 1995/07/31 13:54:55 sra
|
||||
* OSPF now working well enough to let somebody else test it.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _READ_INI_H_
|
||||
#define _READ_INI_H_
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
struct ini_handle {
|
||||
#if INSTALL_SNARK_READ_INI_FROM_MEMORY
|
||||
unsigned long current_pos;
|
||||
#else
|
||||
FILE *file;
|
||||
#endif
|
||||
char *section_name;
|
||||
unsigned long section_start;
|
||||
char *iter_variable;
|
||||
char *buffer;
|
||||
size_t buflen;
|
||||
};
|
||||
|
||||
struct ini_handle_saved {
|
||||
char *section_name;
|
||||
unsigned long section_start;
|
||||
char *iter_variable;
|
||||
unsigned long current_pos;
|
||||
};
|
||||
|
||||
#if INSTALL_SNARK_READ_INI_FROM_MEMORY
|
||||
|
||||
/*
|
||||
* In-memory configuration table is an array of tag-value pairs.
|
||||
* A null value indicates that the tag is a section label.
|
||||
* A null tag indicates the end of the array.
|
||||
*/
|
||||
|
||||
struct ini_table {
|
||||
char *tag;
|
||||
char *value;
|
||||
};
|
||||
|
||||
extern struct ini_table etc_ini_table[];
|
||||
|
||||
#endif
|
||||
|
||||
extern struct ini_handle *ini_open (size_t);
|
||||
extern void ini_close (struct ini_handle *);
|
||||
extern char *ini_lookup (struct ini_handle *, char *, char *);
|
||||
extern char *ini_iter_start (struct ini_handle *, char *, char *);
|
||||
extern char *ini_iter_next (struct ini_handle *);
|
||||
extern void ini_save (struct ini_handle *, struct ini_handle_saved *);
|
||||
extern void ini_restore (struct ini_handle *, struct ini_handle_saved *);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/relay.h,v 1.3 2003/01/15 13:58:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1990-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: relay.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:30 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:45 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:36 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.5 2001/01/19 22:23:36 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.4 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.3 1998/02/25 15:21:44 sra
|
||||
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
|
||||
*
|
||||
* Revision 1.2 1998/02/25 04:57:17 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.1 1997/04/25 05:43:21 sra
|
||||
* Still hacking PCL-725 relay boards after all these years.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_RELAY_H_
|
||||
#define _SNARK_RELAY_H_
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
extern bits8_t relay_read (void);
|
||||
extern void relay_write (bits8_t bits);
|
||||
extern void relay_start (bits8_t state1, bits32_t delay, bits8_t state2);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,77 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/slipbsd.h,v 1.1 2001/11/08 16:00:59 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: slipbsd.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:59 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:51 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:44 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:38 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:10 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 06:13:38 sra
|
||||
* Clean up antique type names and install macros.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Serial Line IP (SLIP) interface for snark under BSD-derived systems.
|
||||
*
|
||||
* This code has only been tested under NetBSD 0.8. It should work on
|
||||
* any BSD-derived system with minor modifications.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SLIPBSD_H_
|
||||
#define _SLIPBSD_H_
|
||||
|
||||
extern void slip_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _SLIPBSD_H_ */
|
||||
@@ -0,0 +1,203 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/snarklib.h,v 1.3 2003/01/15 13:58:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snarklib.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:30 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:45 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.17 2001/01/19 22:23:36 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.16 2000/10/16 19:21:48 paul
|
||||
* Restore sockets and mempool code.
|
||||
*
|
||||
* Revision 2.15 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.14 2000/03/13 21:22:00 paul
|
||||
* Removed some code that we are no longer working on.
|
||||
*
|
||||
* Revision 2.13 1999/02/18 04:41:31 wes
|
||||
* Sockets merge: Everything Else
|
||||
* - memory pools
|
||||
* - thread support
|
||||
* - port-specific headers
|
||||
*
|
||||
* Revision 2.12 1998/10/28 18:50:50 josh
|
||||
* marging in courier-sep98 branch
|
||||
*
|
||||
* Revision 2.11.6.1 1998/09/12 19:27:32 sra
|
||||
* Minor kludges to make this development snapshot of snark compile with
|
||||
* the released versions of the Attache, Envoy, and Emissary products.
|
||||
* These changes will need to be un-done when this branch is merged back
|
||||
* into the main code base.
|
||||
*
|
||||
* Revision 2.11.10.2 1998/11/13 18:17:22 wes
|
||||
* Make SNARK_*LOCK*() calls into the "real" attache global lock
|
||||
* ATTACHE_*LOCK*() and make it live in attache-land, not snark-land.
|
||||
*
|
||||
* Revision 2.11.10.1 1998/09/23 19:17:12 wes
|
||||
* Merge socket-branch-1 changes to socket-branch-2
|
||||
*
|
||||
* Revision 2.11.8.2 1998/09/11 21:32:02 wes
|
||||
* Rename EPI_ prefix thread primitives to ETC_ prefix
|
||||
*
|
||||
* Revision 2.11.8.1 1998/08/19 13:26:14 wes
|
||||
* Merge sockets-pthreads work to shared branch
|
||||
*
|
||||
* Revision 2.11.2.2 1998/08/12 21:02:46 wes
|
||||
* alternate spelling of SNARK_ASSERT_LOCK() because i'm lame..
|
||||
*
|
||||
* Revision 2.11.2.1 1998/07/28 18:30:41 wes
|
||||
* pthreads goop
|
||||
*
|
||||
* Revision 2.11 1998/06/11 21:40:31 wes
|
||||
* Track dhcp invocations
|
||||
*
|
||||
* Revision 2.10 1998/02/25 04:57:17 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.9 1997/08/21 17:23:47 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
* Revision 2.8 1997/07/17 03:38:31 alan
|
||||
* Add: snark_reset_read_fdproc & snark_reset_write_fdproc. Like
|
||||
* snark_set_fdprocs, but only makes you mess with the procedure you're
|
||||
* interested in.
|
||||
*
|
||||
* Revision 2.7 1997/05/21 00:18:09 alan
|
||||
* Expose declaration of snark_set_fdprocs in all environments.
|
||||
*
|
||||
* Revision 2.6 1997/05/19 04:26:50 alan
|
||||
* Let others have access to the basic file descriptor
|
||||
* select() loop in the task dispatcher.
|
||||
*
|
||||
* Revision 2.5 1997/03/20 06:53:23 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.4 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.3 1997/02/24 00:56:59 sra
|
||||
* Support for run-time configuration of BUG() macros.
|
||||
*
|
||||
* Revision 2.2 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.4 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.3 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.2 1993/07/29 04:24:47 sra
|
||||
* PTCP_DNS_H changed to ATTACHE_DNS_H for release 2.0.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_H_
|
||||
#define _SNARK_H_
|
||||
|
||||
#ifndef COMMON_CONFIG_H
|
||||
#include <wrn/wm/common/config.h>
|
||||
#endif
|
||||
|
||||
#include <snark.h>
|
||||
|
||||
#include <wrn/wm/demo/keyboard.h>
|
||||
#include <wrn/wm/demo/parse.h>
|
||||
#include <wrn/wm/demo/sty.h>
|
||||
#include <wrn/wm/demo/tasks.h>
|
||||
#include <wrn/wm/demo/main.h>
|
||||
#include <wrn/wm/demo/keyword.h>
|
||||
|
||||
#ifndef COMMON_GLUE_H
|
||||
#include <wrn/wm/common/glue.h>
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNARK_BUG_CONF
|
||||
#include <wrn/wm/demo/bug_conf.h>
|
||||
#endif
|
||||
|
||||
#ifdef INSTALL_SNARK_THREADS
|
||||
extern void task_kick(void);
|
||||
#endif
|
||||
|
||||
extern void snark_init (void);
|
||||
extern void snark_shutdown (void);
|
||||
|
||||
/* Not all Snark ports support this feature. */
|
||||
typedef void (*fdproc_t)(int, void *);
|
||||
extern int snark_set_fdprocs(int, void *, fdproc_t, fdproc_t);
|
||||
extern int snark_reset_read_fdproc(int, fdproc_t);
|
||||
extern int snark_reset_write_fdproc(int, fdproc_t);
|
||||
|
||||
/*
|
||||
* netconfig() sets this up from the config file, it's available
|
||||
* for use by applications.
|
||||
*/
|
||||
#if INSTALL_ATTACHE_DNS
|
||||
#include <wrn/wm/attache/dns.h>
|
||||
extern struct dns_config domain_config;
|
||||
#endif
|
||||
|
||||
#if INSTALL_ATTACHE_DHCP
|
||||
#include <wrn/wm/attache/dhcp.h>
|
||||
|
||||
extern dhcp_stateblk_t *snark_dhcp_find(net_if *net);
|
||||
|
||||
typedef int (*snark_dhcpwalk_fn_t)(void *, dhcp_stateblk_t *, net_if *);
|
||||
|
||||
extern int snark_dhcp_walk(snark_dhcpwalk_fn_t callback, void *cookie);
|
||||
|
||||
extern void snark_dhcp_add (net_if *net, dhcp_stateblk_t *);
|
||||
|
||||
extern int snark_dhcp_set_punt (dhcp_stateblk_t *, int);
|
||||
|
||||
extern int snark_dhcp_get_punt (dhcp_stateblk_t *);
|
||||
|
||||
extern void snark_dhcp_remove (dhcp_stateblk_t *);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _SNARK_H_ */
|
||||
@@ -0,0 +1,204 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/snmpconf.h,v 1.2 2002/03/11 19:23:36 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1991-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/* declarations for routines in parse.c */
|
||||
|
||||
/*
|
||||
* $Log: snmpconf.h,v $
|
||||
* Revision 1.2 2002/03/11 19:23:36 josh
|
||||
* change dest_addr to an ipaddr_t, and add definitions for ipaddr_t if
|
||||
* Attache isn't installed
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:23:37 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 1998/11/25 03:38:17 sra
|
||||
* "timeout" => "snmp_timeout" to fix OpEN symbol conflict.
|
||||
*
|
||||
* Revision 1.1 1998/06/23 20:45:04 sar
|
||||
* The gneral snmp configuration information, moved here from snmptalk/parse.h
|
||||
*
|
||||
* Revision 7.8 1998/06/07 02:52:55 sar
|
||||
* Move the global configuration arguments to snark library
|
||||
*
|
||||
* Revision 7.7 1998/05/23 18:19:25 sar
|
||||
* Added global arguments for v3 along with their defaults
|
||||
*
|
||||
* Revision 7.6 1998/02/25 04:58:01 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 7.5 1997/03/20 06:53:54 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.4 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.3 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 7.2 1997/01/10 20:32:24 sra
|
||||
* Punt this copy of parse_line(), since there's a better one snark/lib.
|
||||
*
|
||||
* Revision 7.1 1997/01/08 01:58:11 sar
|
||||
* Removed no_pp stuff and updated copyrights
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:19:20 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.3 1996/01/10 16:41:40 sar
|
||||
* Usec updates
|
||||
*
|
||||
* Revision 6.2 1995/11/11 00:09:41 sar
|
||||
* Added a new command option to decide where the rfc1445 viewtree
|
||||
* comes from - the config.txt file or nvviews.c
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:39:59 sar
|
||||
* remvoed dparty, sparty and context info
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:50:19 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.4 1995/03/21 00:50:48 sar
|
||||
* Added a packet_dump option to snmptalk, this allows the user to trun
|
||||
* packet dumping on & off while snmptalk is running.
|
||||
*
|
||||
* Revision 5.3 1994/11/09 01:43:52 sar
|
||||
* Read the nv config file if/when we need to. If the master_agent or
|
||||
* v2_view options are installed we always read it, if they aren't vut
|
||||
* v2 is installed we check the snmptalk_version flag if it is 2 we read
|
||||
* the file if it is 1 we don't. The first time we switch to v2 we
|
||||
* try and read the file and complain if one doesn't exist. If we only
|
||||
* have v1 installed we never read the config file.
|
||||
*
|
||||
* Revision 5.2 1994/09/23 19:29:50 sar
|
||||
* Removed the old non volatile scheme and added a new one that is hopefully
|
||||
* easier to use and allows for some new options such as a read only
|
||||
* flag to prohibit creating a new config file. The config stuff will
|
||||
* only be included if needed.
|
||||
* In snmptalk and snmpint added a next function.
|
||||
*
|
||||
* Revision 5.1 1994/07/24 15:41:03 dab
|
||||
* Added ability to set UDP port used by manager and the set command can
|
||||
* now specify enumerated integer values by symbolic name.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:57:40 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 17:14:56 sar
|
||||
* Updated rev to 4.0 and copyright to 93
|
||||
*
|
||||
* Revision 3.6 1993/05/13 19:08:06 sar
|
||||
* Added code to use a file implementation of nv memory
|
||||
*
|
||||
* Revision 3.5 1993/03/03 20:03:22 dab
|
||||
* don't undef __(), might need it
|
||||
*
|
||||
* Revision 3.4 1993/03/02 18:18:59 dab
|
||||
* Added read_config_defaults()
|
||||
*
|
||||
* Revision 3.3 1993/02/19 19:29:35 dab
|
||||
* Added mib_filename.
|
||||
*
|
||||
* Revision 3.2 1993/02/17 21:20:58 sar
|
||||
* Extern definition for spoid, dpoid, cpoid, spoidlen, dpoidlen and cpoidlen
|
||||
* Used to hold parties to send the packet to.
|
||||
*
|
||||
* Revision 3.1 92/06/16 16:05:42 dab
|
||||
* Added batch mode
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:53:14 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:05:22 dab
|
||||
* Update version number. This is just before the work to upgrade to
|
||||
* release 3.0.
|
||||
*
|
||||
* Revision 1.1 91/07/11 18:13:37 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if !INSTALL_ATTACHE
|
||||
#if INSTALL_SNMP_DEMO_AGENT_IPV6
|
||||
#define MAX_IP_ADDR_LEN 16
|
||||
#else
|
||||
#define MAX_IP_ADDR_LEN 4
|
||||
#endif
|
||||
|
||||
enum ipaddr_type { IPNONE = 0, IPV4 = 4, IPV6 = 6 };
|
||||
|
||||
typedef bits8_t ipaddr_bits_t;
|
||||
|
||||
typedef struct ipaddr {
|
||||
enum ipaddr_type type;
|
||||
ipaddr_bits_t addr[MAX_IP_ADDR_LEN];
|
||||
} ipaddr_t;
|
||||
#endif
|
||||
|
||||
#define ETC_ENV_VARIABLE "ETC_SNMP_CONF"
|
||||
|
||||
extern char *read_community;
|
||||
extern char *write_community;
|
||||
extern char *destination;
|
||||
extern char *mib_filename;
|
||||
extern ipaddr_t dest_addr;
|
||||
#if INSTALL_SNMP_DEMO_AGENT_IPV6
|
||||
extern int v6_scope;
|
||||
#endif
|
||||
extern unsigned udp_port;
|
||||
extern int snmp_timeout;
|
||||
extern int retry_count;
|
||||
extern int batch_mode;
|
||||
extern int packet_dump;
|
||||
extern int SNMPTalk_NV_Read;
|
||||
extern int SNMPTalk_SNMP_Version;
|
||||
|
||||
extern int SNMP_Parse_Opts (int, char **, char *);
|
||||
extern int SNMP_Config (void);
|
||||
|
||||
/* defaults for version 3 stuff */
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
extern char v3_tos_flags;
|
||||
extern char *v3_con_name;
|
||||
extern bits8_t v3_con_id[];
|
||||
extern ALENGTH_T v3_con_id_len;
|
||||
extern char *v3_sec_name;
|
||||
extern bits8_t v3_sec_id[];
|
||||
extern ALENGTH_T v3_sec_id_len;
|
||||
#endif
|
||||
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_USEC
|
||||
extern OCTET_T *usec_agentid;
|
||||
extern OCTET_T *usec_context;
|
||||
extern OCTET_T usec_qos;
|
||||
#endif
|
||||
@@ -0,0 +1,89 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/snmpfunc.h,v 1.3 2003/01/15 13:58:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snmpfunc.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:30 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/07 14:27:45 tneale
|
||||
* Added wm to include path
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.4 2001/01/19 22:23:37 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.3 2000/03/17 00:12:13 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.2 1998/06/07 02:29:36 sar
|
||||
* Add trap community
|
||||
*
|
||||
* Revision 1.1 1998/06/07 02:12:01 sar
|
||||
* Gather a group of common snmp functions in snark/lib so
|
||||
* we don't have to rewrite them for each new demo.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef snark_snmpfunc_ins
|
||||
#define snark_snmpfunc_ins
|
||||
|
||||
#ifndef EPILOGUE_INSTALL_H
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
#ifndef EPILOGUE_TYPES_H
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#include <wrn/wm/snmp/engine/proxy_tr.h>
|
||||
|
||||
#define SNMP_COMM_MAX 32
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_PROXY)
|
||||
typedef struct TRANS_STUFF_S {
|
||||
PROXY_BLOCK_T pblockp;
|
||||
bits16_t port;
|
||||
bits8_t *addr_str;
|
||||
ptr_t *pkt;
|
||||
} TRANS_STUFF_T;
|
||||
#endif
|
||||
|
||||
extern int validate_SNMP_community __((SNMP_PKT_T *, SNMPADDR_T *,
|
||||
SNMPADDR_T *));
|
||||
|
||||
extern int validate_SNMP_V3_Address __((SNMP_PKT_T *, SNMPADDR_T *,
|
||||
SNMPADDR_T *));
|
||||
|
||||
extern sbits32_t attache_proxy_send_rtn __((EBUFFER_T *, ptr_t));
|
||||
|
||||
extern char snmp_get_request_community[];
|
||||
extern char snmp_set_request_community[];
|
||||
extern char snmp_trap_community[];
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/snoop.h,v 1.1 2001/11/08 16:00:59 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snoop.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:59 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 1.7 2001/01/19 22:23:53 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.6 2000/03/17 00:12:46 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.5 1998/02/25 04:57:40 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.4 1997/03/20 06:53:12 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 1.2 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 1.1 1996/11/13 15:06:46 mrf
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Snoop interface to ethernet for Attache testing under Irix.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNOOP_H_
|
||||
#define _SNOOP_H_
|
||||
|
||||
extern int snoop_open (char *, unsigned, unsigned char *);
|
||||
extern int snoop_write (int, unsigned char *, unsigned);
|
||||
extern void snoop_close (int);
|
||||
extern void snoop_find (void (*)(char *, void *), void *);
|
||||
extern int snoop_read (int, unsigned,
|
||||
void (*)(unsigned char *, unsigned, unsigned, void *),
|
||||
void *);
|
||||
|
||||
#endif /* _SNOOP_H_ */
|
||||
@@ -0,0 +1,77 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/snoopdrv.h,v 1.1 2001/11/08 16:00:59 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snoopdrv.h,v $
|
||||
* Revision 1.1 2001/11/08 16:00:59 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 1.6 2001/01/19 22:23:53 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.5 2000/03/17 00:12:46 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.4 1998/02/25 04:57:41 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 1.3 1997/03/20 06:53:13 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 1.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 1.1 1996/11/13 15:06:46 mrf
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 06:13:38 sra
|
||||
* Clean up antique type names and install macros.
|
||||
*
|
||||
* Revision 1.1 1994/01/09 23:57:29 sra
|
||||
* Add support for NIT under SunOS 4.1.2.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Attache code for interfacing to ethernet via SNOOP on Irix.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNOOPDRV_H_
|
||||
#define _SNOOPDRV_H_
|
||||
|
||||
extern void snoop_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _SNOOPDRV_H_ */
|
||||
@@ -0,0 +1,52 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/strdup.h,v 1.1.1.1 2001/11/05 17:47:37 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: strdup.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.3 2001/01/19 22:23:37 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 1.2 2000/03/17 00:12:14 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 1.1 1998/06/03 20:28:47 sar
|
||||
* Local version of the strdup function so we don't have to
|
||||
* depend on the system for it.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/* This used to be part of snmptalk/stdf.h it has been moved to
|
||||
the snark library so other demo code can use it. The other
|
||||
stdf functions were moved to the common library. */
|
||||
|
||||
char *etc_strdup (char *str);
|
||||
void etc_strdup_free (char *str);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/sty.h,v 1.1.1.1 2001/11/05 17:47:37 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: sty.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.8 2001/01/19 22:23:37 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.7 2000/03/17 00:12:14 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.6 1998/11/23 20:47:29 wes
|
||||
* If building with GCC, use a gcc extension to declare sty_printf() as
|
||||
* being printf-like so sty_printf args can be sanity-checked at build
|
||||
* time. Most visible with stuff relating to the BUG macro..
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:18 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/03/20 06:53:24 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.2 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Software terminal definitions for Snark.
|
||||
* Based on ideas in Bridgham's doskbd code.
|
||||
* Keymaps not implemented yet, maybe some day.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,10may05,job increase maximum input line size
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_STY_H_
|
||||
#define _SNARK_STY_H_
|
||||
|
||||
/*
|
||||
* GCC has a mode which lets it catch a number of common errors
|
||||
* made involving printf-like format strings.
|
||||
* It also has a language extension which lets you declare a function as
|
||||
* taking a printf-like format string.
|
||||
* If we're using a suitably new version of GCC (2.5 or newer), use
|
||||
* this extension.
|
||||
*/
|
||||
|
||||
#if !defined(__GNUC__) || __GNUC__ < 2 || \
|
||||
(__GNUC__ == 2 && __GNUC_MINOR__ < 5)
|
||||
#define STY_ATTRIBUTE(x) /* delete __attribute__ if non-gcc or gcc1 */
|
||||
#else
|
||||
#define STY_ATTRIBUTE(x) __attribute__(x)
|
||||
#endif
|
||||
|
||||
#define STY_RING_SIZE 1024
|
||||
#define STY_LINE_SIZE 2048
|
||||
#define STY_HISTORY_SIZE 20
|
||||
|
||||
struct sty;
|
||||
struct sty_driver;
|
||||
|
||||
struct sty {
|
||||
unsigned flags; /* state flags */
|
||||
unsigned char ring_buf[STY_RING_SIZE]; /* input character ring buffer */
|
||||
unsigned ring_start, ring_end; /* portion of ring buffer in use */
|
||||
char line_buf[STY_LINE_SIZE]; /* input line buffer */
|
||||
unsigned line_len; /* length of current line */
|
||||
char *history[STY_HISTORY_SIZE]; /* command line history */
|
||||
fastint_t history_ptr; /* current command history line */
|
||||
struct sty_driver *driver; /* device driver */
|
||||
void *driver_cookie; /* cookie for driver code */
|
||||
void *app_cookie; /* cookie for application */
|
||||
void (*app_receiver)(struct sty *, char *, void *);
|
||||
char *prompt; /* prompt string, null ok if none */
|
||||
};
|
||||
|
||||
#define STY_FLAG_ECHOING 0x1
|
||||
#define STY_FLAG_BLOCKED 0x2
|
||||
#define STY_FLAG_ABORTED 0x4
|
||||
#define STY_FLAG_INTERRUPTED 0x8
|
||||
#define STY_FLAG_RAWMODE 0x10
|
||||
|
||||
struct sty_driver {
|
||||
void (*write)(struct sty *, unsigned char *, size_t, void *);
|
||||
void (*close)(struct sty *, void *);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The "console", which might be a keyboard/display pair, a log file,
|
||||
* a null sty driver, a telnet session, a serial line, or something weirder.
|
||||
*
|
||||
* In general, it is NOT a good idea to just assume that the cty is the
|
||||
* right sty to use for interactive commands. The cty is primarily for
|
||||
* use by code which has no sty context (eg, the BUG() macros), and for
|
||||
* the initial startup code.
|
||||
*
|
||||
* By default, the cty is a keyboard/display pair.
|
||||
*/
|
||||
extern struct sty *cty;
|
||||
|
||||
#ifndef CTY_SETUP
|
||||
#define CTY_SETUP() stykb_open()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Declare listener to catch newly opened stys.
|
||||
* Returns old listener.
|
||||
*/
|
||||
typedef void (*sty_listener_t)(struct sty *);
|
||||
extern sty_listener_t sty_listen(sty_listener_t);
|
||||
|
||||
/*
|
||||
* Open an sty. Caller provides memory.
|
||||
* Installs driver, flags, and cookie, then calls sty listener, if any.
|
||||
*/
|
||||
extern void sty_open(struct sty *, struct sty_driver *, unsigned, void *);
|
||||
|
||||
/*
|
||||
* Close an sty. Calls driver close routine, clears driver.
|
||||
*/
|
||||
extern void sty_close(struct sty *);
|
||||
|
||||
/*
|
||||
* Initialize sty system.
|
||||
*/
|
||||
extern void sty_init(void);
|
||||
|
||||
/*
|
||||
* Request a "line" of text from the sty. At the moment a "line"
|
||||
* really is a line, because EOL is the only break sequence.
|
||||
* This could change if/when keymaps are implemented.
|
||||
*/
|
||||
extern void sty_read
|
||||
(struct sty *, void (*)(struct sty *, char *, void *), char *, void *);
|
||||
|
||||
/*
|
||||
* Output routines.
|
||||
*/
|
||||
extern void sty_write (struct sty *, char *, size_t);
|
||||
extern void sty_putc (struct sty *, int);
|
||||
extern void sty_puts (struct sty *, char *);
|
||||
extern int sty_printf (struct sty *, char *, ...)
|
||||
STY_ATTRIBUTE((__format__(__printf__, 2, 3)));
|
||||
|
||||
|
||||
/*
|
||||
* Hand some text from driver to low-level sty code.
|
||||
*/
|
||||
extern void sty_receive (struct sty *, unsigned char *, unsigned);
|
||||
|
||||
/*
|
||||
* Ask how much buffer space this sty has left (for TELNET, mostly).
|
||||
*/
|
||||
extern unsigned sty_window (struct sty *);
|
||||
|
||||
/*
|
||||
* Clear sty input buffer.
|
||||
*/
|
||||
extern void sty_discard (struct sty *);
|
||||
|
||||
/*
|
||||
* Install a new cty.
|
||||
*/
|
||||
extern void cty_set(struct sty *sty);
|
||||
|
||||
/*
|
||||
* This should really go somewhere else, no good place for it though.
|
||||
*/
|
||||
extern void stykb_open (void);
|
||||
|
||||
#endif /* _SNARK_STY_H_ */
|
||||
@@ -0,0 +1,114 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/tasks.h,v 1.1.1.1 2001/11/05 17:47:37 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: tasks.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:37 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 2.8 2001/01/19 22:23:37 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.7 2000/03/17 00:12:14 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.6 1998/07/02 06:55:34 sra
|
||||
* Make Snark restartable under pSOS, and other minor cleanups.
|
||||
*
|
||||
* Revision 2.5 1998/02/25 04:57:18 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.4 1997/03/20 06:53:24 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.3 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.2 1997/02/19 08:10:29 sra
|
||||
* More fun merging snmptalk into snark, general snark cleanup.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.3 1995/01/06 00:52:48 sra
|
||||
* Update copyright notice for 2.1 release.
|
||||
*
|
||||
* Revision 1.2 1994/09/04 23:55:50 sra
|
||||
* Get rid of most of the ancient NO_PP cruft.
|
||||
*
|
||||
* Revision 1.1 1993/07/05 21:53:06 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for snark's tasking package.
|
||||
*
|
||||
* This is based in large part on Romkey's simtask package, with
|
||||
* some changes suggested by Bridgham and different modularization
|
||||
* to fit into snark properly.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SNARK_TASKS_H_
|
||||
#define _SNARK_TASKS_H_
|
||||
|
||||
/*
|
||||
* The task structure.
|
||||
*/
|
||||
struct task {
|
||||
char *name;
|
||||
void (*func) __((struct task *, void *));
|
||||
void *cookie;
|
||||
struct task *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Tasking functions common to all implementations.
|
||||
* These handle all the locking crud via glue_intlock().
|
||||
*/
|
||||
extern void task_ini (struct task *);
|
||||
extern void task_enq (struct task *);
|
||||
extern struct task *task_deq (void);
|
||||
extern void task_delq (struct task *);
|
||||
extern void task_add (struct task *, char *,
|
||||
void (*)(struct task *, void *), void *);
|
||||
extern int task_idle (void);
|
||||
|
||||
/*
|
||||
* The task scheduler itself, provided by each port of snark.
|
||||
* It should get tasks to run by calling task_deq().
|
||||
* If it ever returns, main() will exit with the same value.
|
||||
*/
|
||||
extern int tasks_run (void);
|
||||
|
||||
/*
|
||||
* Initialize static variables for the tasking package.
|
||||
*/
|
||||
extern void tasks_init (void);
|
||||
|
||||
#endif /* _SNARK_TASKS_H_ */
|
||||
@@ -0,0 +1,25 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/tundrive.h,v 1.1 2001/11/08 16:01:00 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
extern void tun_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
@@ -0,0 +1,69 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/demo/vapornet.h,v 1.1 2001/11/08 16:01:00 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 2000-2001 Wind River Systems, Inc.
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: vapornet.h,v $
|
||||
* Revision 1.1 2001/11/08 16:01:00 tneale
|
||||
* Adding header files originally from snark/lib
|
||||
*
|
||||
* Revision 2.6 2001/01/19 22:23:56 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 2.5 2000/03/17 00:12:49 meister
|
||||
* Update copyright message
|
||||
*
|
||||
* Revision 2.4 1998/02/25 04:57:45 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 2.3 1997/03/20 06:53:18 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 2.2 1997/02/25 10:58:16 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 2.1 1996/03/22 10:05:39 sra
|
||||
* Update copyrights prior to Attache 3.2 release.
|
||||
*
|
||||
* Revision 2.0 1995/05/10 22:38:15 sra
|
||||
* Attache release 3.0.
|
||||
*
|
||||
* Revision 1.1 1995/03/26 02:29:19 sra
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,20apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/*
|
||||
* Fake network built on BSD "unix domain" sockets. Intended primarily
|
||||
* to allow building a complex enough network to do some testing of router
|
||||
* code in a relatively sane debugging environment.
|
||||
*/
|
||||
|
||||
#ifndef _VAPORNET_H_
|
||||
#define _VAPORNET_H_
|
||||
|
||||
extern void vp_driver_find
|
||||
(void (*config)(char *, struct driver *, int, bits16_t, unsigned, bits32_t));
|
||||
|
||||
#endif /* _VAPORNET_H_ */
|
||||
@@ -0,0 +1,599 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/agentx.h,v 1.9 2002/05/30 17:24:54 andre Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: agentx.h,v $
|
||||
* Revision 1.9 2002/05/30 17:24:54 andre
|
||||
* Add placeholder definition for AX_RESPONSE_PREPROCESS
|
||||
*
|
||||
* Revision 1.8 2002/04/09 14:18:35 tneale
|
||||
* REGLIST changes to handle list-based registration
|
||||
*
|
||||
* Revision 1.7 2002/03/28 14:37:07 tneale
|
||||
* Removed externs of old mib variables
|
||||
*
|
||||
* Revision 1.6 2002/03/20 20:20:41 tneale
|
||||
* Fixed multiple definition of ENVOY_AX_PARSE_ERROR
|
||||
*
|
||||
* Revision 1.5 2002/03/19 21:47:01 tneale
|
||||
* Changed Agentx protocol error codes per RFC2741
|
||||
*
|
||||
* Revision 1.4 2002/03/18 16:05:43 tneale
|
||||
* Added cmonnect_id member to Session structure
|
||||
*
|
||||
* Revision 1.3 2002/03/12 15:54:39 tneale
|
||||
* Added structure definition for the registration list
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:00 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6.4.1 2001/08/17 20:38:43 meister
|
||||
* Added prototypes for some agentx helper functions which were previously
|
||||
* declared statically. Added prototypes for agentx and v3 dynamic config init
|
||||
* functions.
|
||||
*
|
||||
* Revision 9.6 2001/01/19 22:22:02 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:27 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:32 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 16:53:16 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 1999/12/23 14:47:26 josh
|
||||
* cleaning up code per Shawn's comments -- removing extraneous
|
||||
* comments and doing proxy check before notify check
|
||||
*
|
||||
* Revision 9.1 1999/03/30 15:20:13 josh
|
||||
* feature to allow customer-driven context conversion into AgentX
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:03 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.2 1998/08/12 04:52:15 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:19 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:19 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.4 1997/10/30 04:23:16 sar
|
||||
* Update type information mostly convert bits16_ts to ALENGTH_Ts
|
||||
* also add MAX_ALENGTH
|
||||
*
|
||||
* Revision 7.3 1997/10/29 04:11:40 sar
|
||||
* Cleaned up some type mismatches to keep compilers happy
|
||||
*
|
||||
* Revision 7.2 1997/10/21 02:53:37 sar
|
||||
* Added defines for transport types and index allocate and deallocate macros
|
||||
* and removed leaf decrement function
|
||||
*
|
||||
* Revision 7.1 1997/10/16 00:25:16 sar
|
||||
* Primarily this set of modifications is for the agentx protocol.
|
||||
* Most of the work was in the agentx.h and ax_mth.h files. Most
|
||||
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
|
||||
* to their structures and snmp got some new lock macros.
|
||||
*
|
||||
* One other change of note was the modification of continue
|
||||
* processing. Previously we called a specific continue routine
|
||||
* directly, now we store a pointer to the corret continue
|
||||
* function in the snmp packet structure and call that. We include
|
||||
* macros for backwards compatibility.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,19apr05,job update copyright notices
|
||||
01a,04aug04,job dropped connection handling
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(envoy_agentx_inc))
|
||||
#define envoy_agentx_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#include <wrn/wm/snmp/engine/vbdefs.h>
|
||||
#include <wrn/wm/snmp/engine/etimer.h>
|
||||
#include <wrn/wm/snmp/engine/tree.h>
|
||||
|
||||
/*extern struct ENVOY_AX_PKT_S;
|
||||
extern struct SNMP_PKT_S;*/
|
||||
|
||||
typedef void ENVOY_AX_ADMIN_T (ptr_t, ptr_t);
|
||||
typedef int ENVOY_AX_SEND_T (ptr_t, ptr_t, ptr_t, ALENGTH_T);
|
||||
typedef void ENVOY_AX_ERROR_T (ptr_t, int);
|
||||
typedef void ENVOY_AX_ADD_T (ptr_t);
|
||||
|
||||
#define ENVOY_AX_MASTER_PORT 705
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* Define a chunk block for agentx, this is used by the byte_handler
|
||||
code to save and build a packet when it arrives in chunks rather
|
||||
than all at once */
|
||||
typedef struct ENVOY_AX_CHUNK_S
|
||||
{
|
||||
EBUFFER_T chunk;
|
||||
} ENVOY_AX_CHUNK_T;
|
||||
|
||||
/* Define a state block for the sub agent, primarily this will
|
||||
be useful if you want to have multiple sub agents in the same
|
||||
process space */
|
||||
typedef struct ENVOY_AX_SA_SB_S
|
||||
{
|
||||
struct ENVOY_AX_PKT_S *set_list; /* list of outstanding set requests */
|
||||
struct ENVOY_AX_PKT_S *gnb_list; /* list of deferred gnb requests */
|
||||
bits32_t readers; /* number of outstanding gnb reqs */
|
||||
|
||||
ENVOY_TIMER_T ager; /* timer block for aging pkts */
|
||||
ENVOY_TIMER_T defer; /* timer block for deferring pkts */
|
||||
bits32_t flags; /* currently only if the timer has
|
||||
been set */
|
||||
#if INSTALL_ENVOY_SNMP_LOCK
|
||||
ENVOY_LOCK_T list_lock; /* lock for manipulating this struct
|
||||
and the structs on the two lists */
|
||||
ENVOY_LOCK_T coarse_lock; /* lock for manipulating the mib db */
|
||||
#endif
|
||||
} ENVOY_AX_SA_SB_T;
|
||||
|
||||
/* Define the agentx structure */
|
||||
typedef struct ENVOY_AX_PKT_S
|
||||
{
|
||||
bits8_t version; /* The agentx protocol version */
|
||||
bits8_t type; /* The agentx pdu type, see below */
|
||||
bits8_t flags; /* Agentx flags, also see below */
|
||||
bits32_t session_id; /* session id between mast & sub */
|
||||
bits32_t transaction_id; /* groups agentx pkts to snmp pkts */
|
||||
bits32_t packet_id; /* associates response pkts to reqs */
|
||||
|
||||
EBUFFER_T context; /* context, optional, see flags */
|
||||
|
||||
ENVOY_AX_SEND_T *send; /* io completion routine */
|
||||
ENVOY_AX_ERROR_T *error; /* error completion routine */
|
||||
ptr_t cookie; /* cookie for comp routines */
|
||||
|
||||
struct SNMP_PKT_S *pktp; /* snmp packet we've turned this agentx
|
||||
request into for processing */
|
||||
ENVOY_AX_SA_SB_T *sasb; /* pointer to the state block for
|
||||
this sub agent */
|
||||
struct ENVOY_AX_PKT_S *next; /* next pointer for lists */
|
||||
|
||||
bits32_t ts; /* timestamp for aging pkts */
|
||||
|
||||
bits32_t sysuptime; /* these 3 are only used in */
|
||||
bits16_t error_stat; /* responses */
|
||||
bits16_t error_index;
|
||||
|
||||
union { /* pdu data, one of the following */
|
||||
|
||||
bits8_t reason; /* enum for reason for closing */
|
||||
|
||||
struct { /* used for opens, add caps and */
|
||||
bits8_t timeout; /* remove caps */
|
||||
bits8_t prefix;
|
||||
OBJ_ID_T sub_id;
|
||||
EBUFFER_T descr;
|
||||
} open_data;
|
||||
|
||||
struct { /* used for (un)registers */
|
||||
bits8_t timeout;
|
||||
bits8_t priority;
|
||||
bits8_t range;
|
||||
OBJ_ID_T region;
|
||||
OIDC_T bound;
|
||||
} reg_data;
|
||||
|
||||
struct { /* gets, nexts, bulks, test sets, */
|
||||
bits16_t non_reps; /* responses, notifies and index */
|
||||
bits16_t max_reps; /* (de)allocates */
|
||||
VBL_T vbl_str;
|
||||
bits8_t cur_phase; /* current phase of set processing */
|
||||
/* same as vb flags */
|
||||
|
||||
bits32_t next_pid; /* info for the next phase */
|
||||
bits8_t next_phase; /* of set processing, what */
|
||||
ENVOY_AX_SEND_T *next_send; /* to do, and any comp info */
|
||||
ENVOY_AX_ERROR_T *next_error;
|
||||
ptr_t *next_cookie;
|
||||
} proc_data;
|
||||
} data;
|
||||
} ENVOY_AX_PKT_T;
|
||||
|
||||
/* AgentX pdu types */
|
||||
#define ENVOY_AX_OPEN 1
|
||||
#define ENVOY_AX_CLOSE 2
|
||||
#define ENVOY_AX_REGISTER 3
|
||||
#define ENVOY_AX_UNREGISTER 4
|
||||
#define ENVOY_AX_GET 5
|
||||
#define ENVOY_AX_NEXT 6
|
||||
#define ENVOY_AX_BULK 7
|
||||
#define ENVOY_AX_TEST 8
|
||||
#define ENVOY_AX_COMMIT 9
|
||||
#define ENVOY_AX_UNDO 10
|
||||
#define ENVOY_AX_CLEANUP 11
|
||||
#define ENVOY_AX_NOTIFY 12
|
||||
#define ENVOY_AX_PING 13
|
||||
#define ENVOY_AX_INDEX_ALLOCATE 14
|
||||
#define ENVOY_AX_INDEX_DEALLOCATE 15
|
||||
#define ENVOY_AX_ADD_AC 16
|
||||
#define ENVOY_AX_REMOVE_AC 17
|
||||
#define ENVOY_AX_RESPONSE 18
|
||||
|
||||
/* AgentX flag bits */
|
||||
#define ENVOY_AX_BIT_INSTANCE 1
|
||||
#define ENVOY_AX_BIT_NEW_INDEX 2
|
||||
#define ENVOY_AX_BIT_ANY_INDEX 4
|
||||
#define ENVOY_AX_BIT_NDC 8 /* non-default context bit, when set
|
||||
optional context field is used */
|
||||
#define ENVOY_AX_BIT_BYTE_ORDER 16 /* when set, network byte order used */
|
||||
|
||||
/* reasons for closing a connection */
|
||||
#define ENVOY_AX_CLOSE_OTHER 1
|
||||
#define ENVOY_AX_CLOSE_PARSE 2
|
||||
#define ENVOY_AX_CLOSE_PROTO 3
|
||||
#define ENVOY_AX_CLOSE_TIMEOUTS 4
|
||||
#define ENVOY_AX_CLOSE_SHUTDOWN 5
|
||||
#define ENVOY_AX_CLOSE_MANAGER 6
|
||||
|
||||
/* AgentX codes for the next phase of sets */
|
||||
#define ENVOY_AX_NEXT_CLEANUP_START 1
|
||||
#define ENVOY_AX_NEXT_UNDO_START 2
|
||||
|
||||
/* AgentX Protocol error codes */
|
||||
#define ENVOY_AX_OPEN_FAILED 256
|
||||
#define ENVOY_AX_NOT_OPEN 257
|
||||
#define ENVOY_AX_INDEX_WRONG_TYPE 258
|
||||
#define ENVOY_AX_INDEX_ALREADY_ALLOCATED 259
|
||||
#define ENVOY_AX_INDEX_NONE_AVAILABLE 260
|
||||
#define ENVOY_AX_INDEX_NOT_ALLOCATED 261
|
||||
#define ENVOY_AX_UNSUPPORTED_CONTEXT 262
|
||||
#define ENVOY_AX_DUPLICATE_REGISTRATION 263
|
||||
#define ENVOY_AX_UNKNOWN_REGISTRATION 264
|
||||
#define ENVOY_AX_UNKNOWN_AGENT_CAPS 265
|
||||
#define ENVOY_AX_PROTOCOL_PARSE_ERROR 266
|
||||
#define ENVOY_AX_REQUEST_DENIED 267
|
||||
#define ENVOY_AX_PROCESSING_ERROR 268
|
||||
|
||||
#define ENVOY_AX_OTHER 0xffff
|
||||
|
||||
/* AgentX error codes */
|
||||
#define ENVOY_AX_ALLOCATION_FAILURE 1
|
||||
#define ENVOY_AX_BAD_VALUE 2
|
||||
#define ENVOY_AX_TOO_SMALL 3
|
||||
#define ENVOY_AX_BAD_SIZE 4
|
||||
#define ENVOY_AX_WRONG_VERSION 5
|
||||
#define ENVOY_AX_PARSE_ERROR 6
|
||||
#define ENVOY_AX_BAD_OPERATION 7
|
||||
#define ENVOY_AX_SESS_LOSS 8
|
||||
#define ENVOY_AX_TOO_BIG 9
|
||||
|
||||
/* AgentX packet access macros */
|
||||
#define ax_pkt_get_context(PKTP) (&(PKTP)->context)
|
||||
|
||||
/* AgentX version stamps */
|
||||
#define ENVOY_AX_VERSION_1 1
|
||||
#define ENVOY_AX_VERSION_MAXIMUM 1
|
||||
|
||||
/* AgentX session admin status codes */
|
||||
#define ENVOY_AX_SESSION_UP 1
|
||||
#define ENVOY_AX_SESSION_DOWN 2
|
||||
|
||||
/* globals variables for subagents */
|
||||
#ifndef ENVOY_AX_SA_TIMEOUT
|
||||
#define ENVOY_AX_SA_TIMEOUT 1000
|
||||
#endif
|
||||
extern bits32_t envoy_ax_sa_timeout;
|
||||
|
||||
extern void envoy_ax_sa_init (void);
|
||||
|
||||
|
||||
extern void envoy_ax_pkt_init (ENVOY_AX_PKT_T *);
|
||||
extern ENVOY_AX_PKT_T *envoy_ax_pkt_allocate (void);
|
||||
extern ALENGTH_T envoy_ax_pkt_size (ENVOY_AX_PKT_T *, VB_T *);
|
||||
extern void envoy_ax_pkt_clean (ENVOY_AX_PKT_T *);
|
||||
extern void envoy_ax_pkt_free (ENVOY_AX_PKT_T *);
|
||||
|
||||
extern int envoy_ax_pkt_encode (ENVOY_AX_PKT_T *, VB_T *,
|
||||
EBUFFER_T *, ALENGTH_T);
|
||||
extern ENVOY_AX_PKT_T *envoy_ax_pkt_decode (bits8_t *, ALENGTH_T, int *);
|
||||
|
||||
|
||||
|
||||
extern ENVOY_AX_PKT_T *envoy_ax_pkt_create_all(int *, bits8_t, bits8_t,
|
||||
bits8_t, bits32_t, bits32_t,
|
||||
bits8_t, bits32_t, bits8_t *,
|
||||
int, OBJ_ID_T *, bits8_t,
|
||||
bits8_t, bits8_t, OIDC_T,
|
||||
bits32_t, bits8_t *, int,
|
||||
bits8_t);
|
||||
|
||||
extern int envoy_ax_pkt_create_open (EBUFFER_T *, bits8_t, bits8_t,
|
||||
bits32_t, bits8_t, bits32_t,
|
||||
bits8_t *, OBJ_ID_T *);
|
||||
|
||||
extern int envoy_ax_pkt_create_close (EBUFFER_T *, bits8_t, bits8_t,
|
||||
bits32_t, bits32_t, bits8_t);
|
||||
|
||||
extern int envoy_ax_pkt_create_registrations(EBUFFER_T *, bits8_t, bits8_t,
|
||||
bits8_t, bits32_t, bits32_t,
|
||||
bits8_t, bits8_t, bits8_t,
|
||||
OBJ_ID_T *, OIDC_T, bits32_t,
|
||||
bits8_t *);
|
||||
|
||||
extern int envoy_ax_pkt_create_ping (EBUFFER_T *, bits8_t, bits8_t,
|
||||
bits32_t, bits32_t, bits32_t,
|
||||
bits8_t *);
|
||||
|
||||
extern int envoy_ax_pkt_create_agent_caps(EBUFFER_T *, bits8_t, bits8_t,
|
||||
bits8_t, bits32_t, bits32_t,
|
||||
bits32_t, bits8_t *, bits32_t,
|
||||
bits8_t *, OBJ_ID_T *);
|
||||
|
||||
extern ENVOY_AX_PKT_T *envoy_ax_pkt_create_variables(int *, bits8_t,
|
||||
bits8_t, bits8_t,
|
||||
bits32_t, bits32_t,
|
||||
bits32_t, bits8_t *,
|
||||
int, int);
|
||||
|
||||
extern int envoy_ax_bind_integer (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
sbits32_t);
|
||||
extern int envoy_ax_bind_ip_address(ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
bits8_t *);
|
||||
extern int envoy_ax_bind_null (ENVOY_AX_PKT_T *, int, int, OIDC_T *);
|
||||
extern int envoy_ax_bind_object_id (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
int, OIDC_T *);
|
||||
extern int envoy_ax_bind_string (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
bits8_t, int, bits8_t *, int);
|
||||
extern int envoy_ax_bind_uint_64 (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
bits8_t, bits32_t, bits32_t);
|
||||
extern int envoy_ax_bind_uint (ENVOY_AX_PKT_T *, int, int, OIDC_T *,
|
||||
bits8_t, bits32_t);
|
||||
|
||||
extern void envoy_ax_sa_handler(bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
|
||||
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
|
||||
ENVOY_AX_ERROR_T *, ptr_t);
|
||||
|
||||
extern int _snmp_find_next_helper_ax(MIBNODE_T *, int,
|
||||
OIDC_T*, OBJ_ID_T *, int, VB_T *,
|
||||
SNMP_PKT_T *, int);
|
||||
|
||||
extern int _snmp_find_next_bound(MIBNODE_T *, VB_T *);
|
||||
|
||||
#if INSTALL_COMMON_DYNAMIC_COMP_CONFIG
|
||||
extern void ax_dyncfg_init(void);
|
||||
#endif
|
||||
|
||||
extern ENVOY_AX_SA_SB_T *envoy_ax_sa_state_create(void);
|
||||
extern void envoy_ax_sa_state_init (ENVOY_AX_SA_SB_T *);
|
||||
extern int envoy_ax_sa_session_loss(ENVOY_AX_SA_SB_T *, ptr_t,
|
||||
int, bits32_t);
|
||||
|
||||
typedef struct ENVOY_AX_SESSION_S
|
||||
{
|
||||
struct ENVOY_AX_SESSION_S *next;/* next session in the list */
|
||||
bits32_t session_id; /* id for this session */
|
||||
bits32_t connection_id; /* id for this connection */
|
||||
bits8_t version; /* protocol version for this session */
|
||||
bits8_t timeout; /* default timeout period */
|
||||
bits8_t flags; /* flags, currently byte order */
|
||||
|
||||
ENVOY_AX_SEND_T *send; /* routine to send to sub agent */
|
||||
ENVOY_AX_ERROR_T *error; /* routine to free the cookie */
|
||||
ptr_t cookie; /* cookie for use with send rtn */
|
||||
|
||||
OBJ_ID_T sub_id; /* tag for sub agent */
|
||||
EBUFFER_T descr; /* string for sub agent */
|
||||
bits32_t timestamp; /* when this session started */
|
||||
bits32_t timeout_count; /* number of consecutive timeouts */
|
||||
} ENVOY_AX_SESSION_T;
|
||||
|
||||
typedef struct ENVOY_AX_MA_REG_S
|
||||
{
|
||||
bits32_t reg_index; /* index for use in agentx mib */
|
||||
bits32_t context_id; /* index of context for this object */
|
||||
bits8_t priority; /* priority for this object */
|
||||
MIBLEAF_T *leaf; /* leaf for use in the mib tree
|
||||
also contains session, priority
|
||||
and timeout information */
|
||||
struct ENVOY_AX_MA_REG_S *next;
|
||||
struct ENVOY_AX_MA_REG_S *mib_next;
|
||||
} ENVOY_AX_MA_REG_T;
|
||||
|
||||
typedef struct ENVOY_AX_MA_REGLIST_S
|
||||
{
|
||||
struct ENVOY_AX_MA_REGLIST_S *next; /* next registration in the list */
|
||||
bits32_t reg_index; /* index for use in agentx mib */
|
||||
bits32_t session_id; /* id for this session */
|
||||
bits32_t connection_id; /* id for this connection */
|
||||
bits8_t range_id; /* subid which has range, if any */
|
||||
OIDC_T bound; /* upper bound of range, if any */
|
||||
bits8_t flags; /* non-zero if this is an instance */
|
||||
MIBLEAF_T *mibleaf; /* MIB leaf that has more info on this reg. */
|
||||
struct ENVOY_AX_MA_REGLIST_S *match; /* For list of registrations w/same OID */
|
||||
bits32_t context_id; /* id for this context */
|
||||
bits8_t priority; /* priority of this registration */
|
||||
OBJ_ID_T start_oid; /* registered subtree, or start if range */
|
||||
} ENVOY_AX_MA_REGLIST_T;
|
||||
|
||||
typedef struct ENVOY_AX_CONTEXT_S
|
||||
{
|
||||
bits32_t id; /* this context's index in the list */
|
||||
struct ENVOY_AX_CONTEXT_S *next; /* ptr to next element in list */
|
||||
EBUFFER_T context; /* string for the context */
|
||||
MIBNODE_T *mibroot; /* mib root node the user gave us */
|
||||
TREENODE_T *indexroot; /* root for possible indexes */
|
||||
} ENVOY_AX_CONTEXT_T;
|
||||
|
||||
/* control structure for outstanding agentx requests */
|
||||
typedef struct AX_CB_S
|
||||
{
|
||||
struct AX_CB_S *next;
|
||||
bits32_t reqid;
|
||||
SNMP_PKT_T *pktp;
|
||||
VB_T *vbp;
|
||||
int count;
|
||||
} AX_CB_T;
|
||||
|
||||
/* global variables used by an agentx master to keep state */
|
||||
#ifndef ENVOY_AX_DEFAULT_TIMEOUT
|
||||
#define ENVOY_AX_DEFAULT_TIMEOUT 1
|
||||
#endif
|
||||
|
||||
#ifndef SNMP_AX_TIMEOUT_COUNT
|
||||
#define SNMP_AX_TIMEOUT_COUNT 3
|
||||
#endif
|
||||
|
||||
/* General sub-agent response packet pre-processing. */
|
||||
#ifndef AX_RESPONSE_PREPROCESS
|
||||
#define AX_RESPONSE_PREPROCESS(PKT)
|
||||
#endif
|
||||
|
||||
extern bits32_t agentxDefaultTimeout;
|
||||
|
||||
extern AX_CB_T *first_axcb;
|
||||
extern bits32_t ax_reqid;
|
||||
|
||||
extern bits32_t ax_registration_id;
|
||||
extern TREENODE_T *registration_root;
|
||||
|
||||
extern bits32_t agentxRegisterDuplicate;
|
||||
|
||||
extern bits32_t envoy_ax_session_id;
|
||||
extern ENVOY_AX_SESSION_T *envoy_ax_session_list;
|
||||
extern ENVOY_AX_MA_REGLIST_T *envoy_ax_registration_list;
|
||||
|
||||
extern bits32_t context_list_id;
|
||||
extern ENVOY_AX_CONTEXT_T *context_list;
|
||||
|
||||
extern sbits32_t agentxMasterAgentXVer;
|
||||
|
||||
extern void envoy_ax_ma_init (void);
|
||||
|
||||
extern void envoy_ax_ma_handler(bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
|
||||
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
|
||||
ENVOY_AX_ERROR_T *, ptr_t);
|
||||
|
||||
extern int envoy_ax_ma_cleanup_sessions(ptr_t, bits8_t);
|
||||
|
||||
typedef void ENVOY_AX_HANDLER_T (bits8_t *, ALENGTH_T, ENVOY_AX_SA_SB_T *,
|
||||
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
|
||||
ENVOY_AX_ERROR_T *, ptr_t);
|
||||
|
||||
extern void envoy_ax_chunk_init (ENVOY_AX_CHUNK_T *);
|
||||
extern int envoy_ax_chunk_clean (ENVOY_AX_CHUNK_T *);
|
||||
extern int envoy_ax_chunk_handler(bits8_t *, ALENGTH_T, ENVOY_AX_HANDLER_T *,
|
||||
ENVOY_AX_CHUNK_T *, ENVOY_AX_SA_SB_T *,
|
||||
ENVOY_AX_ADMIN_T *, ENVOY_AX_SEND_T *,
|
||||
ENVOY_AX_ERROR_T *, ENVOY_AX_ADD_T *,
|
||||
ptr_t);
|
||||
|
||||
#if (!defined(ENVOY_AX_COOKIE_CMP))
|
||||
#define ENVOY_AX_COOKIE_CMP(HAND, COOKIE) (HAND == COOKIE)
|
||||
#endif
|
||||
|
||||
typedef struct ENVOY_AX_INDEX_STR_S
|
||||
{
|
||||
ALENGTH_T length;
|
||||
bits8_t *buffer;
|
||||
} ENVOY_AX_INDEX_STR_T;
|
||||
|
||||
typedef struct ENVOY_AX_INDEX_DATA_S
|
||||
{
|
||||
struct ENVOY_AX_INDEX_DATA_S *next;
|
||||
bits32_t session_id; /* 0 for no session */
|
||||
union {
|
||||
OBJ_ID_T objid;
|
||||
bits32_t bits32;
|
||||
ENVOY_AX_INDEX_STR_T string;
|
||||
bits8_t ipaddr[4];
|
||||
} data;
|
||||
} ENVOY_AX_INDEX_DATA_T;
|
||||
|
||||
typedef struct ENVOY_AX_INDEX_HDR_S
|
||||
{
|
||||
bits8_t type;
|
||||
ENVOY_AX_INDEX_DATA_T *data;
|
||||
} ENVOY_AX_INDEX_HDR_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
extern ENVOY_AX_SESSION_T *ax_session_find_index(bits32_t, int *);
|
||||
extern void ax_session_release (ENVOY_AX_SESSION_T *);
|
||||
extern ENVOY_AX_SESSION_T *ax_session_next (bits32_t, int *);
|
||||
extern int envoy_ax_ma_cleanup_session_mth(bits32_t, bits8_t);
|
||||
|
||||
extern ENVOY_AX_CONTEXT_T *ax_context_index(bits32_t);
|
||||
extern ENVOY_AX_CONTEXT_T *ax_context_next (ENVOY_AX_CONTEXT_T *);
|
||||
|
||||
extern ENVOY_AX_MA_REG_T *find_reg_leaf(OBJ_ID_T *, bits8_t, bits32_t);
|
||||
|
||||
extern sbits32_t Find_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *, MIBLEAF_T **);
|
||||
extern int AX_Add_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *, MIBLEAF_T *,
|
||||
MIBLEAF_T **);
|
||||
extern MIBLEAF_T * AX_Remove_Leaf_From_Root(MIBNODE_T *, OBJ_ID_T *);
|
||||
|
||||
#define ENVOY_AX_TRANSPORT_TYPE_UNIX 1
|
||||
#define ENVOY_AX_TRANSPORT_TYPE_TCP 2
|
||||
#define ENVOY_AX_TRANSPORT_TYPE_UDP 3
|
||||
#define ENVOY_AX_TRANSPORT_TYPE_MEM 4
|
||||
#define ENVOY_AX_TRANSPORT_TYPE_OTHER 5
|
||||
|
||||
extern void ax_ma_index_allocate (ENVOY_AX_PKT_T *, ENVOY_AX_PKT_T *,
|
||||
ENVOY_AX_CONTEXT_T *);
|
||||
extern void ax_ma_index_deallocate(ENVOY_AX_PKT_T *, ENVOY_AX_PKT_T *,
|
||||
ENVOY_AX_CONTEXT_T *);
|
||||
extern void ax_ma_cleanup_indexes (bits32_t);
|
||||
|
||||
#if INSTALL_ENVOY_AGENTX_INDEX
|
||||
#define AX_MA_RTN_IND_ALLOC(AX, RP, CON) ax_ma_index_allocate(AX, RP, CON)
|
||||
#define AX_MA_RTN_IND_DEALLOC(AX, RP, CON) ax_ma_index_deallocate(AX, RP, CON)
|
||||
#else
|
||||
#define AX_MA_RTN_IND_ALLOC(AX, RP, CON) ((RP)->error_stat = GEN_ERR)
|
||||
#define AX_MA_RTN_IND_DEALLOC(AX, RP, CON) ((RP)->error_stat = GEN_ERR)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* envoy_agentx_inc */
|
||||
@@ -0,0 +1,257 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/asn1.h,v 1.2 2001/11/06 21:35:00 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1986-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: asn1.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:00 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:02 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:27 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:32 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:53:49 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:03 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:21 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:20 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:47:58 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:28 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.4 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.3 1993/04/28 22:00:38 sar
|
||||
* Moved the definition of UINT_64_T to ui64.h and update others
|
||||
*
|
||||
* Revision 3.2 1993/04/26 20:33:14 sar
|
||||
* Added bitstrings, and have deletion of parties or contexts delete acls.
|
||||
*
|
||||
* Revision 3.1 1993/03/25 21:15:21 sar
|
||||
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
|
||||
*
|
||||
* Revision 3.0 1992/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.104 91/10/30 20:53:14 dab
|
||||
* Include asn1conf.h only if it's not already been included.
|
||||
*
|
||||
* Revision 2.103 91/08/15 15:41:45 dab
|
||||
* Pulled configuration from asn1.h and snmp.h and put in
|
||||
* snmpconf.h and asn1conf.h.
|
||||
*
|
||||
* Revision 2.102 91/08/14 10:55:24 dab
|
||||
* Removed type declarations to snmpconf.h and includes that file.
|
||||
*
|
||||
* Revision 2.101 91/08/12 12:48:00 dab
|
||||
* Added typedef of PTR_T.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:44 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:19 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:26
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.1 14 Dec 1989 16:01:16
|
||||
* Added support for Borland Turbo C compiler
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:12
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#define asn1_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
/* ASN.1 FLAGS (form and class), adjusted for position within an octet */
|
||||
#define A_IDCF_MASK 0xE0 /* Mask for ID CLASS and FORM bits */
|
||||
#define A_IDC_MASK 0xC0 /* Mask for ID CLASS bits */
|
||||
#define A_IDF_MASK 0x20 /* Mask for ID FORM bit */
|
||||
#define A_FLAG_MASK 0xE0
|
||||
#define A_UNIVERSAL 0x00
|
||||
#define A_APPLICATION 0x40
|
||||
#define A_CONTEXT 0x80
|
||||
#define A_PRIVATE 0xC0
|
||||
#define A_PRIMITIVE 0x00
|
||||
#define A_CONSTRUCTOR 0x20
|
||||
|
||||
#define A_DEFAULT_SCOPE A_CONTEXT
|
||||
|
||||
/* ASN.1 basic types, all in UNIVERSAL scope */
|
||||
#define A_NO_ID 0x00
|
||||
#define A_BOOLEAN 0x01
|
||||
#define A_INTEGER 0x02
|
||||
#define A_BITSTRING 0x03
|
||||
#define A_OCTETSTRING 0x04
|
||||
#define A_NULL 0x05
|
||||
#define A_OBJECTID 0x06
|
||||
#define A_SEQUENCE 0x10
|
||||
#define A_SET 0x11
|
||||
|
||||
/* ASN.1 defined types, all based on OCTETSTRING */
|
||||
#define A_NUMERICSTRING 0x12
|
||||
#define A_PRINTABLESTRING 0x13
|
||||
#define A_T61STRING 0x14
|
||||
#define A_TELETEXSTRING A_T61STRING
|
||||
#define A_VIDEOTEXSTRING 0x15
|
||||
#define A_IA5STRING 0x16
|
||||
#define A_GRAPHICSTRING 0x19
|
||||
#define A_VISIBLESTRING 0x1A
|
||||
#define A_GENERALSTRING 0x1B
|
||||
|
||||
/* Other ASN.1 defined universal types */
|
||||
#define A_GENERALIZEDTIME 0x18
|
||||
#define A_UTCTIME 0x17
|
||||
#define A_OBJECTDESCRIPTOR 0x07
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: A_SizeOfLength
|
||||
|
||||
PURPOSE: Compute the number of octets needed to hold an ASN.1 length field.
|
||||
|
||||
PARAMETERS:
|
||||
ALENGTH_T The proposed length
|
||||
|
||||
RETURNS: ALENGTH_T The number of octets needed
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define A_SizeOfLength(S) ((ALENGTH_T)((S) <= 127 ? 1 : ((S) <= 255 ? 2 : 3)))
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: A_SizeOfType
|
||||
|
||||
PURPOSE: Compute the number of octets needed to hold an ASN.1 type field
|
||||
|
||||
PARAMETERS:
|
||||
ATVALUE_T The proposed type (without CLASS & FORM bits)
|
||||
|
||||
RETURNS: unsigned int The number of octets needed
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define A_SizeOfType(V) ((unsigned int) ((V) <= 30 ? 1 : \
|
||||
((V) <= 127 ? 2 : ((V) <= 16383 ? 3 : 4))))
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
A_SizeOfOctetString -- Return total size that an octet string would
|
||||
occupy when ASN.1 encoded (tag and length fields
|
||||
are NOT included)
|
||||
|
||||
Parameters:
|
||||
ALENGTH_T The size of the string
|
||||
|
||||
Returns: ALENGTH_T Number of octets the octet string would occupy if
|
||||
in ASN.1 encoding, NOT including the type/length fields
|
||||
of the outermost wrapper. Since these routines only
|
||||
generate non-constructor encodings, the length is
|
||||
exactly that given.
|
||||
****************************************************************************/
|
||||
#define A_SizeOfOctetString(L) ((ALENGTH_T)(L))
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
OBJECT IDENTIFIER
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* The following structure is used to internally hold an object identifier */
|
||||
/* Each component is limited in range from 0 to 64K-1. */
|
||||
|
||||
typedef struct OBJ_ID_S
|
||||
{
|
||||
int num_components; /* # of object id components */
|
||||
/* Note: this is the number of */
|
||||
/* components in the object id, */
|
||||
/* which is one more than the # */
|
||||
/* of subidentifiers in an */
|
||||
/* encoded object id. */
|
||||
OIDC_T *component_list;
|
||||
} OBJ_ID_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* asn1_inc */
|
||||
|
||||
@@ -0,0 +1,408 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/asn1conf.h,v 1.3 2003/01/15 13:58:56 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: asn1conf.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:56 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:50:40 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.9.4.3 2001/09/21 19:14:28 josh
|
||||
* an extra check: can't install coexistence if neither SNMPv1
|
||||
* nor SNMPv2 are installed
|
||||
*
|
||||
* Revision 9.9.4.2 2001/08/24 14:32:10 josh
|
||||
* a variety of option checks to make sure we don't have conflicting
|
||||
* options installed
|
||||
*
|
||||
* Revision 9.9.4.1 2001/06/28 18:22:56 josh
|
||||
* Seeding the Cormorant branch with the code from the old
|
||||
* cormorant branch
|
||||
*
|
||||
* Revision 9.9 2001/04/11 20:58:32 josh
|
||||
* we are overwriting the trunk's copy of this file with
|
||||
* the file from the kingfisher branch
|
||||
*
|
||||
* Revision 9.8 2001/01/19 22:22:02 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.7 2000/07/10 15:55:13 mrf
|
||||
* Add configuration for Cygnus NT environment with associated changes.
|
||||
*
|
||||
* Revision 9.6 2000/06/09 14:54:12 josh
|
||||
* modifications due to new installation options, new proxy code
|
||||
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
|
||||
* be built with the target code
|
||||
*
|
||||
* Revision 9.5.4.1 2001/04/11 20:48:29 josh
|
||||
* moving cormorant-specific changes off to the cormorant
|
||||
* branch
|
||||
*
|
||||
* Revision 9.5.2.2 2001/03/12 22:07:50 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.5.2.1 2000/09/21 21:14:52 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:28 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:32 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 16:54:09 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 1999/06/01 15:46:14 josh
|
||||
* Moving some installation option checking.
|
||||
*
|
||||
* Revision 9.1 1999/04/09 20:36:59 josh
|
||||
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:04 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.8 1998/08/04 02:02:17 sar
|
||||
* Added some macros for use with longer term storage, if the user
|
||||
* hasn't defined them they default to the standard ones.
|
||||
*
|
||||
* Revision 8.7 1998/06/23 20:28:23 sar
|
||||
* Added requirement for view2275 if v3 is installed
|
||||
*
|
||||
* Revision 8.6 1998/06/09 21:34:56 sar
|
||||
* Added MEMCMP_NULLOK
|
||||
*
|
||||
* Revision 8.5 1998/06/08 19:42:10 sar
|
||||
* Create a define to tell us if we need the stats group in general
|
||||
*
|
||||
* Revision 8.4 1998/05/29 03:53:54 sar
|
||||
* Add and use defines for v2 types and v2 protocol pieces. This allows
|
||||
* us to include the types and pieces for other versions, such as v3,
|
||||
* without having to touch all of the seperate files that use the
|
||||
* types or pieces.
|
||||
*
|
||||
* Revision 8.3 1998/05/23 19:55:38 sar
|
||||
* As part of adding rfc2275 made a switch to mesh 2275 and 1445.
|
||||
*
|
||||
* Revision 8.2 1998/02/25 15:21:23 sra
|
||||
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:22 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:20 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.5 1997/10/30 04:23:16 sar
|
||||
* Update type information mostly convert bits16_ts to ALENGTH_Ts
|
||||
* also add MAX_ALENGTH
|
||||
*
|
||||
* Revision 7.4 1997/10/22 03:07:28 sar
|
||||
* Mofied the agentx and older subagent schemes install options
|
||||
*
|
||||
* Revision 7.3 1997/08/21 17:23:44 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:47:59 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,26jul08,y_t fix the incompatible for STL
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(asn1conf_inc)
|
||||
#define asn1conf_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if !defined(EPILOGUE_INSTALL_H)
|
||||
#include <wrn/wm/common/install.h>
|
||||
#endif
|
||||
|
||||
/* Get the standard types and the install defines */
|
||||
#if !defined(EPILOGUE_TYPES_H)
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
/* !!! These are here for backwards compatibility only while we're switching
|
||||
* over to the new configuration system. */
|
||||
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2)
|
||||
#define SGRP 1
|
||||
#endif
|
||||
|
||||
/* This is to provide compatibility for windnet users because the
|
||||
* windnet version of envoy had all struct declarations bracketted
|
||||
* with an alignment pragma based on this test. We will follow
|
||||
* suit but put the test in a single place (here). */
|
||||
#if INSTALL_ENVOY_ALIGN_STRUCTURES
|
||||
#define WINDNET_STRUCT_ALIGN
|
||||
#endif
|
||||
|
||||
/*****************************************************************
|
||||
* Portable types definitions for backwards compatibility. These
|
||||
* are now defined in terms of things defined by <common/h/types.h> and
|
||||
* therefore <oemtypes.h> so any changes should be made in
|
||||
* <oemtypes.h>.
|
||||
*****************************************************************/
|
||||
/* various sizes of integers */
|
||||
typedef sbits32_t INT_32_T;
|
||||
typedef bits32_t UINT_32_T;
|
||||
typedef sbits16_t INT_16_T;
|
||||
typedef bits16_t UINT_16_T;
|
||||
typedef bits8_t UINT_8_T;
|
||||
typedef bits8_t OCTET_T ;
|
||||
/* A generic pointer type. Use void * if your compiler can hack
|
||||
* it, otherwise char * is probably the right thing. */
|
||||
typedef ptr_t PTR_T;
|
||||
/* SNMP ASN.1 tags and lengths can always fit into 16 bits... */
|
||||
typedef bits16_t ATVALUE_T; /* ASN.1 type values */
|
||||
typedef bits16_t ALENGTH_T; /* ASN.1 contents field lengths */
|
||||
/* this is used as both a maximum and a mask */
|
||||
#define MAX_ALENGTH 0xFFFF
|
||||
|
||||
#define OCTETS_PER_INT32 (sizeof(INT_32_T)/sizeof(OCTET_T))
|
||||
#define OCTETS_PER_INT16 (sizeof(INT_16_T)/sizeof(OCTET_T))
|
||||
|
||||
|
||||
/*
|
||||
* get the common system configuration
|
||||
*/
|
||||
#include <wrn/wm/common/config.h>
|
||||
|
||||
/*
|
||||
* get the system configuration for envoy
|
||||
*/
|
||||
#define CONFIG_PREAMBLE 1
|
||||
#include <envoy.h>
|
||||
#undef CONFIG_PREAMBLE
|
||||
|
||||
|
||||
/* Long lived dynamic storage. If the user doesn't define
|
||||
them explicitly we use the shorter term ones */
|
||||
#ifndef SNMP_memory_alloc_lt
|
||||
#define SNMP_memory_alloc_lt(need) SNMP_memory_alloc(need)
|
||||
#endif
|
||||
|
||||
#ifndef SNMP_memory_free_lt
|
||||
#define SNMP_memory_free_lt(buf) SNMP_memory_free(buf)
|
||||
#endif
|
||||
|
||||
/*****************************************************************
|
||||
* Set the size of object identifier components. 32 bits is recommended
|
||||
* but 16 bits may work and may save a little space.
|
||||
* This may be overridden in <oemtypes.h> by defining __TYPES_HAVE_OIDC_T_
|
||||
*****************************************************************/
|
||||
#ifndef __TYPES_HAVE_OIDC_T_
|
||||
typedef bits32_t OIDC_T;
|
||||
#endif
|
||||
|
||||
/* min and max macros if not provided by the system */
|
||||
#ifndef NOMINMAX
|
||||
#if (!defined(max))
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#if (!defined(min))
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* These are the standard C functions that we use in Envoy. If the
|
||||
* customer's compiler supplies these correctly then nothing more need be
|
||||
* done. If not, then <envoy.h> can override. The most common case is
|
||||
* that the system provides them but with the wrong type arguments (char *
|
||||
* instead of void *). The macros can then fix this with casts. */
|
||||
#ifndef MEMCPY
|
||||
#define MEMCPY(dst, src, n) memcpy(dst, src, n)
|
||||
#endif
|
||||
#ifndef MEMSET
|
||||
#define MEMSET(dst, val, n) memset(dst, val, n)
|
||||
#endif
|
||||
#ifndef MEMCMP
|
||||
#define MEMCMP(s1, s2, n) memcmp(s1, s2, n)
|
||||
#endif
|
||||
#ifndef STRLEN
|
||||
#define STRLEN(s) strlen(s)
|
||||
#endif
|
||||
|
||||
#ifndef MEMCMP_NULLOK
|
||||
#define MEMCMP_NULLOK(s1, s2, n) (n ? MEMCMP(s1, s2, n) : 0)
|
||||
#endif
|
||||
|
||||
/* Error checking, Look for inconsistencies or necessary configuration
|
||||
that hasn't been done */
|
||||
|
||||
/* Do we need any of the stats. For v1 & v2 there is a seperate
|
||||
installation option for the stats groups, for v3 the stats
|
||||
are required for reports so installing v3 installs the groups */
|
||||
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2 || \
|
||||
INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
#define ENVOY_NEED_STATS 1
|
||||
#else
|
||||
#define ENVOY_NEED_STATS 0
|
||||
#endif
|
||||
|
||||
/* See if we need either v2 types or protocols, we do this
|
||||
to avoid needing to add new install option whenever a new
|
||||
version is defined */
|
||||
#if (INSTALL_ENVOY_SNMP_USE_V2_TYPES || INSTALL_ENVOY_SNMP_VERSION_2 || \
|
||||
INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
#define ENVOY_USE_V2_TYPES 1
|
||||
#else
|
||||
#define ENVOY_USE_V2_TYPES 0
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_VERSION_2 || INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
#define ENVOY_USE_V2_PROTOS 1
|
||||
#else
|
||||
#define ENVOY_USE_V2_PROTOS 0
|
||||
#endif
|
||||
|
||||
/* If version 3 is installed we must have 2275 views */
|
||||
#if ((INSTALL_ENVOY_SNMP_VERSION_3) && !(INSTALL_ENVOY_SNMP_RFC2275_VIEWS))
|
||||
#error If you are installing version 3 you must also install rfc2275
|
||||
#error views using _ENVOY_SNMP_RFC2275_VIEWS.
|
||||
#endif
|
||||
|
||||
/* check that only one of the view schemes is turned on,
|
||||
if one is turned on turn on the flex view option for use
|
||||
elsewhere */
|
||||
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS && INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
#error Must not have both the rfc1445 and rfc2275 view schemes installed.
|
||||
#error You should modify the configuration file and remove either the
|
||||
#error ENVOY_SNMP_RFC1445_VIEWS or ENVOY_SNMP_RFC2275_VIEWS option
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS || INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
#define INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS 1
|
||||
#else
|
||||
#define INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS 0
|
||||
#endif
|
||||
|
||||
/* Check that that the lock & serialization options are consistent */
|
||||
#if (INSTALL_ENVOY_SNMP_LOCK && INSTALL_ENVOY_SNMP_SERIALIZE)
|
||||
#error Must not have both the lock code and the serialization code installed.
|
||||
#error You should modify the configuration file and remove either
|
||||
#error the ENVOY_SNMP_LOCK or the ENVOY_SNMP_SERIALIZE option
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_CONTINUE_REENTRANT && !INSTALL_ENVOY_SNMP_LOCK)
|
||||
#error Must have locks installed to use reentrant continues.
|
||||
#error You should modify the configuration file and install
|
||||
#error the ENVOY_SNMP_LOCK option.
|
||||
#endif
|
||||
|
||||
/* check that the options for the agentx scheme are consistent */
|
||||
#if ((INSTALL_ENVOY_AGENTX_MASTER || INSTALL_ENVOY_AGENTX_SUB) && \
|
||||
!(INSTALL_ENVOY_AGENTX))
|
||||
#error You must install ENVOY_AGENTX with ENVOY_AGENTX_MASTER
|
||||
#error and ENVOY_AGENTX_SUB
|
||||
#endif
|
||||
|
||||
|
||||
#if (INSTALL_ENVOY_AGENTX_MASTER)
|
||||
#if (INSTALL_ENVOY_MAIN_AGENT && !(INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS))
|
||||
#error You must install ENVOY_SNMP_RFC1445_VIEWS or
|
||||
#error ENVOY_SNMP_RFC2275_VIEWS for use with a master agent
|
||||
#endif
|
||||
|
||||
#if (!INSTALL_ENVOY_SNMP_LOCK && !INSTALL_ENVOY_SNMP_SERIALIZE)
|
||||
#error Must have either the locking scheme or the serialization scheme
|
||||
#error installed. You should modify the configuration file and install
|
||||
#error either the ENVOY_SNMP_LOCK or ENVOY_SNMP_SERIALIZE option
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Check that the various SNMPv3 components are consistent */
|
||||
#if ((INSTALL_ENVOY_SNMP_V3_TARGET) && !(INSTALL_ENVOY_SNMP_VERSION_3))
|
||||
#error The target code (ENVOY_SNMP_V3_TARGET) requires SNMPv3 support.
|
||||
#error Either uninstall ENVOY_SNMP_V3_TARGET or install ENVOY_SNMP_VERSION_3.
|
||||
#endif
|
||||
|
||||
#if !(INSTALL_ENVOY_SNMP_VERSION_1 || INSTALL_ENVOY_SNMP_VERSION_2) && \
|
||||
INSTALL_ENVOY_SNMP_COEXISTENCE
|
||||
#error If coexistence is installed, either SNMPv1 or SNMPv2 must also
|
||||
#error be installed.
|
||||
#endif
|
||||
|
||||
#if ((INSTALL_ENVOY_SNMP_V3_NOTIFY || INSTALL_ENVOY_SNMP_V3_PROXY || \
|
||||
INSTALL_ENVOY_SNMP_COEXISTENCE) && !(INSTALL_ENVOY_SNMP_V3_TARGET))
|
||||
#error The use of notifies, proxies, or coexistence requires that
|
||||
#error ENVOY_SNMP_V3_TARGET be installed.
|
||||
#endif
|
||||
|
||||
#if ((INSTALL_ENVOY_SNMP_V3_PROXY) && (INSTALL_ENVOY_SNMP_PROXY))
|
||||
#error ENVOY_SNMP_V3_PROXY and ENVOY_SNMP_PROXY cannot both be installed.
|
||||
#endif
|
||||
|
||||
#if ((INSTALL_ENVOY_SNMP_V3_PROXY) || (INSTALL_ENVOY_SNMP_PROXY))
|
||||
#define INSTALL_ENVOY_USE_SNMP_PROXY 1
|
||||
#else
|
||||
#define INSTALL_ENVOY_USE_SNMP_PROXY 0
|
||||
#endif
|
||||
|
||||
/* If we don't have a main agent we shouldn't be counting stats */
|
||||
#if ((INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2) && \
|
||||
!(INSTALL_ENVOY_MAIN_AGENT))
|
||||
#error Must not have the stats groups installed if building only a
|
||||
#error sub agent. You should modify the configuration file
|
||||
#error for the makmak program and either uninstall the SNMP_GROUP
|
||||
#error options, add the MASTER agent option or remove the SUB agent option
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_USEC
|
||||
#error Envoy no longer supports USEC. Please uninstall
|
||||
#error ENVOY_SNMP_VERSION_USEC and recompile.
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_40_VB_FREE_COMPAT
|
||||
#error ENVOY_40_VB_FREE_COMPAT is no longer a valid option.
|
||||
#error Please uninstall it and recompile.
|
||||
#endif
|
||||
|
||||
#if (INSTALL_SNMP_VXWORKS_VIRTUAL_STACK && \
|
||||
INSTALL_SNMP_VXWORKS_VS_ENTITY && \
|
||||
!(INSTALL_ENVOY_ENTITY_MIB))
|
||||
#error You must install ENVOY_ENTITY_MIB for use with SNMP_VXWORKS_VS_ENTITY
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* asn1conf_inc */
|
||||
@@ -0,0 +1,297 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/auxfuncs.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1991-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: auxfuncs.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:01 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:03 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:29 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:32 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:54:24 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 1999/05/24 20:12:10 josh
|
||||
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
|
||||
* to avoid C++ compiler errors.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:05 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.2 1998/05/23 19:58:52 sar
|
||||
* Added string to oid (and back) translation routines
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:24 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:21 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:00 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.2 1996/01/05 19:09:34 sar
|
||||
* added group_by_getproc_and_instance
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* removed bitstring & uinteger32 options
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:31 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.4 1995/05/06 01:39:54 sar
|
||||
* moved the defs for method routines in auxi into auxmth.h
|
||||
*
|
||||
* Revision 5.3 1995/03/20 23:11:33 sar
|
||||
* Added declarations of the get_<type>_async functions
|
||||
* Updated scan_vb_forLeaf & scan_for_leaf_and_match to use vb pointers
|
||||
* instead of indexes.
|
||||
*
|
||||
* Revision 5.2 1994/10/03 21:20:27 sar
|
||||
* Added the defs for SNMP_Create_And_Send_Traps and
|
||||
* SNMP_Create_Encode_And_Send_Traps.
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Rearrange some items to deal with removing v2 types from v1 settings if
|
||||
* they aren't installed.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.3 1994/05/04 22:43:48 sar
|
||||
* added def for null_set_proc
|
||||
*
|
||||
* Revision 4.2 1994/04/15 21:38:04 sar
|
||||
* added the dynmaic flag to get_ui64.
|
||||
*
|
||||
* Revision 4.1 1994/03/08 18:00:01 dab
|
||||
* Added oidcmp2
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.9 1993/06/07 18:31:09 sar
|
||||
* Added the get and set functions for ui64s and the get function for
|
||||
* bit strings.
|
||||
*
|
||||
* Revision 3.8 1993/05/14 15:13:29 sar
|
||||
* removed scan_vb_and_reset as it was no longer being used.
|
||||
*
|
||||
* Revision 3.7 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.6 1993/04/27 21:06:48 sar
|
||||
* Removed index_to_vbp it is now in buildpkt.h
|
||||
*
|
||||
* Revision 3.5 1993/04/17 00:58:20 sar
|
||||
* added the def for vb_extract_row_loose
|
||||
*
|
||||
* Revision 3.4 1993/03/05 03:56:25 dab
|
||||
* fixed up types
|
||||
*
|
||||
* Revision 3.3 1993/03/03 16:12:39 dab
|
||||
* Protect against multiple inclusion and remove __() definition.
|
||||
*
|
||||
* Revision 3.2 1993/03/02 19:04:38 sar
|
||||
* added definition of vb_scan_and_reset.
|
||||
*
|
||||
* Revision 3.1 1993/02/26 17:28:25 sar
|
||||
* added scan_for_leaf_and_match and scan_vb_for_leaf so they can be use
|
||||
* by outside routines.
|
||||
*
|
||||
* Revision 3.0 1992/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 1.13 92/03/31 12:23:54 dab
|
||||
* Changed flags in the create_row structure again.
|
||||
*
|
||||
* Revision 1.12 92/03/31 11:16:56 dab
|
||||
* Changed flags in create_row structure.
|
||||
*
|
||||
* Revision 1.11 92/03/30 18:43:17 dab
|
||||
* Changed arguments to oid_to_ip().
|
||||
*
|
||||
* Revision 1.10 92/03/26 10:47:08 dab
|
||||
* removed get_cookie().
|
||||
*
|
||||
* Revision 1.9 92/02/27 16:47:39 dab
|
||||
* Changed the create_row structure to hold a MIBLEAF_T pointer instead
|
||||
* of a locator.
|
||||
*
|
||||
* Revision 1.7 92/02/04 10:49:00 dab
|
||||
* Added oidcmp().
|
||||
*
|
||||
* Revision 1.6 91/11/06 14:39:44 dab
|
||||
* Added vb_extract_row and the create_row structure.
|
||||
*
|
||||
* Revision 1.5 91/11/04 15:25:56 dab
|
||||
* Renamed index parameter in function declarations so it doesn't
|
||||
* conflict with system routine index().
|
||||
*
|
||||
* Revision 1.4 91/11/04 15:10:31 dab
|
||||
* Added oidorder().
|
||||
*
|
||||
* Revision 1.3 91/10/31 13:08:41 dab
|
||||
* Changed args to ip_to_llist so llist is a signed long *.
|
||||
* Also added llist_cmp.
|
||||
*
|
||||
* Revision 1.2 91/10/30 09:43:32 dab
|
||||
* New functions ip_to_rlist(), ip_to_llist(), and oid_to_ip().
|
||||
*
|
||||
* Revision 1.1 91/10/24 10:59:34 dab
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef auxfuncs_inc
|
||||
#define auxfuncs_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(buildpkt_inc))
|
||||
#include <wrn/wm/snmp/engine/buildpkt.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(auxmth_inc))
|
||||
#include <wrn/wm/snmp/engine/auxmth.h>
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* A structure used for looking up all the pieces of a row create of an
|
||||
* SNMP packet. */
|
||||
struct create_row {
|
||||
MIBLEAF_T *leaf;
|
||||
OCTET_T flags;
|
||||
};
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define ROW_FLAG_NEEDED 0x01
|
||||
#define ROW_FLAG_CALL_SET 0x02
|
||||
|
||||
/* various other housekeeping functions */
|
||||
extern int ip_to_llist __((UINT_32_T ip,
|
||||
INT_32_T *llist));
|
||||
|
||||
extern int ip_to_rlist __((UINT_32_T ip,
|
||||
OIDC_T *rlist));
|
||||
|
||||
extern int llist_cmp __((INT_32_T *list1,
|
||||
INT_32_T *list2,
|
||||
int len));
|
||||
|
||||
extern int oid_to_ip __((int tcount,
|
||||
OIDC_T *tlist,
|
||||
UINT_32_T *addr));
|
||||
|
||||
extern int oidcmp __((int tcount_1,
|
||||
OIDC_T *tlist_1,
|
||||
int tcount_2,
|
||||
OIDC_T *tlist_2));
|
||||
|
||||
extern int oidcmp2 __((int tcount_1,
|
||||
OIDC_T *tlist_1,
|
||||
int tcount_2,
|
||||
OIDC_T *tlist_2));
|
||||
|
||||
extern int oidorder __((OIDC_T *idp1,
|
||||
OIDC_T *idp2,
|
||||
int n));
|
||||
|
||||
extern int scan_vb_for_locator __((SNMP_PKT_T * pktp,
|
||||
int vb_index,
|
||||
UINT_16_T loc));
|
||||
|
||||
extern VB_T *vb_extract_row __((SNMP_PKT_T *pkt,
|
||||
int start_indx,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
int row_len,
|
||||
struct create_row *row));
|
||||
|
||||
extern VB_T *scan_for_leaf_and_match __((SNMP_PKT_T *pkt,
|
||||
VB_T *vbp,
|
||||
MIBLEAF_T *leaf,
|
||||
int tcount,
|
||||
OIDC_T *tlist));
|
||||
|
||||
extern VB_T *scan_vb_for_leaf __((SNMP_PKT_T *pktp,
|
||||
VB_T *vbp,
|
||||
MIBLEAF_T *leaf));
|
||||
|
||||
extern VB_T *vb_extract_row_loose __((SNMP_PKT_T *pktp,
|
||||
int indx,
|
||||
MIBLEAF_T **leaves,
|
||||
int tcount,
|
||||
OIDC_T *tlist));
|
||||
|
||||
extern void group_by_getproc_and_instance __((SNMP_PKT_T *pktp,
|
||||
VB_T *first_vbp,
|
||||
int tcount,
|
||||
OIDC_T *tlist));
|
||||
|
||||
extern int oid_to_string __((int tcount,
|
||||
OIDC_T *tlist,
|
||||
ALENGTH_T *blen,
|
||||
bits8_t *buffp,
|
||||
int iflag));
|
||||
|
||||
extern int string_to_oid __((ALENGTH_T blen,
|
||||
bits8_t *buffp,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
int iflag));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* auxfuncs_inc */
|
||||
@@ -0,0 +1,409 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/auxmth.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: auxmth.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:01 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6 2001/04/11 20:12:00 josh
|
||||
* merging changes from the kingfisher branch back onto
|
||||
* the trunk
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:03 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4.2.2 2001/03/12 22:07:51 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.4.2.1 2000/09/21 21:14:53 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:29 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 16:54:40 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 2000/02/04 21:54:14 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.1 1999/05/24 20:12:11 josh
|
||||
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
|
||||
* to avoid C++ compiler errors.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:05 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.2 1998/05/29 03:53:54 sar
|
||||
* Add and use defines for v2 types and v2 protocol pieces. This allows
|
||||
* us to include the types and pieces for other versions, such as v3,
|
||||
* without having to touch all of the seperate files that use the
|
||||
* types or pieces.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:25 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:21 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:01 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.3 1996/01/05 19:09:34 sar
|
||||
* Added null_next and null_test functions for use with the mibcompiler
|
||||
*
|
||||
* Revision 6.2 1995/11/11 00:05:52 sar
|
||||
* added *_TestAndIncr_async functions.
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* removed bitstring & uinteger32 options
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:32 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 1.1 1995/05/06 01:39:54 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/* Defs for all of the method routines written in auxi */
|
||||
|
||||
#ifndef auxmth_inc
|
||||
#define auxmth_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buildpkt_inc))
|
||||
#include <wrn/wm/snmp/engine/buildpkt.h>
|
||||
#endif
|
||||
|
||||
/* null test functions */
|
||||
extern int null_test_proc __((int form,
|
||||
OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp,
|
||||
int indx));
|
||||
|
||||
extern void null_test_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
|
||||
/* generic test function (for non-settable scalars) */
|
||||
extern int it_exists __((int form,
|
||||
OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp,
|
||||
int vb_index));
|
||||
|
||||
extern void it_exists_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
/* Test function for test and increment type variables */
|
||||
extern void test_TestAndIncr_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
/* Test and cleanup functions for UInteger64 */
|
||||
extern void ui64_async_test __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void ui64_async_cleanup __((PTR_T value));
|
||||
|
||||
#endif
|
||||
|
||||
/* various get functions */
|
||||
|
||||
extern INT_32_T null_get_proc __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp));
|
||||
|
||||
extern void null_get_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
|
||||
extern INT_32_T get_int __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp));
|
||||
|
||||
|
||||
extern unsigned char *get_ip_address __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp,
|
||||
UINT_32_T *addr));
|
||||
|
||||
extern OBJ_ID_T *get_object_identifier __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp,
|
||||
int *dynamic));
|
||||
|
||||
extern unsigned char *get_string __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
int *lengthp,
|
||||
SNMP_PKT_T *pktp,
|
||||
int *dynamic));
|
||||
|
||||
extern UINT_32_T get_uint __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp));
|
||||
|
||||
extern UINT_32_T get_ulong __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp));
|
||||
|
||||
/* We only include these two functions if v2 types are in use */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern UINT_64_T *get_ui64 __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp,
|
||||
int *dynamic));
|
||||
#endif
|
||||
|
||||
|
||||
extern void get_int_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_ip_address_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_object_identifier_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_string_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_uint_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_ulong_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void get_TestAndIncr_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
/* We only include these two functions if v2 types are in use */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void get_ui64_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
#endif
|
||||
|
||||
/* null next functions */
|
||||
extern int null_next_proc __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
OIDC_T *rlist,
|
||||
char *cookie,
|
||||
SNMP_PKT_T *pktp));
|
||||
|
||||
extern void null_next_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
/* various undo procedures */
|
||||
extern void undo_int_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void undo_uint_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
extern void undo_TestAndIncr_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void ui64_async_undo __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
#endif
|
||||
|
||||
/* various set procedures */
|
||||
extern void null_set_proc __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
INT_32_T value,
|
||||
SNMP_PKT_T *pktp,
|
||||
int vb_index));
|
||||
|
||||
extern void null_set_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
|
||||
extern void set_int __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
INT_32_T value,
|
||||
SNMP_PKT_T *pktp,
|
||||
int vb_index));
|
||||
|
||||
extern void set_uint __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
UINT_32_T value,
|
||||
SNMP_PKT_T *pktp,
|
||||
int vb_index));
|
||||
|
||||
/* We only include this function if v2 types are in use */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void set_ui64 __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
char *cookie,
|
||||
UINT_32_T high,
|
||||
UINT_32_T low,
|
||||
SNMP_PKT_T *pktp,
|
||||
int vb_index));
|
||||
#endif
|
||||
|
||||
extern void set_int_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
|
||||
extern void set_uint_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
|
||||
extern void set_TestAndIncr_async __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
|
||||
/* We only include this function if v2 types are in use */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void ui64_async_set __((OIDC_T lastmatch,
|
||||
int tcount,
|
||||
OIDC_T *tlist,
|
||||
SNMP_PKT_T *pktp,
|
||||
VB_T *vbp));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,215 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/axapi.h,v 1.5 2002/04/04 15:20:35 andre Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: axapi.h,v $
|
||||
* Revision 1.5 2002/04/04 15:20:35 andre
|
||||
* Change enums to #defines; add default user-exit
|
||||
*
|
||||
* Revision 1.3 2002/03/18 20:20:04 tneale
|
||||
* Changed type of argument tcount to conform to correct type
|
||||
*
|
||||
* Revision 1.2 2002/02/26 18:41:49 josh
|
||||
* update and nits
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(_RFC2742API_H_)
|
||||
#define _RFC2742API_H_
|
||||
|
||||
/* Macros / symbolic constant definitions */
|
||||
|
||||
#if !defined(TRUE)
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#if !defined(FALSE)
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#if !defined(ENVOY_AX_CONN_ENTRY)
|
||||
/* Define ENVOY_AX_CONN_ENTRY for non-VxWorks builds */
|
||||
#define ENVOY_AX_CONN_ENTRY(INDEX, MATCH_TYPE, P_CONNENT) 0
|
||||
#endif
|
||||
|
||||
#if !defined(ENVOY_AX_GET_CONNID)
|
||||
/* Define ENVOY_AX_GET_CONNID for non-VxWorks builds */
|
||||
#define ENVOY_AX_GET_CONNID(PCE) 1
|
||||
#endif
|
||||
|
||||
#define agentxConnectionEntry_INSTANCE_LEN 1
|
||||
#define agentxSessionEntry_INSTANCE_LEN 2
|
||||
#define agentxRegistrationEntry_INSTANCE_LEN 3
|
||||
|
||||
/* Internal data retrieval definitions, typedefs and structures */
|
||||
|
||||
#define AX_MATCH_GET 1
|
||||
#define AX_MATCH_NEXT 2
|
||||
|
||||
#define AX_GEN_DEFTO 1
|
||||
#define AX_GEN_VER 2
|
||||
#define AX_CONN_LASTCHG 3
|
||||
#define AX_SESS_LASTCHG 4
|
||||
#define AX_REG_LASTCHG 5
|
||||
|
||||
/* GENERAL, CONNECTION, SESSION and REGISTRATION group structures */
|
||||
|
||||
typedef struct AX_GEN_S
|
||||
{
|
||||
bits32_t agentxDefaultTimeout;
|
||||
bits32_t agentxMasterAgentXVer;
|
||||
} AX_GEN_T;
|
||||
|
||||
typedef struct AX_CONNENT_S
|
||||
{
|
||||
bits32_t agentxConnIndex;
|
||||
bits32_t agentxConnTransportTime;
|
||||
OBJ_ID_T agentxConnTransportDomain;
|
||||
EBUFFER_T agentxConnTransportAddress;
|
||||
} AX_CONNENT_T;
|
||||
|
||||
typedef struct AX_SESSENT_S
|
||||
{
|
||||
bits32_t agentxConnIndex;
|
||||
bits32_t agentxSessIndex;
|
||||
OBJ_ID_T agentxSessObjectID;
|
||||
EBUFFER_T agentxSessDescr;
|
||||
bits32_t agentxSessAdminStatus;
|
||||
bits32_t agentxSessOpenTime;
|
||||
bits32_t agentxSessAgentXVer;
|
||||
bits32_t agentxSessTimeout;
|
||||
} AX_SESSENT_T;
|
||||
|
||||
typedef struct AX_REGENT_S
|
||||
{
|
||||
bits32_t agentxConnIndex;
|
||||
bits32_t agentxSessIndex;
|
||||
bits32_t agentxRegIndex;
|
||||
EBUFFER_T agentxRegContext;
|
||||
OBJ_ID_T agentxRegStart;
|
||||
bits32_t agentxRegRangeSubId;
|
||||
bits32_t agentxRegUpperBound;
|
||||
bits32_t agentxRegPriority;
|
||||
bits32_t agentxRegTimeout;
|
||||
bits32_t agentxRegInstance;
|
||||
} AX_REGENT_T;
|
||||
|
||||
/* API prototypes */
|
||||
|
||||
boolean_t AxGetScalar (int scalarCode, bits32_t *value);
|
||||
|
||||
AX_CONNENT_T *AxConnGetEntry (int tcount, OIDC_T *tlist);
|
||||
AX_CONNENT_T *AxConnGetNext (int tcount, OIDC_T *tlist);
|
||||
|
||||
AX_SESSENT_T *AxSessGetEntry (int tcount, OIDC_T *tlist);
|
||||
AX_SESSENT_T *AxSessGetNext (int tcount, OIDC_T *tlist);
|
||||
|
||||
AX_REGENT_T *AxRegGetEntry (int tcount, OIDC_T *tlist);
|
||||
AX_REGENT_T *AxRegGetNext (int tcount, OIDC_T *tlist);
|
||||
|
||||
/* axmth.c prototypes: GENERAL group */
|
||||
|
||||
void agentxGeneral_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxGeneral_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
|
||||
/* axmth.c prototypes: CONNECTION group */
|
||||
|
||||
void agentxConnectionEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
AX_CONNENT_T *agentxConnectionEntry_first (void);
|
||||
void agentxConnectionEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
bits32_t agentxConnectionEntry_build_instance (AX_CONNENT_T *axConnEntry, OIDC_T *tempInst);
|
||||
void agentxConnection_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxConnection_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void setAxConnTblLastChg (bits32_t timeStamp);
|
||||
void agentxFreeConnEntry (ptr_t pConnEntry);
|
||||
|
||||
/* axmth.c prototypes: SESSION group */
|
||||
|
||||
void agentxSessionEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxSessionEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxSessionEntry_test (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxSessionEntry_set (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
|
||||
void agentxSession_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxSession_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
|
||||
/* axmth.c prototypes: REGISTRATION group */
|
||||
|
||||
void agentxRegistrationEntry_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxRegistrationEntry_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxRegistration_get (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
void agentxRegistration_next (OIDC_T lastmatch, int tcount, OIDC_T *tlist, SNMP_PKT_T *pktp, VB_T *vbp);
|
||||
|
||||
/* mibLeaf.h definitions moved here for convenience */
|
||||
|
||||
#define LEAF_agentxDefaultTimeout 1
|
||||
#define MIN_agentxDefaultTimeout 0L
|
||||
#define MAX__agentxDefaultTimeout 255L
|
||||
#define LEAF_agentxMasterAgentXVer 2
|
||||
#define MIN_agentxMasterAgentXVer 1L
|
||||
#define MAX__agentxMasterAgentXVer 255L
|
||||
#define LEAF_agentxConnTableLastChange 1
|
||||
#define LEAF_agentxConnIndex 1
|
||||
#define MIN_agentxConnIndex 1L
|
||||
#define MAX__agentxConnIndex 4294967295L
|
||||
#define LEAF_agentxConnTransportTime 2
|
||||
#define LEAF_agentxConnTransportDomain 3
|
||||
#define LEAF_agentxConnTransportAddress 4
|
||||
#define MINSIZE_agentxConnTransportAddress 0L
|
||||
#define MAX_SIZE_agentxConnTransportAddress 255L
|
||||
#define LEAF_agentxSessionTableLastChange 1
|
||||
#define LEAF_agentxSessionIndex 1
|
||||
#define MIN_agentxSessionIndex 0L
|
||||
#define MAX__agentxSessionIndex 4294967295L
|
||||
#define LEAF_agentxSessionObjectID 2
|
||||
#define LEAF_agentxSessionDescr 3
|
||||
#define MINSIZE_agentxSessionDescr 0L
|
||||
#define MAX_SIZE_agentxSessionDescr 255L
|
||||
#define LEAF_agentxSessionAdminStatus 4
|
||||
#define VAL_agentxSessionAdminStatus_up 1L
|
||||
#define VAL_agentxSessionAdminStatus_down 2L
|
||||
#define LEAF_agentxSessionOpenTime 5
|
||||
#define LEAF_agentxSessionAgentXVer 6
|
||||
#define MIN_agentxSessionAgentXVer 1L
|
||||
#define MAX__agentxSessionAgentXVer 255L
|
||||
#define LEAF_agentxSessionTimeout 7
|
||||
#define MIN_agentxSessionTimeout 0L
|
||||
#define MAX__agentxSessionTimeout 255L
|
||||
#define LEAF_agentxRegistrationTableLastChange 1
|
||||
#define LEAF_agentxRegIndex 1
|
||||
#define MIN_agentxRegIndex 1L
|
||||
#define MAX__agentxRegIndex 4294967295L
|
||||
#define LEAF_agentxRegContext 2
|
||||
#define LEAF_agentxRegStart 3
|
||||
#define LEAF_agentxRegRangeSubId 4
|
||||
#define LEAF_agentxRegUpperBound 5
|
||||
#define LEAF_agentxRegPriority 6
|
||||
#define LEAF_agentxRegTimeout 7
|
||||
#define MIN_agentxRegTimeout 0L
|
||||
#define MAX__agentxRegTimeout 255L
|
||||
#define LEAF_agentxRegInstance 8
|
||||
#define VAL_agentxRegInstance_true 1L
|
||||
#define VAL_agentxRegInstance_false 2L
|
||||
|
||||
#endif /* _RFC2742API_H_ */
|
||||
@@ -0,0 +1,62 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/bstring.h,v 1.1.1.1 2001/11/05 17:47:22 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1996-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: bstring.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.2 2001/01/19 22:22:03 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.1 2000/03/17 19:48:31 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:07 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:27 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:22 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:02 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 1.1 1996/01/22 20:58:52 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
/* This is a placeholder file for use with older makefiles that require
|
||||
it for dependency reasons. */
|
||||
|
||||
@@ -0,0 +1,338 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/buffer.h,v 1.2 2001/11/06 21:35:01 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: buffer.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:01 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:04 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:31 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:33 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:55:08 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:07 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.3 1998/06/18 04:42:00 sar
|
||||
* Modified bflags in ebuffer to be unsigned ints and updated
|
||||
* calling routines accordingly
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:01:13 sar
|
||||
* Added EBufferAllocateLoad and updated some types
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:28 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:23 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:05 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:34 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.6 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.5 1993/04/22 20:14:13 sar
|
||||
* Updating of macros and defines to use new naming scheme and get the
|
||||
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
|
||||
* for example).
|
||||
*
|
||||
* Revision 3.4 1993/03/20 00:21:50 sar
|
||||
* Replaced EBufferAdd with EBufferAdjust which takes a length and if
|
||||
* necessary extends the buffer.
|
||||
* Added EBufferReplace which puts the given string into the buffer
|
||||
* extending the buffer if necessary.
|
||||
*
|
||||
* Revision 3.3 1993/03/05 03:56:25 dab
|
||||
* fixed up types
|
||||
*
|
||||
* Revision 3.2 1993/03/02 19:04:38 sar
|
||||
* added definition of EBuffer_add which extends the string in a buffer.
|
||||
*
|
||||
* Revision 3.1 1993/02/17 20:46:41 sar
|
||||
* Added EBufferStart - macro: obtain address of first byte in a buffer.
|
||||
* Added EBufferSeek - definition: move the pointer in a buffer.
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.102 1992/03/31 14:04:08 dab
|
||||
* Fixed EBufferReset to fixup the remaining field too.
|
||||
*
|
||||
* Revision 2.101 92/02/04 11:04:37 dab
|
||||
* Changed the EBufferReset macro to return void.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:44 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:21 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Revision 2.0 31-Mar-1990 15:11:22 dab
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:04
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:12
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#define buffer_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* The EBUFFER_T structure is used to control encoding into a buffer */
|
||||
typedef struct EBUFFER_S
|
||||
{
|
||||
unsigned int bflags;
|
||||
bits8_t *start_bp; /* Start of the buffer. */
|
||||
bits8_t *next_bp; /* Next location in buffer to be filled */
|
||||
ALENGTH_T remaining; /* Number of empty spots remaining in buffer*/
|
||||
} EBUFFER_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/* Values for bflags */
|
||||
#define BFL_IS_ALLOC 0x0002 /* Buffer must be obtained */
|
||||
#define BFL_IS_DYNAMIC 0x0001 /* Buffer was obtained by malloc */
|
||||
#define BFL_IS_STATIC 0x0000 /* Buffer is statically allocated */
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferInitialize
|
||||
|
||||
PURPOSE: Initialize a buffer to a know, but not usable state
|
||||
EBufferSetup must be used to make the buffer ready for use.
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: Nothing
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferInitialize(E) (((EBUFFER_T *)(E))->bflags=0, \
|
||||
((EBUFFER_T *)(E))->next_bp=(bits8_t *)0, \
|
||||
((EBUFFER_T *)(E))->start_bp=(bits8_t *)0, \
|
||||
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)0)
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferSetup
|
||||
|
||||
PURPOSE: Setup a buffer to receive ASN.1 encoded data
|
||||
|
||||
PARAMETERS:
|
||||
unsigned int BFL_xxx flags from buffer.h
|
||||
EBUFFER_T * Buffer descriptor
|
||||
bits8_t * Address of the buffer
|
||||
ALENGTH_T Length of the buffer
|
||||
|
||||
RETURNS: Nothing
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferSetup(F,E,B,L) (((EBUFFER_T *)(E))->bflags=(F), \
|
||||
((EBUFFER_T *)(E))->start_bp=(bits8_t *)(B), \
|
||||
((EBUFFER_T *)(E))->next_bp=(bits8_t *)(B), \
|
||||
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)(L))
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferPreLoad
|
||||
|
||||
PURPOSE: Pre-load data into a buffer
|
||||
|
||||
PARAMETERS:
|
||||
unsigned int BFL_xxx flags from buffer.h
|
||||
EBUFFER_T * Buffer descriptor
|
||||
bits8_t * Address of the buffer containing the data
|
||||
ALENGTH_T Length of the data
|
||||
|
||||
RETURNS: Nothing
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferPreLoad(F,E,B,L) ( \
|
||||
((EBUFFER_T *)(E))->bflags=(F), \
|
||||
((EBUFFER_T *)(E))->start_bp=(bits8_t *)(B), \
|
||||
((EBUFFER_T *)(E))->next_bp=((bits8_t *)(B)+(ALENGTH_T)(L)), \
|
||||
((EBUFFER_T *)(E))->remaining=(ALENGTH_T)0)
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferNext
|
||||
|
||||
PURPOSE: Obtain address of next free byte in a buffer
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: bits8_t * Buffer descriptor
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferNext(E) (((EBUFFER_T *)(E))->next_bp)
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferStart
|
||||
|
||||
PURPOSE: Obtain address of first byte in a buffer
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: bits8_t * Buffer descriptor
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferStart(E) (((EBUFFER_T *)(E))->start_bp)
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferUsed
|
||||
|
||||
PURPOSE: Indicate how many octets are currently in the buffer.
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: ALENGTH_T Number of octets used.
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferUsed(E) ((ALENGTH_T)((((EBUFFER_T *)(E))->next_bp) - \
|
||||
(((EBUFFER_T *)(E))->start_bp)))
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferRemaining
|
||||
|
||||
PURPOSE: Indicate how many octets are currently unused in the buffer.
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: ALENGTH_T Number of octets unused.
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferRemaining(E) (((EBUFFER_T *)(E))->remaining)
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: EBufferReset
|
||||
|
||||
PURPOSE: Reset the buffer to an empty state, just like after EBufferSetup
|
||||
|
||||
PARAMETERS:
|
||||
EBUFFER_T * Buffer descriptor
|
||||
|
||||
RETURNS: Nothing
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define EBufferReset(E) ( \
|
||||
(((EBUFFER_T *)(E))->remaining += \
|
||||
((EBUFFER_T *)(E))->next_bp - \
|
||||
((EBUFFER_T *)(E))->start_bp), \
|
||||
((void)(((EBUFFER_T *)(E))->next_bp = \
|
||||
((EBUFFER_T *)(E))->start_bp)))
|
||||
|
||||
extern int EBufferClone __((EBUFFER_T *, EBUFFER_T *));
|
||||
extern void EBufferClean __((EBUFFER_T *));
|
||||
extern void EBufferAppend __((EBUFFER_T *, EBUFFER_T *));
|
||||
extern int EBufferSeek __((EBUFFER_T *, ALENGTH_T, int));
|
||||
extern int EBufferAdjust __((EBUFFER_T *, ALENGTH_T));
|
||||
extern int EBufferReplace __((EBUFFER_T *, bits8_t *, ALENGTH_T));
|
||||
extern int EBufferAllocateLoad __((unsigned int, EBUFFER_T *,
|
||||
bits8_t *, ALENGTH_T));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* buffer_inc */
|
||||
@@ -0,0 +1,310 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/buildpkt.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: buildpkt.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:02 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.7 2001/01/19 22:22:04 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.6 2000/03/17 19:48:32 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.5 2000/03/09 16:55:22 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.4 2000/03/09 13:51:30 josh
|
||||
* a shell function has been created to allow SNMPv3 requests
|
||||
* to be created while we're holding the coarse lock.
|
||||
*
|
||||
* Revision 9.3 1999/09/21 21:30:20 josh
|
||||
* correcting VBL_Bind_* macros
|
||||
*
|
||||
* Revision 9.2 1999/09/14 19:44:11 josh
|
||||
* prototypes and macros for VBL_Bind_*() functions/macros
|
||||
*
|
||||
* Revision 9.1 1999/04/09 20:37:00 josh
|
||||
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:08 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.5 1998/07/20 02:01:23 sar
|
||||
* Removed dynamic/static tags from v3 packet creation routine
|
||||
*
|
||||
* Revision 8.4 1998/06/18 04:42:02 sar
|
||||
* Modified bflags in ebuffer to be unsigned ints and updated
|
||||
* calling routines accordingly
|
||||
*
|
||||
* Revision 8.3 1998/05/29 03:53:54 sar
|
||||
* Add and use defines for v2 types and v2 protocol pieces. This allows
|
||||
* us to include the types and pieces for other versions, such as v3,
|
||||
* without having to touch all of the seperate files that use the
|
||||
* types or pieces.
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:04:07 sar
|
||||
* Added creation function for v3 requests
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:30 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:23 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.4 1997/03/20 06:48:06 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.3 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.2 1996/12/04 18:42:08 sar
|
||||
* Added a definition for SNMP_Bind_OBJECT_ID to make older versions
|
||||
* of Emissary happy.
|
||||
*
|
||||
* Revision 7.1 1996/10/15 14:28:01 sar
|
||||
* Added create_internal_request
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.2 1996/01/10 16:23:25 sar
|
||||
* USEC updates
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* remvoed nsapaddress function
|
||||
* removed create functions for party system
|
||||
* remvoed bitstring function
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:38 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.3 1995/03/20 23:11:33 sar
|
||||
* Moved index_to_vbp to snmpdefs.h and included snmpdefs.h for backward
|
||||
* compatibility.
|
||||
*
|
||||
* Revision 5.2 1994/10/03 21:20:27 sar
|
||||
* Added the def for SNMP_Create_V2_Half_Trap
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Rearrange some items to deal with removing v2 types from v1 settings if
|
||||
* they aren't installed.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.6 1993/05/17 14:04:13 sar
|
||||
* changed SNMP_Create_Party_Request to be SNMP_Create_V2_Request
|
||||
*
|
||||
* Revision 3.5 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.4 1993/04/27 21:06:48 sar
|
||||
* Removed index_to_vbp it is now in buildpkt.h
|
||||
*
|
||||
* Revision 3.3 1993/04/26 20:33:14 sar
|
||||
* Added bitstrings, and have deletion of parties or contexts delete acls.
|
||||
*
|
||||
* Revision 3.2 1993/03/25 21:15:21 sar
|
||||
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
|
||||
*
|
||||
* Revision 3.1 1993/02/17 20:47:28 sar
|
||||
* Added SNMP_Create_Party_Request - definition: create a v2 packet.
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:45 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:22 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:20
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.4 25 Jan 1989 11:55:50
|
||||
* Corrected definitions of macros SNMP_Bind_Counter, SNMP_Bind_Gauge, and
|
||||
* SNMP_Bind_Timeticks -- each of these had the type mis-defined.
|
||||
* Also added a new macro -- SNMP_Bind_Opaque.
|
||||
*
|
||||
* Rev 1.3 11 Jan 1989 12:10:10
|
||||
* Buildpkt.c split into multiple files to prevent linker from picking up
|
||||
* unused routines.
|
||||
*
|
||||
* Rev 1.2 22 Sep 1988 18:38:14
|
||||
* Added definitions for SNMP_Bind_Null().
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:04
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:14
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(buildpkt_inc))
|
||||
#define buildpkt_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmp_inc))
|
||||
#include <wrn/wm/snmp/engine/snmp.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#define SNMP_Bind_Counter(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_COUNTER, V)
|
||||
|
||||
#define SNMP_Bind_Gauge(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_GAUGE, V)
|
||||
|
||||
#define SNMP_Bind_Timeticks(P,I,C,L,V) SNMP_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_TIMETICKS, V)
|
||||
|
||||
#define SNMP_Bind_Opaque(P,I,C,L,W,S,D) SNMP_Bind_String(P, I, C, L, \
|
||||
VT_OPAQUE, W, S, D)
|
||||
|
||||
#define VBL_Bind_Counter(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_COUNTER, V)
|
||||
|
||||
#define VBL_Bind_Gauge(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_GAUGE, V)
|
||||
|
||||
#define VBL_Bind_Timeticks(P,I,C,L,V) VBL_Bind_Unsigned_Integer(P, I, C, \
|
||||
L, VT_TIMETICKS, V)
|
||||
|
||||
#define VBL_Bind_Opaque(P,I,C,L,W,S,D) VBL_Bind_String(P, I, C, L, \
|
||||
VT_OPAQUE, W, S, D)
|
||||
|
||||
/* Defined to clean up an error in some versions of Emissary */
|
||||
#define SNMP_Bind_OBJECT_ID SNMP_Bind_Object_ID
|
||||
|
||||
|
||||
/* We only install some functions if their types are installed */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
#define SNMP_Bind_Counter64(P,I,C,L,H,LO) SNMP_Bind_64_Unsigned_Integer(P, I,\
|
||||
C, L, VT_COUNTER64, H, LO)
|
||||
#define VBL_Bind_Counter64(P,I,C,L,H,LO) VBL_Bind_64_Unsigned_Integer(P, I,\
|
||||
C, L, VT_COUNTER64, H, LO)
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
extern SNMP_PKT_T * SNMP_Create_Request_V3_Lockable __((int, int, bits32_t,
|
||||
bits32_t, bits8_t,
|
||||
bits32_t, bits8_t *,
|
||||
ALENGTH_T, bits8_t *,
|
||||
ALENGTH_T, bits8_t *,
|
||||
ALENGTH_T, bits8_t *,
|
||||
ALENGTH_T, sbits32_t,
|
||||
int, int, int, int));
|
||||
extern SNMP_PKT_T * SNMP_Create_Request_V3 __((int, int, bits32_t,
|
||||
bits32_t, bits8_t, bits32_t,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
sbits32_t, int, int, int));
|
||||
#endif
|
||||
|
||||
extern SNMP_PKT_T * SNMP_Create_Request2 __((int, int, int, char *,
|
||||
INT_32_T, int, int, int));
|
||||
#define SNMP_Create_Request(PDU, VER, CLEN, CSTR, RID, VBS) \
|
||||
SNMP_Create_Request2(PDU, VER, CLEN, CSTR, RID, VBS, 0, 0)
|
||||
|
||||
extern SNMP_PKT_T *SNMP_Create_Internal_Request __((int, int, int, sbits8_t *,
|
||||
unsigned short int,
|
||||
INT_32_T, int, int, int,
|
||||
ALENGTH_T, IO_COMPLETE_T *,
|
||||
ERR_COMPLETE_T *, PTR_T));
|
||||
|
||||
extern SNMP_PKT_T * SNMP_Create_Trap __((int, int, char *, int,
|
||||
OIDC_T *, OCTET_T *, int,
|
||||
INT_32_T, UINT_32_T, int));
|
||||
|
||||
extern int SNMP_Bind_Integer __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, INT_32_T));
|
||||
extern int SNMP_Bind_Unsigned_Integer __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, OCTET_T, UINT_32_T));
|
||||
extern int SNMP_Bind_IP_Address __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, OCTET_T *));
|
||||
extern int SNMP_Bind_Object_ID __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, int, OIDC_T *));
|
||||
extern int SNMP_Bind_String __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, OCTET_T,
|
||||
int, OCTET_T *, int));
|
||||
extern int SNMP_Bind_Null __((SNMP_PKT_T *, int, int, OIDC_T *));
|
||||
|
||||
extern int VBL_Bind_Integer __((VBL_T *, int, int,
|
||||
OIDC_T *, INT_32_T));
|
||||
extern int VBL_Bind_Unsigned_Integer __((VBL_T *, int, int,
|
||||
OIDC_T *, OCTET_T, UINT_32_T));
|
||||
extern int VBL_Bind_IP_Address __((VBL_T *, int, int,
|
||||
OIDC_T *, OCTET_T *));
|
||||
extern int VBL_Bind_Object_ID __((VBL_T *, int, int,
|
||||
OIDC_T *, int, OIDC_T *));
|
||||
extern int VBL_Bind_String __((VBL_T *, int, int,
|
||||
OIDC_T *, OCTET_T,
|
||||
int, OCTET_T *, int));
|
||||
extern int VBL_Bind_Null __((VBL_T *, int, int, OIDC_T *));
|
||||
|
||||
/* We only install some functions if their types are installed */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern int SNMP_Bind_64_Unsigned_Integer __((SNMP_PKT_T *, int, int,
|
||||
OIDC_T *, OCTET_T,
|
||||
UINT_32_T, UINT_32_T));
|
||||
|
||||
extern int VBL_Bind_64_Unsigned_Integer __((VBL_T *, int, int,
|
||||
OIDC_T *, OCTET_T,
|
||||
UINT_32_T, UINT_32_T));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* buildpkt_inc */
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/decode.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1986-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: decode.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:02 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.3 2001/01/19 22:22:04 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.2 2000/03/17 19:48:33 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:55:35 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:09 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.3 1998/05/29 03:53:55 sar
|
||||
* Add and use defines for v2 types and v2 protocol pieces. This allows
|
||||
* us to include the types and pieces for other versions, such as v3,
|
||||
* without having to touch all of the seperate files that use the
|
||||
* types or pieces.
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:02:36 sar
|
||||
* Added A_DecodeOctetWTC
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:32 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:24 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:08 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* removed bitstring & uinteger32 options
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:40 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Rearrange some items to deal with removing v2 types from v1 settings if
|
||||
* they aren't installed.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.1 1994/05/02 17:03:55 sar
|
||||
* Added a new decode error (AE_WRONG_TYPE) for use with some new routines
|
||||
* that do type checking while pulling a value out.
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.5 1993/06/17 23:30:45 sar
|
||||
* Modifed decode of bit strings as it was wrong.
|
||||
*
|
||||
* Revision 3.4 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.3 1993/04/28 22:00:38 sar
|
||||
* Moved the definition of UINT_64_T to ui64.h and update others
|
||||
*
|
||||
* Revision 3.2 1993/04/26 20:33:14 sar
|
||||
* Added bitstrings, and have deletion of parties or contexts delete acls.
|
||||
*
|
||||
* Revision 3.1 1993/03/25 21:15:21 sar
|
||||
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
|
||||
*
|
||||
* Revision 3.0 1992/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.101 92/02/05 18:49:08 dab
|
||||
* Fixed up casting in A_DecodeTypeClass for MSC.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:45 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:23 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:26
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.3 23 Mar 1989 11:55:58
|
||||
* Merged the decode helper into the one routine that used it.
|
||||
*
|
||||
* Rev 1.2 18 Mar 1989 11:57:26
|
||||
* Revised prototypes for A_DecodeOctetStringData and A_DecodeOctetString
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:04
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:14
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(decode_inc))
|
||||
#define decode_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(localio_inc))
|
||||
#include <wrn/wm/snmp/engine/localio.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(ui64_inc))
|
||||
#include <wrn/wm/snmp/engine/ui64.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
NAME: A_DecodeTypeClass
|
||||
|
||||
PURPOSE: Decode the Class and Form bits from an ASN.1 type field.
|
||||
The data stream is read using the local I/O package.
|
||||
The stream pointer is NOT advanced, leaving it pointing to the
|
||||
start of the type field, ready for a subsequent call to
|
||||
A_DecodeTypeValue.
|
||||
|
||||
CAVEAT: The user should call this return *BEFORE* calling
|
||||
A_DecodeTypeValue.
|
||||
|
||||
PARAMETERS: LCL_FILE * A stream descriptor (already open)
|
||||
|
||||
RETURNS: OCTET_T The Class and Form bits
|
||||
|
||||
RESTRICTIONS: It is assumed that the stream is not at EOF.
|
||||
****************************************************************************/
|
||||
|
||||
#define A_DecodeTypeClass(L) ((OCTET_T) (Lcl_Peekc((LCL_FILE *)(L)) & \
|
||||
A_IDCF_MASK))
|
||||
|
||||
/****************************************************************************
|
||||
Decoding errors
|
||||
****************************************************************************/
|
||||
#define AE_PREMATURE_END 1
|
||||
#define AE_INDEFINITE_LENGTH 2
|
||||
#define AE_WRONG_VALUE 3
|
||||
#define AE_WRONG_TYPE 4
|
||||
#define AE_WRONG_LENGTH 5
|
||||
#define AE_ALLOC_FAILURE 6
|
||||
|
||||
extern ATVALUE_T A_DecodeTypeValue __((LCL_FILE *, int *));
|
||||
extern ALENGTH_T A_DecodeLength __((LCL_FILE *, int *));
|
||||
extern void A_DecodeOctetStringData __((LCL_FILE *, ALENGTH_T,
|
||||
EBUFFER_T *, int *));
|
||||
extern void A_DecodeOctetString __((LCL_FILE *, EBUFFER_T *,
|
||||
int *));
|
||||
extern void A_DecodeOctetStringWTC __((LCL_FILE *, EBUFFER_T *,
|
||||
int *, ATVALUE_T,
|
||||
OCTET_T));
|
||||
extern bits8_t A_DecodeOctetWTC __((LCL_FILE *, int *,
|
||||
ATVALUE_T, bits8_t));
|
||||
extern INT_32_T A_DecodeIntegerData __((LCL_FILE *, ALENGTH_T,
|
||||
int *));
|
||||
extern INT_32_T A_DecodeInteger __((LCL_FILE *, int *));
|
||||
extern INT_32_T A_DecodeIntegerWTC __((LCL_FILE *, int *,
|
||||
ATVALUE_T, OCTET_T));
|
||||
extern void A_DecodeObjectIdData __((LCL_FILE *, ALENGTH_T,
|
||||
OBJ_ID_T *, int *));
|
||||
extern void A_DecodeObjectId __((LCL_FILE *, OBJ_ID_T *,
|
||||
int *));
|
||||
extern void A_DecodeObjectIdWTC __((LCL_FILE *, OBJ_ID_T *,
|
||||
int *, ATVALUE_T,
|
||||
OCTET_T));
|
||||
|
||||
/* We only install some functions if their types are installed */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void A_DecodeInteger64Data __((LCL_FILE *, ALENGTH_T,
|
||||
UINT_64_T *, int *));
|
||||
extern void A_DecodeInteger64 __((LCL_FILE *, UINT_64_T *,
|
||||
int *));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* decode_inc */
|
||||
@@ -0,0 +1,184 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/encode.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1986-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: encode.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:02 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.3 2001/01/19 22:22:04 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.2 2000/03/17 19:48:33 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:55:43 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:10 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.2 1998/05/29 03:53:55 sar
|
||||
* Add and use defines for v2 types and v2 protocol pieces. This allows
|
||||
* us to include the types and pieces for other versions, such as v3,
|
||||
* without having to touch all of the seperate files that use the
|
||||
* types or pieces.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:33 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:24 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:09 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* removed bitstring & uinteger32 options
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:41 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Rearrange some items to deal with removing v2 types from v1 settings if
|
||||
* they aren't installed.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.4 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.3 1993/04/28 22:00:38 sar
|
||||
* Moved the definition of UINT_64_T to ui64.h and update others
|
||||
*
|
||||
* Revision 3.2 1993/04/26 20:33:14 sar
|
||||
* Added bitstrings, and have deletion of parties or contexts delete acls.
|
||||
*
|
||||
* Revision 3.1 1993/03/25 21:15:21 sar
|
||||
* Added types for uint 64 (counter64) and nsapaddress (translates to string)
|
||||
*
|
||||
* Revision 3.0 1992/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.101 91/08/12 12:53:01 dab
|
||||
* Added EHELPER_T so as to declare the arguments to the helper function.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:46 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:24 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:24
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:06
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:16
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,03jun09,y_t update for requirement WIND00161876
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(encode_inc))
|
||||
#define encode_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(ui64_inc))
|
||||
#include <wrn/wm/snmp/engine/ui64.h>
|
||||
#endif
|
||||
|
||||
typedef ALENGTH_T (EHELPER_T) __((PTR_T, OCTET_T *, ALENGTH_T));
|
||||
extern ALENGTH_T A_SizeOfInt __((INT_32_T));
|
||||
extern ALENGTH_T A_SizeOfUnsignedInt __((UINT_32_T));
|
||||
extern ALENGTH_T A_SizeOfObjectId __((OBJ_ID_T *));
|
||||
|
||||
/* We only install some functions if their types are installed */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern ALENGTH_T A_SizeOfUnsignedInt64 __((UINT_64_T *));
|
||||
#endif
|
||||
|
||||
extern void A_EncodeType __((ATVALUE_T, OCTET_T,
|
||||
EHELPER_T *, OCTET_T *));
|
||||
extern void A_EncodeLength __((ALENGTH_T, EHELPER_T *,
|
||||
OCTET_T *));
|
||||
extern void A_EncodeInt __((ATVALUE_T, OCTET_T,
|
||||
INT_32_T, EHELPER_T *,
|
||||
OCTET_T *));
|
||||
extern void A_EncodeUnsignedInt __((ATVALUE_T, OCTET_T,
|
||||
UINT_32_T, EHELPER_T *,
|
||||
OCTET_T *));
|
||||
extern void A_EncodeOctetString __((ATVALUE_T, OCTET_T,
|
||||
OCTET_T *, ALENGTH_T,
|
||||
EHELPER_T *, OCTET_T *));
|
||||
extern void A_EncodeObjectId __((ATVALUE_T, OCTET_T,
|
||||
OBJ_ID_T *, EHELPER_T *,
|
||||
OCTET_T *));
|
||||
|
||||
/* We only install some functions if their types are installed */
|
||||
#if (ENVOY_USE_V2_TYPES)
|
||||
extern void A_EncodeUnsignedInt64 __((ATVALUE_T, OCTET_T,
|
||||
UINT_64_T , EHELPER_T *,
|
||||
OCTET_T *));
|
||||
#endif
|
||||
|
||||
extern EHELPER_T A_EncodeHelper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* encode_inc */
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/entlogic.h,v 1.1 2002/05/23 18:47:30 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: entlogic.h,v $
|
||||
* Revision 1.1 2002/05/23 18:47:30 josh
|
||||
* support for the entLogicalTable from RFC 2737
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(ent_logical_inc))
|
||||
#define ent_logical_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define ETC_ENT_LOGICAL_MAX_INDEX 0x7fffffff
|
||||
#define ETC_ENT_LOGICAL_MAX 255
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct ENT_LOGICAL_S
|
||||
{
|
||||
struct ENT_LOGICAL_S *next;
|
||||
bits32_t entLogicalIndex;
|
||||
EBUFFER_T entLogicalDescr;
|
||||
OBJ_ID_T entLogicalType;
|
||||
EBUFFER_T entLogicalCommunity;
|
||||
EBUFFER_T entLogicalTAddress;
|
||||
OBJ_ID_T entLogicalTDomain;
|
||||
EBUFFER_T entLogicalContextEngineID;
|
||||
EBUFFER_T entLogicalContextName;
|
||||
bits16_t flags;
|
||||
} ENT_LOGICAL_T;
|
||||
|
||||
/* global root pointer for target params list */
|
||||
extern ENT_LOGICAL_T *root_ent_logical;
|
||||
|
||||
#define Ent_Logical_Set_Defaults(L) \
|
||||
(MEMSET((L), 0, sizeof(ENT_LOGICAL_T)), \
|
||||
EBufferInitialize(&((L)->entLogicalDescr)), \
|
||||
EBufferInitialize(&((L)->entLogicalCommunity)), \
|
||||
EBufferInitialize(&((L)->entLogicalTAddress)), \
|
||||
EBufferInitialize(&((L)->entLogicalContextEngineID)), \
|
||||
EBufferInitialize(&((L)->entLogicalContextName)), \
|
||||
(L)->flags = 0)
|
||||
|
||||
extern ENT_LOGICAL_T * Ent_Logical_Create __((void));
|
||||
extern void Ent_Logical_Destroy __((ENT_LOGICAL_T *));
|
||||
extern int Ent_Logical_Install __((ENT_LOGICAL_T *, bits32_t));
|
||||
extern void Ent_Logical_Deinstall __((ENT_LOGICAL_T *));
|
||||
extern ENT_LOGICAL_T * Ent_Logical_Lookup __((bits32_t));
|
||||
extern ENT_LOGICAL_T * Ent_Logical_Next __((int, OIDC_T *));
|
||||
extern ENT_LOGICAL_T * Ent_Logical_Next_Ent __((ENT_LOGICAL_T *));
|
||||
|
||||
#define Ent_Logical_Get_Index(L) ((L)->entLogicalIndex)
|
||||
#define Ent_Logical_Set_Index(L, V) ((L)->entLogicalIndex = (V))
|
||||
|
||||
#define Ent_Logical_Get_Descr(L) (EBufferStart(&((L)->entLogicalDescr)))
|
||||
#define Ent_Logical_Get_Descr_Len(L) (EBufferUsed(&((L)->entLogicalDescr)))
|
||||
#define Ent_Logical_Set_Descr(L, S, N, F) \
|
||||
(EBufferAllocateLoad((F), &((L)->entLogicalDescr), (S), (N)))
|
||||
|
||||
#define Ent_Logical_Get_Type(L) (&((L)->entLogicalType))
|
||||
#define Ent_Logical_Set_Type(L, D, N) \
|
||||
(build_object_id((N), (D), (&((L)->entLogicalType))))
|
||||
|
||||
#define Ent_Logical_Get_Community(L) \
|
||||
(EBufferStart(&((L)->entLogicalCommunity)))
|
||||
#define Ent_Logical_Get_Community_Len(L) \
|
||||
(EBufferUsed(&((L)->entLogicalCommunity)))
|
||||
#define Ent_Logical_Set_Community(L, S, N, F) \
|
||||
(EBufferAllocateLoad((F), &((L)->entLogicalCommunity), (S), (N)))
|
||||
|
||||
#define Ent_Logical_Get_TAddress(L) \
|
||||
(EBufferStart(&((L)->entLogicalTAddress)))
|
||||
#define Ent_Logical_Get_TAddress_Len(L) \
|
||||
(EBufferUsed(&((L)->entLogicalTAddress)))
|
||||
#define Ent_Logical_Set_TAddress(L, S, N, F) \
|
||||
(EBufferAllocateLoad((F), &((L)->entLogicalTAddress), (S), (N)))
|
||||
|
||||
#define Ent_Logical_Get_TDomain(L) (&((L)->entLogicalTDomain))
|
||||
#define Ent_Logical_Set_TDomain(L, D, N) \
|
||||
(build_object_id((N), (D), (&((L)->entLogicalTDomain))))
|
||||
|
||||
#define Ent_Logical_Get_Context_Engine_ID(L) \
|
||||
(EBufferStart(&((L)->entLogicalContextEngineID)))
|
||||
#define Ent_Logical_Get_Context_Engine_ID_Len(L) \
|
||||
(EBufferUsed(&((L)->entLogicalContextEngineID)))
|
||||
#define Ent_Logical_Set_Context_Engine_ID(L, S, N, F) \
|
||||
(EBufferAllocateLoad((F), &((L)->entLogicalContextEngineID), (S), (N)))
|
||||
|
||||
#define Ent_Logical_Get_Context_Name(L) \
|
||||
(EBufferStart(&((L)->entLogicalContextName)))
|
||||
#define Ent_Logical_Get_Context_Name_Len(L) \
|
||||
(EBufferUsed(&((L)->entLogicalContextName)))
|
||||
#define Ent_Logical_Set_Context_Name(L, S, N, F) \
|
||||
(EBufferAllocateLoad((F), &((L)->entLogicalContextName), (S), (N)))
|
||||
|
||||
#define Ent_Logical_Get_Flags(L) ((L)->flags)
|
||||
#define Ent_Logical_Set_Flags(L, V) ((L)->flags = (bits16_t)(V))
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct ENT_GENERAL_S
|
||||
{
|
||||
bits32_t entLastChangeTime;
|
||||
} ENT_GENERAL_T;
|
||||
|
||||
|
||||
/* Global pointer for the entityGeneral group */
|
||||
extern ENT_GENERAL_T root_ent_general;
|
||||
|
||||
#define Ent_General_Set_Defaults(G) \
|
||||
(MEMSET((G), 0, sizeof(ENT_GENERAL_T)))
|
||||
|
||||
#define Ent_General_Group_Lookup() (&root_ent_general)
|
||||
|
||||
#define Ent_General_Get_Last_Change_Time(G) ((G)->entLastChangeTime)
|
||||
#define Ent_General_Set_Last_Change_Time(G, V) \
|
||||
((G)->entLastChangeTime = (bits32_t) V)
|
||||
|
||||
/* Constants for entLogicalTable */
|
||||
#define LEAF_entLogicalIndex 1
|
||||
#define MIN_entLogicalIndex 1L
|
||||
#define MAX_entLogicalIndex 2147483647L
|
||||
#define LEAF_entLogicalDescr 2
|
||||
#define MINSIZE_entLogicalDescr 0L
|
||||
#define MAXSIZE_entLogicalDescr 255L
|
||||
#define LEAF_entLogicalType 3
|
||||
#define LEAF_entLogicalCommunity 4
|
||||
#define MINSIZE_entLogicalCommunity 0L
|
||||
#define MAXSIZE_entLogicalCommunity 255L
|
||||
#define LEAF_entLogicalTAddress 5
|
||||
#define MINSIZE_entLogicalTAddress 1L
|
||||
#define MAXSIZE_entLogicalTAddress 255L
|
||||
#define LEAF_entLogicalTDomain 6
|
||||
#define LEAF_entLogicalContextEngineID 7
|
||||
#define MINSIZE_entLogicalContextEngineID 0L
|
||||
#define MAXSIZE_entLogicalContextEngineID 32L
|
||||
#define LEAF_entLogicalContextName 8
|
||||
#define MINSIZE_entLogicalContextName 0L
|
||||
#define MAXSIZE_entLogicalContextName 255L
|
||||
|
||||
/* Constants for entGeneral group */
|
||||
#define LEAF_entLastChangeTime 1
|
||||
|
||||
extern void entLogicalEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void entLogicalEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void entityGeneral_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void entityGeneral_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(ent_logical_inc))*/
|
||||
@@ -0,0 +1,147 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/etimer.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: etimer.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:02 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:04 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:34 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:33 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:55:57 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 2000/02/29 20:40:48 josh
|
||||
* #ifdefs so we don't have semicolons sitting on lines alone in include
|
||||
* files (the ARM compiler hates that).
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:10 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.3 1998/08/12 04:52:15 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 8.2 1998/06/28 21:48:54 sar
|
||||
* Added ENVOY_TIMER_32_T for functions that want 32 bit cookies
|
||||
* and need to allocate space on the fly.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:34 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:25 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:10 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:42 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 1.1 1995/03/20 23:07:47 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(etimer_inc))
|
||||
#define etimer_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined snmp_inc)
|
||||
#include <wrn/wm/snmp/engine/snmp.h>
|
||||
#endif
|
||||
|
||||
/* timer structure. Timer memory allocation is expected to be managed by
|
||||
* code which calls into the timer system.
|
||||
*
|
||||
* Software using timers must call tm_init() on any timer before calling
|
||||
* any other tm_ functions on it.
|
||||
*/
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct ENVOY_TIMER_S {
|
||||
struct ENVOY_TIMER_S *link; /* list link */
|
||||
bits32_t expire; /* relative expiration time in ms */
|
||||
void (*handler) __((struct ENVOY_TIMER_S *, void *));
|
||||
/* expiration handler */
|
||||
void *cookie; /* handler cookie */
|
||||
} ENVOY_TIMER_T;
|
||||
|
||||
/* structure that contains a 32 bit id so the memory can be allocated
|
||||
as a block, done here so that multiple routines can use it */
|
||||
typedef struct ENVOY_TIMER_32_S {
|
||||
struct ENVOY_TIMER_S timer;
|
||||
bits32_t id;
|
||||
} ENVOY_TIMER_32_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/* timer calls
|
||||
*/
|
||||
|
||||
void envoy_tm_init __((ENVOY_TIMER_T *)); /* init timer */
|
||||
int envoy_tm_set __((ENVOY_TIMER_T *, bits32_t));/* set timer */
|
||||
int envoy_tm_cancel __((ENVOY_TIMER_T *)); /* cancel timer */
|
||||
|
||||
/* global root pointer and init routine */
|
||||
#if INSTALL_ENVOY_SNMP_LOCK
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_TimerLock);
|
||||
#endif
|
||||
extern ENVOY_TIMER_T *envoy_timer_list;
|
||||
void envoy_timer_init __((void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* etimer_inc */
|
||||
@@ -0,0 +1,196 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/localio.h,v 1.3 2003/01/15 13:58:56 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Copyright 1986-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: localio.h,v $
|
||||
* Revision 1.3 2003/01/15 13:58:56 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:50:40 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:05 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:34 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:33 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:56:08 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:14 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.3 1998/06/22 03:11:10 sar
|
||||
* Changed the type used for lengths in localio. We now use ALENGTH_Ts
|
||||
* to make it match the rest of the code and keep compilers happy
|
||||
*
|
||||
* Revision 8.2 1998/02/25 15:21:23 sra
|
||||
* Finish moving types.h, bug.h, and bugdef.h to common/h/.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:36 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:25 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.3 1997/03/20 06:48:11 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.2 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.1 1997/01/16 20:46:35 sar
|
||||
* changed uchar to bits8_t
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.1 1996/01/10 16:23:25 sar
|
||||
* Removed some no_pp stuff
|
||||
* Added the start of buffer macro
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:43 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.3 1993/05/19 20:07:52 sar
|
||||
* tiding up types to make compilers happy, (timestamps to UINT_32_T,
|
||||
* sizes to ALENGTH_T).
|
||||
*
|
||||
* Revision 3.2 1993/02/17 20:48:03 sar
|
||||
* Added Lcl_Next - macro: get current position in buffer.
|
||||
* Added Lcl_Dup - defin: duplicate a lcl_file.
|
||||
* Changed Lcl_Size - macro: corrected lbuf->next to lbuf_next.
|
||||
*
|
||||
* Revision 3.1 92/07/31 11:54:43 dab
|
||||
* Added Lcl_Size().
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.101 92/02/05 18:49:59 dab
|
||||
* In lcl_* macros don't cast L as (LCL_FILE *) because it already
|
||||
* should be.
|
||||
* Made sure all returns of Lcl_Getc() were the same type.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:46 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:26 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:26
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.2 19 Sep 1988 17:48:36
|
||||
* Added header and version identification lines. No code changes.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(localio_inc))
|
||||
#define localio_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
/* Get the standard types */
|
||||
#if !defined(EPILOGUE_TYPES_H)
|
||||
#include <wrn/wm/common/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct LCL_FILE_S
|
||||
{
|
||||
bits8_t lcl_flags;
|
||||
bits8_t *lbuf_start;
|
||||
bits8_t *lbuf_next;
|
||||
bits8_t *lbuf_end; /* Address AFTER last byte */
|
||||
} LCL_FILE;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define LCL_MALLOC 0x01 /* LCL_FILE was malloc-ed at open */
|
||||
#define LCL_EOF 0x80 /* EOF encountered */
|
||||
|
||||
/* Start of buffer */
|
||||
#define Lcl_Start(L) (L)->lbuf_start
|
||||
|
||||
#define Lcl_Eof(L) (((L)->lcl_flags&LCL_EOF)?-1:0)
|
||||
|
||||
/* Current position in stream. */
|
||||
#define Lcl_Tell(L) (ALENGTH_T)((L)->lbuf_next - (L)->lbuf_start)
|
||||
|
||||
/* Address of current positon in buffer */
|
||||
#define Lcl_Next(L) (L)->lbuf_next
|
||||
|
||||
/* Amount of data left in stream. */
|
||||
#define Lcl_Size(L) (ALENGTH_T)((L)->lbuf_end - (L)->lbuf_next)
|
||||
|
||||
#define GETC_MACRO
|
||||
#if defined(GETC_MACRO)
|
||||
/* The following is an macro version of this routine Lcl_Getc */
|
||||
#define Lcl_Getc(L) ( (((L)->lcl_flags & LCL_EOF) ? -1 : \
|
||||
(((L)->lbuf_next < (L)->lbuf_end) ? \
|
||||
(int)(*((L)->lbuf_next++)) : \
|
||||
(((L)->lcl_flags |= LCL_EOF), -1))))
|
||||
#endif /* GETC_MACRO */
|
||||
|
||||
extern LCL_FILE *Lcl_Open (LCL_FILE *, bits8_t *, ALENGTH_T);
|
||||
extern void Lcl_Close (LCL_FILE *);
|
||||
#if !defined(GETC_MACRO)
|
||||
extern int Lcl_Getc (LCL_FILE *);
|
||||
#endif /* GETC_MACRO */
|
||||
extern int Lcl_Peekc (LCL_FILE *);
|
||||
extern ALENGTH_T Lcl_Read (LCL_FILE *, bits8_t *, ALENGTH_T);
|
||||
extern int Lcl_Seek (LCL_FILE *, ALENGTH_T, int);
|
||||
extern ALENGTH_T Lcl_Resize (LCL_FILE *, ALENGTH_T, int);
|
||||
extern LCL_FILE *Lcl_Dup (LCL_FILE *, LCL_FILE *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,567 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/mib.h,v 1.2 2001/11/06 21:35:02 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: mib.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:02 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.9.4.1 2001/08/24 14:11:25 josh
|
||||
* make sure that standard declaration of NODE_NT zeroes all fields
|
||||
*
|
||||
* Revision 9.9 2001/04/11 20:12:00 josh
|
||||
* merging changes from the kingfisher branch back onto
|
||||
* the trunk
|
||||
*
|
||||
* Revision 9.8 2001/01/19 22:22:05 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.7.2.2 2001/03/12 22:07:54 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.7.2.1 2000/10/13 21:17:33 josh
|
||||
* function prototypes and static declarations to eliminate warnings
|
||||
* from the Tornado compiler
|
||||
*
|
||||
* Revision 9.7 2000/03/17 19:48:35 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.6 2000/03/09 20:58:33 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.5 2000/03/09 16:56:42 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.4 1999/12/23 14:47:26 josh
|
||||
* cleaning up code per Shawn's comments -- removing extraneous
|
||||
* comments and doing proxy check before notify check
|
||||
*
|
||||
* Revision 9.3 1999/11/12 23:20:28 josh
|
||||
* fixing synchronous function prototypes
|
||||
*
|
||||
* Revision 9.2 1999/10/26 20:07:33 josh
|
||||
* fix indeterminate function prototyping with forward declarations
|
||||
*
|
||||
* Revision 9.1 1999/05/24 20:12:11 josh
|
||||
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
|
||||
* to avoid C++ compiler errors.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:15 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:40 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:26 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.6 1997/10/29 01:33:28 sar
|
||||
* Only define the two character macros ("NO", "RW" etc) if the user
|
||||
* asks for them via an installation option.
|
||||
*
|
||||
* Revision 7.5 1997/10/22 03:07:29 sar
|
||||
* Mofied the agentx and older subagent schemes install options
|
||||
*
|
||||
* Revision 7.4 1997/10/16 00:25:17 sar
|
||||
* Primarily this set of modifications is for the agentx protocol.
|
||||
* Most of the work was in the agentx.h and ax_mth.h files. Most
|
||||
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
|
||||
* to their structures and snmp got some new lock macros.
|
||||
*
|
||||
* One other change of note was the modification of continue
|
||||
* processing. Previously we called a specific continue routine
|
||||
* directly, now we store a pointer to the corret continue
|
||||
* function in the snmp packet structure and call that. We include
|
||||
* macros for backwards compatibility.
|
||||
*
|
||||
* Revision 7.3 1997/09/16 19:19:23 sar
|
||||
* Added the NT macros for leaves and nodes, these add a flag
|
||||
* word to allow the mib compiler to set some flags in the mib
|
||||
* tree structure. Emissary 7.0 can make use of these macros.
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:13 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:58 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.4 1995/05/03 21:01:22 sar
|
||||
* Added CREATE_ACCESS & NOTIFY_ACCESS
|
||||
*
|
||||
* Revision 5.3 1995/03/24 17:35:34 sar
|
||||
* Added scalar/tabular arg to the leaf_asy and leaf_com macros, currently
|
||||
* we just throw it away.
|
||||
*
|
||||
* Revision 5.2 1995/03/20 23:11:33 sar
|
||||
* Added the ASY_*PROC_T method routines
|
||||
* Updated the MIBLEAF_T structure to use the async method routine typedefs
|
||||
* Added a compatibility structure for backwards compatibility
|
||||
* Added a new series of macros to populate the mibleaf and compat structure.
|
||||
*
|
||||
* Revision 5.1 1994/08/04 22:05:29 sar
|
||||
* Added multiple mib tree capability, including macros to translate the
|
||||
* old apis into the new api's
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.3 1994/04/29 20:06:04 sar
|
||||
* Added LEAF_INACTIVE flag and modified calling sequence for Find_Node.
|
||||
*
|
||||
* Revision 4.2 1994/02/01 23:37:07 sar
|
||||
* Added flags for use with the Find, Add and Remove_Node routines.
|
||||
*
|
||||
* Revision 4.1 1993/09/30 19:32:16 sar
|
||||
* Added a definition for TEST_CREATE in the list of defines for
|
||||
* the form parameter to the testproc routine. TEST_CREATE specified
|
||||
* that this call is to check if the given object can be created.
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.2 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.1 1993/03/02 18:16:06 dab
|
||||
* Removed __() macro since this is defined in <types.h>
|
||||
*
|
||||
* Revision 3.0 1992/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.103 92/01/30 14:00:17 dab
|
||||
* Added function parameter prototypes for the test, get, set, and next
|
||||
* functions. Also added casts inthe LEAF and LEAFM macros to cast the
|
||||
* routines to those prototypes.
|
||||
*
|
||||
* Revision 2.102 91/12/05 15:02:59 dab
|
||||
* LEAF macro initializes mib view masks to 0xFFFFFFFF instead of just 0xFF.
|
||||
*
|
||||
* Revision 2.101 91/11/07 09:37:23 dab
|
||||
* Made the view and write masks be 32 bits.
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:47 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:28 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:24
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.8 24 Sep 1989 22:06:34
|
||||
* Renamed mib_root to mib_root_node to support the MIB compiler.
|
||||
*
|
||||
* Rev 1.7 11 Jan 1989 11:59:48
|
||||
* Updated copyright dates.
|
||||
*
|
||||
* Rev 1.6 11 Jan 1989 11:09:20
|
||||
* Added definitions of find_object_node() and find_next_object() for non-
|
||||
* ANSI compilers.
|
||||
*
|
||||
* Rev 1.5 10 Oct 1988 21:47:00
|
||||
* Reorganized source modules
|
||||
*
|
||||
* Rev 1.4 21 Sep 1988 16:34:00
|
||||
* Revised spelling to conform to the usage "MGMT" in the MIB.
|
||||
*
|
||||
* Rev 1.3 20 Sep 1988 15:50:10
|
||||
* Revised END_OF_ARC macro to avoid an improper type cast.
|
||||
*
|
||||
* Rev 1.2 19 Sep 1988 19:56:06
|
||||
* Revised MIBARC structure and ARC macro to avoid casting structure
|
||||
* pointers to a (char *) which, on machines like the Cray, could
|
||||
* destroy the meaning of the pointer.
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:06
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:18
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(mib_inc))
|
||||
#define mib_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
/* Definitions for "form" parameter to the "testproc" found in leaf nodes */
|
||||
#define TEST_GET 0
|
||||
#define TEST_SET 1
|
||||
#define TEST_CREATE 2
|
||||
|
||||
/* Definitions for node_type in MIBNODE_T and MIBLEAF_T */
|
||||
#define NODE_TYPE 0x01
|
||||
#define INNER_NODE 0x00
|
||||
#define LEAF_NODE 0x01
|
||||
#define REMOVABLE 0x02
|
||||
#define REPLACEABLE 0x04
|
||||
#define SYSTEM_OWNED 0x08
|
||||
#define NODE_DYNAMIC 0x10
|
||||
#define LEAF_DYNAMIC 0x10
|
||||
#define ARC_DYNAMIC 0x20
|
||||
#define COOKIE_DYNAMIC 0x20
|
||||
#define LEAF_INACTIVE 0x40
|
||||
#define AGENTX_LEAF 0x80
|
||||
|
||||
struct SNMP_PKT_S;
|
||||
struct VB_S;
|
||||
typedef void ASY_TESTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
|
||||
typedef void ASY_GETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
|
||||
typedef void ASY_SETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
|
||||
typedef void ASY_NEXTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
|
||||
|
||||
typedef int TESTPROC_T __((int form, OIDC_T lastmatch, int tcount,
|
||||
OIDC_T *tlist, char *cookie,
|
||||
struct SNMP_PKT_S *pktp, int indx));
|
||||
typedef INT_32_T GETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
char *cookie,
|
||||
struct SNMP_PKT_S *pktp));
|
||||
typedef void SETPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
char *cookie, INT_32_T value,
|
||||
struct SNMP_PKT_S *pktp, int vb_index));
|
||||
typedef int NEXTPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
OIDC_T *rlist, char *cookie,
|
||||
struct SNMP_PKT_S *pktp));
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* Define a MIB leaf node */
|
||||
typedef struct MIBLEAF_S
|
||||
{
|
||||
unsigned short node_type; /* See above */
|
||||
OCTET_T expected_tag; /* VT_xxx from snmp.h */
|
||||
OCTET_T access_type; /* See below */
|
||||
|
||||
ASY_TESTPROC_T *testproc; /* Routine to check whether the */
|
||||
/* indicated data object exists */
|
||||
ASY_GETPROC_T *getproc; /* Routine to get the data */
|
||||
ASY_SETPROC_T *setproc; /* Routine to set the data */
|
||||
ASY_NEXTPROC_T *nextproc; /* Routine to locate "next" obj id */
|
||||
char * user_cookie; /* Value to pass to unchanged */
|
||||
UINT_16_T locator; /* The user can define any value for*/
|
||||
/* this field. It is useful to */
|
||||
/* give easy to handle names to */
|
||||
/* leaves. */
|
||||
UINT_32_T view_mask; /* A mask of the views of which this*/
|
||||
/* leaf is a part. */
|
||||
UINT_32_T write_mask; /* That subset of view_mask in which*/
|
||||
/* is potentially writable. */
|
||||
#if INSTALL_ENVOY_AGENTX_MASTER
|
||||
bits32_t session_id; /* session for this object */
|
||||
bits16_t ref_count; /* reference count */
|
||||
bits8_t timeout; /* timeout period */
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
char * object_name; /* FOR DEBUGGING */
|
||||
#endif
|
||||
} MIBLEAF_T;
|
||||
|
||||
/* Bit values for access_type */
|
||||
#define READ_ACCESS 0x01
|
||||
#define WRITE_ACCESS 0x02
|
||||
#define CREATE_ACCESS 0x04
|
||||
#define NOTIFY_ACCESS 0x08
|
||||
#define READ_WRITE_ACCESS (READ_ACCESS | WRITE_ACCESS)
|
||||
#define READ_CREATE_ACCESS (READ_ACCESS | WRITE_ACCESS | CREATE_ACCESS)
|
||||
|
||||
#if INSTALL_ENVOY_TWO_CHAR_MACROS
|
||||
#define RO READ_ACCESS /* READ ONLY ACCESS */
|
||||
#define WO WRITE_ACCESS /* WRITE ONLY ACCESS */
|
||||
#define RW (READ_ACCESS | WRITE_ACCESS) /* READ/WRITE ACCESS */
|
||||
#define RC (READ_ACCESS | WRITE_ACCESS | CREATE_ACCESS) /* READ/CREATE */
|
||||
#define NO NOTIFY_ACCESS /* NOTIFY ONLY ACCESS */
|
||||
#endif
|
||||
|
||||
/* Bit values for scalar vs tabular type */
|
||||
#define SCALAR 0x80
|
||||
#define TABULAR 0x00
|
||||
|
||||
/* maximum size for a reference count */
|
||||
#define AX_MAX_REF_COUNT 0xFFFF
|
||||
|
||||
/* Define an MIB internal (or root) node */
|
||||
typedef struct MIBNODE_S
|
||||
{
|
||||
unsigned short node_type; /* See above */
|
||||
struct MIBARC_S *arcs; /* Descendents from this node */
|
||||
#if INSTALL_ENVOY_AGENTX_MASTER
|
||||
MIBLEAF_T *leaf; /* leaf for this node */
|
||||
#endif
|
||||
} MIBNODE_T;
|
||||
|
||||
/* Define a pointer from a node to subsidiary node or a leaf */
|
||||
/* These structures are aggregated into an array. */
|
||||
/* THE LAST ELEMENT IN SUCH AN ARRAY MUST HAVE A NULL POINTER. */
|
||||
typedef struct MIBARC_S
|
||||
{
|
||||
OIDC_T id; /* Object identifier component */
|
||||
struct MIBARC_S *nodep; /* The descendent node/leaf */
|
||||
} MIBARC_T;
|
||||
|
||||
/* Define a cookie structure to hold old style method routines for use with
|
||||
the backwards compatibility method routines */
|
||||
typedef struct COMPAT_ROUTINES_S
|
||||
{
|
||||
TESTPROC_T * testproc;
|
||||
NEXTPROC_T * nextproc;
|
||||
GETPROC_T * getproc;
|
||||
SETPROC_T * setproc;
|
||||
char * cookie;
|
||||
} COMPAT_ROUTINES_T;
|
||||
|
||||
#define MIB_ISO 1 /* Level 0 - ISO *IS* #1 by fiat (!!) */
|
||||
#define MIB_CCITT 2 /* Level 0 */
|
||||
#define MIB_JOINT_ISO_CCITT 3 /* Level 0 */
|
||||
#define MIB_ORG 3 /* Level 1 - {ISO 3} */
|
||||
#define MIB_DOD 6 /* Level 2 - {ORG 6} */
|
||||
#define MIB_INTERNET 1 /* Level 3 - {DOD 1} */
|
||||
|
||||
|
||||
#define MIB_DIRECTORY 1 /* Level 4 - {INTERNET 1} */
|
||||
#define MIB_MGMT 2 /* Level 4 - {INTERNET 2} */
|
||||
#define MIB_MIB2 1 /* Level 5 - {MGMT 1} */
|
||||
#define MIB_MIB1 1 /* Level 5 - {MGMT 1} */
|
||||
#define MIB_SYSTEM 1 /* Level 6 - {MIB 1} */
|
||||
#define MIB_INTERFACES 2 /* Level 6 - {MIB 2} */
|
||||
#define MIB_AT 3 /* Level 6 - {MIB 3} */
|
||||
#define MIB_IP 4 /* Level 6 - {MIB 4} */
|
||||
#define MIB_ICMP 5 /* Level 6 - {MIB 5} */
|
||||
#define MIB_TCP 6 /* Level 6 - {MIB 6} */
|
||||
#define MIB_UDP 7 /* Level 6 - {MIB 7} */
|
||||
#define MIB_EGP 8 /* Level 6 - {MIB 8} */
|
||||
|
||||
#define MIB_EXPERIMENTAL 3 /* Level 4 - {INTERNET 3} */
|
||||
#define MIB_IETF 1 /* Level 5 - {EXPERIMENTAL 1} */
|
||||
#define MIB_PRIVATE 4 /* Level 4 - {INTERNET 4} */
|
||||
#define MIB_ENTERPRISE 1 /* Level 5 - {PRIVATE 1} */
|
||||
|
||||
|
||||
#define ARC(ID,NODE) {ID, (struct MIBARC_S *)&NODE}
|
||||
#define END_OF_ARC_LIST {0, (struct MIBARC_S *)0}
|
||||
#define NODE(NAME, ARCLIST) {INNER_NODE, ARCLIST}
|
||||
#if INSTALL_ENVOY_AGENTX_MASTER
|
||||
#define NODE_NT(NAME, NT, ARCLIST) {(INNER_NODE | NT), ARCLIST, 0}
|
||||
#else
|
||||
#define NODE_NT(NAME, NT, ARCLIST) {(INNER_NODE | NT), ARCLIST}
|
||||
#endif
|
||||
#define SNMP_NULLPROC (int (*)())0
|
||||
|
||||
/* The LEAF macro is for release 1 mib.c and MIB Compiler */
|
||||
#define LEAF(NAME, VT, ACCESS, TESTP, GETP, SETP, NXTP, COOKIE) \
|
||||
{LEAF_NODE, VT, ACCESS, \
|
||||
(TESTPROC_T *)TESTP, (GETPROC_T *)GETP, \
|
||||
(SETPROC_T *)SETP, (NEXTPROC_T *)NXTP, \
|
||||
(char *)COOKIE, 0, 0xFFFFFFFFL, 0xFFFFFFFFL}
|
||||
|
||||
/* The LEAFM macro is for release 2 mib.c and MIB Compiler */
|
||||
#define LEAFM(NM, VT, ACC, TSTP, GETP, SETP, NXTP, CKE, LOC, VMSK, WMSK) \
|
||||
{LEAF_NODE, VT, ACC, \
|
||||
(TESTPROC_T *)TSTP, (GETPROC_T *)GETP, \
|
||||
(SETPROC_T *)SETP, (NEXTPROC_T *)NXTP, \
|
||||
(char *)CKE, LOC, VMSK, WMSK }
|
||||
|
||||
/* The LEAF_ASYS macro is for release envoy release 6 and is for use with
|
||||
the async routines, it tags the leaf as static */
|
||||
#define LEAF_ASYS(LN, NM, VT, AC, TB, TST, GET, SET, NEX, CKE, LOC, VMK, WMK) \
|
||||
STATIC MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
|
||||
(ASY_TESTPROC_T *)TST, (ASY_GETPROC_T *)GET, \
|
||||
(ASY_SETPROC_T *)SET, (ASY_NEXTPROC_T *)NEX, \
|
||||
(char *)CKE, LOC, VMK, WMK }
|
||||
|
||||
/* The LEAF_ASY macro is for release envoy release 6 and is for use with
|
||||
the async routines */
|
||||
#define LEAF_ASY(LN, NM, VT, AC, TB, TST, GET, SET, NEX, CKE, LOC, VMK, WMK) \
|
||||
MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
|
||||
(ASY_TESTPROC_T *)TST, (ASY_GETPROC_T *)GET, \
|
||||
(ASY_SETPROC_T *)SET, (ASY_NEXTPROC_T *)NEX, \
|
||||
(char *)CKE, LOC, VMK, WMK }
|
||||
|
||||
/* The LEAFCOMS macro is for envoy release 6 and is for use with the async
|
||||
compatibility routines. The compat routines allow older non-async method
|
||||
routines to be run from a newer async engine */
|
||||
#define LEAF_COMS(LN, CN, NM, VT, AC, TB, TS, GT, ST, NX, CKE, LOC, VMK, WMK) \
|
||||
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
|
||||
(GETPROC_T *)GT, (SETPROC_T *)ST, \
|
||||
(char *)CKE }; \
|
||||
STATIC MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
|
||||
(ASY_TESTPROC_T *)async_compat_test, \
|
||||
(ASY_GETPROC_T *)async_compat_get, \
|
||||
(ASY_SETPROC_T *)async_compat_set, \
|
||||
(ASY_NEXTPROC_T *)async_compat_next, \
|
||||
(char *)&CN, LOC, VMK, WMK }
|
||||
|
||||
#define LEAF_COM(LN, CN, NM, VT, AC, TB, TS, GT, ST, NX, CKE, LOC, VMK, WMK) \
|
||||
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
|
||||
(GETPROC_T *)GT, (SETPROC_T *)ST, \
|
||||
(char *)CKE }; \
|
||||
MIBLEAF_T LN = {LEAF_NODE, VT, AC, \
|
||||
(ASY_TESTPROC_T *)async_compat_test, \
|
||||
(ASY_GETPROC_T *)async_compat_get, \
|
||||
(ASY_SETPROC_T *)async_compat_set, \
|
||||
(ASY_NEXTPROC_T *)async_compat_next, \
|
||||
(char *)&CN, LOC, VMK, WMK }
|
||||
|
||||
/* The LEAF NT macros are for emissary release 7 and include a flag
|
||||
argument to allow setting of the removable class flags */
|
||||
#define LEAF_NT_ASYS(LN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
|
||||
STATIC MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
|
||||
(ASY_TESTPROC_T *)TS, (ASY_GETPROC_T *)GT, \
|
||||
(ASY_SETPROC_T *)ST, (ASY_NEXTPROC_T *)NX, \
|
||||
(char *)CK, LC, VM, WM }
|
||||
|
||||
#define LEAF_NT_ASY(LN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
|
||||
MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
|
||||
(ASY_TESTPROC_T *)TS, (ASY_GETPROC_T *)GT, \
|
||||
(ASY_SETPROC_T *)ST, (ASY_NEXTPROC_T *)NX, \
|
||||
(char *)CK, LC, VM, WM }
|
||||
|
||||
/* The COM macros are for use with the async compatibility routines.
|
||||
The compat routines allow older non-async method routines to
|
||||
be run from a newer async engine */
|
||||
#define LEAF_NT_COMS(LN, CN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
|
||||
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
|
||||
(GETPROC_T *)GT, (SETPROC_T *)ST, \
|
||||
(char *)CK }; \
|
||||
STATIC MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
|
||||
(ASY_TESTPROC_T *)async_compat_test, \
|
||||
(ASY_GETPROC_T *)async_compat_get, \
|
||||
(ASY_SETPROC_T *)async_compat_set, \
|
||||
(ASY_NEXTPROC_T *)async_compat_next, \
|
||||
(char *)&CN, LC, VM, WM }
|
||||
|
||||
#define LEAF_NT_COM(LN, CN, NT, NM, VT, AC, TB, TS, GT, ST, NX, CK, LC, VM, WM) \
|
||||
STATIC COMPAT_ROUTINES_T CN = {(TESTPROC_T *)TS, (NEXTPROC_T *)NX, \
|
||||
(GETPROC_T *)GT, (SETPROC_T *)ST, \
|
||||
(char *)CK }; \
|
||||
MIBLEAF_T LN = {(LEAF_NODE | NT), VT, AC, \
|
||||
(ASY_TESTPROC_T *)async_compat_test, \
|
||||
(ASY_GETPROC_T *)async_compat_get, \
|
||||
(ASY_SETPROC_T *)async_compat_set, \
|
||||
(ASY_NEXTPROC_T *)async_compat_next, \
|
||||
(char *)&CN, LC, VM, WM }
|
||||
|
||||
|
||||
|
||||
typedef struct MIBLOC_S
|
||||
{
|
||||
UINT_16_T ml_flags;
|
||||
OIDC_T ml_last_match;
|
||||
/* The following item splits out the "instance" part of the */
|
||||
/* full object identifier. The number of components in the */
|
||||
/* "base" part (i.e. the path to the leaf may be derived by */
|
||||
/* vb_obj_id.num_components - ml_base_objid.num_components and */
|
||||
/* the list of components being taken directly from */
|
||||
/* vb_obj_id.component_list. */
|
||||
OBJ_ID_T ml_remaining_objid;
|
||||
union {
|
||||
MIBLEAF_T *mlleaf_u;
|
||||
MIBNODE_T *mlnode_u;
|
||||
} mbl_u;
|
||||
} MIBLOC_T;
|
||||
#define ml_leaf mbl_u.mlleaf_u
|
||||
#define ml_node mbl_u.mlnode_u
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/* Values for ml_flags */
|
||||
#define ML_IS_LEAF 0x01
|
||||
|
||||
/* Determine what the default root node will be */
|
||||
#ifdef ENVOY_DEFAULT_MIB_ROOT_NODE
|
||||
#define ENVOY_MIB_ROOT_NODE ENVOY_DEFAULT_MIB_ROOT_NODE
|
||||
extern MIBNODE_T ENVOY_DEFAULT_MIB_ROOT_NODE;
|
||||
#else
|
||||
#define ENVOY_MIB_ROOT_NODE mib_root_node
|
||||
extern MIBNODE_T mib_root_node;
|
||||
#endif
|
||||
|
||||
extern INT_32_T Find_Node_From_Root __((MIBNODE_T *root,
|
||||
OBJ_ID_T *objp,
|
||||
MIBNODE_T **npp));
|
||||
|
||||
extern int Add_Node_From_Root __((MIBNODE_T *root,
|
||||
OBJ_ID_T *objp,
|
||||
MIBNODE_T *anode,
|
||||
MIBNODE_T **rnode));
|
||||
|
||||
extern MIBNODE_T * Remove_Node_From_Root __((MIBNODE_T *root,
|
||||
OBJ_ID_T *objp));
|
||||
|
||||
#if (INSTALL_ENVOY_AGENTX_MASTER)
|
||||
extern sbits32_t Find_Leaf_From_Root __((MIBNODE_T *mibroot,
|
||||
OBJ_ID_T *objid,
|
||||
MIBLEAF_T **mibleaf));
|
||||
|
||||
extern int AX_Add_Leaf_From_Root __((MIBNODE_T *mibroot,
|
||||
OBJ_ID_T *objp,
|
||||
MIBLEAF_T *add_leaf,
|
||||
MIBLEAF_T **rem_leaf));
|
||||
|
||||
extern MIBLEAF_T * AX_Remove_Leaf_From_Root __((MIBNODE_T *mibroot,
|
||||
OBJ_ID_T *objid));
|
||||
|
||||
#endif /* #if (INSTALL_ENVOY_AGENTX_MASTER) */
|
||||
|
||||
#define Find_Node(O, N) Find_Node_From_Root (0, O, N)
|
||||
|
||||
#define Add_Node(O, A, R) Add_Node_From_Root (0, O, A, R)
|
||||
|
||||
#define Remove_Node(O) Remove_Node_From_Root (0, O)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* mib_inc */
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/ntfy_chk.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: ntfy_chk.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:03 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:22 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6.4.2 2001/08/07 18:33:56 josh
|
||||
* adding support for SNMPv1/v2c/v3 coexistence to SNMP Notify code
|
||||
*
|
||||
* Revision 9.6.4.1 2001/06/28 18:22:56 josh
|
||||
* Seeding the Cormorant branch with the code from the old
|
||||
* cormorant branch
|
||||
*
|
||||
* Revision 9.6 2001/04/11 21:01:49 josh
|
||||
* we are overwriting the trunk's copy of this file with
|
||||
* the file from the kingfisher branch
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:05 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/07/12 18:36:41 josh
|
||||
* additional flags and prototypes
|
||||
*
|
||||
* Revision 9.3.4.1 2001/04/11 20:48:30 josh
|
||||
* moving cormorant-specific changes off to the cormorant
|
||||
* branch
|
||||
*
|
||||
* Revision 9.3.2.3 2001/03/12 22:07:55 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.3.2.2 2000/12/13 20:51:07 josh
|
||||
* SNMP_Send_Notify_Name() now obsoletes SNMP_Send_Notify()
|
||||
* logic of SNMP_Send_Notify_Name() is improved to help prevent nesting of
|
||||
* locks and generally smooth out flow of data
|
||||
*
|
||||
* Revision 9.3.2.1 2000/09/21 21:14:53 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:35 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:34 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:57:00 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1999/10/21 20:43:34 josh
|
||||
* updating version stamps
|
||||
*
|
||||
* Revision 1.5 1999/10/18 22:49:52 josh
|
||||
* patches to method routines and related code
|
||||
*
|
||||
* Revision 1.4 1999/09/30 22:07:57 josh
|
||||
* cleaning up and changing prototypes to match new cookie scheme
|
||||
*
|
||||
* Revision 1.3 1999/09/27 21:11:44 josh
|
||||
* fixing nits, rewriting engine id <--> address code, adding installation
|
||||
* option
|
||||
*
|
||||
* Revision 1.2 1999/09/14 19:41:02 josh
|
||||
* completed code for sending v3 notifies
|
||||
*
|
||||
* Revision 1.1 1999/09/08 18:10:51 josh
|
||||
* functions to build a target list for a given notify
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,15sep09,y_t fix for WIND00181371
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(ntfy_chk_inc))
|
||||
#define ntfy_chk_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_trgt_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_trgt.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_ntfy_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_ntfy.h>
|
||||
#endif
|
||||
|
||||
#define tag_whitespace(TL) \
|
||||
((((TL) == ' ') || ((TL) == '\x9') || \
|
||||
((TL) == '\xd') || ((TL) == '\xa')) ? 1 : 0)
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct TARGET_LIST_S
|
||||
{
|
||||
struct TARGET_LIST_S *next;
|
||||
SNMP_TARGET_ADDR_T *target;
|
||||
/* information passed in by the caller */
|
||||
SNMP_PKT_T *pktp;
|
||||
VBL_T *vblp;
|
||||
EBUFFER_T context;
|
||||
/* destination address */
|
||||
SNMPADDR_T for_addr;
|
||||
/* information pulled out of the target_addr object */
|
||||
OBJ_ID_T tdomain;
|
||||
EBUFFER_T taddress;
|
||||
bits32_t timeout;
|
||||
bits16_t retry_count;
|
||||
bits32_t mms;
|
||||
/* information pulled out of the target_params object */
|
||||
int ptype;
|
||||
int mp_model;
|
||||
int sec_model;
|
||||
EBUFFER_T sec_name;
|
||||
int sec_level;
|
||||
bits16_t flags;
|
||||
#define SNMP_TARGET_LIST_SEND_NOTIFY 0x0001
|
||||
#define SNMP_TARGET_LIST_SEND_PROBE 0x0002
|
||||
#define SNMP_TARGET_LIST_SEND_INFORM 0x0004
|
||||
#define SNMP_TARGET_LIST_SEND_PROXY_PROBE 0x0008
|
||||
#define SNMP_TARGET_LIST_INFOK 0x0010
|
||||
} TARGET_LIST_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
extern void init_target_list __((TARGET_LIST_T *));
|
||||
extern void clean_target_list __((TARGET_LIST_T *));
|
||||
extern TARGET_LIST_T *build_target_list __((SNMP_NOTIFY_T *, VBL_T *));
|
||||
extern int taglist_check __((EBUFFER_T *, EBUFFER_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(ntfy_chk_inc))*/
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/objectid.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: objectid.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:03 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.3 2001/01/19 22:22:05 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.2 2000/03/17 19:48:36 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:57:20 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:16 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:42 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:27 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:14 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:48 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.1 1995/03/20 23:11:33 sar
|
||||
* Minor cleanup.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.4 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.3 1993/04/27 21:06:48 sar
|
||||
* added copy_object_id which does a straight copy, beware free one copy
|
||||
* while using the other.
|
||||
*
|
||||
* Revision 3.2 1993/04/22 20:14:13 sar
|
||||
* Updating of macros and defines to use new naming scheme and get the
|
||||
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
|
||||
* for example).
|
||||
*
|
||||
* Revision 3.1 1993/02/17 20:49:21 sar
|
||||
* Added no_pp definition (#define __(x) x stuff)
|
||||
* Added init_object_id - macro: init an OBJ_ID_T to 0 components and 0 list.
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 2.100 91/08/09 14:09:47 dab
|
||||
* Update version.
|
||||
*
|
||||
* Revision 1.1 91/07/30 02:24:29 romkey
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
* Rev 2.0 31 Mar 1990 15:11:20
|
||||
* Release 2.00
|
||||
*
|
||||
* Rev 1.2 11 Jan 1989 12:46:46
|
||||
* Moved Clean_Obj_ID() to objectid.c
|
||||
*
|
||||
* Rev 1.1 19 Sep 1988 17:27:08
|
||||
* Made changes to make the Sun C compiler happy.
|
||||
*
|
||||
* Rev 1.0 12 Sep 1988 10:46:20
|
||||
* Initial revision.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(objectid_inc))
|
||||
#define objectid_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#define clone_object_id(O, N) build_object_id( \
|
||||
((OBJ_ID_T *)(O))->num_components, \
|
||||
((OBJ_ID_T *)(O))->component_list, N)
|
||||
|
||||
#define init_object_id(O) ((OBJ_ID_T *)(O))->num_components = 0; \
|
||||
((OBJ_ID_T *)(O))->component_list = 0;
|
||||
|
||||
#define copy_object_id(O, N) \
|
||||
(((OBJ_ID_T *)(N))->num_components = ((OBJ_ID_T *)(O))->num_components, \
|
||||
((OBJ_ID_T *)(N))->component_list = ((OBJ_ID_T *)(O))->component_list)
|
||||
|
||||
extern int build_object_id __((int, OIDC_T *, OBJ_ID_T *));
|
||||
extern void Clean_Obj_ID __((OBJ_ID_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* objectid_inc */
|
||||
@@ -0,0 +1,118 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/proxy.h,v 1.3 2001/11/06 21:50:40 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: proxy.h,v $
|
||||
* Revision 1.3 2001/11/06 21:50:40 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:03 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6 2001/01/19 22:22:05 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:37 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:34 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 16:57:34 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 2000/02/29 20:40:49 josh
|
||||
* #ifdefs so we don't have semicolons sitting on lines alone in include
|
||||
* files (the ARM compiler hates that).
|
||||
*
|
||||
* Revision 9.1 1999/11/01 19:56:52 josh
|
||||
* cleaning up initializations to keep extra files out of code when not
|
||||
* in use
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:16 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/08/12 04:52:14 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(proxy_ini_inc))
|
||||
#define proxy_ini_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmp_inc))
|
||||
#include <wrn/wm/snmp/engine/snmp.h>
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_LOCK
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_ProxyLock);
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct PROXY_CB_S
|
||||
{
|
||||
struct PROXY_CB_S *next;
|
||||
UINT_32_T indx;
|
||||
UINT_32_T reqid;
|
||||
EBUFFER_T community;
|
||||
SNMPADDR_T loc_addr;
|
||||
SNMPADDR_T for_addr;
|
||||
IO_COMPLETE_T *io_comp;
|
||||
ERR_COMPLETE_T *err_comp;
|
||||
PTR_T async_cookie;
|
||||
ALENGTH_T maxpkt;
|
||||
ATVALUE_T pdu_type;
|
||||
INT_32_T original_version;
|
||||
} PROXY_CB_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
extern void envoy_proxy_init __((void));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(proxy_ini_inc)) */
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/proxy_tr.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: proxy_tr.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:03 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:06 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:37 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:34 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:57:46 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:17 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:43 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:27 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:15 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 1.1 1995/11/14 22:41:44 sar
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(proxy_tr_inc))
|
||||
#define proxy_tr_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_PROXY)
|
||||
typedef INT_32_T TRANSPORT_ROUTINE_T __((EBUFFER_T *, PTR_T));
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct PROXY_BLOCK_S
|
||||
{
|
||||
EBUFFER_T community;
|
||||
TRANSPORT_ROUTINE_T *transport_routine;
|
||||
PTR_T transport_block;
|
||||
} PROXY_BLOCK_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
extern INT_32_T SNMP_Proxy_V1_Translation __((SNMP_PKT_T *));
|
||||
|
||||
extern INT_32_T SNMP_Proxy_Trap_V1_To_V2 __((SNMP_PKT_T *));
|
||||
extern INT_32_T SNMP_Proxy_V2_Translation __((SNMP_PKT_T *));
|
||||
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_PROXY) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(proxy_tr_inc)) */
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/sendntfy.h,v 1.2 2001/11/06 21:35:03 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005, 2008 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: sendntfy.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:03 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.9 2001/04/11 20:42:56 josh
|
||||
* merge from the kingfisher branch
|
||||
*
|
||||
* Revision 9.8 2001/01/19 22:22:06 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.7 2000/07/12 18:39:31 josh
|
||||
* moving SNMP_Find_Matching_Engine_ID() to v3_eng.c -- appropriately
|
||||
* updating headers to correspond
|
||||
*
|
||||
* Revision 9.6 2000/06/09 14:54:12 josh
|
||||
* modifications due to new installation options, new proxy code
|
||||
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
|
||||
* be built with the target code
|
||||
*
|
||||
* Revision 9.5.2.3 2001/03/12 22:07:56 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.5.2.2 2001/01/19 21:32:24 josh
|
||||
* prototype for SNMP_Send_Notify_Name(). retrans_timer_exp() redefined
|
||||
* to static
|
||||
*
|
||||
* Revision 9.5.2.1 2000/09/21 21:14:53 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:38 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:34 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 16:58:01 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 2000/02/04 21:54:16 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.1 2000/01/05 21:15:28 josh
|
||||
* moving code around to make sure probe checks occur as long as an
|
||||
* engine ID is found
|
||||
*
|
||||
* Revision 9.0 1999/10/21 20:43:35 josh
|
||||
* updating version stamps
|
||||
*
|
||||
* Revision 1.8 1999/10/07 23:38:24 josh
|
||||
* added definition for snmpaddr to taddress conversion routine
|
||||
*
|
||||
* Revision 1.7 1999/10/03 00:18:08 josh
|
||||
* fixing retramit timer code -- setting handler correctly,
|
||||
* cleaning up some double-free situations, and putting locking in
|
||||
* where needed
|
||||
*
|
||||
* Revision 1.6 1999/09/30 22:07:58 josh
|
||||
* cleaning up and changing prototypes to match new cookie scheme
|
||||
*
|
||||
* Revision 1.5 1999/09/27 21:11:44 josh
|
||||
* fixing nits, rewriting engine id <--> address code, adding installation
|
||||
* option
|
||||
*
|
||||
* Revision 1.4 1999/09/15 16:17:39 josh
|
||||
* Linking the Retransmit Lock to the Retransmit list turns out to
|
||||
* be a lot more trouble than it's worth. We'll just refer to
|
||||
* it directly, a la SNMP_CoarseLock.
|
||||
*
|
||||
* Revision 1.3 1999/09/14 19:41:02 josh
|
||||
* completed code for sending v3 notifies
|
||||
*
|
||||
* Revision 1.2 1999/09/11 02:14:06 josh
|
||||
* updating header file -- created retrans block structures
|
||||
*
|
||||
* Revision 1.1 1999/09/01 21:56:04 josh
|
||||
* Code to do actual sending of Notifies
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,15jul08,y_z add ack,timeout callback in the RETRANS_COOKIE_T
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(sendntfy_inc))
|
||||
#define sendntfy_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(etimer_inc))
|
||||
#include <wrn/wm/snmp/engine/etimer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_trgt_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_trgt.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_ntfy_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_ntfy.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(ntfy_chk_inc))
|
||||
#include <wrn/wm/snmp/engine/ntfy_chk.h>
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_RETRANS_CLEANUP_INTERVAL
|
||||
#define ENVOY_RETRANS_CLEANUP_INTERVAL 500
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_SET_RETRANS_ID
|
||||
#define ENVOY_SET_RETRANS_ID(RET) \
|
||||
(RET)->retrans_id = root_retrans_block.next_retrans_id++
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct RETRANS_COOKIE_S
|
||||
{
|
||||
struct RETRANS_COOKIE_S *next;
|
||||
int ref_cnt;
|
||||
RETRANS_CLEANUP_T *cleanup_rtn;
|
||||
ACK_CALLBACK_T *ack_rtn;
|
||||
TIMEOUT_CALLBACK_T *timeout_rtn;
|
||||
PTR_T cookie;
|
||||
} RETRANS_COOKIE_T;
|
||||
|
||||
typedef struct SNMP_RETRANS_S
|
||||
{
|
||||
struct SNMP_RETRANS_S *next;
|
||||
SNMP_PKT_T *pktp;
|
||||
SNMPADDR_T for_addr;
|
||||
SNMPADDR_T loc_addr;
|
||||
bits16_t retry_count;
|
||||
bits32_t timeout;
|
||||
IO_COMPLETE_T *io_complete;
|
||||
ERR_COMPLETE_T *error_complete;
|
||||
RETRANS_COOKIE_T *cookie;
|
||||
bits32_t retrans_id;
|
||||
bits32_t time_sent;
|
||||
bits16_t flags;
|
||||
#define SNMP_RETRANS_FLAGS_EXPIRED 0x01
|
||||
#define SNMP_RETRANS_FLAGS_ACKNOWLEDGED 0x02
|
||||
#define SNMP_RETRANS_FLAGS_SENDING_PROBE 0x04
|
||||
bits16_t ref_cnt;
|
||||
TARGET_LIST_T *tlp;
|
||||
} SNMP_RETRANS_T;
|
||||
|
||||
typedef struct SNMP_RETRANS_ROOT_S
|
||||
{
|
||||
SNMP_RETRANS_T *retrans;
|
||||
bits32_t next_retrans_id;
|
||||
ENVOY_TIMER_T timer;
|
||||
} SNMP_RETRANS_ROOT_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
|
||||
extern RETRANS_COOKIE_T *root_retrans_cookie;
|
||||
extern SNMP_RETRANS_ROOT_T root_retrans_block;
|
||||
|
||||
extern int SNMP_Probe_Check __((SNMP_RETRANS_T *));
|
||||
extern void SNMP_Check_Retrans_List __((SNMP_PKT_T *));
|
||||
extern void SNMP_Send_Packet_Retransmit __((SNMP_PKT_T *, SNMPADDR_T *,
|
||||
SNMPADDR_T *, bits16_t,
|
||||
bits32_t, IO_COMPLETE_T *,
|
||||
ERR_COMPLETE_T *,
|
||||
RETRANS_COOKIE_T *));
|
||||
extern void SNMP_Send_Packet_Probe __((TARGET_LIST_T *,
|
||||
SNMPADDR_T *,
|
||||
IO_COMPLETE_T *,
|
||||
ERR_COMPLETE_T *,
|
||||
RETRANS_COOKIE_T *));
|
||||
extern void SNMP_Send_Notify __((SNMP_NOTIFY_T *, VBL_T *, SNMPADDR_T *,
|
||||
bits8_t *, ALENGTH_T, IO_COMPLETE_T *,
|
||||
ERR_COMPLETE_T *, RETRANS_CLEANUP_T *,
|
||||
PTR_T));
|
||||
extern void SNMP_Send_Notify_Name_Ack __((bits8_t *, ALENGTH_T, VBL_T *,
|
||||
SNMPADDR_T *, bits8_t *, ALENGTH_T,
|
||||
IO_COMPLETE_T *, ERR_COMPLETE_T *,
|
||||
RETRANS_CLEANUP_T *, PTR_T,ACK_CALLBACK_T *,TIMEOUT_CALLBACK_T *));
|
||||
extern void SNMP_Send_Notify_Name __((bits8_t *, ALENGTH_T, VBL_T *,
|
||||
SNMPADDR_T *, bits8_t *, ALENGTH_T,
|
||||
IO_COMPLETE_T *, ERR_COMPLETE_T *,
|
||||
RETRANS_CLEANUP_T *, PTR_T));
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(sendntfy_inc))*/
|
||||
@@ -0,0 +1,63 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/smi.h,v 1.1.1.1 2001/11/05 17:47:23 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: smi.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.2 2001/01/19 22:22:06 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.1 2000/03/17 19:48:38 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:18 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:51:56 sar
|
||||
* Defines for various items that are in the standard smi
|
||||
* and might be used by our code. For example row status
|
||||
* and storage tags.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#define smi_inc
|
||||
|
||||
#define ETC_STO_OTHER 1
|
||||
#define ETC_STO_VOL 2
|
||||
#define ETC_STO_NONVOL 3
|
||||
#define ETC_STO_PERM 4
|
||||
#define ETC_STO_RONLY 5
|
||||
|
||||
#define ETC_RS_RSNE 0
|
||||
#define ETC_RS_ACTIVE 1
|
||||
#define ETC_RS_NIS 2
|
||||
#define ETC_RS_NREADY 3
|
||||
#define ETC_RS_CAGO 4
|
||||
#define ETC_RS_CAWAIT 5
|
||||
#define ETC_RS_DESTROY 6
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,270 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/snmp.h,v 1.4 2003/01/15 13:58:56 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snmp.h,v $
|
||||
* Revision 1.4 2003/01/15 13:58:56 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.3 2001/11/06 21:50:40 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:04 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:06 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:39 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 1999/10/29 21:05:42 josh
|
||||
* The infrastructure lock tag is needed by Epilogue subagents as well
|
||||
*
|
||||
* Revision 9.2 1999/10/18 22:35:52 sar
|
||||
* Add free_lock
|
||||
* add init_lock to the block used if locks aren't defined
|
||||
*
|
||||
* Revision 9.1 1999/09/14 19:45:12 josh
|
||||
* added a new lock -- SNMP_V3_Retrans_Lock
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:18 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.5 1998/05/29 17:12:34 josh
|
||||
* a few ifdefs for cleanliness
|
||||
*
|
||||
* Revision 8.4 1998/05/29 17:10:02 josh
|
||||
* new locking macros added.
|
||||
*
|
||||
* Revision 8.3 1998/05/28 03:41:35 sar
|
||||
* Added extern for boots lock
|
||||
*
|
||||
* Revision 8.2 1998/04/16 15:45:07 josh
|
||||
* Declaring a separate lock if necessary
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:44 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:27 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.5 1997/10/22 03:07:30 sar
|
||||
* Mofied the agentx and older subagent schemes install options
|
||||
*
|
||||
* Revision 7.4 1997/10/16 00:25:18 sar
|
||||
* Primarily this set of modifications is for the agentx protocol.
|
||||
* Most of the work was in the agentx.h and ax_mth.h files. Most
|
||||
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
|
||||
* to their structures and snmp got some new lock macros.
|
||||
*
|
||||
* One other change of note was the modification of continue
|
||||
* processing. Previously we called a specific continue routine
|
||||
* directly, now we store a pointer to the corret continue
|
||||
* function in the snmp packet structure and call that. We include
|
||||
* macros for backwards compatibility.
|
||||
*
|
||||
* Revision 7.3 1997/08/21 17:23:44 sra
|
||||
* Begin moving configuration stuff that's common to all products to common.h
|
||||
* Minor cleanups to common/lib/prng.c. Add pnrg seed function to snarkbsd.
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:16 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:59:45 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.4 1995/05/02 23:29:47 sar
|
||||
* added some semi-colons in the lock macros.
|
||||
*
|
||||
* Revision 5.3 1995/04/18 20:41:28 sar
|
||||
* Added some new macros and modified the old macros so we don't require
|
||||
* ifdefs in all of the mainline code. Instead we use the new macros
|
||||
* which will be defined to nothgin if locks aren't installed.
|
||||
*
|
||||
* Revision 5.2 1995/03/20 23:11:33 sar
|
||||
* Redo the defaults for the lock scheme. They macros are now
|
||||
* defined to look like "good" returns so the main line code does not
|
||||
* have to deal with if defs. Some places that have large blocks of
|
||||
* lock code may still choose to use if defs.
|
||||
*
|
||||
* Revision 5.1 1994/10/12 20:11:47 sar
|
||||
* Added an ifdef around the def for the coarse lock
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 1.6 1993/05/28 18:01:05 sar
|
||||
* added the define as nothing macros for snmp_trace_input and output.
|
||||
*
|
||||
* Revision 1.5 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 1.4 1993/04/30 22:58:26 sar
|
||||
* Added mechanism for minimal proxies and coarse grained locks.
|
||||
*
|
||||
* Revision 1.3 1993/04/26 20:33:14 sar
|
||||
* Added bitstrings, and have deletion of parties or contexts delete acls.
|
||||
*
|
||||
* Revision 1.2 1993/03/03 20:06:55 dab
|
||||
* If the config file doesn't set SNMP_SILLY_MARKETING_MACRO
|
||||
* then set it to something that wan't make a mess here.
|
||||
*
|
||||
* Revision 1.1 1993/02/26 17:08:46 dab
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(snmp_inc))
|
||||
#define snmp_inc
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#include <wrn/wm/common/glue.h>
|
||||
#include <envoy.h>
|
||||
|
||||
/* Define some macros as nothing if the user hasn't defined them */
|
||||
#if !defined(SNMP_TRACE_INPUT)
|
||||
#define SNMP_TRACE_INPUT(pkt)
|
||||
#endif
|
||||
|
||||
#if !defined(SNMP_TRACE_OUTPUT)
|
||||
#define SNMP_TRACE_OUTPUT(pkt)
|
||||
#endif
|
||||
|
||||
/* If we are using the lock code specify coarse lock for everybody to use.
|
||||
We also specify a larger macro that gets a lock and if it can't
|
||||
executes it's other arguments */
|
||||
#if INSTALL_ENVOY_SNMP_LOCK
|
||||
|
||||
#ifndef ENVOY_SNMP_INIT_LOCK_TAG
|
||||
#define ENVOY_SNMP_INIT_LOCK_TAG(name, tag) ENVOY_SNMP_INIT_LOCK((name))
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_SNMP_FREE_LOCK_TAG
|
||||
#define ENVOY_SNMP_FREE_LOCK_TAG(lock, tag)
|
||||
#endif
|
||||
|
||||
#ifndef SNMP_COARSELOCK_TAG
|
||||
#define SNMP_COARSELOCK_TAG "COAR"
|
||||
#endif
|
||||
|
||||
#ifndef SNMP_TIMERLOCK_TAG
|
||||
#define SNMP_TIMERLOCK_TAG "TIMR"
|
||||
#endif
|
||||
|
||||
#ifndef SNMP_INFRASTRUCTURELOCK_TAG
|
||||
#define SNMP_INFRASTRUCTURELOCK_TAG "INFR"
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_PROXY
|
||||
#ifndef SNMP_PROXYLOCK_TAG
|
||||
#define SNMP_PROXYLOCK_TAG "PROX"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_CONTINUE_REENTRANT
|
||||
#ifndef ENVOY_CONTINUELOCK_TAG
|
||||
#define ENVOY_CONTINUELOCK_TAG "CONT"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_AGENTX
|
||||
#ifndef ENVOY_AXLISTLOCK_TAG
|
||||
#define ENVOY_AXLISTLOCK_TAG "AXLS"
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_AXCOARSELOCK_TAG
|
||||
#define ENVOY_AXCOARSELOCK_TAG "AXCO"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
#ifndef ENVOY_V3RETRANSLOCK_TAG
|
||||
#define ENVOY_V3RETRANSLOCK_TAG "RETR"
|
||||
#endif
|
||||
#ifndef ENVOY_V3BOOTSLOCK_TAG
|
||||
#define ENVOY_V3BOOTSLOCK_TAG "V3BT"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_CoarseLock);
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_infrastructure_lock);
|
||||
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_V3_Retrans_Lock);
|
||||
ENVOY_SNMP_LOCK_EXTERN(SNMP_V3_Boots_Lock);
|
||||
#endif
|
||||
|
||||
#define ENVOY_SNMP_LOCK_AND_1ARGS(get, lock, com1) \
|
||||
if (get(lock)) { com1; }
|
||||
#define ENVOY_SNMP_LOCK_AND_2ARGS(get, lock, com1, com2) \
|
||||
if (get(lock)) { com1; com2; }
|
||||
#define ENVOY_SNMP_LOCK_AND_3ARGS(get, lock, com1, com2, com3) \
|
||||
if (get(lock)) { com1; com2; com3; }
|
||||
#define ENVOY_SNMP_LOCK_AND_4ARGS(get, lock, com1, com2, com3, com4) \
|
||||
if (get(lock)) { com1; com2; com3; com4; }
|
||||
#else /* INSTALL_ENVOY_SNMP_LOCK */
|
||||
/* Don't use the lock stuff if the user doesn't define it */
|
||||
#define ENVOY_SNMP_LOCK(name)
|
||||
#define ENVOY_SNMP_LOCK_EXTERN(name);
|
||||
#define ENVOY_SNMP_INIT_LOCK(name)
|
||||
#define ENVOY_SNMP_INIT_LOCK_TAG(name, tag)
|
||||
#define ENVOY_SNMP_FREE_LOCK_TAG(lock, tag)
|
||||
#define ENVOY_SNMP_GET_READ_LOCK(name) 0
|
||||
#define ENVOY_SNMP_RELEASE_READ_LOCK(name)
|
||||
#define ENVOY_SNMP_GET_WRITE_LOCK(name) 0
|
||||
#define ENVOY_SNMP_RELEASE_WRITE_LOCK(name)
|
||||
#define ENVOY_SNMP_LOCK_AND_1ARGS(get, lock, com1)
|
||||
#define ENVOY_SNMP_LOCK_AND_2ARGS(get, lock, com1, com2)
|
||||
#define ENVOY_SNMP_LOCK_AND_3ARGS(get, lock, com1, com2, com3)
|
||||
#define ENVOY_SNMP_LOCK_AND_4ARGS(get, lock, com1, com2, com3, com4)
|
||||
#endif /* INSTALL_ENVOY_SNMP_LOCK */
|
||||
|
||||
#if (INSTALL_ENVOY_AGENTX_MASTER && INSTALL_ENVOY_SNMP_LOCK)
|
||||
#define ENVOY_AX_MA_RELEASE_READ_LOCK(name) ENVOY_SNMP_RELEASE_READ_LOCK(name)
|
||||
#define ENVOY_AX_MA_RELEASE_WRITE_LOCK(name) ENVOY_SNMP_RELEASE_WRITE_LOCK(name)
|
||||
#else
|
||||
#define ENVOY_AX_MA_RELEASE_READ_LOCK(name)
|
||||
#define ENVOY_AX_MA_RELEASE_WRITE_LOCK(name)
|
||||
#endif
|
||||
|
||||
#endif /* snmp_inc */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,246 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/snmpstat.h,v 1.2 2001/11/06 21:35:04 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2010 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1991-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: snmpstat.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:04 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:10 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:41 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:34 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:58:33 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 1999/04/09 20:37:02 josh
|
||||
* Obsoleting ENVOY_SNMP_VERSON_USEC and ENVOY_40_VB_FREE_COMPAT
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:20 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.3 1998/06/08 19:42:11 sar
|
||||
* Create a define to tell us if we need the stats group in general
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:06:17 sar
|
||||
* Added some stats variables for SNMPv3
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:48 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:28 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:19 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.3 1996/01/10 16:23:25 sar
|
||||
* USEC updates
|
||||
*
|
||||
* Revision 6.2 1995/11/14 22:42:26 sar
|
||||
* renamed proxydrops & silentdrops to match the mib definitions.
|
||||
*
|
||||
* Revision 6.1 1995/10/20 22:53:35 sar
|
||||
* moved some stats into and out of the ifdef blocks
|
||||
* removed the v2 classic stats
|
||||
* added some v2 community stats
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:53 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.1 1995/03/20 23:11:33 sar
|
||||
* Moved the deinition of the statistics macros here so there is one
|
||||
* central point for them.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 3.5 1993/06/02 23:05:55 dab
|
||||
* Changed #ifdef's to #if's for things from install.h
|
||||
*
|
||||
* Revision 3.4 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 3.3 1993/04/22 20:14:13 sar
|
||||
* Updating of macros and defines to use new naming scheme and get the
|
||||
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
|
||||
* for example).
|
||||
*
|
||||
* Revision 3.2 1993/02/18 20:43:26 sar
|
||||
* Added DestPartyMismatches and UnknownContexts to the v2 snmpstat group.
|
||||
*
|
||||
* Revision 3.1 1993/02/17 20:55:10 sar
|
||||
* Updated stats to deal with v1 and v2 options.
|
||||
*
|
||||
* Revision 3.0 92/04/03 19:52:27 dab
|
||||
* Release 3.0
|
||||
*
|
||||
* Revision 1.1 91/10/30 20:45:25 dab
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,15jun10,y_t update for LP64
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(snmpstat_inc))
|
||||
#define snmpstat_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmp_inc))
|
||||
#include <wrn/wm/snmp/engine/snmp.h>
|
||||
#endif
|
||||
|
||||
#if (ENVOY_NEED_STATS)
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_STATS_S
|
||||
{
|
||||
unsigned int snmpInPkts;
|
||||
unsigned int snmpInBadVersions;
|
||||
unsigned int snmpInBadCommunityNames;
|
||||
unsigned int snmpInBadCommunityUses;
|
||||
unsigned int snmpInASNParseErrs;
|
||||
unsigned short snmpEnableAuthTraps;
|
||||
#if INSTALL_ENVOY_SNMP_GROUP_V1
|
||||
unsigned int snmpOutPkts;
|
||||
unsigned int snmpInBadTypes;
|
||||
unsigned int snmpInTooBigs;
|
||||
unsigned int snmpInNoSuchNames;
|
||||
unsigned int snmpInBadValues;
|
||||
unsigned int snmpInReadOnlys;
|
||||
unsigned int snmpInGenErrs;
|
||||
unsigned int snmpInTotalReqVars;
|
||||
unsigned int snmpInTotalSetVars;
|
||||
unsigned int snmpInGetRequests;
|
||||
unsigned int snmpInGetNexts;
|
||||
unsigned int snmpInSetRequests;
|
||||
unsigned int snmpInGetResponses;
|
||||
unsigned int snmpInTraps;
|
||||
unsigned int snmpOutTooBigs;
|
||||
unsigned int snmpOutNoSuchNames;
|
||||
unsigned int snmpOutBadValues;
|
||||
unsigned int snmpOutReadOnlys;
|
||||
unsigned int snmpOutGenErrs;
|
||||
unsigned int snmpOutGetRequests;
|
||||
unsigned int snmpOutGetNexts;
|
||||
unsigned int snmpOutSetRequests;
|
||||
unsigned int snmpOutGetResponses;
|
||||
unsigned int snmpOutTraps;
|
||||
#endif /* INSTALL_ENVOY_SNMP_GROUP_V1 */
|
||||
#if INSTALL_ENVOY_SNMP_GROUP_V2
|
||||
unsigned int snmpSilentDrops;
|
||||
unsigned int snmpProxyDrops;
|
||||
#endif /* INSTALL_ENVOY_SNMP_GROUP_V2 */
|
||||
#if INSTALL_ENVOY_SNMP_VERSION_3
|
||||
unsigned int snmpUnknownSecurityModels;
|
||||
unsigned int snmpInvalidMsgs;
|
||||
unsigned int snmpUnknownPDUHandlers;
|
||||
unsigned int snmpUnavailableContexts;
|
||||
unsigned int snmpUnknownContexts;
|
||||
unsigned int usmStatsUnsupportedSecLevels;
|
||||
unsigned int usmStatsNotInTimeWindows;
|
||||
unsigned int usmStatsUnknownUserNames;
|
||||
unsigned int usmStatsUnknownEngineIDs;
|
||||
unsigned int usmStatsWrongDigests;
|
||||
unsigned int usmStatsDecryptionErrors;
|
||||
#endif /* INSTALL_ENVOY_SNMP_VERSION_3 */
|
||||
} SNMP_STATS_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
|
||||
extern SNMP_STATS_T snmp_stats;
|
||||
|
||||
#endif /* ENVOY_NEED_STATS */
|
||||
|
||||
|
||||
/* Some macros to make the mainline code a little cleaner to read */
|
||||
#if (INSTALL_ENVOY_SNMP_GROUP_V1)
|
||||
#define SGRPv1_INC_COUNTER(x) inc_counter(x)
|
||||
#define SGRPv1_ADD_COUNTER(x, y) add_counter(x, y)
|
||||
#else
|
||||
#define SGRPv1_INC_COUNTER(x)
|
||||
#define SGRPv1_ADD_COUNTER(x, y)
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_GROUP_V2)
|
||||
#define SGRPv2_INC_COUNTER(x) inc_counter(x)
|
||||
#else
|
||||
#define SGRPv2_INC_COUNTER(x)
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_GROUP_V1 || INSTALL_ENVOY_SNMP_GROUP_V2)
|
||||
#define SGRPv1v2_INC_COUNTER(x) inc_counter(x)
|
||||
#else
|
||||
#define SGRPv1v2_INC_COUNTER(x)
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_VERSION_3)
|
||||
#define SGRPv3_INC_COUNTER(x) inc_counter(x)
|
||||
#else
|
||||
#define SGRPv3_INC_COUNTER(x)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* snmpstat_inc */
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/tree.h,v 1.2 2001/11/06 21:35:04 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: tree.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:04 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:10 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:42 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:35 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:59:00 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:21 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:51 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:31 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:21 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:55 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Minor cleanup, adding other include files.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.1 1994/05/10 20:17:19 sar
|
||||
* Removed the #if that restricted it for use with v2 only
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 1.8 1993/06/02 23:05:55 dab
|
||||
* Changed #ifdef's to #if's for things from install.h
|
||||
*
|
||||
* Revision 1.7 1993/05/03 17:54:14 sar
|
||||
* Modified #include <foo> to be #include <envoy/h/foo.h> where it was correct.
|
||||
*
|
||||
* Revision 1.6 1993/04/30 22:58:26 sar
|
||||
* Added mechanism for minimal proxies and coarse grained locks.
|
||||
*
|
||||
* Revision 1.5 1993/04/22 20:14:13 sar
|
||||
* Updating of macros and defines to use new naming scheme and get the
|
||||
* names to be more useful in general. (use INSTALL_ENVOY_SNMP_VERSION_1
|
||||
* for example).
|
||||
*
|
||||
* Revision 1.4 1993/04/17 00:58:50 sar
|
||||
* changed def of TREE_Add to allow the user to determine what node the leaf
|
||||
* was attatched to.
|
||||
*
|
||||
* Revision 1.3 1993/03/05 03:56:25 dab
|
||||
* fixed up types
|
||||
*
|
||||
* Revision 1.2 1993/02/24 00:59:50 sar
|
||||
* Removed the name objid from the partyleaf and put a copy of it in the
|
||||
* pkt. Also Updated many of the SNMP_(Party, Context, ACL)_* files
|
||||
* to use a OIDC_T/length instead of a OBJ_ID_T so we don't have to
|
||||
* allocate an OBJ_ID_T when we don't have one.
|
||||
*
|
||||
* Revision 1.1 1993/02/17 20:55:28 sar
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 3.0 92/09/09 sar
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
|
||||
#if (!defined(tree_inc))
|
||||
#define tree_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* Define a generic tree structure */
|
||||
typedef struct TREENODE_S
|
||||
{
|
||||
INT_32_T status; /* flag and status word */
|
||||
OIDC_T name; /* subid for this level */
|
||||
struct TREENODE_S * parent; /* ptr to one level up */
|
||||
struct TREENODE_S * sibling; /* ptr to this level */
|
||||
PTR_T child; /* ptr to one level down */
|
||||
/* or to the data block */
|
||||
} TREENODE_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define TREESTATIC 0x1 /* Node may not be deleted, ptrs may change */
|
||||
#define TREETWIN 0x2 /* Next node contains a leaf pointer */
|
||||
#define TREECHILD 0x4 /* Node contains a child pointer */
|
||||
#define TREELEAF 0x8 /* Node contains a leaf pointer */
|
||||
|
||||
extern int TREE_Add __((TREENODE_T **root, OIDC_T *oidc,
|
||||
int oidclen, PTR_T leaf,
|
||||
TREENODE_T **retnode));
|
||||
extern int TREE_Delete __((TREENODE_T **root, TREENODE_T *node));
|
||||
extern TREENODE_T *TREE_Get __((TREENODE_T *root, OIDC_T *oidc,
|
||||
int oidclen, int *length));
|
||||
extern TREENODE_T *TREE_GetPrev __((TREENODE_T *root, OIDC_T *oidc,
|
||||
int oidclen));
|
||||
extern TREENODE_T *TREE_GetNext __((TREENODE_T *root, TREENODE_T *node));
|
||||
extern int TREE_Extract __((TREENODE_T *node, PTR_T *leaf));
|
||||
extern int TREE_Install __((TREENODE_T *node, PTR_T leaf));
|
||||
extern int TREE_Name __((TREENODE_T *node, OIDC_T *oidc, int len));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* tree_inc */
|
||||
@@ -0,0 +1,334 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/ui64.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1993-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: ui64.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:05 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:10 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:42 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:35 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 16:59:11 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:21 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:52 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:32 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.3 1997/10/26 01:44:43 sar
|
||||
* Always define the 64 bit counter and include it in the vb defintion
|
||||
* instead of forgetting about it if we don't have v2 or v2 types installed.
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:23 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:56 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 5.2 1994/11/29 21:58:53 sar
|
||||
* Added a missing : to UI64_Compare.
|
||||
*
|
||||
* Revision 5.1 1994/09/29 18:31:12 sar
|
||||
* Rearrange some items to deal with removing v2 types from v1 settings if
|
||||
* they aren't installed.
|
||||
*
|
||||
* Revision 5.0 1994/05/16 15:49:04 sar
|
||||
* Updated revision to 5.0 and copyright to include 1994
|
||||
*
|
||||
* Revision 4.0 1993/06/24 16:05:41 sar
|
||||
* Updated rev to 4.0 and coypright to 93
|
||||
*
|
||||
* Revision 1.4 1993/06/17 23:30:45 sar
|
||||
* remvoed the ENVOY_ from UI64 routines and macros.
|
||||
*
|
||||
* Revision 1.3 1993/06/07 18:31:09 sar
|
||||
* Added a set macro to set a 64 bitter from two 32 bitters.
|
||||
*
|
||||
* Revision 1.2 1993/04/28 22:00:38 sar
|
||||
* Moved the definition of UINT_64_T to ui64.h and update others
|
||||
*
|
||||
* Revision 1.1 1993/04/22 20:14:13 sar
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,01apr09,y_t fix the big endian & little endian issue
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
/* define some macros for manipulating unsinged 64 bit quantities */
|
||||
#if !defined(ui64_inc)
|
||||
#define ui64_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
UINT_64_T
|
||||
****************************************************************************/
|
||||
|
||||
/* The following structure is used to hold 64 bit unsigned int. It is
|
||||
targeted for COUNTER64 but for generality it is called UINT_64_T. */
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
#if (_BYTE_ORDER == _BIG_ENDIAN)
|
||||
|
||||
typedef struct UINT_64_S
|
||||
{
|
||||
UINT_32_T high; /* the high (msb) 4 bytes of the uint */
|
||||
UINT_32_T low; /* the low (lsb) 4 bytes of the uint */
|
||||
} UINT_64_T;
|
||||
|
||||
#endif
|
||||
|
||||
#if (_BYTE_ORDER == _LITTLE_ENDIAN)
|
||||
|
||||
typedef struct UINT_64_S
|
||||
{
|
||||
UINT_32_T low; /* the low (lsb) 4 bytes of the uint */
|
||||
UINT_32_T high; /* the high (msb) 4 bytes of the uint */
|
||||
} UINT_64_T;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Set
|
||||
|
||||
PURPOSE: Set a UINT_64_T from two UINT_32_Ts
|
||||
|
||||
PARAMETERS: UINT_64_T * the structure to use
|
||||
UINT_32_T the high bits
|
||||
UINT_32_T the low bits
|
||||
|
||||
RETURNS: nothing
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Set(N, H, L) ((N)->high = (H), (N)->low = (L))
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_High
|
||||
|
||||
PURPOSE: Get the high order 32 bits
|
||||
|
||||
PARAMETERS: UINT_64_T * the structure to use
|
||||
|
||||
RETURNS: UINT_32_T
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_High(N) (N)->high
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Low
|
||||
|
||||
PURPOSE: Get the low order 32 bits
|
||||
|
||||
PARAMETERS: UINT_64_T * Pointer to the object
|
||||
|
||||
RETURNS: UINT_32_T
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Low(N) (N)->low
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Zero
|
||||
|
||||
PURPOSE: Zero a UINT_64_T object
|
||||
|
||||
PARAMETERS: UINT_64_T * Pointer to the object to be zeroed.
|
||||
|
||||
RETURNS:
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Zero(N) (N)->high = (N)->low = 0L
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Increment
|
||||
|
||||
PURPOSE: Increment (by one) a UINT_64_T object
|
||||
|
||||
PARAMETERS: UINT_64_T * Pointer to the object to be incremented.
|
||||
|
||||
RETURNS:
|
||||
|
||||
RESTRICTIONS: This routine will wrap the object if necessary and not give
|
||||
any warning about having done so.
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Increment(N) if (++((N)->low) == 0) (N)->high++
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Add32
|
||||
|
||||
PURPOSE: Add a UINT_32_T to a UINT_64_T
|
||||
|
||||
PARAMETERS: UINT_64_T * pointer to the object to be updated
|
||||
UINT_32_T the quantity to add in.
|
||||
|
||||
RETURNS:
|
||||
|
||||
RESTRICTIONS: This routine will wrap the object if necessary and not give
|
||||
any warning about having done so.
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Add32(N, I) (N)->low += I; if ((N)->low < I) (N)->high++
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Add64
|
||||
|
||||
PURPOSE: Add two UINT_64_Ts
|
||||
|
||||
PARAMETERS: UINT_64_T * The object to update
|
||||
UINT_64_T * The object to add in
|
||||
|
||||
RETURNS: Doesn't return anything but the first UINT_64_T is updated.
|
||||
|
||||
RESTRICTIONS: This routine will wrap the object if necessary and not give
|
||||
any warning about having done so.
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Add64(N, M) (N)->low += (M)->low; (N)->high += (M)->high; \
|
||||
if ((N)->low < (M)->low) (N)->high++
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Sub64
|
||||
|
||||
PURPOSE: Subtract two UINT_64_Ts
|
||||
|
||||
PARAMETERS: UINT_64_T * the result goes here
|
||||
UINT_64_T * Subtract from this object
|
||||
UINT_64_T * the object to subtract
|
||||
|
||||
RETURNS: Doesn't return anything but the first UINT_64_T is filled in.
|
||||
|
||||
RESTRICTIONS: This routine will wrap the object if necessary and not give
|
||||
any warning about having done so.
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Sub64(X, Y, Z) (X)->low = (Y)->low - (Z)->low; \
|
||||
(X)->high = (Y)->high - (Z)->high; \
|
||||
if ((X)->low > (Y)->low) (X)->high--
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Copy
|
||||
|
||||
PURPOSE: Copy one UINT_64_T to another
|
||||
|
||||
PARAMETERS: UINT_64_T * the result goes here
|
||||
UINT_64_T * copy from this object
|
||||
|
||||
RETURNS: Doesn't return anything but the first UINT_64_T is filled in.
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Copy(X, Y) (X)->low = (Y)->low; (X)->high = (Y)->high
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
NAME: UI64_Compare
|
||||
|
||||
PURPOSE: Compare two UINT_64_Ts
|
||||
|
||||
PARAMETERS: UINT_64_T * The two objects to compare
|
||||
UINT_64_T *
|
||||
|
||||
RETURNS: < 0 if the first is smaller than the second
|
||||
> 0 if the first is greater than the second
|
||||
0 if they are equal.
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
BUGS:
|
||||
****************************************************************************/
|
||||
#define UI64_Compare(X, Y) \
|
||||
(((X)->high == (Y)->high) ? \
|
||||
(((X)->low == (Y)->low) ? (0) : (((X)->low > (Y)->low) ? (1) : (-1))) : \
|
||||
(((X)->high > (Y)->high) ? (1) : (-1)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ui64.h defined */
|
||||
@@ -0,0 +1,285 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_acc.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_acc.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:05 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6 2001/04/25 16:52:23 josh
|
||||
* the SNMP_ACCESS_T object is now initialized with a default
|
||||
* status of ETC_RS_NIS instead of ETC_RS_NREADY
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:11 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:43 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:35 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:59:22 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 2000/02/04 21:54:19 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:23 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.7 1998/08/12 04:52:16 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 1.6 1998/07/06 01:01:21 sar
|
||||
* Update type of security level field to make compilers happy
|
||||
*
|
||||
* Revision 1.5 1998/07/01 01:48:18 sar
|
||||
* As part of the set_defaults macro do a memset to zero the memory
|
||||
*
|
||||
* Revision 1.4 1998/06/18 04:42:03 sar
|
||||
* Modified bflags in ebuffer to be unsigned ints and updated
|
||||
* calling routines accordingly
|
||||
*
|
||||
* Revision 1.3 1998/06/16 05:29:56 sar
|
||||
* clean up some type info
|
||||
* modify the api for the next routine
|
||||
*
|
||||
* Revision 1.2 1998/05/30 02:52:08 sar
|
||||
* Modifed the names used for max string length
|
||||
* Updated user lookup
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:39 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_acc_inc))
|
||||
#define v3_acc_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define ETC_ACCESS_VIEW_MAX 32
|
||||
#define ETC_ACCESS_GROUP_MAX 32
|
||||
#define ETC_ACCESS_ACCESS_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_GROUP_S
|
||||
{
|
||||
struct SNMP_GROUP_S *next;
|
||||
sbits32_t model; /* security model, an index */
|
||||
bits8_t *uname; /* security name, other index */
|
||||
ALENGTH_T uname_len; /* length of security name */
|
||||
EBUFFER_T grp_name; /* group name */
|
||||
bits16_t status;
|
||||
bits16_t storage;
|
||||
} SNMP_GROUP_T;
|
||||
|
||||
/* global root pointer for group list */
|
||||
extern SNMP_GROUP_T *root_group;
|
||||
|
||||
#define SNMP_Group_Set_Defaults(G) (MEMSET((G), 0, sizeof(SNMP_GROUP_T)), \
|
||||
EBufferInitialize(&((G)->grp_name)), \
|
||||
(G)->storage = ETC_STO_NONVOL, \
|
||||
(G)->status = ETC_RS_NREADY)
|
||||
|
||||
extern SNMP_GROUP_T * SNMP_Group_Create __((void));
|
||||
extern void SNMP_Group_Destroy __((SNMP_GROUP_T *));
|
||||
extern int SNMP_Group_Install __((SNMP_GROUP_T *, sbits32_t,
|
||||
bits8_t *, ALENGTH_T));
|
||||
extern void SNMP_Group_Deinstall __((SNMP_GROUP_T *));
|
||||
extern SNMP_GROUP_T * SNMP_Group_Lookup __((sbits32_t, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern SNMP_GROUP_T * SNMP_Group_Next __((int, OIDC_T *));
|
||||
extern SNMP_GROUP_T * SNMP_Group_Next_Group __((SNMP_GROUP_T *));
|
||||
extern void SNMP_Group_Name __((SNMP_GROUP_T *, sbits32_t *,
|
||||
bits8_t *, ALENGTH_T *));
|
||||
|
||||
#define SNMP_Group_Set_Group(G, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((G)->grp_name), (S), (L)))
|
||||
|
||||
#define SNMP_Group_Compare_Names(G1, G2) ((G1 == G2) ? 0 : 1)
|
||||
|
||||
#define SNMP_Group_Get_Group(G) (EBufferStart(&((G)->grp_name)))
|
||||
#define SNMP_Group_Get_Group_Len(G) (EBufferUsed(&((G)->grp_name)))
|
||||
|
||||
#define SNMP_Group_Get_Status(G) ((G)->status)
|
||||
#define SNMP_Group_Set_Status(G, V) ((G)->status = (bits16_t)(V))
|
||||
#define SNMP_Group_Get_Storage(G) ((G)->storage)
|
||||
#define SNMP_Group_Set_Storage(G, V) ((G)->storage = (bits16_t)(V))
|
||||
|
||||
typedef struct SNMP_ACC_GRP_S
|
||||
{
|
||||
struct SNMP_ACC_GRP_S *next;
|
||||
bits8_t *grp_name; /* group name, an index */
|
||||
ALENGTH_T grp_len;
|
||||
struct SNMP_ACCESS_S *access;
|
||||
} SNMP_ACC_GRP_T;
|
||||
|
||||
typedef struct SNMP_ACCESS_S
|
||||
{
|
||||
struct SNMP_ACC_GRP_S *group;
|
||||
struct SNMP_ACCESS_S *next;
|
||||
bits8_t *prefix; /* context prefix, an index */
|
||||
ALENGTH_T prefix_len;
|
||||
int prefix_match; /* prefix match, exact - 1, prefix - 2 */
|
||||
sbits32_t model; /* security model, an index */
|
||||
sbits16_t level; /* security level, an index */
|
||||
EBUFFER_T readview; /* name of view for reading */
|
||||
EBUFFER_T writeview; /* name of view for writing */
|
||||
EBUFFER_T notifyview; /* name of view for notifies */
|
||||
int status;
|
||||
int storage;
|
||||
} SNMP_ACCESS_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define ETC_ACCESS_EXACT 1
|
||||
#define ETC_ACCESS_PREFIX 2
|
||||
|
||||
/* global root pointer for access list */
|
||||
extern SNMP_ACC_GRP_T *root_access;
|
||||
|
||||
#define SNMP_V3_Access_Set_Defaults(A) (MEMSET((A), 0, sizeof(SNMP_ACCESS_T)),\
|
||||
(A)->prefix_match = ETC_ACCESS_EXACT, \
|
||||
EBufferInitialize(&((A)->readview)), \
|
||||
EBufferInitialize(&((A)->writeview)), \
|
||||
EBufferInitialize(&((A)->notifyview)),\
|
||||
(A)->storage = ETC_STO_NONVOL, \
|
||||
(A)->status = ETC_RS_NIS)
|
||||
|
||||
extern SNMP_ACCESS_T * SNMP_V3_Access_Create __((void));
|
||||
extern void SNMP_V3_Access_Destroy __((SNMP_ACCESS_T *));
|
||||
extern int SNMP_V3_Access_Install __((SNMP_ACCESS_T *,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
sbits32_t, sbits32_t));
|
||||
extern void SNMP_V3_Access_Deinstall __((SNMP_ACCESS_T *));
|
||||
extern SNMP_ACCESS_T * SNMP_V3_Access_Lookup __((bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
sbits32_t, sbits32_t));
|
||||
extern SNMP_ACCESS_T * SNMP_V3_Access_Next __((int, OIDC_T *));
|
||||
extern SNMP_ACCESS_T * SNMP_V3_Access_Next_Access __((SNMP_ACCESS_T *));
|
||||
|
||||
extern void SNMP_V3_Access_Name __((SNMP_ACCESS_T *,
|
||||
bits8_t *, ALENGTH_T *,
|
||||
bits8_t *, ALENGTH_T *,
|
||||
sbits32_t *, sbits32_t *));
|
||||
|
||||
extern SNMP_ACCESS_T * SNMP_V3_Access_Find __((bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T,
|
||||
sbits32_t, sbits32_t));
|
||||
extern int SNMP_V3_Access_Set_View __((SNMP_ACCESS_T *,
|
||||
EBUFFER_T *, bits8_t *,
|
||||
ALENGTH_T, unsigned int));
|
||||
|
||||
#define SNMP_V3_Access_Compare_Names(A1, A2) ((A1 == A2) ? 0 : 1)
|
||||
|
||||
#define SNMP_V3_Access_Get_Read(A) EBufferStart(&((A)->readview))
|
||||
#define SNMP_V3_Access_Get_Read_Len(A) EBufferUsed(&((A)->readview))
|
||||
#define SNMP_V3_Access_Set_Read(A,S,L,F) \
|
||||
SNMP_V3_Access_Set_View(A, &((A)->readview), S, L, F)
|
||||
#define SNMP_V3_Access_Get_Write(A) EBufferStart(&((A)->writeview))
|
||||
#define SNMP_V3_Access_Get_Write_Len(A) EBufferUsed(&((A)->writeview))
|
||||
#define SNMP_V3_Access_Set_Write(A,S,L,F) \
|
||||
SNMP_V3_Access_Set_View(A, &((A)->writeview), S, L, F)
|
||||
#define SNMP_V3_Access_Get_Notify(A) EBufferStart(&((A)->notifyview))
|
||||
#define SNMP_V3_Access_Get_Notify_Len(A) EBufferUsed(&((A)->notifyview))
|
||||
#define SNMP_V3_Access_Set_Notify(A,S,L,F) \
|
||||
SNMP_V3_Access_Set_View(A, &((A)->notifyview), S, L, F)
|
||||
|
||||
|
||||
#define SNMP_V3_Access_Get_Prefix_Match(A) ((A)->prefix_match)
|
||||
#define SNMP_V3_Access_Set_Prefix_Match(A, B) (((A)->prefix_match) = (B))
|
||||
|
||||
#define SNMP_V3_Access_Get_Status(A) ((A)->status)
|
||||
#define SNMP_V3_Access_Set_Status(A, V) ((A)->status = (bits16_t)(V))
|
||||
#define SNMP_V3_Access_Get_Storage(A) ((A)->storage)
|
||||
#define SNMP_V3_Access_Set_Storage(A, V) ((A)->storage = (bits16_t)(V))
|
||||
|
||||
extern void grouptable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void grouptable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void grouptable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void grouptable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void accesstable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void accesstable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void accesstable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void accesstable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_acc_inc))*/
|
||||
@@ -0,0 +1,243 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_auth.h,v 1.4 2003/01/15 13:58:56 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_auth.h,v $
|
||||
* Revision 1.4 2003/01/15 13:58:56 josh
|
||||
* directory structure shifting
|
||||
*
|
||||
* Revision 1.3 2001/11/06 21:50:41 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:05 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:11 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:43 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:35 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:59:34 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 2000/02/04 21:54:20 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:23 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.4 1998/08/12 04:52:17 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 1.3 1998/06/16 05:29:19 sar
|
||||
* Add a long tag ("L") to a long constant
|
||||
*
|
||||
* Revision 1.2 1998/05/27 22:53:53 sar
|
||||
* Add routines to manipulate the auth and priv lists (add and find),
|
||||
* as well as some specifics adds (md5, sha)
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:39 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01e,09sep10,y_t fixed for WIND00230477
|
||||
01d,03sep08,y_t update for openssl
|
||||
01c,17may05,job fix up the DH code
|
||||
01b,05may05,asl Diffie-Hellman work
|
||||
01a,15apr05,AJS Diffie-Hellman work
|
||||
01a,13apr05,AJS Diffie-Hellman work
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_auth_inc))
|
||||
#define v3_auth_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*#if (!defined(HMAC_H))
|
||||
#ifndef INSTALL_on_linux
|
||||
#include <ipcom_type.h>
|
||||
#endif
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/hmac.h>
|
||||
#endif*/
|
||||
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
/* For password to key purposes, this is the length to expand a password to */
|
||||
#define V3_AUTH_MEGABYTE 1048576L
|
||||
|
||||
/* Needs is what is the length needed in the packet,
|
||||
digest is the length of the acutal digest
|
||||
keysize is the length of the keysize */
|
||||
#define V3_HMAC_MD5_NEEDS 12
|
||||
#define V3_HMAC_MD5_DIGEST 16
|
||||
#define V3_HMAC_MD5_KEYSIZE 16
|
||||
|
||||
#define V3_HMAC_SHA_NEEDS 12
|
||||
#define V3_HMAC_SHA_DIGEST 20
|
||||
#define V3_HMAC_SHA_KEYSIZE 20
|
||||
|
||||
#define V3_HMAC_MAX_NEEDS 12
|
||||
#define V3_HMAC_MAX_DIGEST 20
|
||||
|
||||
#define V3_HMAC_ENCRYPT_NONE 0
|
||||
#define V3_HMAC_ENCRYPT_MD5 1
|
||||
#define V3_HMAC_ENCRYPT_SHA 2
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
typedef struct SNMP_AUTH_S
|
||||
{
|
||||
struct SNMP_AUTH_S *next;
|
||||
OBJ_ID_T name; /* name of the auth protocol */
|
||||
char *digest_name;
|
||||
ALENGTH_T need; /* digest carried in snmp message */
|
||||
ALENGTH_T keysize; /* full digest */
|
||||
int (*authenticate)(struct SNMP_AUTH_S *, bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T, bits8_t *, int);
|
||||
|
||||
} SNMP_AUTH_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/* global root pointer for the auth list */
|
||||
extern SNMP_AUTH_T *v3_auth_root;
|
||||
|
||||
extern SNMP_AUTH_T * SNMP_Auth_Find __((int, OIDC_T *));
|
||||
extern int SNMP_Auth_Add __((SNMP_AUTH_T *));
|
||||
extern int SNMP_Auth_Add_MD5 __((void));
|
||||
extern int SNMP_Auth_Add_SHA __((void));
|
||||
|
||||
#define SNMP_Auth_Digest(A, K, KL, B, BL, O) \
|
||||
((A)->authenticate(A, K, KL, B, BL, O, 0))
|
||||
#define SNMP_Auth_Verify(A, K, KL, B, BL, O) \
|
||||
((A)->authenticate(A, K, KL, B, BL, O, 1))
|
||||
|
||||
#define SNMP_Auth_Get_KeySize(A) ((A)->keysize)
|
||||
#define SNMP_Auth_Get_Need(A) ((A)->need)
|
||||
|
||||
#define SNMP_Auth_Get_Name(A) (&((A)->name))
|
||||
|
||||
|
||||
extern int SNMP_V3_Pass2Key __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T key_len,
|
||||
bits8_t *, ALENGTH_T engineid_len, int));
|
||||
extern int SNMP_V3_KeyChange __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T key_len));
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
int SNMP_V3_DHKeyChange (DH *DHvalues, BIGNUM *pubKey,\
|
||||
bits8_t **sk, int *skLen);
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
/* Macros to get/set an Auth/Priv key */
|
||||
|
||||
#define SNMP_Get_DHauthKey(USER) \
|
||||
(EBufferStart (&(USER->DH_keys.DHpubAuthKey)))
|
||||
|
||||
#define SNMP_Get_DHauthKey_len(USER) \
|
||||
(EBufferUsed (&(USER->DH_keys.DHpubAuthKey)))
|
||||
|
||||
#define SNMP_Set_DHauthKey(USER,FLAGS,KEY,LENGTH) \
|
||||
(EBufferPreload(FLAGS,((SNMP_DH_T *)(USER)->DH_keys).DHpubAuthKey,KEY,LENGTH)
|
||||
|
||||
/* Macros to get/set a Priv key */
|
||||
|
||||
#define SNMP_Get_DHprivKey(USER) \
|
||||
(EBufferStart (&(USER->DH_keys.DHpubPrivKey)))
|
||||
|
||||
#define SNMP_Get_DHprivKey_len(USER) \
|
||||
(EBufferUsed (&(USER->DH_keys.DHpubPrivKey)))
|
||||
|
||||
#define SNMP_Set_DHprivKey(USER,FLAGS,KEY,LENGTH) \
|
||||
(EBufferPreload(FLAGS,((SNMP_DH_T *)(USER)->DH_keys).DHpubPrivKey,KEY,LENGTH)
|
||||
|
||||
/* Get the auth/priv random numbers; returns a pointer to BIGNUM */
|
||||
|
||||
#define SNMP_Get_DHauthRand(USER) (((SNMP_DH_T *)(USER)->DH_keys).DHauthRand)
|
||||
#define SNMP_Get_DHprivhRand(USER) (((SNMP_DH_T *)(USER)->DH_keys).DHprivRand)
|
||||
|
||||
/* Set the BIGNUM pointer for auth/priv random numbers */
|
||||
|
||||
#define SNMP_Set_DHauthRand(USER,BN) \
|
||||
(((SNMP_DH_T *)(USER)->DH_keys).DHauthRand = BN)
|
||||
#define SNMP_Set_DHprivRand(USER,BN) \
|
||||
(((SNMP_DH_T *)(USER)->DH_keys).DHprivRand = BN)
|
||||
|
||||
/* Other declarations */
|
||||
|
||||
extern OIDC_T v3_auth_noauth[];
|
||||
extern int v3_auth_noauth_size;
|
||||
|
||||
extern int v3_auth_authenticate __((SNMP_AUTH_T *, bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T, bits8_t *, int));
|
||||
|
||||
|
||||
extern SNMP_AUTH_T v3_auth_md5;
|
||||
extern SNMP_AUTH_T v3_auth_sha;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_auth_inc)) */
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_comm.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005, 2013 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_comm.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:05 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.1.2.3 2001/09/21 19:16:07 josh
|
||||
* updating and expanding structures for use with coexistence
|
||||
*
|
||||
* Revision 1.1.2.2 2001/08/07 18:33:57 josh
|
||||
* adding support for SNMPv1/v2c/v3 coexistence to SNMP Notify code
|
||||
*
|
||||
* Revision 1.1.2.1 2001/07/16 18:02:12 josh
|
||||
* a first-round commit adding infrastructure support
|
||||
* for the SNMPv3 Coexistence RFC (2576)
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,06aug13,bbz clear the med impact warning from prevent.pl(WIND00429583)
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_comm_inc))
|
||||
#define v3_comm_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define ETC_COMMUNITY_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_COMMUNITY_S
|
||||
{
|
||||
struct SNMP_COMMUNITY_S *next;
|
||||
EBUFFER_T comm_index; /* the name of this entry */
|
||||
EBUFFER_T comm_name; /* the community name */
|
||||
EBUFFER_T comm_sec_name; /* security name */
|
||||
EBUFFER_T comm_con_id; /* context engine id */
|
||||
EBUFFER_T comm_con_name; /* context name */
|
||||
EBUFFER_T comm_tag; /* transport tag */
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_COMMUNITY_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define ETC_COMM_NAME 0x01
|
||||
#define ETC_COMM_SEC_NAME 0x02
|
||||
#define ETC_COMM_ALL_FLAGS 0x03
|
||||
|
||||
/* global root pointer for target params list */
|
||||
extern SNMP_COMMUNITY_T *root_community;
|
||||
|
||||
#define SNMP_Community_Set_Defaults(C) \
|
||||
(MEMSET((C), 0, sizeof(SNMP_COMMUNITY_T)), \
|
||||
EBufferInitialize(&((C)->comm_index)), \
|
||||
EBufferInitialize(&((C)->comm_name)), \
|
||||
EBufferInitialize(&((C)->comm_sec_name)), \
|
||||
EBufferInitialize(&((C)->comm_con_id)), \
|
||||
EBufferAllocateLoad(BFL_IS_ALLOC, &((C)->comm_con_id), \
|
||||
v3_my_engine->id, v3_my_engine->id_len), \
|
||||
EBufferInitialize(&((C)->comm_con_name)), \
|
||||
EBufferInitialize(&((C)->comm_tag)), \
|
||||
(C)->storage = ETC_STO_NONVOL, \
|
||||
(C)->status = ETC_RS_NREADY, \
|
||||
(C)->flags = 0)
|
||||
|
||||
extern SNMP_COMMUNITY_T * SNMP_Community_Create __((void));
|
||||
extern void SNMP_Community_Destroy __((SNMP_COMMUNITY_T *));
|
||||
extern envoy_err_t SNMP_Community_Install __((SNMP_COMMUNITY_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern void SNMP_Community_Deinstall __((SNMP_COMMUNITY_T *));
|
||||
extern SNMP_COMMUNITY_T * SNMP_Community_Lookup __((bits8_t *, ALENGTH_T));
|
||||
extern SNMP_COMMUNITY_T * SNMP_Community_Next __((int, OIDC_T *));
|
||||
extern SNMP_COMMUNITY_T * SNMP_Community_Next_Community
|
||||
__((SNMP_COMMUNITY_T *));
|
||||
extern void SNMP_Community_Index __((SNMP_COMMUNITY_T *, bits8_t *,
|
||||
ALENGTH_T *));
|
||||
|
||||
#define SNMP_Community_Get_Index(C) (EBufferStart(&((C)->comm_index)))
|
||||
#define SNMP_Community_Get_Index_Len(C) (EBufferUsed(&((C)->comm_index)))
|
||||
|
||||
#define SNMP_Community_Get_Name(C) (EBufferStart(&((C)->comm_name)))
|
||||
#define SNMP_Community_Get_Name_Len(C) (EBufferUsed(&((C)->comm_name)))
|
||||
#define SNMP_Community_Set_Name(C, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((C)->comm_name), (S), (L)))
|
||||
|
||||
#define SNMP_Community_Get_Sec_Name(C) (EBufferStart(&((C)->comm_sec_name)))
|
||||
#define SNMP_Community_Get_Sec_Name_Len(C) (EBufferUsed(&((C)->comm_sec_name)))
|
||||
#define SNMP_Community_Set_Sec_Name(C, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((C)->comm_sec_name), (S), (L)))
|
||||
|
||||
#define SNMP_Community_Get_Con_ID(C) (EBufferStart(&((C)->comm_con_id)))
|
||||
#define SNMP_Community_Get_Con_ID_Len(C) (EBufferUsed(&((C)->comm_con_id)))
|
||||
#define SNMP_Community_Set_Con_ID(C, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((C)->comm_con_id), (S), (L)))
|
||||
|
||||
#define SNMP_Community_Get_Con_Name(C) (EBufferStart(&((C)->comm_con_name)))
|
||||
#define SNMP_Community_Get_Con_Name_Len(C) (EBufferUsed(&((C)->comm_con_name)))
|
||||
#define SNMP_Community_Set_Con_Name(C, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((C)->comm_con_name), (S), (L)))
|
||||
|
||||
#define SNMP_Community_Get_Tag(C) (EBufferStart(&((C)->comm_tag)))
|
||||
#define SNMP_Community_Get_Tag_Len(C) (EBufferUsed(&((C)->comm_tag)))
|
||||
#define SNMP_Community_Set_Tag(C, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((C)->comm_tag), (S), (L)))
|
||||
|
||||
#define SNMP_Community_Get_Storage(C) ((C)->storage)
|
||||
#define SNMP_Community_Set_Storage(C, V) ((C)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Community_Get_Status(C) ((C)->status)
|
||||
#define SNMP_Community_Set_Status(C, V) ((C)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Community_Get_Flags(C) ((C)->flags)
|
||||
#define SNMP_Community_Set_Flags(C, V) ((C)->flags = (bits16_t)(V))
|
||||
|
||||
extern void snmpCommunityEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpCommunityEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpCommunityEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpCommunityEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern struct SNMP_TARGET_ADDR_S *find_target_by_community __((EBUFFER_T *,
|
||||
OBJ_ID_T *,
|
||||
EBUFFER_T *));
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_V3_NOTIFY) || (INSTALL_ENVOY_SNMP_V3_PROXY)
|
||||
/* Some well-known OIDs that will be necessary to deal with traps
|
||||
* and proxies
|
||||
*/
|
||||
extern OIDC_T COEX_SNMPTRAPOID[];
|
||||
extern OIDC_T COEX_TRAPENTERPRISE[];
|
||||
extern OIDC_T COEX_SNMPTRAPS[];
|
||||
extern OIDC_T COEX_COLDSTART[];
|
||||
extern OIDC_T COEX_WARMSTART[];
|
||||
extern OIDC_T COEX_LINKDOWN[];
|
||||
extern OIDC_T COEX_LINKUP[];
|
||||
extern OIDC_T COEX_AUTHFAILURE[];
|
||||
extern OIDC_T COEX_NEIGHBORLOSS[];
|
||||
#endif
|
||||
|
||||
/* The leaf definitions for the method routines */
|
||||
#define LEAF_snmpCommunityIndex 1
|
||||
#define MINSIZE_snmpCommunityIndex 1L
|
||||
#define MAXSIZE_snmpCommunityIndex 32L
|
||||
#define LEAF_snmpCommunityName 2
|
||||
#define LEAF_snmpCommunitySecurityName 3
|
||||
#define MINSIZE_snmpCommunitySecurityName 1L
|
||||
#define MAXSIZE_snmpCommunitySecurityName 32L
|
||||
#define LEAF_snmpCommunityContextEngineID 4
|
||||
#define MINSIZE_snmpCommunityContextEngineID 5L
|
||||
#define MAXSIZE_snmpCommunityContextEngineID 32L
|
||||
#define LEAF_snmpCommunityContextName 5
|
||||
#define MINSIZE_snmpCommunityContextName 0L
|
||||
#define MAXSIZE_snmpCommunityContextName 32L
|
||||
#define LEAF_snmpCommunityTransportTag 6
|
||||
#define MINSIZE_snmpCommunityTransportTag 0L
|
||||
#define MAXSIZE_snmpCommunityTransportTag 255L
|
||||
#define LEAF_snmpCommunityStorageType 7
|
||||
#define VAL_snmpCommunityStorageType_other 1L
|
||||
#define VAL_snmpCommunityStorageType_volatile 2L
|
||||
#define VAL_snmpCommunityStorageType_nonVolatile 3L
|
||||
#define VAL_snmpCommunityStorageType_permanent 4L
|
||||
#define VAL_snmpCommunityStorageType_readOnly 5L
|
||||
#define LEAF_snmpCommunityStatus 8
|
||||
#define VAL_snmpCommunityStatus_active 1L
|
||||
#define VAL_snmpCommunityStatus_notInService 2L
|
||||
#define VAL_snmpCommunityStatus_notReady 3L
|
||||
#define VAL_snmpCommunityStatus_createAndGo 4L
|
||||
#define VAL_snmpCommunityStatus_createAndWait 5L
|
||||
#define VAL_snmpCommunityStatus_destroy 6L
|
||||
#define LEAF_snmpTargetAddrTMask 1
|
||||
#define MINSIZE_snmpTargetAddrTMask 0L
|
||||
#define MAXSIZE_snmpTargetAddrTMask 255L
|
||||
#define LEAF_snmpTargetAddrMMS 2
|
||||
#define MIN_snmpTargetAddrMMS 484L
|
||||
#define MAX_snmpTargetAddrMMS 2147483646L
|
||||
#define LEAF_snmpTrapAddress 3
|
||||
#define LEAF_snmpTrapCommunity 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_comm_inc))*/
|
||||
@@ -0,0 +1,128 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_con.h,v 1.2 2001/11/06 21:35:05 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_con.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:05 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/01/19 22:22:11 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.4 2000/03/17 19:48:44 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.3 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.2 2000/03/09 16:59:47 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 2000/02/04 21:54:21 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:24 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.4 1998/08/01 17:29:05 sar
|
||||
* Add argument to context length function
|
||||
*
|
||||
* Revision 1.3 1998/06/09 16:43:54 sar
|
||||
* Moved some context routines to snmp so that they are in the core code
|
||||
* and can be used by the rest of the core. Also renamed the routines
|
||||
* to keep them separate from usec.
|
||||
*
|
||||
* Revision 1.2 1998/05/30 02:52:07 sar
|
||||
* Modifed the names used for max string length
|
||||
* Updated user lookup
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:40 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_context_inc))
|
||||
#define v3_context_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#define ETC_CONTEXT_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_CONTEXT_S
|
||||
{
|
||||
struct SNMP_CONTEXT_S *next;
|
||||
bits8_t *name;
|
||||
ALENGTH_T length;
|
||||
} SNMP_CONTEXT_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
extern SNMP_CONTEXT_T *v3_context_root;
|
||||
|
||||
extern int SNMP_V3_Context_Add __((bits8_t *, ALENGTH_T));
|
||||
extern int SNMP_V3_Context_Remove __((bits8_t *, ALENGTH_T));
|
||||
extern SNMP_CONTEXT_T *SNMP_V3_Context_Find __((bits8_t *, ALENGTH_T));
|
||||
|
||||
#define SNMP_V3_Context_Name(C) ((C)->name)
|
||||
#define SNMP_V3_Context_Name_Length(C) ((C)->length)
|
||||
|
||||
extern void contexttable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void contexttable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* v3_context_inc */
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
/* v3_dh.h - v3_dh.h routines */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01c,04may05,asl Diffie-Hellman work
|
||||
01b,02may05,job fix superfluous definitions
|
||||
01a,28apr05,job remove extraneous prototype
|
||||
*/
|
||||
|
||||
#if (!defined(v3_dh_inc))
|
||||
#define v3_dh_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
|
||||
#include <openssl/bn.h>
|
||||
|
||||
#define DH_MAX_FIELD_LEN 2
|
||||
#define DH_LONG_FORM 2
|
||||
#define DH_MIN_PARAMS_LEN 256
|
||||
#define DH_SEQID 0x30
|
||||
#define DH_MINKEYCHG 4
|
||||
|
||||
#define DH_SEED_PRIME 211
|
||||
#define DH_MAX_SEED_BYTES 256
|
||||
|
||||
#ifndef SNMP_DH_RAND
|
||||
#define SNMP_DH_RAND()
|
||||
#endif
|
||||
|
||||
#define DH_PRIMELEN BN_num_bytes (SNMP_DH_params.prime)
|
||||
|
||||
extern BN_CTX *SNMP_DH_bnCtx;
|
||||
extern SNMP_DH_PARAMS_T SNMP_DH_params;
|
||||
|
||||
int SNMP_DH_encodeParams (BIGNUM *prime, int base, int pvl, EBUFFER_T *result);
|
||||
int SNMP_DH_decodeParams (EBUFFER_T *BUFFER, BIGNUM *prime, int *base, int *pvl);
|
||||
int SNMP_set_DH_params (int primeLen, bits8_t *prime, int base, int pvl);
|
||||
int SNMP_get_DH_params (int *primeLen, bits8_t **prime, int *base, int *pvl);
|
||||
int SNMP_bn2bin (BIGNUM *bignum, bits8_t **binVal);
|
||||
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* v3_dh_inc */
|
||||
@@ -0,0 +1,218 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_eng.h,v 1.3 2002/04/01 21:33:27 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_eng.h,v $
|
||||
* Revision 1.3 2002/04/01 21:33:27 josh
|
||||
* make sure that engine ids conform to restricted lengths
|
||||
* (minimum of 5, maximum of 32)
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:06 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:23 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.11 2001/04/11 20:42:56 josh
|
||||
* merge from the kingfisher branch
|
||||
*
|
||||
* Revision 9.10 2001/01/19 22:22:11 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.9 2000/07/12 18:39:30 josh
|
||||
* moving SNMP_Find_Matching_Engine_ID() to v3_eng.c -- appropriately
|
||||
* updating headers to correspond
|
||||
*
|
||||
* Revision 9.8 2000/06/09 14:54:12 josh
|
||||
* modifications due to new installation options, new proxy code
|
||||
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
|
||||
* be built with the target code
|
||||
*
|
||||
* Revision 9.7.2.2 2001/03/12 22:08:00 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.7.2.1 2000/09/21 21:14:54 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.7 2000/03/17 19:48:44 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.6 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.5 2000/03/09 17:00:01 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.4 2000/02/04 21:54:22 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.3 1999/10/29 21:47:24 josh
|
||||
* better control over how and when ENVOY_ADD_ENGINE_ADDRESS and
|
||||
* ENVOY_ADD_ENGINE_ID are defined.
|
||||
*
|
||||
* Revision 9.2 1999/10/07 23:39:56 josh
|
||||
* default definitions for ENVOY_ADD_ENGINE_ID and
|
||||
* ENVOY_ADD_ENGINE_ADDRESS
|
||||
*
|
||||
* Revision 9.1 1999/09/27 21:11:44 josh
|
||||
* fixing nits, rewriting engine id <--> address code, adding installation
|
||||
* option
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:24 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.6 1998/08/12 04:52:16 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 1.5 1998/07/20 01:59:57 sar
|
||||
* Add () to SNMP_Engine_Get_My_* and ENVOY_TIME calls
|
||||
* Modify the timestamp installs so they are all the same,
|
||||
* installing ENVOY_TIME() - timestamp
|
||||
*
|
||||
* Revision 1.4 1998/07/03 16:54:53 sar
|
||||
* Remove many engine install option, moved this engine's information
|
||||
* into an engine structure
|
||||
*
|
||||
* Revision 1.3 1998/06/18 04:42:04 sar
|
||||
* Modified bflags in ebuffer to be unsigned ints and updated
|
||||
* calling routines accordingly
|
||||
*
|
||||
* Revision 1.2 1998/05/30 02:52:08 sar
|
||||
* Modifed the names used for max string length
|
||||
* Updated user lookup
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:40 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_eng_inc))
|
||||
#define v3_eng_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#define ETC_ENGINE_ENGINE_MIN 5
|
||||
#define ETC_ENGINE_ENGINE_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct ENGINE_LEAF_S
|
||||
{
|
||||
struct ENGINE_LEAF_S *next;
|
||||
bits8_t *id;
|
||||
ALENGTH_T id_len;
|
||||
bits32_t boots;
|
||||
sbits32_t offset;
|
||||
sbits32_t lasttime;
|
||||
#if INSTALL_ENVOY_SNMP_V3_TARGET
|
||||
OBJ_ID_T tdomain; /* information to allow us to find */
|
||||
EBUFFER_T taddress; /* a remote engineid for informs */
|
||||
#endif
|
||||
} ENGINE_LEAF_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_ADD_ENGINE_ADDRESS
|
||||
#if (INSTALL_ENVOY_SNMP_V3_TARGET)
|
||||
extern int envoy_add_engine_address __((SNMP_PKT_T *, SNMPADDR_T *, int));
|
||||
|
||||
#define ENVOY_ADD_ENGINE_ADDRESS(P, A, C) \
|
||||
envoy_add_engine_address((P), (A), (C))
|
||||
#elif defined(ENVOY_ADD_ENGINE_ID)
|
||||
#define ENVOY_ADD_ENGINE_ADDRESS(P, A, C) (ENVOY_ADD_ENGINE_ID(P), 1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* global variables */
|
||||
extern sbits32_t v3_snmpEngineMaxMessageSize;
|
||||
extern ENGINE_LEAF_T *v3_my_engine;
|
||||
extern ENGINE_LEAF_T *root_engine;
|
||||
|
||||
extern int SNMP_Engine_Set_My_Info __((bits8_t *, ALENGTH_T,
|
||||
bits32_t, sbits32_t));
|
||||
#define SNMP_Engine_Get_My_ID() (v3_my_engine ? v3_my_engine->id : 0)
|
||||
#define SNMP_Engine_Get_My_ID_Length() (v3_my_engine ? v3_my_engine->id_len : 0)
|
||||
#define SNMP_Engine_Get_My_Boots() (v3_my_engine ? v3_my_engine->boots : 0)
|
||||
#define SNMP_Engine_Get_My_Time() (v3_my_engine ? \
|
||||
(ENVOY_TIME()) - v3_my_engine->offset : 0)
|
||||
|
||||
#define SNMP_Engine_Get_Boots(E) ((E)->boots)
|
||||
#define SNMP_Engine_Get_Time(E) ((ENVOY_TIME()) - (E)->offset)
|
||||
#define SNMP_Engine_Get_LastTime(E) ((E)->lasttime)
|
||||
|
||||
#define SNMP_Engine_Set_Info(E, B, T) ((E)->boots = (B), \
|
||||
(E)->offset = (ENVOY_TIME()) - (T),\
|
||||
(E)->lasttime = (T))
|
||||
|
||||
extern void SNMP_Find_Matching_Engine_ID __((OBJ_ID_T *, EBUFFER_T *,
|
||||
bits8_t **, ALENGTH_T *));
|
||||
extern int SNMP_Engine_Set_Address __((bits8_t *, ALENGTH_T,
|
||||
OIDC_T *, int,
|
||||
bits8_t *, ALENGTH_T));
|
||||
extern ENGINE_LEAF_T * SNMP_Engine_Lookup __((bits8_t *, ALENGTH_T));
|
||||
extern int SNMP_Engine_Install __((bits8_t *, ALENGTH_T,
|
||||
bits32_t, sbits32_t));
|
||||
|
||||
extern void get_snmpEngineID __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void get_snmpEngineBoots __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void get_snmpEngineTime __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (!defined(v3_eng_inc)) */
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_ini.h,v 1.3 2001/11/06 21:50:41 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2011 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_ini.h,v $
|
||||
* Revision 1.3 2001/11/06 21:50:41 josh
|
||||
* second (and hopefully final) pass of new path hacking
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:06 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.3 2001/01/19 22:22:11 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.2 2000/03/17 19:48:45 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.1 2000/03/09 17:00:12 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:25 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/08/12 04:52:16 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,16jun11,y_t update for requirement WIND00242199
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_ini_inc))
|
||||
#define v3_ini_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1conf_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1conf.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmp_inc))
|
||||
#include <wrn/wm/snmp/engine/snmp.h>
|
||||
#endif
|
||||
|
||||
extern void envoy_v3_init __((void));
|
||||
|
||||
#ifdef _WRS_CONFIG_COMPONENT_IPCRYPTO_USE_FIPS_140_2
|
||||
#define OPENSSL_FIPS
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_ini_inc)) */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_mth.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_mth.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:06 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4.4.1 2001/07/16 18:02:13 josh
|
||||
* a first-round commit adding infrastructure support
|
||||
* for the SNMPv3 Coexistence RFC (2576)
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:12 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:45 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 17:00:24 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.1 1999/10/15 17:44:50 josh
|
||||
* added prototypes for method routines for target and notify MIBs
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:25 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.2 1998/07/03 16:54:53 sar
|
||||
* Remove many engine install option, moved this engine's information
|
||||
* into an engine structure
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:40 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,21apr05,AJS Diffie-Hellman work
|
||||
01a,19apr05,job update copyright notices
|
||||
01a,13apr05,AJS Diffie-Hellman work
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_mth_inc))
|
||||
#define v3_mth_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(vb_inc))
|
||||
#include <wrn/wm/snmp/engine/vbdefs.h>
|
||||
#endif
|
||||
|
||||
/* for our engine information */
|
||||
extern void get_snmpEngineID __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void get_snmpEngineBoots __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void get_snmpEngineTime __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
/* for the targetaddr table */
|
||||
extern void snmpTargetAddrEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetAddrEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetAddrEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetAddrEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the targetparams table */
|
||||
extern void snmpTargetParamsEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetParamsEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetParamsEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpTargetParamsEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the notify table */
|
||||
extern void snmpNotifyEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the notifyfilterprofile table */
|
||||
extern void snmpNotifyFilterProfileEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterProfileEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterProfileEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterProfileEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the notifyfilter table */
|
||||
extern void snmpNotifyFilterEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpNotifyFilterEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the proxy table */
|
||||
extern void snmpProxyEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpProxyEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpProxyEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpProxyEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the user table */
|
||||
extern void usertable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usertable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usertable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usertable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* Diffie-Hellman usmDHParameters object */
|
||||
|
||||
extern void usmDHPublicObjects_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usmDHPublicObjects_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usmDHPublicObjects_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void usmDHPublicObjects_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* for the context table, read only so don't have test or set */
|
||||
extern void contexttable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void contexttable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
|
||||
/* for the security to group and access tables */
|
||||
extern void grouptable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void grouptable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void grouptable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void grouptable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void accesstable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void accesstable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void accesstable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void accesstable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
/* for the community table */
|
||||
extern void snmpCommunityEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpCommunityEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpCommunityEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
extern void snmpCommunityEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,402 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_ntfy.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_ntfy.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:06 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.6 2001/01/19 22:22:12 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:46 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 17:06:27 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 2000/02/04 21:54:24 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.1 2000/01/02 22:55:56 josh
|
||||
* patching up a memory leak here, a broken compare there...per
|
||||
* sar's comments
|
||||
*
|
||||
* Revision 9.0 1999/10/21 20:43:36 josh
|
||||
* updating version stamps
|
||||
*
|
||||
* Revision 1.7 1999/10/21 19:13:08 josh
|
||||
* adding flags for flags fields in various objects to help with row
|
||||
* creation
|
||||
*
|
||||
* Revision 1.6 1999/10/15 17:47:27 josh
|
||||
* included MIB leaf definitions and cleaned up useless macros
|
||||
*
|
||||
* Revision 1.5 1999/09/21 21:31:26 josh
|
||||
* Adding a limit constant for the NotifyFilterMask
|
||||
*
|
||||
* Revision 1.4 1999/09/14 19:35:26 josh
|
||||
* updating default initialization per RFC 2573
|
||||
*
|
||||
* Revision 1.3 1999/09/11 02:15:19 josh
|
||||
* added definitions for filter excluded and included
|
||||
*
|
||||
* Revision 1.2 1999/09/01 20:50:02 josh
|
||||
* updates to reach consistency with v3_ntfy.c
|
||||
*
|
||||
* Revision 1.1 1999/06/16 17:04:22 josh
|
||||
* First step of adding RFC2573 Notify support.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_ntfy_inc))
|
||||
#define v3_ntfy_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define ETC_NOTIFY_MAX 32
|
||||
#define ETC_NOTIFY_FILTER_PROFILE_MAX 32
|
||||
#define ETC_NOTIFY_FILTER_MAX 32
|
||||
#define ETC_NOTIFY_FILTER_MASK_MAX 16
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_NOTIFY_S
|
||||
{
|
||||
struct SNMP_NOTIFY_S *next;
|
||||
EBUFFER_T notify_name; /* Name of the notify */
|
||||
EBUFFER_T notify_tag; /* Tag notify is associated with */
|
||||
bits16_t notify_type; /* Trap or Inform? */
|
||||
#define SNMP_NOTIFY_TRAP 1
|
||||
#define SNMP_NOTIFY_INFORM 2
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_NOTIFY_T;
|
||||
|
||||
/* global root pointer for notify list */
|
||||
extern SNMP_NOTIFY_T *root_notify;
|
||||
|
||||
#define SNMP_Notify_Set_Defaults(T) \
|
||||
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_T)), \
|
||||
EBufferInitialize(&((T)->notify_name)), \
|
||||
EBufferInitialize(&((T)->notify_tag)), \
|
||||
(T)->notify_type = SNMP_NOTIFY_TRAP, \
|
||||
(T)->storage = ETC_STO_NONVOL, \
|
||||
(T)->status = ETC_RS_NREADY, \
|
||||
(T)->flags = 0)
|
||||
|
||||
extern SNMP_NOTIFY_T * SNMP_Notify_Create __((void));
|
||||
extern void SNMP_Notify_Destroy __((SNMP_NOTIFY_T *));
|
||||
extern int SNMP_Notify_Install __((SNMP_NOTIFY_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern void SNMP_Notify_Deinstall __((SNMP_NOTIFY_T *));
|
||||
extern SNMP_NOTIFY_T * SNMP_Notify_Lookup __((bits8_t *, ALENGTH_T));
|
||||
extern SNMP_NOTIFY_T * SNMP_Notify_Next __((int, OIDC_T *));
|
||||
extern SNMP_NOTIFY_T * SNMP_Notify_Next_Notify __((SNMP_NOTIFY_T *));
|
||||
extern void SNMP_Notify_Name __((SNMP_NOTIFY_T *, bits8_t *,
|
||||
ALENGTH_T *));
|
||||
|
||||
#define SNMP_Notify_Get_Name(N) (EBufferStart(&((N)->notify_name)))
|
||||
#define SNMP_Notify_Get_Name_Len(N) (EBufferUsed(&((N)->notify_name)))
|
||||
|
||||
#define SNMP_Notify_Get_Tag(N) (EBufferStart(&((N)->notify_tag)))
|
||||
#define SNMP_Notify_Get_Tag_Len(N) (EBufferUsed(&((N)->notify_tag)))
|
||||
#define SNMP_Notify_Set_Tag(N, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((N)->notify_tag), (S), (L)))
|
||||
|
||||
#define SNMP_Notify_Get_Type(N) ((N)->notify_type)
|
||||
#define SNMP_Notify_Set_Type(N, V) ((N)->notify_type = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Get_Storage(N) ((N)->storage)
|
||||
#define SNMP_Notify_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Get_Status(N) ((N)->status)
|
||||
#define SNMP_Notify_Set_Status(N, V) ((N)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Get_Flags(N) ((N)->flags)
|
||||
#define SNMP_Notify_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
|
||||
|
||||
typedef struct SNMP_NOTIFY_FILTER_PROFILE_S
|
||||
{
|
||||
struct SNMP_NOTIFY_FILTER_PROFILE_S *next;
|
||||
EBUFFER_T params_name; /* From snmpTargetParamsTable */
|
||||
EBUFFER_T profile_name; /* Name of filter profile */
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_NOTIFY_FILTER_PROFILE_T;
|
||||
|
||||
#define ETC_NPROF_PROFILE 0x01
|
||||
#define ETC_NPROF_ALL_FLAGS 0x01
|
||||
|
||||
/* global root pointer for notify filter profile list */
|
||||
extern SNMP_NOTIFY_FILTER_PROFILE_T *root_notify_filter_profile;
|
||||
|
||||
#define SNMP_Notify_Profile_Set_Defaults(T) \
|
||||
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_FILTER_PROFILE_T)), \
|
||||
EBufferInitialize(&((T)->params_name)), \
|
||||
EBufferInitialize(&((T)->profile_name)), \
|
||||
(T)->storage = ETC_STO_NONVOL, \
|
||||
(T)->status = ETC_RS_NREADY, \
|
||||
(T)->flags = 0)
|
||||
|
||||
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Create
|
||||
__((void));
|
||||
extern void SNMP_Notify_Profile_Destroy
|
||||
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
|
||||
extern int SNMP_Notify_Profile_Install
|
||||
__((SNMP_NOTIFY_FILTER_PROFILE_T *, bits8_t *, ALENGTH_T));
|
||||
extern void SNMP_Notify_Profile_Deinstall
|
||||
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
|
||||
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Lookup
|
||||
__((bits8_t *, ALENGTH_T));
|
||||
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Next
|
||||
__((int, OIDC_T *));
|
||||
extern SNMP_NOTIFY_FILTER_PROFILE_T * SNMP_Notify_Profile_Next_Profile
|
||||
__((SNMP_NOTIFY_FILTER_PROFILE_T *));
|
||||
extern void SNMP_Notify_Profile_Name
|
||||
__((SNMP_NOTIFY_FILTER_PROFILE_T *, bits8_t *, ALENGTH_T *));
|
||||
|
||||
#define SNMP_Notify_Profile_Get_Params(N) \
|
||||
(EBufferStart(&((N)->params_name)))
|
||||
#define SNMP_Notify_Profile_Get_Params_Len(N) \
|
||||
(EBufferUsed(&((N)->params_name)))
|
||||
|
||||
#define SNMP_Notify_Profile_Get_Profile(N) \
|
||||
(EBufferStart(&((N)->profile_name)))
|
||||
#define SNMP_Notify_Profile_Get_Profile_Len(N) \
|
||||
(EBufferUsed(&((N)->profile_name)))
|
||||
#define SNMP_Notify_Profile_Set_Profile(N, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((N)->profile_name), (S), (L)))
|
||||
|
||||
#define SNMP_Notify_Profile_Get_Storage(N) ((N)->storage)
|
||||
#define SNMP_Notify_Profile_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Profile_Get_Status(N) ((N)->status)
|
||||
#define SNMP_Notify_Profile_Set_Status(N, V) ((N)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Profile_Get_Flags(N) ((N)->flags)
|
||||
#define SNMP_Notify_Profile_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
|
||||
|
||||
typedef struct SNMP_NOTIFY_FILTER_S
|
||||
{
|
||||
struct SNMP_NOTIFY_FILTER_S *next;
|
||||
EBUFFER_T profile_name; /* From snmpNotifyFilterProfileTable */
|
||||
OBJ_ID_T subtree; /* MIB subtree for this filter */
|
||||
EBUFFER_T filter_mask; /* Mask for subtree */
|
||||
bits16_t filter_type; /* include or exclude filter */
|
||||
#define SNMP_NOTIFY_FILTER_INCLUDED 1
|
||||
#define SNMP_NOTIFY_FILTER_EXCLUDED 2
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_NOTIFY_FILTER_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
/* global root pointer for notify filter list */
|
||||
extern SNMP_NOTIFY_FILTER_T *root_notify_filter;
|
||||
|
||||
#define SNMP_Notify_Filter_Set_Defaults(T) \
|
||||
(MEMSET((T), 0, sizeof(SNMP_NOTIFY_FILTER_T)), \
|
||||
EBufferInitialize(&((T)->profile_name)) , \
|
||||
EBufferInitialize(&((T)->filter_mask)), \
|
||||
(T)->filter_type = SNMP_NOTIFY_FILTER_INCLUDED, \
|
||||
(T)->storage = ETC_STO_NONVOL, \
|
||||
(T)->status = ETC_RS_NREADY, \
|
||||
(T)->flags = 0)
|
||||
|
||||
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Create __((void));
|
||||
extern void SNMP_Notify_Filter_Destroy __((SNMP_NOTIFY_FILTER_T *));
|
||||
extern int SNMP_Notify_Filter_Install __((SNMP_NOTIFY_FILTER_T *, bits8_t *,
|
||||
ALENGTH_T, OBJ_ID_T *));
|
||||
extern void SNMP_Notify_Filter_Deinstall __((SNMP_NOTIFY_FILTER_T *));
|
||||
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Lookup
|
||||
__((bits8_t *, ALENGTH_T, OBJ_ID_T *));
|
||||
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Next __((int, OIDC_T *));
|
||||
extern SNMP_NOTIFY_FILTER_T * SNMP_Notify_Filter_Next_Filter
|
||||
__((SNMP_NOTIFY_FILTER_T *));
|
||||
extern void SNMP_Notify_Filter_Name __((SNMP_NOTIFY_FILTER_T *,
|
||||
bits8_t *, ALENGTH_T *,
|
||||
OIDC_T **, int *));
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Profile(N) \
|
||||
(EBufferStart(&((N)->profile_name)))
|
||||
#define SNMP_Notify_Filter_Get_Profile_Len(N) \
|
||||
(EBufferUsed(&((N)->profile_name)))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Subtree(N) (&((N)->subtree))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Mask(N) \
|
||||
(EBufferStart(&((N)->filter_mask)))
|
||||
#define SNMP_Notify_Filter_Get_Mask_Len(N) \
|
||||
(EBufferUsed(&((N)->filter_mask)))
|
||||
#define SNMP_Notify_Filter_Set_Mask(N, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((N)->filter_mask), (S), (L)))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Type(N) ((N)->filter_type)
|
||||
#define SNMP_Notify_Filter_Set_Type(N, V) ((N)->filter_type = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Storage(N) ((N)->storage)
|
||||
#define SNMP_Notify_Filter_Set_Storage(N, V) ((N)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Status(N) ((N)->status)
|
||||
#define SNMP_Notify_Filter_Set_Status(N, V) ((N)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Notify_Filter_Get_Flags(N) ((N)->flags)
|
||||
#define SNMP_Notify_Filter_Set_Flags(N, V) ((N)->flags = (bits16_t)(V))
|
||||
|
||||
extern void snmpNotifyEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterProfileEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterProfileEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterProfileEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterProfileEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpNotifyFilterEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* The leaf definitions for the method routines */
|
||||
#define LEAF_snmpNotifyName 1
|
||||
#define MINSIZE_snmpNotifyName 1L
|
||||
#define MAXSIZE_snmpNotifyName 32L
|
||||
#define LEAF_snmpNotifyTag 2
|
||||
#define MINSIZE_snmpNotifyTag 0L
|
||||
#define MAXSIZE_snmpNotifyTag 255L
|
||||
#define LEAF_snmpNotifyType 3
|
||||
#define VAL_snmpNotifyType_trap 1L
|
||||
#define VAL_snmpNotifyType_inform 2L
|
||||
#define LEAF_snmpNotifyStorageType 4
|
||||
#define VAL_snmpNotifyStorageType_other 1L
|
||||
#define VAL_snmpNotifyStorageType_volatile 2L
|
||||
#define VAL_snmpNotifyStorageType_nonVolatile 3L
|
||||
#define VAL_snmpNotifyStorageType_permanent 4L
|
||||
#define VAL_snmpNotifyStorageType_readOnly 5L
|
||||
#define LEAF_snmpNotifyRowStatus 5
|
||||
#define VAL_snmpNotifyRowStatus_active 1L
|
||||
#define VAL_snmpNotifyRowStatus_notInService 2L
|
||||
#define VAL_snmpNotifyRowStatus_notReady 3L
|
||||
#define VAL_snmpNotifyRowStatus_createAndGo 4L
|
||||
#define VAL_snmpNotifyRowStatus_createAndWait 5L
|
||||
#define VAL_snmpNotifyRowStatus_destroy 6L
|
||||
#define LEAF_snmpNotifyFilterProfileName 1
|
||||
#define MINSIZE_snmpNotifyFilterProfileName 1L
|
||||
#define MAXSIZE_snmpNotifyFilterProfileName 32L
|
||||
#define LEAF_snmpNotifyFilterProfileStorType 2
|
||||
#define VAL_snmpNotifyFilterProfileStorType_other 1L
|
||||
#define VAL_snmpNotifyFilterProfileStorType_volatile 2L
|
||||
#define VAL_snmpNotifyFilterProfileStorType_nonVolatile 3L
|
||||
#define VAL_snmpNotifyFilterProfileStorType_permanent 4L
|
||||
#define VAL_snmpNotifyFilterProfileStorType_readOnly 5L
|
||||
#define LEAF_snmpNotifyFilterProfileRowStatus 3
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_active 1L
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_notInService 2L
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_notReady 3L
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_createAndGo 4L
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_createAndWait 5L
|
||||
#define VAL_snmpNotifyFilterProfileRowStatus_destroy 6L
|
||||
#define LEAF_snmpNotifyFilterSubtree 1
|
||||
#define LEAF_snmpNotifyFilterMask 2
|
||||
#define MINSIZE_snmpNotifyFilterMask 0L
|
||||
#define MAXSIZE_snmpNotifyFilterMask 16L
|
||||
#define LEAF_snmpNotifyFilterType 3
|
||||
#define VAL_snmpNotifyFilterType_included 1L
|
||||
#define VAL_snmpNotifyFilterType_excluded 2L
|
||||
#define LEAF_snmpNotifyFilterStorageType 4
|
||||
#define VAL_snmpNotifyFilterStorageType_other 1L
|
||||
#define VAL_snmpNotifyFilterStorageType_volatile 2L
|
||||
#define VAL_snmpNotifyFilterStorageType_nonVolatile 3L
|
||||
#define VAL_snmpNotifyFilterStorageType_permanent 4L
|
||||
#define VAL_snmpNotifyFilterStorageType_readOnly 5L
|
||||
#define LEAF_snmpNotifyFilterRowStatus 5
|
||||
#define VAL_snmpNotifyFilterRowStatus_active 1L
|
||||
#define VAL_snmpNotifyFilterRowStatus_notInService 2L
|
||||
#define VAL_snmpNotifyFilterRowStatus_notReady 3L
|
||||
#define VAL_snmpNotifyFilterRowStatus_createAndGo 4L
|
||||
#define VAL_snmpNotifyFilterRowStatus_createAndWait 5L
|
||||
#define VAL_snmpNotifyFilterRowStatus_destroy 6L
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_ntfy_inc))*/
|
||||
@@ -0,0 +1,141 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_priv.h,v 1.2 2001/11/06 21:35:06 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_priv.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:06 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:12 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:46 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 17:06:57 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:26 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.3 1998/08/12 04:52:17 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 1.2 1998/05/27 22:53:53 sar
|
||||
* Add routines to manipulate the auth and priv lists (add and find),
|
||||
* as well as some specifics adds (md5, sha)
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:40 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,20apr09,y_t update for requirement WIND00000579
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_priv_inc))
|
||||
#define v3_priv_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
typedef ALENGTH_T (V3_PRIV_SIZE_T) __((ptr_t, ALENGTH_T));
|
||||
typedef int (V3_PRIV_ENCODE_T) __((bits8_t *, ALENGTH_T, sbits32_t, sbits32_t,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, bits8_t *));
|
||||
typedef int (V3_PRIV_DECODE_T) __((bits8_t *, ALENGTH_T,sbits32_t, sbits32_t,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, bits8_t *));
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_PRIV_S
|
||||
{
|
||||
struct SNMP_PRIV_S *next;
|
||||
OBJ_ID_T name; /* name of the priv protocol */
|
||||
V3_PRIV_SIZE_T *size; /* routine to calculate the size */
|
||||
V3_PRIV_ENCODE_T *encode; /* routine to encode */
|
||||
V3_PRIV_DECODE_T *decode; /* routine to decode */
|
||||
ALENGTH_T need; /* space required for priv stuff */
|
||||
ALENGTH_T keysize; /* space required for the key */
|
||||
} SNMP_PRIV_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
|
||||
/* global root pointer for the auth list */
|
||||
extern SNMP_PRIV_T *v3_priv_root;
|
||||
|
||||
extern SNMP_PRIV_T * SNMP_Priv_Find __((int, OIDC_T *));
|
||||
extern int SNMP_Priv_Add __((SNMP_PRIV_T *));
|
||||
extern int SNMP_Priv_Add_DES __((void));
|
||||
extern int SNMP_Priv_Add_AESCFB128 __((void));
|
||||
|
||||
#define SNMP_Priv_Size(P, PKT, SL) (((P)->size)((PKT), (SL)))
|
||||
#define SNMP_Priv_Encode(P, K, KL, BT, ET, B, BL, SP, OP) \
|
||||
(((P)->encode)((K), (KL), (BT),(ET), (B), (BL), (SP), (OP)))
|
||||
#define SNMP_Priv_Decode(P, K, KL, BT, ET, B, BL, SP, OP) \
|
||||
(((P)->decode)((K), (KL), (BT), (ET), (B), (BL), (SP), (OP)))
|
||||
|
||||
#define SNMP_Priv_Get_KeySize(P) ((P)->keysize)
|
||||
#define SNMP_Priv_Get_Need(P) ((P)->need)
|
||||
|
||||
#define SNMP_Priv_Get_Name(P) (&((P)->name))
|
||||
|
||||
extern OIDC_T v3_priv_nopriv[];
|
||||
extern int v3_priv_nopriv_size;
|
||||
|
||||
|
||||
extern SNMP_PRIV_T v3_priv_des;
|
||||
extern SNMP_PRIV_T v3_priv_aescfb128;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_priv_inc)) */
|
||||
@@ -0,0 +1,282 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_proxy.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
|
||||
|
||||
/* v3_proxy.h - definitions for RFC 2573 Proxy code */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
modification history
|
||||
--------------------
|
||||
01d,15sep09,y_t fix for WIND00181371
|
||||
01c,19apr05,job update copyright notices
|
||||
01b,25nov03,ps copyright update
|
||||
01a,25aug03,job fixing a prototype mismatch
|
||||
$Log: v3_proxy.h,v $
|
||||
Revision 1.2 2001/11/06 21:35:07 josh
|
||||
new revised path structure, first pass. Also removing useless
|
||||
shell include files.
|
||||
|
||||
Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
Tornado shuffle
|
||||
|
||||
Revision 9.4.2.4 2001/09/21 19:16:07 josh
|
||||
updating and expanding structures for use with coexistence
|
||||
|
||||
Revision 9.4.2.3 2001/08/31 17:02:20 josh
|
||||
clean up a few nits
|
||||
|
||||
Revision 9.4.2.2 2001/08/24 14:31:24 josh
|
||||
adding function prototypes for the proxy processing routines
|
||||
|
||||
Revision 9.4.2.1 2001/06/28 18:22:57 josh
|
||||
Seeding the Cormorant branch with the code from the old
|
||||
cormorant branch
|
||||
|
||||
Revision 9.3.2.1 2001/04/11 19:35:41 josh
|
||||
moving cormorant-specific files onto the special
|
||||
cormorant branch so they don't get in kingfisher's way
|
||||
|
||||
Revision 9.3 2001/01/19 22:22:12 paul
|
||||
Update copyright.
|
||||
|
||||
Revision 9.2 2000/07/12 18:42:27 josh
|
||||
definitions for proxy control block and associated flags and
|
||||
structures
|
||||
|
||||
Revision 9.1 2000/06/09 14:54:13 josh
|
||||
modifications due to new installation options, new proxy code
|
||||
moved some definitions from sendntfy.h into v3_trgt.h so they'd
|
||||
be built with the target code
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#if (!defined(__INCv3Proxyh))
|
||||
#define __INCv3Proxyh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#include <wrn/wm/snmp/engine/etimer.h>
|
||||
|
||||
#define ETC_PROXY_NAME_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_PROXY_S
|
||||
{
|
||||
struct SNMP_PROXY_S *next; /* next proxy object in list */
|
||||
struct EBUFFER_S proxy_name; /* the name of the proxy object */
|
||||
struct EBUFFER_S context_engine_id; /* engine id of this proxy */
|
||||
struct EBUFFER_S context_name; /* context name of proxy */
|
||||
struct EBUFFER_S target_params_in; /* for endpoint matching */
|
||||
struct EBUFFER_S single_target_out; /* for forwarding of requests */
|
||||
struct EBUFFER_S multiple_target_out; /* for forwarding of notifies */
|
||||
ETC_STORAGE_T storage; /* storage type of this object */
|
||||
ETC_STATUS_T status; /* row status of this object */
|
||||
bits8_t proxy_type; /* read, write, trap or inform */
|
||||
} SNMP_PROXY_T;
|
||||
|
||||
/* global root pointer for target params list */
|
||||
extern SNMP_PROXY_T *root_proxy;
|
||||
|
||||
#define SNMP_Proxy_Set_Defaults(P) \
|
||||
(MEMSET((P), 0, sizeof(SNMP_PROXY_T)), \
|
||||
EBufferInitialize(&((P)->proxy_name)), \
|
||||
EBufferInitialize(&((P)->context_engine_id)), \
|
||||
EBufferInitialize(&((P)->context_name)), \
|
||||
EBufferInitialize(&((P)->target_params_in)), \
|
||||
EBufferInitialize(&((P)->single_target_out)), \
|
||||
EBufferInitialize(&((P)->multiple_target_out)), \
|
||||
(P)->storage = ETC_STO_NONVOL, \
|
||||
(P)->status = ETC_RS_NREADY, \
|
||||
(P)->proxy_type = PROXY_TYPE_READ)
|
||||
|
||||
/* values for the proxy_type field */
|
||||
#define PROXY_TYPE_READ 1
|
||||
#define PROXY_TYPE_WRITE 2
|
||||
#define PROXY_TYPE_TRAP 3
|
||||
#define PROXY_TYPE_INFORM 4
|
||||
|
||||
extern SNMP_PROXY_T * SNMP_Proxy_Create __((void));
|
||||
extern void SNMP_Proxy_Destroy __((SNMP_PROXY_T * proxy));
|
||||
extern envoy_err_t SNMP_Proxy_Install __((SNMP_PROXY_T * proxy,
|
||||
bits8_t * proxy_name,
|
||||
ALENGTH_T proxy_name_len));
|
||||
extern void SNMP_Proxy_Deinstall __((SNMP_PROXY_T * proxy));
|
||||
extern SNMP_PROXY_T * SNMP_Proxy_Lookup __((bits8_t * proxy_name,
|
||||
ALENGTH_T proxy_name_len));
|
||||
extern SNMP_PROXY_T * SNMP_Proxy_Next __((int tcount,
|
||||
OIDC_T * tlist));
|
||||
extern SNMP_PROXY_T * SNMP_Proxy_Next_Proxy __((SNMP_PROXY_T * proxy));
|
||||
extern void SNMP_Proxy_Name __((SNMP_PROXY_T * proxy,
|
||||
bits8_t * proxy_name,
|
||||
ALENGTH_T * proxy_name_len));
|
||||
|
||||
#define SNMP_Proxy_Get_Proxy_Name(P) (EBufferStart(&((P)->proxy_name)))
|
||||
#define SNMP_Proxy_Get_Proxy_Name_Len(P) (EBufferUsed(&((P)->proxy_name)))
|
||||
|
||||
#define SNMP_Proxy_Get_Proxy_Type(P) ((P)->proxy_type)
|
||||
#define SNMP_Proxy_Set_Proxy_Type(P, V) ((P)->proxy_type = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Proxy_Get_Context_Engine_ID(P) \
|
||||
(EBufferStart(&((P)->context_engine_id)))
|
||||
#define SNMP_Proxy_Get_Context_Engine_ID_Len(P) \
|
||||
(EBufferUsed(&((P)->context_engine_id)))
|
||||
#define SNMP_Proxy_Set_Context_Engine_ID(P, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((P)->context_engine_id), (S), (L)))
|
||||
|
||||
#define SNMP_Proxy_Get_Context_Name(P) (EBufferStart(&((P)->context_name)))
|
||||
#define SNMP_Proxy_Get_Context_Name_Len(P) (EBufferUsed(&((P)->context_name)))
|
||||
#define SNMP_Proxy_Set_Context_Name(P, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((P)->context_name), (S), (L)))
|
||||
|
||||
#define SNMP_Proxy_Get_Target_Params_In(P) \
|
||||
(EBufferStart(&((P)->target_params_in)))
|
||||
#define SNMP_Proxy_Get_Target_Params_In_Len(P) \
|
||||
(EBufferUsed(&((P)->target_params_in)))
|
||||
#define SNMP_Proxy_Set_Target_Params_In(P, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((P)->target_params_in), (S), (L)))
|
||||
|
||||
#define SNMP_Proxy_Get_Single_Target_Out(P) \
|
||||
(EBufferStart(&((P)->single_target_out)))
|
||||
#define SNMP_Proxy_Get_Single_Target_Out_Len(P) \
|
||||
(EBufferUsed(&((P)->single_target_out)))
|
||||
#define SNMP_Proxy_Set_Single_Target_Out(P, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((P)->single_target_out), (S), (L)))
|
||||
|
||||
#define SNMP_Proxy_Get_Multiple_Target_Out(P) \
|
||||
(EBufferStart(&((P)->multiple_target_out)))
|
||||
#define SNMP_Proxy_Get_Multiple_Target_Out_Len(P) \
|
||||
(EBufferUsed(&((P)->multiple_target_out)))
|
||||
#define SNMP_Proxy_Set_Multiple_Target_Out(P, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((P)->multiple_target_out), (S), (L)))
|
||||
|
||||
#define SNMP_Proxy_Get_Storage(P) ((P)->storage)
|
||||
#define SNMP_Proxy_Set_Storage(P, V) ((P)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Proxy_Get_Status(P) ((P)->status)
|
||||
#define SNMP_Proxy_Set_Status(P, V) ((P)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Proxy_Get_Flags(P) ((P)->flags)
|
||||
#define SNMP_Proxy_Set_Flags(P, V) ((P)->flags = (bits16_t)(V))
|
||||
|
||||
/* User-definable stuff */
|
||||
#ifndef PROXY_SWEEP_TIME
|
||||
#define PROXY_SWEEP_TIME 3000
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_SNMP_SEND_PROXY
|
||||
#define ENVOY_SNMP_SEND_PROXY(FOR, LOC, PKT, SIZ)
|
||||
#endif
|
||||
|
||||
/* structure definition for proxy control block */
|
||||
struct TARGET_LIST_S;
|
||||
|
||||
typedef struct SNMP_PROXY_CB_S
|
||||
{
|
||||
struct SNMP_PROXY_CB_S * next;
|
||||
struct TARGET_LIST_S * targetList;
|
||||
SNMP_PKT_T * originalPkt;
|
||||
EBUFFER_T contextEngineID;
|
||||
EBUFFER_T contextName;
|
||||
EBUFFER_T secName;
|
||||
EBUFFER_T communityString;
|
||||
bits32_t msgID;
|
||||
bits32_t expires;
|
||||
bits8_t flags;
|
||||
} SNMP_PROXY_CB_T;
|
||||
|
||||
#define SNMP_PROXY_FLAGS_EXPIRED 0x01
|
||||
#define SNMP_PROXY_FLAGS_RESPONDED 0x02
|
||||
#define SNMP_PROXY_FLAGS_VBLIST_COPIED 0x04
|
||||
|
||||
typedef struct SNMP_PROXY_CB_ROOT_S
|
||||
{
|
||||
SNMP_PROXY_CB_T * pcb;
|
||||
bits32_t * nextMsgID;
|
||||
ENVOY_TIMER_T timer;
|
||||
} SNMP_PROXY_CB_ROOT_T;
|
||||
|
||||
extern SNMP_PROXY_CB_ROOT_T root_proxy_block;
|
||||
|
||||
extern envoy_err_t snmpProxyV3Request __((SNMP_PKT_T *));
|
||||
|
||||
extern envoy_err_t snmpProxyV3Notify __((SNMP_PKT_T *));
|
||||
|
||||
extern envoy_err_t snmpProxyV3Response __((SNMP_PKT_T *));
|
||||
|
||||
extern void snmpProxyEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpProxyEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpProxyEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpProxyEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
/* Definitions of leaf nodes for MIB support */
|
||||
|
||||
#define LEAF_snmpProxyName 1
|
||||
#define MINSIZE_snmpProxyName 1L
|
||||
#define MAXSIZE_snmpProxyName 32L
|
||||
#define LEAF_snmpProxyType 2
|
||||
#define VAL_snmpProxyType_read 1L
|
||||
#define VAL_snmpProxyType_write 2L
|
||||
#define VAL_snmpProxyType_trap 3L
|
||||
#define VAL_snmpProxyType_inform 4L
|
||||
#define LEAF_snmpProxyContextEngineID 3
|
||||
#define MINSIZE_snmpProxyContextEngineID 5L
|
||||
#define MAXSIZE_snmpProxyContextEngineID 32L
|
||||
#define LEAF_snmpProxyContextName 4
|
||||
#define MINSIZE_snmpProxyContextName 0L
|
||||
#define MAXSIZE_snmpProxyContextName 255L
|
||||
#define LEAF_snmpProxyTargetParamsIn 5
|
||||
#define MINSIZE_snmpProxyTargetParamsIn 0L
|
||||
#define MAXSIZE_snmpProxyTargetParamsIn 255L
|
||||
#define LEAF_snmpProxySingleTargetOut 6
|
||||
#define MINSIZE_snmpProxySingleTargetOut 0L
|
||||
#define MAXSIZE_snmpProxySingleTargetOut 255L
|
||||
#define LEAF_snmpProxyMultipleTargetOut 7
|
||||
#define MINSIZE_snmpProxyMultipleTargetOut 0L
|
||||
#define MAXSIZE_snmpProxyMultipleTargetOut 255L
|
||||
#define LEAF_snmpProxyStorageType 8
|
||||
#define VAL_snmpProxyStorageType_other 1L
|
||||
#define VAL_snmpProxyStorageType_volatile 2L
|
||||
#define VAL_snmpProxyStorageType_nonVolatile 3L
|
||||
#define VAL_snmpProxyStorageType_permanent 4L
|
||||
#define VAL_snmpProxyStorageType_readOnly 5L
|
||||
#define LEAF_snmpProxyRowStatus 9
|
||||
#define VAL_snmpProxyRowStatus_active 1L
|
||||
#define VAL_snmpProxyRowStatus_notInService 2L
|
||||
#define VAL_snmpProxyRowStatus_notReady 3L
|
||||
#define VAL_snmpProxyRowStatus_createAndGo 4L
|
||||
#define VAL_snmpProxyRowStatus_createAndWait 5L
|
||||
#define VAL_snmpProxyRowStatus_destroy 6L
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __INCv3Proxyh */
|
||||
@@ -0,0 +1,418 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_trgt.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005, 2013 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_trgt.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:07 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.8.4.2 2001/09/21 19:16:08 josh
|
||||
* updating and expanding structures for use with coexistence
|
||||
*
|
||||
* Revision 9.8.4.1 2001/07/16 18:02:13 josh
|
||||
* a first-round commit adding infrastructure support
|
||||
* for the SNMPv3 Coexistence RFC (2576)
|
||||
*
|
||||
* Revision 9.8 2001/04/11 20:42:56 josh
|
||||
* merge from the kingfisher branch
|
||||
*
|
||||
* Revision 9.7 2001/01/19 22:22:12 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.6 2000/06/09 14:54:13 josh
|
||||
* modifications due to new installation options, new proxy code
|
||||
* moved some definitions from sendntfy.h into v3_trgt.h so they'd
|
||||
* be built with the target code
|
||||
*
|
||||
* Revision 9.5.2.2 2001/03/12 22:08:02 tneale
|
||||
* Updated copyright
|
||||
*
|
||||
* Revision 9.5.2.1 2000/09/21 21:14:55 josh
|
||||
* bringing branch include files in line with root
|
||||
*
|
||||
* Revision 9.5 2000/03/17 19:48:47 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.4 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.3 2000/03/09 17:07:15 tneale
|
||||
* Added #ifdef for C++ to declare extern C if needed
|
||||
*
|
||||
* Revision 9.2 2000/02/04 21:54:25 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.1 2000/01/02 22:55:56 josh
|
||||
* patching up a memory leak here, a broken compare there...per
|
||||
* sar's comments
|
||||
*
|
||||
* Revision 9.0 1999/10/21 20:43:35 josh
|
||||
* updating version stamps
|
||||
*
|
||||
* Revision 1.5 1999/10/21 19:13:09 josh
|
||||
* adding flags for flags fields in various objects to help with row
|
||||
* creation
|
||||
*
|
||||
* Revision 1.4 1999/10/15 17:47:26 josh
|
||||
* included MIB leaf definitions and cleaned up useless macros
|
||||
*
|
||||
* Revision 1.3 1999/09/21 21:31:45 josh
|
||||
* fixed a few structure access macros
|
||||
*
|
||||
* Revision 1.2 1999/09/14 19:35:26 josh
|
||||
* updating default initialization per RFC 2573
|
||||
*
|
||||
* Revision 1.1 1999/06/16 17:04:23 josh
|
||||
* First step of adding RFC2573 Notify support.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01b,06aug13,bbz clear the med impact warning from prevent.pl(WIND00429583)
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_trgt_inc))
|
||||
#define v3_trgt_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define ETC_TARGET_ADDR_MAX 32
|
||||
#define ETC_TARGET_PARAMS_MAX 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct SNMP_TARGET_ADDR_S
|
||||
{
|
||||
struct SNMP_TARGET_ADDR_S *next;
|
||||
EBUFFER_T target_name; /* the name of the target */
|
||||
OBJ_ID_T tdomain; /* the transport domain */
|
||||
EBUFFER_T taddress; /* target address */
|
||||
EBUFFER_T tmask; /* target mask */
|
||||
sbits32_t timeout; /* interval between retr. */
|
||||
bits16_t retry_count; /* number of retrans. */
|
||||
bits32_t target_mms; /* max message size */
|
||||
EBUFFER_T tag_list; /* list of magic labels */
|
||||
EBUFFER_T params; /* name of SNMP_TARGET_PARAM_T */
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_TARGET_ADDR_T;
|
||||
|
||||
#define ETC_TADDR_TDOMAIN 0x01
|
||||
#define ETC_TADDR_TADDRESS 0x02
|
||||
#define ETC_TADDR_PARAMS 0x04
|
||||
#define ETC_TADDR_ALL_FLAGS 0x07
|
||||
|
||||
#define ETC_TADDR_TIMEOUT 1500
|
||||
#define ETC_TADDR_RETRY_COUNT 3
|
||||
#define ETC_TADDR_MMS 484
|
||||
|
||||
/* global root pointer for target params list */
|
||||
extern SNMP_TARGET_ADDR_T *root_target_addr;
|
||||
|
||||
#define SNMP_Target_Addr_Set_Defaults(T) \
|
||||
(MEMSET((T), 0, sizeof(SNMP_TARGET_ADDR_T)), \
|
||||
EBufferInitialize(&((T)->target_name)), \
|
||||
EBufferInitialize(&((T)->taddress)), \
|
||||
EBufferInitialize(&((T)->tmask)), \
|
||||
EBufferInitialize(&((T)->tag_list)), \
|
||||
EBufferInitialize(&((T)->params)), \
|
||||
(T)->timeout = ETC_TADDR_TIMEOUT, \
|
||||
(T)->retry_count = ETC_TADDR_RETRY_COUNT, \
|
||||
(T)->target_mms = ETC_TADDR_MMS, \
|
||||
(T)->storage = ETC_STO_NONVOL, \
|
||||
(T)->status = ETC_RS_NREADY, \
|
||||
(T)->flags = 0)
|
||||
|
||||
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Create __((void));
|
||||
extern void SNMP_Target_Addr_Destroy __((SNMP_TARGET_ADDR_T *));
|
||||
extern int SNMP_Target_Addr_Install __((SNMP_TARGET_ADDR_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern void SNMP_Target_Addr_Deinstall __((SNMP_TARGET_ADDR_T *));
|
||||
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Lookup __((bits8_t *, ALENGTH_T));
|
||||
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Next __((int, OIDC_T *));
|
||||
extern SNMP_TARGET_ADDR_T * SNMP_Target_Addr_Next_Addr __((SNMP_TARGET_ADDR_T *));
|
||||
extern void SNMP_Target_Addr_Name __((SNMP_TARGET_ADDR_T *, bits8_t *,
|
||||
ALENGTH_T *));
|
||||
|
||||
#define SNMP_Target_Addr_Get_Name(T) (EBufferStart(&((T)->target_name)))
|
||||
#define SNMP_Target_Addr_Get_Name_Len(T) (EBufferUsed(&((T)->target_name)))
|
||||
|
||||
#define SNMP_Target_Addr_Get_TDomain(T) (&((T)->tdomain))
|
||||
#define SNMP_Target_Addr_Set_TDomain(T, D, L) \
|
||||
(build_object_id((L), (D), (&((T)->tdomain))))
|
||||
|
||||
#define SNMP_Target_Addr_Get_TAddress(T) (EBufferStart(&((T)->taddress)))
|
||||
#define SNMP_Target_Addr_Get_TAddress_Len(T) (EBufferUsed(&((T)->taddress)))
|
||||
#define SNMP_Target_Addr_Set_TAddress(T, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((T)->taddress), (S), (L)))
|
||||
|
||||
#define SNMP_Target_Addr_Get_TMask(T) (EBufferStart(&((T)->tmask)))
|
||||
#define SNMP_Target_Addr_Get_TMask_Len(T) (EBufferUsed(&((T)->tmask)))
|
||||
#define SNMP_Target_Addr_Set_TMask(T, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((T)->tmask), (S), (L)))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Timeout(T) ((T)->timeout)
|
||||
#define SNMP_Target_Addr_Set_Timeout(T, V) ((T)->timeout = (sbits32_t)(V))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Retry_Count(T) ((T)->retry_count)
|
||||
#define SNMP_Target_Addr_Set_Retry_Count(T, V) ((T)->retry_count = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Addr_Get_MMS(T) ((T)->target_mms)
|
||||
#define SNMP_Target_Addr_Set_MMS(T, V) ((T)->target_mms = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Tag_List(T) (EBufferStart(&((T)->tag_list)))
|
||||
#define SNMP_Target_Addr_Get_Tag_List_Len(T) (EBufferUsed(&((T)->tag_list)))
|
||||
#define SNMP_Target_Addr_Set_Tag_List(T, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((T)->tag_list), (S), (L)))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Params(T) (EBufferStart(&((T)->params)))
|
||||
#define SNMP_Target_Addr_Get_Params_Len(T) (EBufferUsed(&((T)->params)))
|
||||
#define SNMP_Target_Addr_Set_Params(T, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((T)->params), (S), (L)))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Storage(T) ((T)->storage)
|
||||
#define SNMP_Target_Addr_Set_Storage(T, V) ((T)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Status(T) ((T)->status)
|
||||
#define SNMP_Target_Addr_Set_Status(T, V) ((T)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Addr_Get_Flags(T) ((T)->flags)
|
||||
#define SNMP_Target_Addr_Set_Flags(T, V) ((T)->flags = (bits16_t)(V))
|
||||
|
||||
typedef struct SNMP_TARGET_PARAMS_S
|
||||
{
|
||||
struct SNMP_TARGET_PARAMS_S *next;
|
||||
EBUFFER_T params_name; /* name of the params object */
|
||||
sbits32_t mp_model; /* SNMP version, roughly */
|
||||
sbits32_t sec_model; /* security model */
|
||||
EBUFFER_T sec_name; /* security name, aka user */
|
||||
bits16_t sec_level; /* security level (auth/priv) */
|
||||
bits16_t storage;
|
||||
bits16_t status;
|
||||
bits16_t flags;
|
||||
} SNMP_TARGET_PARAMS_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define ETC_TPARAM_MPMODEL 0x01
|
||||
#define ETC_TPARAM_SECMODEL 0x02
|
||||
#define ETC_TPARAM_SECNAME 0x04
|
||||
#define ETC_TPARAM_SECLEVEL 0x08
|
||||
#define ETC_TPARAM_ALL_FLAGS 0x0F
|
||||
|
||||
/* global root pointer for target params list */
|
||||
extern SNMP_TARGET_PARAMS_T *root_target_params;
|
||||
|
||||
#define SNMP_Target_Params_Set_Defaults(G) \
|
||||
(MEMSET((G), 0, sizeof(SNMP_TARGET_PARAMS_T)), \
|
||||
EBufferInitialize(&((G)->params_name)), \
|
||||
EBufferInitialize(&((G)->sec_name)), \
|
||||
(G)->storage = ETC_STO_NONVOL, \
|
||||
(G)->status = ETC_RS_NREADY, \
|
||||
(G)->flags = 0)
|
||||
|
||||
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Create __((void));
|
||||
extern void SNMP_Target_Params_Destroy __((SNMP_TARGET_PARAMS_T *));
|
||||
extern int SNMP_Target_Params_Install __((SNMP_TARGET_PARAMS_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern void SNMP_Target_Params_Deinstall __((SNMP_TARGET_PARAMS_T *));
|
||||
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Lookup __((bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Next __((int, OIDC_T *));
|
||||
extern SNMP_TARGET_PARAMS_T * SNMP_Target_Params_Next_Params
|
||||
__((SNMP_TARGET_PARAMS_T *));
|
||||
extern void SNMP_Target_Params_Name __((SNMP_TARGET_PARAMS_T *,
|
||||
bits8_t *, ALENGTH_T *));
|
||||
|
||||
#define SNMP_Target_Params_Get_Name(T) (EBufferStart(&((T)->params_name)))
|
||||
#define SNMP_Target_Params_Get_Name_Len(T) (EBufferUsed(&((T)->params_name)))
|
||||
|
||||
#define SNMP_Target_Params_Get_MP_Model(T) ((T)->mp_model)
|
||||
#define SNMP_Target_Params_Set_MP_Model(T, V) ((T)->mp_model = (sbits32_t)(V))
|
||||
|
||||
#define SNMP_Target_Params_Get_Sec_Model(T) ((T)->sec_model)
|
||||
#define SNMP_Target_Params_Set_Sec_Model(T, V) ((T)->sec_model = (sbits32_t)(V))
|
||||
|
||||
#define SNMP_Target_Params_Get_Sec_Name(T) (EBufferStart(&((T)->sec_name)))
|
||||
#define SNMP_Target_Params_Get_Sec_Name_Len(T) (EBufferUsed(&((T)->sec_name)))
|
||||
#define SNMP_Target_Params_Set_Sec_Name(T, S, L, F) \
|
||||
(EBufferAllocateLoad((F), &((T)->sec_name), (S), (L)))
|
||||
|
||||
#define SNMP_Target_Params_Get_Sec_Level(T) ((T)->sec_level)
|
||||
#define SNMP_Target_Params_Set_Sec_Level(T, V) ((T)->sec_level = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Params_Get_Storage(T) ((T)->storage)
|
||||
#define SNMP_Target_Params_Set_Storage(T, V) ((T)->storage = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Params_Get_Status(T) ((T)->status)
|
||||
#define SNMP_Target_Params_Set_Status(T, V) ((T)->status = (bits16_t)(V))
|
||||
|
||||
#define SNMP_Target_Params_Get_Flags(T) ((T)->flags)
|
||||
#define SNMP_Target_Params_Set_Flags(T, V) ((T)->flags = (bits16_t)(V))
|
||||
|
||||
extern sbits32_t v3_snmpTargetSpinLock;
|
||||
|
||||
extern void snmpTargetAddrEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetAddrEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetAddrEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetAddrEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetParamsEntry_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetParamsEntry_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetParamsEntry_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void snmpTargetParamsEntry_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifndef ENVOY_SNMPADDR_TO_TADDRESS
|
||||
#define ENVOY_USE_DEFAULT_SNMPADDR 1
|
||||
#define ENVOY_SNMPADDR_TO_TADDRESS(A, D, T) \
|
||||
envoy_snmpaddr_to_taddress(A, D, T)
|
||||
|
||||
extern int envoy_snmpaddr_to_taddress __((SNMPADDR_T *, OBJ_ID_T *,
|
||||
EBUFFER_T *));
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_TADDRESS_TO_SNMPADDR
|
||||
#define ENVOY_USE_DEFAULT_TADDRESS 1
|
||||
#define ENVOY_TADDRESS_TO_SNMPADDR(A, D, T) \
|
||||
envoy_taddress_to_snmpaddr(A, D, T)
|
||||
|
||||
extern int envoy_taddress_to_snmpaddr __((SNMPADDR_T *, OBJ_ID_T *,
|
||||
EBUFFER_T *));
|
||||
#endif
|
||||
|
||||
extern envoy_err_t copyVarBind __((VB_T *, int, SNMP_PKT_T *));
|
||||
extern int copyVarBindList __((VBL_T *, VBL_T *, sbits32_t));
|
||||
extern int SNMP_Convert_VB __((VBL_T *, OBJ_ID_T *, int *,
|
||||
sbits32_t *, bits32_t *));
|
||||
extern envoy_err_t copyNotifyVarBindList __((SNMP_PKT_T *, SNMP_PKT_T *));
|
||||
|
||||
/* The leaf definitions for the method routines */
|
||||
#define LEAF_snmpTargetAddrName 1
|
||||
#define MINSIZE_snmpTargetAddrName 1L
|
||||
#define MAXSIZE_snmpTargetAddrName 32L
|
||||
#define LEAF_snmpTargetAddrTDomain 2
|
||||
#define LEAF_snmpTargetAddrTAddress 3
|
||||
#define MINSIZE_snmpTargetAddrTAddress 1L
|
||||
#define MAXSIZE_snmpTargetAddrTAddress 255L
|
||||
#define LEAF_snmpTargetAddrTimeout 4
|
||||
#define MIN_snmpTargetAddrTimeout 0L
|
||||
#define MAX_snmpTargetAddrTimeout 2147483647L
|
||||
#define LEAF_snmpTargetAddrRetryCount 5
|
||||
#define MIN_snmpTargetAddrRetryCount 0L
|
||||
#define MAX_snmpTargetAddrRetryCount 255L
|
||||
#define LEAF_snmpTargetAddrTagList 6
|
||||
#define MINSIZE_snmpTargetAddrTagList 0L
|
||||
#define MAXSIZE_snmpTargetAddrTagList 255L
|
||||
#define LEAF_snmpTargetAddrParams 7
|
||||
#define MINSIZE_snmpTargetAddrParams 1L
|
||||
#define MAXSIZE_snmpTargetAddrParams 32L
|
||||
#define LEAF_snmpTargetAddrStorageType 8
|
||||
#define VAL_snmpTargetAddrStorageType_other 1L
|
||||
#define VAL_snmpTargetAddrStorageType_volatile 2L
|
||||
#define VAL_snmpTargetAddrStorageType_nonVolatile 3L
|
||||
#define VAL_snmpTargetAddrStorageType_permanent 4L
|
||||
#define VAL_snmpTargetAddrStorageType_readOnly 5L
|
||||
#define LEAF_snmpTargetAddrRowStatus 9
|
||||
#define VAL_snmpTargetAddrRowStatus_active 1L
|
||||
#define VAL_snmpTargetAddrRowStatus_notInService 2L
|
||||
#define VAL_snmpTargetAddrRowStatus_notReady 3L
|
||||
#define VAL_snmpTargetAddrRowStatus_createAndGo 4L
|
||||
#define VAL_snmpTargetAddrRowStatus_createAndWait 5L
|
||||
#define VAL_snmpTargetAddrRowStatus_destroy 6L
|
||||
#define LEAF_snmpTargetParamsName 1
|
||||
#define MINSIZE_snmpTargetParamsName 1L
|
||||
#define MAXSIZE_snmpTargetParamsName 32L
|
||||
#define LEAF_snmpTargetParamsMPModel 2
|
||||
#define MIN_snmpTargetParamsMPModel 0L
|
||||
#define MAX_snmpTargetParamsMPModel 2147483647L
|
||||
#define LEAF_snmpTargetParamsSecurityModel 3
|
||||
#define MIN_snmpTargetParamsSecurityModel 1L
|
||||
#define MAX_snmpTargetParamsSecurityModel 2147483646L
|
||||
#define LEAF_snmpTargetParamsSecurityName 4
|
||||
#define MINSIZE_snmpTargetParamsSecurityName 0L
|
||||
#define MAXSIZE_snmpTargetParamsSecurityName 255L
|
||||
#define LEAF_snmpTargetParamsSecurityLevel 5
|
||||
#define VAL_snmpTargetParamsSecurityLevel_noAuthNoPriv 1L
|
||||
#define VAL_snmpTargetParamsSecurityLevel_authNoPriv 2L
|
||||
#define VAL_snmpTargetParamsSecurityLevel_authPriv 3L
|
||||
#define LEAF_snmpTargetParamsStorageType 6
|
||||
#define VAL_snmpTargetParamsStorageType_other 1L
|
||||
#define VAL_snmpTargetParamsStorageType_volatile 2L
|
||||
#define VAL_snmpTargetParamsStorageType_nonVolatile 3L
|
||||
#define VAL_snmpTargetParamsStorageType_permanent 4L
|
||||
#define VAL_snmpTargetParamsStorageType_readOnly 5L
|
||||
#define LEAF_snmpTargetParamsRowStatus 7
|
||||
#define VAL_snmpTargetParamsRowStatus_active 1L
|
||||
#define VAL_snmpTargetParamsRowStatus_notInService 2L
|
||||
#define VAL_snmpTargetParamsRowStatus_notReady 3L
|
||||
#define VAL_snmpTargetParamsRowStatus_createAndGo 4L
|
||||
#define VAL_snmpTargetParamsRowStatus_createAndWait 5L
|
||||
#define VAL_snmpTargetParamsRowStatus_destroy 6L
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* #if (!defined(v3_trgt_inc))*/
|
||||
@@ -0,0 +1,299 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/v3_user.h,v 1.2 2001/11/06 21:35:07 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: v3_user.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:07 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.7 2001/01/19 22:22:13 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.6 2000/03/17 19:48:47 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.5 2000/03/09 20:58:36 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.4 2000/03/09 17:14:06 tneale
|
||||
* Added #ifdef for C++ to extern C if needed
|
||||
*
|
||||
* Revision 9.3 2000/02/04 21:54:26 josh
|
||||
* prototyping functions that may need to be called by other modules
|
||||
* this is done primarily to make the vxWorks compiler happy.
|
||||
* Warning: the prototypes added may be duplicated by a mib_hand.h
|
||||
* file generated by Emissary.
|
||||
*
|
||||
* Revision 9.2 1999/11/02 20:55:18 josh
|
||||
* bringing usmUserTable into line with new spec: RFC 2574
|
||||
* allows changing of auth and priv protocols after clone,
|
||||
* allows row creation without initial clone, and allows enabling of rows
|
||||
* without keychange for unused protocols (no authkeychange required if
|
||||
* not using auth, etc.)
|
||||
*
|
||||
* Revision 9.1 1999/09/30 21:56:14 josh
|
||||
* change public field to public_data so as not to conflict with
|
||||
* C++ compilers
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:27 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 1.7 1998/08/12 04:52:17 sar
|
||||
* revamp the initialization routines to limit the amount of
|
||||
* code that might get pulled in.
|
||||
*
|
||||
* Revision 1.6 1998/08/01 17:28:37 sar
|
||||
* Removed the id check flag
|
||||
*
|
||||
* Revision 1.5 1998/07/01 01:48:20 sar
|
||||
* As part of the set_defaults macro do a memset to zero the memory
|
||||
*
|
||||
* Revision 1.4 1998/06/30 00:30:58 sar
|
||||
* Added macros to get and set user flags (cloned, authed and prived)
|
||||
*
|
||||
* Revision 1.3 1998/06/16 05:30:38 sar
|
||||
* modify the api for the next routine
|
||||
* split the engine id into its own struct
|
||||
*
|
||||
* Revision 1.2 1998/05/30 02:52:07 sar
|
||||
* Modifed the names used for max string length
|
||||
* Updated user lookup
|
||||
*
|
||||
* Revision 1.1 1998/05/23 19:49:41 sar
|
||||
* Include files for use with v3 code. They define the structures
|
||||
* and entry points for the various pieces.
|
||||
* acc: access and group information
|
||||
* auth & priv: authentication and privacy
|
||||
* con: context
|
||||
* eng: engine ids, both this agents and any others it knows
|
||||
* mth: method routines, for use with mib control files
|
||||
* user: user info
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,15apr05,AJS Diffie-Hellman work
|
||||
01a,13apr05,AJS Diffie-Hellman work
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(v3_user_inc))
|
||||
#define v3_user_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_auth_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_auth.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_priv_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_priv.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(v3_eng_inc))
|
||||
#include <wrn/wm/snmp/engine/v3_eng.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
#define ETC_USER_USER_MAX 32
|
||||
#define ETC_USER_ENGINE_MAX 32
|
||||
#define ENGINE_MAXNAMELEN 32
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
|
||||
#define LEAF_usmDHParameters 1
|
||||
#define LEAF_usmDHUserAuthKeyChange 1
|
||||
#define LEAF_usmDHUserOwnAuthKeyChange 2
|
||||
#define LEAF_usmDHUserPrivKeyChange 3
|
||||
#define LEAF_usmDHUserOwnPrivKeyChange 4
|
||||
|
||||
typedef struct SNMP_DH_S
|
||||
{
|
||||
EBUFFER_T DHpubAuthKey; /* DH public authentication key */
|
||||
EBUFFER_T DHpubPrivKey; /* DH public privacy key */
|
||||
DH *DHauthValues; /* DH values for the auth key */
|
||||
DH *DHprivValues; /* DH values for the priv key */
|
||||
} SNMP_DH_T;
|
||||
|
||||
typedef struct SNMP_DH_PARAMS_S
|
||||
{
|
||||
BIGNUM *prime; /* Large prime */
|
||||
BIGNUM *base; /* Generator; typically 2 or 5 */
|
||||
int pvl; /* Private value length, in bits */
|
||||
EBUFFER_T encodedString; /* Encoded string with values above */
|
||||
} SNMP_DH_PARAMS_T;
|
||||
|
||||
extern int SNMP_init_DH (void);
|
||||
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
typedef struct SNMP_USER_ENG_S
|
||||
{
|
||||
struct SNMP_USER_ENG_S *next;
|
||||
bits8_t *id;
|
||||
ALENGTH_T id_len;
|
||||
struct SNMP_USER_S *user;
|
||||
} SNMP_USER_ENG_T;
|
||||
|
||||
typedef struct SNMP_USER_S
|
||||
{
|
||||
SNMP_USER_ENG_T *parent;
|
||||
struct SNMP_USER_S *next;
|
||||
bits8_t *uname;
|
||||
ALENGTH_T uname_len;
|
||||
SNMP_AUTH_T *auth;
|
||||
bits8_t *authkey;
|
||||
SNMP_PRIV_T *priv;
|
||||
bits8_t *privkey;
|
||||
EBUFFER_T public_data;
|
||||
bits8_t maxsec;
|
||||
sbits16_t storage;
|
||||
sbits16_t status;
|
||||
sbits16_t flags;
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
SNMP_DH_T DH_keys;
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
} SNMP_USER_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
#define ETC_USER_CLONED 0x01
|
||||
#define ETC_USER_AUTHED 0x02
|
||||
#define ETC_USER_PRIVED 0x04
|
||||
#define ETC_USER_VALID_AUTHKEY 0x08
|
||||
#define ETC_USER_VALID_PRIVKEY 0x10
|
||||
#define ETC_USER_ALL_FLAGS 0x1F
|
||||
|
||||
/* global root pointer for the user list */
|
||||
extern SNMP_USER_ENG_T *root_user;
|
||||
|
||||
#if INSTALL_SNMP_V3_DIFFIE_HELLMAN
|
||||
#define SNMP_User_Set_Defaults(U) (MEMSET((U), 0, sizeof(SNMP_USER_T)), \
|
||||
EBufferInitialize(&((U)->public_data)), \
|
||||
EBufferInitialize(&((U)->DH_keys.DHpubAuthKey)), \
|
||||
EBufferInitialize(&((U)->DH_keys.DHpubPrivKey)), \
|
||||
(U)->storage = ETC_STO_NONVOL, \
|
||||
(U)->status = ETC_RS_NREADY)
|
||||
#else
|
||||
#define SNMP_User_Set_Defaults(U) (MEMSET((U), 0, sizeof(SNMP_USER_T)), \
|
||||
EBufferInitialize(&((U)->public_data)), \
|
||||
(U)->storage = ETC_STO_NONVOL, \
|
||||
(U)->status = ETC_RS_NREADY)
|
||||
#endif /* INSTALL_SNMP_V3_DIFFIE_HELLMAN */
|
||||
|
||||
|
||||
extern SNMP_USER_T * SNMP_User_Lookup __((bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T));
|
||||
extern SNMP_USER_T * SNMP_User_Next __((int, OIDC_T *));
|
||||
extern SNMP_USER_T * SNMP_User_Next_User __((SNMP_USER_T *));
|
||||
extern void SNMP_User_Destroy __((SNMP_USER_T *));
|
||||
extern SNMP_USER_T * SNMP_User_Create __((SNMP_AUTH_T *, SNMP_PRIV_T *));
|
||||
extern int SNMP_User_Install __((SNMP_USER_T *,
|
||||
bits8_t *, ALENGTH_T,
|
||||
bits8_t *, ALENGTH_T));
|
||||
extern void SNMP_User_Deinstall __((SNMP_USER_T *));
|
||||
extern void SNMP_User_Name __((SNMP_USER_T *,
|
||||
bits8_t *, ALENGTH_T *,
|
||||
bits8_t *, ALENGTH_T *));
|
||||
|
||||
extern void SNMP_User_Get_Sec_Name __((SNMP_USER_T *, bits8_t *,
|
||||
ALENGTH_T *));
|
||||
extern int SNMP_User_Set_AuthKey __((SNMP_USER_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern int SNMP_User_Set_PrivKey __((SNMP_USER_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern int SNMP_User_Swap_Users __((SNMP_USER_T *, SNMP_USER_T *));
|
||||
|
||||
#define SNMP_User_Compare_Names(U1, U2) (((U1) == (U2)) ? 0 : 1)
|
||||
|
||||
#define SNMP_User_Get_Auth(U) ((U)->auth)
|
||||
#define SNMP_User_Get_AuthKey(U) ((U)->authkey)
|
||||
#define SNMP_User_Get_Priv(U) ((U)->priv)
|
||||
#define SNMP_User_Get_PrivKey(U) ((U)->privkey)
|
||||
#define SNMP_User_Get_Public(U) (EBufferStart(&((U)->public_data)))
|
||||
#define SNMP_User_Get_Public_Len(U) (EBufferUsed(&((U)->public_data)))
|
||||
#define SNMP_User_Get_MaxSec(U) ((U)->maxsec)
|
||||
#define SNMP_User_Get_Storage(U) ((U)->storage)
|
||||
#define SNMP_User_Set_Storage(U, V) ((U)->storage = (sbits16_t)(V))
|
||||
#define SNMP_User_Get_Status(U) ((U)->status)
|
||||
#define SNMP_User_Set_Status(U, V) ((U)->status = (sbits16_t)(V))
|
||||
#define SNMP_User_Get_Flags(U) ((U)->flags)
|
||||
#define SNMP_User_Set_Flags(U, F) ((U)->flags = (sbits16_t)(F))
|
||||
|
||||
/* These macros are for internal use only and should not be used
|
||||
by customers. It makes use of internal knowledge of the user
|
||||
structure which may change in the future, causing the macros
|
||||
to become unsupportable. In this case any code calling these
|
||||
macros will need to be updated.
|
||||
currently the only mapping between name and security name
|
||||
is the identity mapping */
|
||||
#define SNMP_User_Get_SName(U) ((U)->uname)
|
||||
#define SNMP_User_Get_SName_Len(U) ((U)->uname_len)
|
||||
|
||||
extern sbits32_t v3_usmUserSpinLock;
|
||||
|
||||
extern void usertable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void usertable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void usertable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void usertable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (!defined(user_inc)) */
|
||||
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/vbdefs.h,v 1.3 2002/05/13 20:46:19 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: vbdefs.h,v $
|
||||
* Revision 1.3 2002/05/13 20:46:19 josh
|
||||
* encoding process now checks for 16-bit overflows in
|
||||
* calculating packet sizes
|
||||
*
|
||||
* Revision 1.2 2001/11/06 21:35:07 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.7 2001/01/19 22:22:13 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.6 2000/03/17 19:48:48 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.5 2000/03/09 20:58:37 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.4 2000/03/09 17:14:20 tneale
|
||||
* Added #ifdef for C++ to extern C if needed
|
||||
*
|
||||
* Revision 9.3 2000/02/02 17:35:28 josh
|
||||
* adding VBList_Free() API call
|
||||
*
|
||||
* Revision 9.2 1999/12/23 14:47:28 josh
|
||||
* cleaning up code per Shawn's comments -- removing extraneous
|
||||
* comments and doing proxy check before notify check
|
||||
*
|
||||
* Revision 9.1 1999/05/24 20:12:12 josh
|
||||
* 'compc' and 'compl' have been replaced by 'tcount' and 'tlist'
|
||||
* to avoid C++ compiler errors.
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:28 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:54 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:33 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.6 1997/10/26 01:44:43 sar
|
||||
* Always define the 64 bit counter and include it in the vb defintion
|
||||
* instead of forgetting about it if we don't have v2 or v2 types installed.
|
||||
*
|
||||
* Revision 7.5 1997/10/22 03:07:28 sar
|
||||
* Mofied the agentx and older subagent schemes install options
|
||||
*
|
||||
* Revision 7.4 1997/10/16 23:52:27 sar
|
||||
* We changed the macro VB_GET_IP_ADDRESS to provide a more consistent
|
||||
* type signature from compilers. Previously it could have been either
|
||||
* a pointer to an array of bytes or a pointer to a byte. It should
|
||||
* now resolve to a pointer to an array of bytes.
|
||||
*
|
||||
* Revision 7.3 1997/10/16 00:25:19 sar
|
||||
* Primarily this set of modifications is for the agentx protocol.
|
||||
* Most of the work was in the agentx.h and ax_mth.h files. Most
|
||||
* other files (snmpdefs.h, vbdefs.h and mib.h) received updates
|
||||
* to their structures and snmp got some new lock macros.
|
||||
*
|
||||
* One other change of note was the modification of continue
|
||||
* processing. Previously we called a specific continue routine
|
||||
* directly, now we store a pointer to the corret continue
|
||||
* function in the snmp packet structure and call that. We include
|
||||
* macros for backwards compatibility.
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:25 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.2 1995/10/20 22:53:35 sar
|
||||
* removed bitstring include file & macro
|
||||
* removed nsapaddress
|
||||
* added VT_BITS & VT_UNSIGNED32
|
||||
*
|
||||
* Revision 6.1 1995/06/05 20:57:49 sar
|
||||
* Added clean_vb_data.
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:46:57 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 1.1 1995/03/20 23:07:47 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#if (!defined(vb_inc))
|
||||
#define vb_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(asn1_inc))
|
||||
#include <wrn/wm/snmp/engine/asn1.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(buffer_inc))
|
||||
#include <wrn/wm/snmp/engine/buffer.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(mib_inc))
|
||||
#include <wrn/wm/snmp/engine/mib.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(ui64_inc))
|
||||
#include <wrn/wm/snmp/engine/ui64.h>
|
||||
#endif
|
||||
|
||||
/* Definition for routine to free private vb space */
|
||||
typedef void VBPRIVPROC_T __((PTR_T));
|
||||
|
||||
/* Definition for routine to undo sets */
|
||||
struct VB_S;
|
||||
typedef void UNDOPROC_T __((OIDC_T lastmatch, int tcount, OIDC_T *tlist,
|
||||
struct SNMP_PKT_S *pktp, struct VB_S *vbp));
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
/* Define the internal shape of a VarBind */
|
||||
typedef struct VB_S
|
||||
{
|
||||
struct VB_S * vb_link; /* For the user to use, usually */
|
||||
/* to build a list of related */
|
||||
/* VB_Ts. */
|
||||
ALENGTH_T vb_seq_size; /* Overall length of the VarBind */
|
||||
/* sequence when encoded. */
|
||||
OBJ_ID_T vb_obj_id; /* Object id for this VarBind */
|
||||
OCTET_T vb_data_flags_n_type; /* Class form & type of data */
|
||||
OCTET_T vb_flags; /* See below */
|
||||
ALENGTH_T vb_data_length; /* Length of the data when encode */
|
||||
MIBLOC_T vb_ml; /* The mib-leaf associated with */
|
||||
/* this VarBind. */
|
||||
union {
|
||||
INT_32_T v_number; /* Integer kinds of things */
|
||||
UINT_32_T v_counter; /* Unsigned int things */
|
||||
EBUFFER_T v_string; /* Octetstring things */
|
||||
OBJ_ID_T v_object; /* Object id things */
|
||||
unsigned char v_network_address[4];
|
||||
UINT_64_T v_counter64; /* 64 bit unsigned things */
|
||||
} value_u;
|
||||
|
||||
union {
|
||||
ptr_t p_ptr; /* storage space for moving info */
|
||||
bits32_t p_int; /* between test and set routines */
|
||||
} priv;
|
||||
|
||||
VBPRIVPROC_T * vb_free_priv; /* pointer to routine to free the */
|
||||
/* private storage space */
|
||||
UNDOPROC_T * undoproc; /* pointer to routine to undo sets*/
|
||||
#if (INSTALL_ENVOY_AGENTX)
|
||||
OBJ_ID_T ax_search_end;
|
||||
OCTET_T ax_flags;
|
||||
#endif
|
||||
} VB_T;
|
||||
#define v_gauge v_counter
|
||||
#define v_timeticks v_counter
|
||||
#define v_uinteger32 v_counter
|
||||
#define v_opaque v_string
|
||||
|
||||
#define vb_priv priv.p_ptr
|
||||
#define vb_int priv.p_int
|
||||
|
||||
/* Values for vb_data_flags_n_type */
|
||||
#define VT_NUMBER A_INTEGER
|
||||
#define VT_STRING A_OCTETSTRING
|
||||
#define VT_BITS A_OCTETSTRING /* same as a string */
|
||||
#define VT_OBJECT A_OBJECTID
|
||||
#define VT_EMPTY A_NULL
|
||||
#define VT_IPADDRESS (A_APPLICATION | 0)
|
||||
#define VT_COUNTER (A_APPLICATION | 1)
|
||||
#define VT_GAUGE (A_APPLICATION | 2)
|
||||
#define VT_UNSIGNED32 (A_APPLICATION | 2) /* same as a guage */
|
||||
#define VT_TIMETICKS (A_APPLICATION | 3)
|
||||
#define VT_OPAQUE (A_APPLICATION | 4)
|
||||
#define VT_COUNTER64 (A_APPLICATION | 6)
|
||||
#define VT_UINTEGER32 (A_APPLICATION | 7)
|
||||
|
||||
/* values for exception data types */
|
||||
#define VT_NOSUCHOBJ (A_CONTEXT | 0)
|
||||
#define VT_NOSUCHINS (A_CONTEXT | 1)
|
||||
#define VT_ENDOFMIB (A_CONTEXT | 2)
|
||||
|
||||
/* Values for vb_flags */
|
||||
#define VFLAG_ALREADY_TEST 0x01
|
||||
#define VFLAG_ALREADY_SET 0x02
|
||||
#define VFLAG_ALREADY_GET 0x02
|
||||
#define VFLAG_SA_SENDIT 0x04
|
||||
#define VFLAG_SA_DOIT 0x08
|
||||
|
||||
/* more values for vb_flags some of them need to be alligned with the
|
||||
already_* flags, the rest are put in as we have space */
|
||||
|
||||
#define VFLAG_TEST_STARTED 0x10
|
||||
#define VFLAG_TEST_DONE 0x01
|
||||
#define VFLAG_SET_STARTED 0x20
|
||||
#define VFLAG_SET_DONE 0x02
|
||||
#define VFLAG_UNDO_STARTED 0x40
|
||||
#define VFLAG_UNDO_DONE 0x80
|
||||
#define VFLAG_UNDO_BOTH (VFLAG_UNDO_STARTED | VFLAG_UNDO_DONE)
|
||||
|
||||
#define VFLAG_GET_STARTED 0x20
|
||||
#define VFLAG_GET_DONE 0x02
|
||||
|
||||
#define VFLAG_NEXT_STARTED 0x20
|
||||
#define VFLAG_NEXT_DONE 0x02
|
||||
#define VFLAG_NEXT_REDO 0x10
|
||||
#define VFLAG_NEXT_VCREQ 0x40
|
||||
#define VFLAG_NEXT_VCDONE 0x80
|
||||
#define VFLAG_NEXT_INSTANCE 0x01
|
||||
#define VFLAG_NEXT_VCBITS (VFLAG_NEXT_VCREQ | VFLAG_NEXT_VCDONE)
|
||||
#define VFLAG_NEXT_FLAGS 0xF3
|
||||
|
||||
#define ENVOY_AX_FLAGS_INCLUDE 0x01
|
||||
#define ENVOY_AX_FLAGS_CLEAN_LEAF 0x02
|
||||
#define ENVOY_AX_FLAGS_CLEAN_INDEX 0x04
|
||||
|
||||
/* Define the shape of the VarBindList */
|
||||
typedef struct VBL_S
|
||||
{
|
||||
ALENGTH_T vbl_length; /* Length of the VarBindList seq */
|
||||
int vbl_count; /* Number of Var Bind items */
|
||||
VB_T *vblist;
|
||||
struct VBL_S *vblp; /* for get bulk chaining purposes */
|
||||
} VBL_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
|
||||
/* macros to get the data from a vbp */
|
||||
#define VB_GET_INT32(V) ((V)->value_u.v_number)
|
||||
#define VB_GET_UINT32(V) ((V)->value_u.v_counter)
|
||||
#define VB_GET_IP_ADDRESS(V) ((V)->value_u.v_network_address)
|
||||
#define VB_GET_STRING(V) &((V)->value_u.v_string)
|
||||
#define VB_GET_OBJECT_ID(V) &((V)->value_u.v_object)
|
||||
#define VB_GET_UINT64(V) &((V)->value_u.v_counter64)
|
||||
|
||||
/* macro to get a pointer to a cookie, so that the user
|
||||
doesn't have to understand what a vb looks like */
|
||||
#define VB_TO_COOKIE(vbp) (vbp)->vb_ml.ml_leaf->user_cookie
|
||||
|
||||
/* various vb utility routines */
|
||||
extern VB_T * VarBindList_Allocate __((int));
|
||||
extern VBL_T * VBList_Allocate __((int));
|
||||
extern bits32_t vbsize __((VB_T *));
|
||||
extern void Clean_vb_data __((VB_T *));
|
||||
extern void Clean_vb __((VB_T *));
|
||||
extern void Clean_vb_list __((VBL_T *));
|
||||
extern void VBList_Free __((VBL_T *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* (!defined(vb_inc)) */
|
||||
@@ -0,0 +1,85 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/version.h,v 1.1.1.1 2001/11/05 17:47:24 tneale Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1988-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: version.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:24 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.3 2001/01/19 22:22:13 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.2 2000/03/17 19:48:48 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.1 2000/03/07 15:17:42 josh
|
||||
* updating version stamp to match release
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:30 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:25:07 sar
|
||||
* Update major version to 9 in preperation for next release.
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:55 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:33 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.4 1997/11/17 23:58:36 sar
|
||||
* Update the version
|
||||
*
|
||||
* Revision 7.3 1997/03/20 06:48:26 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.2 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.1 1997/02/17 20:04:52 sar
|
||||
* udpated version 7.2
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 6.0 1995/05/31 21:59:46 sra
|
||||
* Release 6.0.
|
||||
*
|
||||
* Revision 1.3 1995/05/29 03:59:37 sar
|
||||
* Set the beta version define to 0
|
||||
*
|
||||
* Revision 1.2 1995/03/24 19:47:02 sar
|
||||
* Updated to version 6.0 beta
|
||||
*
|
||||
* Revision 1.1 1995/03/20 23:07:47 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
#define ENVOY_VERSION_STRING "$Revision: 1.1.1.1 $"
|
||||
#define ENVOY_MAJOR_VERSION 9
|
||||
#define ENVOY_MINOR_VERSION 1
|
||||
#define ENVOY_BETA_VERSION 0
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/* $Header: /usr/cvsroot/target/h/wrn/wm/snmp/engine/view.h,v 1.2 2001/11/06 21:35:08 josh Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1995-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: view.h,v $
|
||||
* Revision 1.2 2001/11/06 21:35:08 josh
|
||||
* new revised path structure, first pass. Also removing useless
|
||||
* shell include files.
|
||||
*
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:25 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 9.5 2001/04/25 16:40:05 josh
|
||||
* make sure the instance is thoroughly checked in the
|
||||
* vacmViewTreeFamilyTable before trying to create a
|
||||
* new row
|
||||
*
|
||||
* Revision 9.4 2001/01/19 22:22:13 paul
|
||||
* Update copyright.
|
||||
*
|
||||
* Revision 9.3 2000/03/17 19:48:49 meister
|
||||
* Update copyright notice
|
||||
*
|
||||
* Revision 9.2 2000/03/09 20:58:37 tneale
|
||||
* All structure definitions are now bracketted with a test that
|
||||
* potentially sets an alignment pragma. This is to maintain compatibility
|
||||
* with the code base that had been distributed by Wind River.
|
||||
*
|
||||
* Revision 9.1 2000/03/09 17:14:33 tneale
|
||||
* Added #ifdef for C++ to extern C if needed
|
||||
*
|
||||
* Revision 9.0 1998/10/16 22:10:31 sar
|
||||
* Update version stamp to match release
|
||||
*
|
||||
* Revision 8.4 1998/06/20 17:49:44 sar
|
||||
* Modified the names and calling sequences for snmp_rfc2275 functions
|
||||
*
|
||||
* Revision 8.3 1998/06/18 04:44:20 sar
|
||||
* Update view index to directly point to the name instead of using
|
||||
* an ebuffer
|
||||
*
|
||||
* Revision 8.2 1998/05/23 20:20:08 sar
|
||||
* added code for rfc2275, updated types
|
||||
*
|
||||
* Revision 8.1 1998/02/25 04:50:57 sra
|
||||
* Update copyrights.
|
||||
*
|
||||
* Revision 8.0 1997/11/18 00:56:33 sar
|
||||
* Updated revision to 8.0
|
||||
*
|
||||
* Revision 7.2 1997/03/20 06:48:27 sra
|
||||
* DFARS-safe copyright text. Zap!
|
||||
*
|
||||
* Revision 7.1 1997/02/25 10:49:26 sra
|
||||
* Update copyright notice, dust under the bed.
|
||||
*
|
||||
* Revision 7.0 1996/03/18 20:17:33 sar
|
||||
* Updated rev to 7.0 and copyright to 96
|
||||
*
|
||||
* Revision 1.4 1995/11/14 22:42:26 sar
|
||||
* Added the prototype defs for the view method routines.
|
||||
*
|
||||
* Revision 1.3 1995/11/11 00:05:52 sar
|
||||
* removed use of rfc1445_view_routines
|
||||
*
|
||||
* Revision 1.2 1995/11/01 00:54:33 sar
|
||||
* removed casts of 0
|
||||
* changed the default row status to be nis instead of rsne
|
||||
*
|
||||
* Revision 1.1 1995/10/20 22:53:35 sar
|
||||
* Initial revision
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#if (!defined(view_inc))
|
||||
#define view_inc
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern"C" {
|
||||
#endif
|
||||
|
||||
#if (!defined(snmpdefs_inc))
|
||||
#include <wrn/wm/snmp/engine/snmpdefs.h>
|
||||
#endif
|
||||
|
||||
#if (!defined(smi_inc))
|
||||
#include <wrn/wm/snmp/engine/smi.h>
|
||||
#endif
|
||||
|
||||
#define STO_OTHER 1
|
||||
#define STO_VOL 2
|
||||
#define STO_NONVOL 3
|
||||
#define STO_PERM 4
|
||||
#define STO_RONLY 5
|
||||
|
||||
#define RS_RSNE 0
|
||||
#define RS_ACTIVE 1
|
||||
#define RS_NIS 2
|
||||
#define RS_NREADY 3
|
||||
#define RS_CAGO 4
|
||||
#define RS_CAWAIT 5
|
||||
#define RS_DESTROY 6
|
||||
|
||||
/* define the view structures */
|
||||
#define VIEW_INCLUDED 1
|
||||
#define VIEW_EXCLUDED 2
|
||||
#define VIEW_INDETERMINATE 3
|
||||
#define VIEW_MAXMASKLEN 16
|
||||
#define VIEW_MAXINDEX 65535
|
||||
#define VIEW_MAXINDEXL 65535L
|
||||
|
||||
#define ETC_VIEW_NAME_MIN 1
|
||||
#define ETC_VIEW_NAME_MAX 32
|
||||
|
||||
/* options for SNMP_View_Check */
|
||||
#define VIEW_CHECK_DET 0
|
||||
#define VIEW_CHECK_IND 1
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 1
|
||||
#endif
|
||||
|
||||
typedef struct VIEWLEAF_S
|
||||
{
|
||||
struct VIEWINDEX_S *parent; /* backpointer to parent, 0 if
|
||||
this view isn't installed */
|
||||
bits16_t index; /* index of the view table,
|
||||
this is the same as it's parents
|
||||
view index used for admin */
|
||||
OBJ_ID_T subtree; /* the oid for this subtree */
|
||||
EBUFFER_T mask; /* wildcard string */
|
||||
int type; /* is this entry included or exc */
|
||||
int status; /* status of this entry */
|
||||
int storage; /* type of storage of this entry */
|
||||
struct VIEWLEAF_S * lexinext; /* list of leaves in lexi order */
|
||||
struct VIEWLEAF_S * masknext; /* list of leaves in mask order */
|
||||
} VIEWLEAF_T;
|
||||
|
||||
typedef struct VIEWINDEX_S
|
||||
{
|
||||
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
|
||||
bits16_t index; /* index of the view table */
|
||||
#endif
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
bits8_t * name; /* name of the view table */
|
||||
ALENGTH_T name_len; /* length of name */
|
||||
#endif
|
||||
|
||||
struct VIEWINDEX_S * next; /* next index in the chain */
|
||||
VIEWLEAF_T * lexilist; /* list of leaves in lexi order */
|
||||
VIEWLEAF_T * masklist; /* list of leaves in mask order */
|
||||
} VIEWINDEX_T;
|
||||
|
||||
#ifdef WINDNET_STRUCT_ALIGN
|
||||
#pragma align 0
|
||||
#endif
|
||||
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS)
|
||||
extern int SNMP_View_Find_Family __((SNMP_PKT_T *));
|
||||
extern int SNMP_View_Family_Check __((SNMP_PKT_T *, OIDC_T *, int, int));
|
||||
extern int SNMP_View_Check __((SNMP_PKT_T *, OIDC_T *, int, int));
|
||||
|
||||
#define SNMP_View_Get_Type(V) ((V)->type)
|
||||
#define SNMP_View_Set_Type(V, W) ((V)->type = (bits16_t)W)
|
||||
#define SNMP_View_Get_Mask(V) (EBufferStart(&(V)->mask))
|
||||
#define SNMP_View_Get_MaskLen(V) (EBufferUsed(&(V)->mask))
|
||||
#define SNMP_View_Set_StorageType(V, W) ((V)->storage = (bits16_t)W)
|
||||
#define SNMP_View_Get_StorageType(V) ((V)->storage)
|
||||
#define SNMP_View_Set_Status(V, W) ((V)->status = (bits16_t)W)
|
||||
#define SNMP_View_Get_Status(V) ((V)->status)
|
||||
#define SNMP_View_Get_Subtree(V) ((V)->subtree.component_list)
|
||||
#define SNMP_View_Get_Subtree_Len(V) ((V)->subtree.num_components)
|
||||
|
||||
#define SNMP_View_Set_Defaults(V) ((V)->parent = 0, \
|
||||
EBufferInitialize(&(V)->mask), \
|
||||
(V)->masknext = 0, \
|
||||
(V)->lexinext = 0, \
|
||||
(V)->type = VIEW_INCLUDED, \
|
||||
(V)->storage = STO_NONVOL, \
|
||||
(V)->status = RS_NIS)
|
||||
|
||||
|
||||
extern VIEWLEAF_T *SNMP_View_Create __((OIDC_T *, int));
|
||||
extern void SNMP_View_Delete __((VIEWLEAF_T *));
|
||||
extern VIEWLEAF_T *SNMP_View_Next __((VIEWLEAF_T *));
|
||||
extern int SNMP_View_Set_Mask __((VIEWLEAF_T *, bits8_t *, int));
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
|
||||
#define SNMP_View_Get_Index(V) ((V)->index)
|
||||
|
||||
extern int SNMP_View_Install __((bits16_t, VIEWLEAF_T *));
|
||||
extern int SNMP_View_Name __((VIEWLEAF_T *, bits16_t *,
|
||||
OIDC_T *, int));
|
||||
extern int SNMP_View_Deinstall __((bits16_t, OIDC_T *, int));
|
||||
extern VIEWLEAF_T *SNMP_View_Lookup __((bits16_t, OIDC_T *, int));
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS) */
|
||||
|
||||
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
|
||||
/*#define SNMP_View_2275_Name(V) ((V)->parent ? (V)->parent->name : 0)
|
||||
#define SNMP_View_2275_Name_Len(V) ((V)->parent ? (V)->parent->name_len : 0)*/
|
||||
|
||||
extern void SNMP_View_2275_Name __((VIEWLEAF_T *, bits8_t *,
|
||||
ALENGTH_T *));
|
||||
extern int SNMP_View_2275_Install __((VIEWLEAF_T *, bits8_t *,
|
||||
ALENGTH_T));
|
||||
extern int SNMP_View_2275_Full_Name __((VIEWLEAF_T *, OIDC_T *, int));
|
||||
extern void SNMP_View_2275_Deinstall __((VIEWLEAF_T *));
|
||||
extern VIEWLEAF_T *SNMP_View_2275_Lookup __((bits8_t *, ALENGTH_T,
|
||||
OIDC_T *, int));
|
||||
extern sbits32_t v3_vacmViewSpinLock;
|
||||
#endif /* #if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS) */
|
||||
|
||||
|
||||
extern void viewtable_test __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void viewtable_get __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void viewtable_next __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
extern void viewtable_set __((OIDC_T, int, OIDC_T *,
|
||||
SNMP_PKT_T *, VB_T *));
|
||||
|
||||
#endif /* (INSTALL_ENVOY_SNMP_DYNAMIC_VIEWS) */
|
||||
|
||||
extern VIEWINDEX_T *viewroot;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* view_inc */
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2005 Wind River Systems, Inc.
|
||||
* All rights reserved. Provided under license only.
|
||||
* Distribution or other use of this software is only
|
||||
* permitted pursuant to the terms of a license agreement
|
||||
* from Wind River Systems (and is otherwise prohibited).
|
||||
* Refer to that license agreement for terms of use.
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copyright 1994-1997 Epilogue Technology Corporation.
|
||||
* Copyright 1998 Integrated Systems, Inc.
|
||||
* All rights reserved.
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* $Log: vxcmpnts.h,v $
|
||||
* Revision 1.1.1.1 2001/11/05 17:47:25 tneale
|
||||
* Tornado shuffle
|
||||
*
|
||||
* Revision 1.1.2.3 2001/11/02 23:37:02 meister
|
||||
* prototype for usrSnmpInit
|
||||
*
|
||||
* Revision 1.1.2.2 2001/10/01 18:52:56 meister
|
||||
* Add some prototypes.
|
||||
*
|
||||
* Revision 1.1.2.1 2001/08/29 15:47:08 meister
|
||||
* declarations for vxworks snmpd component initialation functions
|
||||
* and task priorities
|
||||
*
|
||||
*/
|
||||
|
||||
/* [clearcase]
|
||||
modification history
|
||||
-------------------
|
||||
01a,19apr05,job update copyright notices
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENVOY_VXCMPNTS_H
|
||||
# define _ENVOY_VXCMPNTS_H 1
|
||||
|
||||
/*
|
||||
* vxcmpnts.h - this file contains labels for each configurable component
|
||||
* for the SNMPD running under VxWorks. Each one is a bit in
|
||||
* in a bit-mask
|
||||
*/
|
||||
|
||||
#define SNMPD_CORE_COMPONENT 0x1
|
||||
#define SNMPD_VERSION_3_COMPONENT (0x1 << 1)
|
||||
#define SNMPD_AGENTX_MASTER_COMPONENT (0x1 << 2)
|
||||
#define SNMPD_AGENTX_SUBAGENT_COMPONENT (0x1 << 3)
|
||||
|
||||
/*
|
||||
* delcarations for component init routines
|
||||
*/
|
||||
|
||||
void initAxMasterComponent (void);
|
||||
void initAxSubagentComponent (void);
|
||||
void initSnmpV3Component (void);
|
||||
void snmpdInitConfigMsgQ (void);
|
||||
void initSnmpd(void);
|
||||
|
||||
void determineSnmpdComponents (void);
|
||||
void envoy_dyncfg_init (void);
|
||||
|
||||
/*
|
||||
* priorities for the component startup tasks, if not specified by the user
|
||||
*/
|
||||
|
||||
#ifndef ENVOY_VXWORKS_SNMPD_INIT_PRIORITY
|
||||
# define ENVOY_VXWORKS_SNMPD_INIT_PRIORITY 94
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_VXWORKS_SNMPD_COMP_INIT_PRIORITY
|
||||
# define ENVOY_VXWORKS_SNMPD_COMP_INIT_PRIORITY 95
|
||||
#endif
|
||||
|
||||
#ifndef ENVOY_VXWORKS_SNMPD_PRIORITY
|
||||
# define ENVOY_VXWORKS_SNMPD_PRIORITY 96
|
||||
#endif
|
||||
|
||||
#endif /* _ENVOY_VXCMPNTS_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user