original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,549 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: agentx.ldb,v 1.10 1998/02/25 15:21:38 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_AGENTX_H
#define EPILOGUE_LAYOUT_AGENTX_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for AGENTX_PDU */
#define SIZEOF_AGENTX_PDU (20)
#define PTR_AGENTX_PDU_VERSION(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_PDU_VERSION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_PDU_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_AGENTX_PDU_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_AGENTX_PDU_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_AGENTX_PDU_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define AGENTX_PDU_TYPE_is_OPEN GLUE_CAST08(1L)
#define AGENTX_PDU_TYPE_is_CLOSE GLUE_CAST08(2L)
#define AGENTX_PDU_TYPE_is_REG GLUE_CAST08(3L)
#define AGENTX_PDU_TYPE_is_UNREG GLUE_CAST08(4L)
#define AGENTX_PDU_TYPE_is_GET GLUE_CAST08(5L)
#define AGENTX_PDU_TYPE_is_NEXT GLUE_CAST08(6L)
#define AGENTX_PDU_TYPE_is_BULK GLUE_CAST08(7L)
#define AGENTX_PDU_TYPE_is_TEST_SET GLUE_CAST08(8L)
#define AGENTX_PDU_TYPE_is_COMMIT_SET GLUE_CAST08(9L)
#define AGENTX_PDU_TYPE_is_UNDO_SET GLUE_CAST08(10L)
#define AGENTX_PDU_TYPE_is_CLEANUP_SET GLUE_CAST08(11L)
#define AGENTX_PDU_TYPE_is_NOTIFY GLUE_CAST08(12L)
#define AGENTX_PDU_TYPE_is_PING GLUE_CAST08(13L)
#define AGENTX_PDU_TYPE_is_INDEX_ALLOCATE GLUE_CAST08(14L)
#define AGENTX_PDU_TYPE_is_INDEX_DEALLOCATE GLUE_CAST08(15L)
#define AGENTX_PDU_TYPE_is_ADD_AGENT_CAPS GLUE_CAST08(16L)
#define AGENTX_PDU_TYPE_is_REMOVE_AGENT_CAPS GLUE_CAST08(17L)
#define AGENTX_PDU_TYPE_is_RESP GLUE_CAST08(18L)
#define PTR_AGENTX_PDU_FLAGS(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_PDU_FLAGS(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_PDU_FLAGS(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define AGENTX_PDU_FLAGS_is_INSTANCE_REGISTRATION GLUE_CAST08(1L)
#define AGENTX_PDU_FLAGS_is_NEW_INDEX GLUE_CAST08(2L)
#define AGENTX_PDU_FLAGS_is_ANY_INDEX GLUE_CAST08(4L)
#define AGENTX_PDU_FLAGS_is_NON_DEFAULT_CONTEXT GLUE_CAST08(8L)
#define AGENTX_PDU_FLAGS_is_NETWORK_BYTE_ORDER GLUE_CAST08(16L)
/* Can't define PTR_AGENTX_PDU_FILL0 because:
Size 3 is not a multiple of 8. */
#define GET_AGENTX_PDU_FILL0(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) >> 5)
#define SET_AGENTX_PDU_FILL0(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), (GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0xE0L)) | ((GLUE_CAST08(_V_) << 5) & GLUE_CAST08(0xE0L)))
/* Can't define PTR_AGENTX_PDU_NETWORK_BYTE_ORDER because:
Size 1 is not a multiple of 8. */
#define GET_AGENTX_PDU_NETWORK_BYTE_ORDER(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x10L))
#define SET_AGENTX_PDU_NETWORK_BYTE_ORDER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x10L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x10L)))
/* Can't define PTR_AGENTX_PDU_NON_DEFAULT_CONTEXT because:
Size 1 is not a multiple of 8. */
#define GET_AGENTX_PDU_NON_DEFAULT_CONTEXT(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x8L))
#define SET_AGENTX_PDU_NON_DEFAULT_CONTEXT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x8L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x8L)))
/* Can't define PTR_AGENTX_PDU_ANY_INDEX because:
Size 1 is not a multiple of 8. */
#define GET_AGENTX_PDU_ANY_INDEX(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x4L))
#define SET_AGENTX_PDU_ANY_INDEX(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x4L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x4L)))
/* Can't define PTR_AGENTX_PDU_NEW_INDEX because:
Size 1 is not a multiple of 8. */
#define GET_AGENTX_PDU_NEW_INDEX(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x2L))
#define SET_AGENTX_PDU_NEW_INDEX(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x2L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x2L)))
/* Can't define PTR_AGENTX_PDU_INSTANCE_REGISTRATION because:
Size 1 is not a multiple of 8. */
#define GET_AGENTX_PDU_INSTANCE_REGISTRATION(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x1L))
#define SET_AGENTX_PDU_INSTANCE_REGISTRATION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x1L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x1L)))
#define PTR_AGENTX_PDU_FILL1(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_AGENTX_PDU_FILL1(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(3))
#define SET_AGENTX_PDU_FILL1(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_AGENTX_PDU_SESSION_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_AGENTX_PDU_SESSION_ID (4)
#define PTR_AGENTX_PDU_SESSION_ID_B(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_AGENTX_PDU_SESSION_ID_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_AGENTX_PDU_SESSION_ID_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_SESSION_ID_L(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_AGENTX_PDU_SESSION_ID_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_))+(4))
#define SET_AGENTX_PDU_SESSION_ID_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_TRANS_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_AGENTX_PDU_TRANS_ID (4)
#define PTR_AGENTX_PDU_TRANS_ID_B(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_AGENTX_PDU_TRANS_ID_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_AGENTX_PDU_TRANS_ID_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_TRANS_ID_L(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_AGENTX_PDU_TRANS_ID_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_))+(8))
#define SET_AGENTX_PDU_TRANS_ID_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_PACKET_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define SIZEOF_AGENTX_PDU_PACKET_ID (4)
#define PTR_AGENTX_PDU_PACKET_ID_B(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_AGENTX_PDU_PACKET_ID_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(12))
#define SET_AGENTX_PDU_PACKET_ID_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_PACKET_ID_L(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_AGENTX_PDU_PACKET_ID_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_))+(12))
#define SET_AGENTX_PDU_PACKET_ID_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_PAYLOAD_LEN(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define SIZEOF_AGENTX_PDU_PAYLOAD_LEN (4)
#define PTR_AGENTX_PDU_PAYLOAD_LEN_B(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_AGENTX_PDU_PAYLOAD_LEN_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(16))
#define SET_AGENTX_PDU_PAYLOAD_LEN_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
#define PTR_AGENTX_PDU_PAYLOAD_LEN_L(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_AGENTX_PDU_PAYLOAD_LEN_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_))+(16))
#define SET_AGENTX_PDU_PAYLOAD_LEN_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
/* Definitions for AGENTX_CLOSE */
#define SIZEOF_AGENTX_CLOSE (4)
#define PTR_AGENTX_CLOSE_REASON(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_CLOSE_REASON(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_CLOSE_REASON(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define AGENTX_CLOSE_REASON_is_OTHER GLUE_CAST08(1L)
#define AGENTX_CLOSE_REASON_is_PARSE_ERROR GLUE_CAST08(2L)
#define AGENTX_CLOSE_REASON_is_PROTOCOL_ERROR GLUE_CAST08(3L)
#define AGENTX_CLOSE_REASON_is_TIMEOUTS GLUE_CAST08(4L)
#define AGENTX_CLOSE_REASON_is_SHUTDOWN GLUE_CAST08(5L)
#define AGENTX_CLOSE_REASON_is_BY_MANAGER GLUE_CAST08(6L)
#define PTR_AGENTX_CLOSE_FILL0(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_AGENTX_CLOSE_FILL0(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(1))
#define SET_AGENTX_CLOSE_FILL0(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_AGENTX_CLOSE_FILL1(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_CLOSE_FILL1(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_CLOSE_FILL1(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
/* Definitions for AGENTX_TYPE_CODE */
#define SIZEOF_AGENTX_TYPE_CODE (2)
#define GET_AGENTX_TYPE_CODE(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_TYPE_CODE(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define AGENTX_TYPE_CODE_is_INTEGER GLUE_CAST16(2L)
#define AGENTX_TYPE_CODE_is_OCT_STR GLUE_CAST16(4L)
#define AGENTX_TYPE_CODE_is_NULL GLUE_CAST16(5L)
#define AGENTX_TYPE_CODE_is_OID GLUE_CAST16(6L)
#define AGENTX_TYPE_CODE_is_IP_ADDRESS GLUE_CAST16(64L)
#define AGENTX_TYPE_CODE_is_COUNTER32 GLUE_CAST16(65L)
#define AGENTX_TYPE_CODE_is_GAUGE32 GLUE_CAST16(66L)
#define AGENTX_TYPE_CODE_is_TIME_TICKS GLUE_CAST16(67L)
#define AGENTX_TYPE_CODE_is_OPAQUE GLUE_CAST16(68L)
#define AGENTX_TYPE_CODE_is_COUNTER64 GLUE_CAST16(70L)
#define AGENTX_TYPE_CODE_is_NO_SUCH_OBJECT GLUE_CAST16(128L)
#define AGENTX_TYPE_CODE_is_NO_SUCH_INSTANCE GLUE_CAST16(129L)
#define AGENTX_TYPE_CODE_is_END_OF_MIB_VIEW GLUE_CAST16(130L)
/* Definitions for AGENTX_VARBIND */
#define SIZEOF_AGENTX_VARBIND (8)
#define PTR_AGENTX_VARBIND_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_AGENTX_VARBIND_TYPE (2)
#define PTR_AGENTX_VARBIND_TYPE_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_VARBIND_TYPE_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_VARBIND_TYPE_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_VARBIND_TYPE_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_VARBIND_TYPE_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_VARBIND_TYPE_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_VARBIND_FILL0(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_VARBIND_FILL0(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_VARBIND_FILL0(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_AGENTX_VARBIND_NAME(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
/* Definitions for AGENTX_UNSIGNED32 */
#define SIZEOF_AGENTX_UNSIGNED32 (4)
#define PTR_AGENTX_UNSIGNED32_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_UNSIGNED32_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_UNSIGNED32_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_AGENTX_UNSIGNED32_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_UNSIGNED32_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_UNSIGNED32_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
/* Definitions for AGENTX_UNREG */
#define SIZEOF_AGENTX_UNREG (8)
#define PTR_AGENTX_UNREG_FILL0(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_UNREG_FILL0(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_UNREG_FILL0(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_UNREG_RANGE_SUBID(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_UNREG_RANGE_SUBID(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_UNREG_RANGE_SUBID(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_AGENTX_UNREG_FILL1(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_AGENTX_UNREG_FILL1(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(3))
#define SET_AGENTX_UNREG_FILL1(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_AGENTX_UNREG_REGION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
/* Definitions for AGENTX_UNSIGNED16 */
#define SIZEOF_AGENTX_UNSIGNED16 (2)
#define PTR_AGENTX_UNSIGNED16_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_UNSIGNED16_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_UNSIGNED16_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_UNSIGNED16_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_UNSIGNED16_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_UNSIGNED16_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
/* Definitions for AGENTX_UNSIGNED64 */
#define SIZEOF_AGENTX_UNSIGNED64 (8)
#define PTR_AGENTX_UNSIGNED64_B(_P_)\
((GLUE_CAST_PTR(_P_)))
/* Can't define (GET_AGENTX_UNSIGNED64_B SET_AGENTX_UNSIGNED64_B) because:
Size 64 is greater than 32. */
#define PTR_AGENTX_UNSIGNED64_L(_P_)\
((GLUE_CAST_PTR(_P_)))
/* Can't define (GET_AGENTX_UNSIGNED64_L SET_AGENTX_UNSIGNED64_L) because:
Size 64 is greater than 32. */
/* Definitions for AGENTX_OCT_STR */
#define SIZEOF_AGENTX_OCT_STR (4)
#define PTR_AGENTX_OCT_STR_LEN(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_AGENTX_OCT_STR_LEN (4)
#define PTR_AGENTX_OCT_STR_LEN_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_OCT_STR_LEN_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_OCT_STR_LEN_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_AGENTX_OCT_STR_LEN_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_OCT_STR_LEN_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_OCT_STR_LEN_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_AGENTX_OCT_STR_OCTETS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_AGENTX_OCT_STR_OCTETS (0)
#define PTR_AGENTX_OCT_STR_OCTETS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(_X0_))
#define GET_AGENTX_OCT_STR_OCTETS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)+(_X0_))
#define SET_AGENTX_OCT_STR_OCTETS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for AGENTX_BULK */
#define SIZEOF_AGENTX_BULK (4)
#define PTR_AGENTX_BULK_NON_REP(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_AGENTX_BULK_NON_REP (2)
#define PTR_AGENTX_BULK_NON_REP_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_BULK_NON_REP_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_BULK_NON_REP_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_BULK_NON_REP_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_BULK_NON_REP_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_BULK_NON_REP_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_AGENTX_BULK_MAX_REP(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_AGENTX_BULK_MAX_REP (2)
#define PTR_AGENTX_BULK_MAX_REP_B(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_BULK_MAX_REP_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_BULK_MAX_REP_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_AGENTX_BULK_MAX_REP_L(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_BULK_MAX_REP_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_BULK_MAX_REP_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
/* Definitions for AGENTX_OPEN */
#define SIZEOF_AGENTX_OPEN (8)
#define PTR_AGENTX_OPEN_TIMEOUT(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_OPEN_TIMEOUT(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_OPEN_TIMEOUT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_AGENTX_OPEN_FILL0(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_AGENTX_OPEN_FILL0(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(1))
#define SET_AGENTX_OPEN_FILL0(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_AGENTX_OPEN_FILL1(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_OPEN_FILL1(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_OPEN_FILL1(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_AGENTX_OPEN_OID(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
/* Definitions for AGENTX_OID */
#define SIZEOF_AGENTX_OID (4)
#define PTR_AGENTX_OID_N_SUBID(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_OID_N_SUBID(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_OID_N_SUBID(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_AGENTX_OID_PREFIX(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_AGENTX_OID_PREFIX(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_AGENTX_OID_PREFIX(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_AGENTX_OID_INCLUDE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_OID_INCLUDE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_OID_INCLUDE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_AGENTX_OID_FILL0(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_AGENTX_OID_FILL0(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(3))
#define SET_AGENTX_OID_FILL0(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_AGENTX_OID_SUBIDS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_AGENTX_OID_SUBIDS (0)
#define PTR_AGENTX_OID_SUBIDS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_))
#define SIZEOF_AGENTX_OID_SUBIDS_ELT (4)
#define PTR_AGENTX_OID_SUBIDS_ELT_B(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_))
#define GET_AGENTX_OID_SUBIDS_ELT_B(_P_, _X0_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_))
#define SET_AGENTX_OID_SUBIDS_ELT_B(_P_, _X0_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_), GLUE_CAST32(_V_))
#define PTR_AGENTX_OID_SUBIDS_ELT_L(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_))
#define GET_AGENTX_OID_SUBIDS_ELT_L(_P_, _X0_)\
GLUE_GL32((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_))
#define SET_AGENTX_OID_SUBIDS_ELT_L(_P_, _X0_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_))+(4)+(4)*(_X0_), GLUE_CAST32(_V_))
/* Definitions for AGENTX_ERROR_CODE */
#define SIZEOF_AGENTX_ERROR_CODE (2)
#define GET_AGENTX_ERROR_CODE(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_ERROR_CODE(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define AGENTX_ERROR_CODE_is_OPEN_FAILED GLUE_CAST16(256L)
#define AGENTX_ERROR_CODE_is_NOT_OPEN GLUE_CAST16(257L)
#define AGENTX_ERROR_CODE_is_INDEX_WRONG_TYPE GLUE_CAST16(258L)
#define AGENTX_ERROR_CODE_is_INDEX_ALREADY_ALLOCATED GLUE_CAST16(259L)
#define AGENTX_ERROR_CODE_is_INDEX_NONE_AVAILABLE GLUE_CAST16(260L)
#define AGENTX_ERROR_CODE_is_INDEX_NOT_ALLOCATED GLUE_CAST16(261L)
#define AGENTX_ERROR_CODE_is_UNSUPPORTED_CONTEXT GLUE_CAST16(262L)
#define AGENTX_ERROR_CODE_is_DUPLICATE_REGISTRATION GLUE_CAST16(263L)
#define AGENTX_ERROR_CODE_is_UNKNOWN_REGISTRATION GLUE_CAST16(264L)
#define AGENTX_ERROR_CODE_is_UNKNOWN_AGENT_CAPS GLUE_CAST16(265L)
/* Definitions for AGENTX_RESP */
#define SIZEOF_AGENTX_RESP (8)
#define PTR_AGENTX_RESP_SYS_UPTIME(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_AGENTX_RESP_SYS_UPTIME (4)
#define PTR_AGENTX_RESP_SYS_UPTIME_B(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_RESP_SYS_UPTIME_B(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_RESP_SYS_UPTIME_B(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_AGENTX_RESP_SYS_UPTIME_L(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_RESP_SYS_UPTIME_L(_P_)\
GLUE_GL32((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_RESP_SYS_UPTIME_L(_P_, _V_)\
GLUE_SL32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_AGENTX_RESP_ERROR(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_AGENTX_RESP_ERROR (2)
#define PTR_AGENTX_RESP_ERROR_B(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_AGENTX_RESP_ERROR_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(4))
#define SET_AGENTX_RESP_ERROR_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_AGENTX_RESP_ERROR_L(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_AGENTX_RESP_ERROR_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(4))
#define SET_AGENTX_RESP_ERROR_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_AGENTX_RESP_INDEX(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define SIZEOF_AGENTX_RESP_INDEX (2)
#define PTR_AGENTX_RESP_INDEX_B(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_AGENTX_RESP_INDEX_B(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_AGENTX_RESP_INDEX_B(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_AGENTX_RESP_INDEX_L(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_AGENTX_RESP_INDEX_L(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(6))
#define SET_AGENTX_RESP_INDEX_L(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
/* Definitions for AGENTX_REG */
#define SIZEOF_AGENTX_REG (8)
#define PTR_AGENTX_REG_TIMEOUT(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_AGENTX_REG_TIMEOUT(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_AGENTX_REG_TIMEOUT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_AGENTX_REG_PRIORITY(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_AGENTX_REG_PRIORITY(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_AGENTX_REG_PRIORITY(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_AGENTX_REG_RANGE_SUBID(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_AGENTX_REG_RANGE_SUBID(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_AGENTX_REG_RANGE_SUBID(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_AGENTX_REG_FILL0(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_AGENTX_REG_FILL0(_P_)\
GLUE_GU08((GLUE_CAST_PTR(_P_))+(3))
#define SET_AGENTX_REG_FILL0(_P_, _V_)\
GLUE_SU08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_AGENTX_REG_REGION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
/* Definitions for AGENTX_PDU_WITH_CONTEXT */
#define SIZEOF_AGENTX_PDU_WITH_CONTEXT (24)
#define PTR_AGENTX_PDU_WITH_CONTEXT_CONTEXT(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#endif /* EPILOGUE_LAYOUT_AGENTX_H */
@@ -0,0 +1,338 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/agentx.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for AgentX
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: agentx.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.11 2001/01/19 22:22:31 paul
; Update copyright.
;
; Revision 1.10 1998/02/25 15:21:38 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.9 1998/02/25 04:53:42 sra
; Update copyrights.
;
; Revision 1.8 1997/09/26 20:21:12 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.7 1997/06/12 00:09:53 alan
; Turn all the filler into named fields to make them easier to set to zero.
;
; Revision 1.6 1997/06/04 05:46:06 alan
; Fix RCS keywords.
;
; Revision 1.5 1997/06/03 22:59:27 alan
; Use `define-rcs-info'.
;
; Revision 1.4 1997/06/03 20:58:42 alan
; Stopt trying to have a description for each type of PDU.
; Instead, just define the layouts for those PDUs that have
; a fixed part beyond the header. (I.e. for OPEN, CLOSE,
; RESP, REG, UNREG and BULK).
;
; Revision 1.3 1997/06/03 19:08:48 alan
; Make some names shorter...
;
; Revision 1.2 1997/06/03 02:23:24 alan
; Add FLAGS field to AGENTX_PDU layout.
;
; Revision 1.1 1997/06/01 00:46:14 alan
; Initial version
(define-rcs-info "$Id: agentx.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout-macro (big-or-little integer) ; (big-or-little <size>)
(lambda (form)
`(union (field B (unsigned ,(cadr form)))
(field L (unsigned-8bit-little ,(cadr form))))))
(define-layout AGENTX_UNSIGNED16
(big-or-little 16))
(define-layout AGENTX_UNSIGNED32
(big-or-little 32))
(define-layout AGENTX_UNSIGNED64
(big-or-little 64))
(define-layout AGENTX_OID
(struct (field N_SUBID (unsigned 8))
(field PREFIX (unsigned 8))
(field INCLUDE (unsigned 8))
(field FILL0 (opaque 8))
(field SUBIDS (array (count 0)
(type (big-or-little 32))))))
(define-layout AGENTX_OCT_STR
(struct (field LEN (big-or-little 32))
(field OCTETS (array (count 0)
(type (unsigned 8))))))
(define-layout AGENTX_TYPE_CODE
;; This is the type code -after- you've decoded the big-or-little encoding.
(enum (type (unsigned 16))
(value INTEGER 2)
(value OCT_STR 4)
(value NULL 5)
(value OID 6)
(value IP_ADDRESS 64)
(value COUNTER32 65)
(value GAUGE32 66)
(value TIME_TICKS 67)
(value OPAQUE 68)
(value COUNTER64 70)
(value NO_SUCH_OBJECT 128)
(value NO_SUCH_INSTANCE 129)
(value END_OF_MIB_VIEW 130)))
(define-layout AGENTX_VARBIND
(struct (field TYPE (big-or-little 16)) ; an AGENTX_TYPE_CODE
(field FILL0 (opaque 16))
(field NAME AGENTX_OID)
;; Followed by any data...
))
(define-layout AGENTX_PDU
(struct (size (* 5 32)) ; error check
(field VERSION (unsigned 8))
(field TYPE (enum (type (unsigned 8))
(value OPEN 1)
(value CLOSE 2)
(value REG 3)
(value UNREG 4)
(value GET 5)
(value NEXT 6)
(value BULK 7)
(value TEST_SET 8)
(value COMMIT_SET 9)
(value UNDO_SET 10)
(value CLEANUP_SET 11)
(value NOTIFY 12)
(value PING 13)
(value INDEX_ALLOCATE 14)
(value INDEX_DEALLOCATE 15)
(value ADD_AGENT_CAPS 16)
(value REMOVE_AGENT_CAPS 17)
(value RESP 18)))
(union (field FLAGS (enum (type (unsigned 8))
(value NETWORK_BYTE_ORDER #x10)
(value NON_DEFAULT_CONTEXT #x08)
(value ANY_INDEX #x04)
(value NEW_INDEX #x02)
(value INSTANCE_REGISTRATION #x01)
))
(struct (size 8) ; error check
(align 1)
(field FILL0 (unsigned 3))
(field NETWORK_BYTE_ORDER (boolean 1))
(field NON_DEFAULT_CONTEXT (boolean 1))
(field ANY_INDEX (boolean 1))
(field NEW_INDEX (boolean 1))
(field INSTANCE_REGISTRATION (boolean 1))))
(field FILL1 (opaque 8))
(field SESSION_ID (big-or-little 32))
(field TRANS_ID (big-or-little 32))
(field PACKET_ID (big-or-little 32))
(field PAYLOAD_LEN (big-or-little 32))
))
(define-layout AGENTX_PDU_WITH_CONTEXT
(struct (fill (sizeof AGENTX_PDU))
(field CONTEXT AGENTX_OCT_STR)))
;(old) (define-layout AGENTX_OPEN
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ))
(define-layout AGENTX_OPEN
(struct (field TIMEOUT (unsigned 8))
(field FILL0 (opaque 8))
(field FILL1 (opaque 16))
(field OID AGENTX_OID)
;; Followed by an AGENTX_OCT_STR description
))
;(old) (define-layout AGENTX_CLOSE
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ))
(define-layout AGENTX_CLOSE
(struct (field REASON (enum (type (unsigned 8))
(value OTHER 1)
(value PARSE_ERROR 2)
(value PROTOCOL_ERROR 3)
(value TIMEOUTS 4)
(value SHUTDOWN 5)
(value BY_MANAGER 6)))
(field FILL0 (opaque 8))
(field FILL1 (opaque 16))
))
;(old) (define-layout AGENTX_REG
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ))
(define-layout AGENTX_REG
(struct (field TIMEOUT (unsigned 8))
(field PRIORITY (unsigned 8))
(field RANGE_SUBID (unsigned 8))
(field FILL0 (opaque 8))
(field REGION AGENTX_OID)
;; Followed by an additional upper bound SUBID
))
;(old) (define-layout AGENTX_UNREG
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ))
(define-layout AGENTX_UNREG
(struct (field FILL0 (opaque 16))
(field RANGE_SUBID (unsigned 8))
(field FILL1 (opaque 8))
(field REGION AGENTX_OID)
;; Followed by an additional upper bound SUBID
))
;(old) (define-layout AGENTX_GET
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of ranges (pairs of AGENTX_OIDs)
;(old) ))
;(old) (define-layout AGENTX_NEXT
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of ranges (pairs of AGENTX_OIDs)
;(old) ))
;(old) (define-layout AGENTX_BULK
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ))
(define-layout AGENTX_BULK
(struct (field NON_REP (big-or-little 16))
(field MAX_REP (big-or-little 16))
;; Followed by a series of ranges (pairs of AGENTX_OIDs)
))
;(old) (define-layout AGENTX_TEST_SET
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of AGENTX_VARBINDs
;(old) ))
;
; COMMIT_SET, UNDO_SET and CLEANUP_SET have only the header.
;
;(old) (define-layout AGENTX_NOTIFY
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of AGENTX_VARBINDs
;(old) ))
;
; PING has only the header, perhaps with context
;
;(old) (define-layout AGENTX_INDEX_ALLOCATE
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of AGENTX_VARBINDs
;(old) ))
;(old) (define-layout AGENTX_INDEX_DEALLOCATE
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed by a series of AGENTX_VARBINDs
;(old) ))
;(old) (define-layout AGENTX_ADD_AGENT_CAPS
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed an AGENTX_OID
;(old) ;; Followed an AGENTX_OCT_STR
;(old) ))
;(old) (define-layout AGENTX_REMOVE_AGENT_CAPS
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ;; Optional context (AGENTX_OCT_STR)
;(old) ;; Followed an AGENTX_OID
;(old) ))
(define-layout AGENTX_ERROR_CODE
;; This is the error code -after- you've decoded the big-or-little encoding.
(enum (type (unsigned 16))
(value OPEN_FAILED 256)
(value NOT_OPEN 257)
(value INDEX_WRONG_TYPE 258)
(value INDEX_ALREADY_ALLOCATED 259)
(value INDEX_NONE_AVAILABLE 260)
(value INDEX_NOT_ALLOCATED 261)
(value UNSUPPORTED_CONTEXT 262)
(value DUPLICATE_REGISTRATION 263)
(value UNKNOWN_REGISTRATION 264)
(value UNKNOWN_AGENT_CAPS 265)))
;(old) (define-layout AGENTX_RESP
;(old) (struct (fill (sizeof AGENTX_PDU))
;(old) ))
(define-layout AGENTX_RESP
(struct (field SYS_UPTIME (big-or-little 32))
(field ERROR (big-or-little 16)) ; an AGENTX_ERROR_CODE
(field INDEX (big-or-little 16))
;; Followed by any data...
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,60 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: apple.ldb,v 1.8 1998/02/25 15:21:38 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_APPLE_H
#define EPILOGUE_LAYOUT_APPLE_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for APPLE_LAP */
#define SIZEOF_APPLE_LAP (5)
#define PTR_APPLE_LAP_DESTINATION(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_APPLE_LAP_DESTINATION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_APPLE_LAP_DESTINATION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_APPLE_LAP_SOURCE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_APPLE_LAP_SOURCE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_APPLE_LAP_SOURCE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_APPLE_LAP_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_APPLE_LAP_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_APPLE_LAP_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define APPLE_LAP_TYPE_is_DDP_SHORT GLUE_CAST08(1L)
#define APPLE_LAP_TYPE_is_DDP_LONG GLUE_CAST08(2L)
#define APPLE_LAP_TYPE_is_ENQ GLUE_CAST08(129L)
#define APPLE_LAP_TYPE_is_ACK GLUE_CAST08(130L)
#define APPLE_LAP_TYPE_is_RTS GLUE_CAST08(132L)
#define APPLE_LAP_TYPE_is_CTS GLUE_CAST08(133L)
/* Can't define PTR_APPLE_LAP_DATA_LENGTH because:
Size 10 is not a multiple of 8. */
#define GET_APPLE_LAP_DATA_LENGTH(_P_)\
GLUE_CAST16(GLUE_GB16((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST16(0x3FFL))
#define SET_APPLE_LAP_DATA_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(3), (GLUE_GB16((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST16(0x3FFL)) | (GLUE_CAST16(_V_) & GLUE_CAST16(0x3FFL)))
#define PTR_APPLE_LAP_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(5))
#define SIZEOF_APPLE_LAP_DATA (0)
#endif /* EPILOGUE_LAYOUT_APPLE_H */
@@ -0,0 +1,108 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/apple.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for Apple protocols
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: apple.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.9 2001/01/19 22:22:32 paul
; Update copyright.
;
; Revision 1.8 1998/02/25 15:21:38 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.7 1998/02/25 04:53:44 sra
; Update copyrights.
;
; Revision 1.6 1997/09/26 20:21:13 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.5 1997/06/04 05:46:14 alan
; Fix RCS keywords.
;
; Revision 1.4 1997/06/03 22:59:28 alan
; Use `define-rcs-info'.
;
; Revision 1.3 1997/04/22 20:58:11 alan
; Use `(struct (size 0))' where appropriate.
;
; Revision 1.2 1997/04/22 00:18:00 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:11 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.1 1995/06/26 06:24:17 alan
; Initial revision
(define-rcs-info "$Id: apple.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout APPLE_LAP ; or something like this...
(struct (field DESTINATION (unsigned 8))
(field SOURCE (unsigned 8))
(field TYPE (enum (type (unsigned 8))
(value DDP_SHORT #x01)
(value DDP_LONG #x02)
(value ENQ #x81)
(value ACK #x82)
(value RTS #x84)
(value CTS #x85)))
;; ----- control packets (TYPE >= #x80) end here -----
(struct (size 16)
(align 1)
(fill 6)
(field DATA_LENGTH (unsigned 10)))
(field DATA (struct (size 0)))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,69 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: arp.ldb,v 1.10 1998/02/25 15:21:38 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_ARP_H
#define EPILOGUE_LAYOUT_ARP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for ARP_HEADER */
#define SIZEOF_ARP_HEADER (8)
#define PTR_ARP_HEADER_HARDWARE_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_ARP_HEADER_HARDWARE_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_ARP_HEADER_HARDWARE_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define ARP_HEADER_HARDWARE_TYPE_is_ETHERNET GLUE_OPAQUE16(GLUE_CAST16(1L))
#define ARP_HEADER_HARDWARE_TYPE_is_AX25 GLUE_OPAQUE16(GLUE_CAST16(3L))
#define ARP_HEADER_HARDWARE_TYPE_is_PRONET GLUE_OPAQUE16(GLUE_CAST16(4L))
#define ARP_HEADER_HARDWARE_TYPE_is_CHAOS GLUE_OPAQUE16(GLUE_CAST16(5L))
#define ARP_HEADER_HARDWARE_TYPE_is_IEEE802 GLUE_OPAQUE16(GLUE_CAST16(6L))
#define ARP_HEADER_HARDWARE_TYPE_is_ARCNET GLUE_OPAQUE16(GLUE_CAST16(7L))
#define ARP_HEADER_HARDWARE_TYPE_is_HYPERCHANNEL GLUE_OPAQUE16(GLUE_CAST16(8L))
#define ARP_HEADER_HARDWARE_TYPE_is_LANSTAR GLUE_OPAQUE16(GLUE_CAST16(9L))
#define ARP_HEADER_HARDWARE_TYPE_is_AUTONET GLUE_OPAQUE16(GLUE_CAST16(10L))
#define ARP_HEADER_HARDWARE_TYPE_is_SMDS GLUE_OPAQUE16(GLUE_CAST16(14L))
#define PTR_ARP_HEADER_PROTOCOL_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_ARP_HEADER_PROTOCOL_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(2))
#define SET_ARP_HEADER_PROTOCOL_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_ARP_HEADER_HARDWARE_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ARP_HEADER_HARDWARE_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_ARP_HEADER_HARDWARE_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
#define PTR_ARP_HEADER_PROTOCOL_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(5))
#define GET_ARP_HEADER_PROTOCOL_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(5))
#define SET_ARP_HEADER_PROTOCOL_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(5), GLUE_CAST08(_V_))
#define PTR_ARP_HEADER_OPCODE(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_ARP_HEADER_OPCODE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(6))
#define SET_ARP_HEADER_OPCODE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define ARP_HEADER_OPCODE_is_REQUEST GLUE_OPAQUE16(GLUE_CAST16(1L))
#define ARP_HEADER_OPCODE_is_REPLY GLUE_OPAQUE16(GLUE_CAST16(2L))
#endif /* EPILOGUE_LAYOUT_ARP_H */
@@ -0,0 +1,138 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/arp.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for ARP
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: arp.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.11 2001/01/19 22:22:32 paul
; Update copyright.
;
; Revision 1.10 1998/02/25 15:21:38 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.9 1998/02/25 04:53:47 sra
; Update copyrights.
;
; Revision 1.8 1998/02/20 04:02:36 sra
; Fix too-long layout macro names.
;
; Revision 1.7 1997/09/26 20:21:13 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.6 1997/09/23 18:17:44 sra
; Comment out 3MB Ethernet to avoid breaking BCC 4.0.
;
; Revision 1.5 1997/06/04 05:46:17 alan
; Fix RCS keywords.
;
; Revision 1.4 1997/06/03 22:59:29 alan
; Use `define-rcs-info'.
;
; Revision 1.3 1997/05/19 21:18:44 alan
; Add more HARDWARE_TYPE values.
;
; Revision 1.2 1997/04/22 00:18:30 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:12 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.2 1995/06/26 06:25:29 alan
; Comment on Apple protocols
;
; Revision 1.1 1995/05/23 07:16:45 alan
; Basic network layouts.
(define-rcs-info "$Id: arp.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
; This same layout is used for RARP and several other related protocols...
; It also -almost- works for AppleTalk ARP (AARP), see below...
(define-layout ARP_HEADER
(struct (field HARDWARE_TYPE (enum (type (opaque 16))
(value ETHERNET 1)
; (value ETHERNET3MB 2)
(value AX25 3)
(value PRONET 4)
(value CHAOS 5)
(value IEEE802 6)
(value ARCNET 7)
(value HYPERCHANNEL 8)
(value LANSTAR 9)
(value AUTONET 10)
; (value LOCALTALK 11)
; (value LOCALNET 12)
(value SMDS 14)
))
(field PROTOCOL_TYPE (opaque 16)) ; same values as ETHERNET_TYPE
(field HARDWARE_LENGTH (unsigned 8))
(field PROTOCOL_LENGTH (unsigned 8))
(field OPCODE (enum (type (opaque 16))
(value REQUEST 1)
(value REPLY 2)
; (value REVERSE_REQUEST 3)
;; Give 16-bits worth of opcode, why the
;; hell did Apple choose 3 for this?
;; (value APPLETALK_ARP_PROBE 3)
; (value REVERSE_REPLY 4)
))
;; After the header comes:
;; sender's hardware address
;; sender's protocol address
;; target's hardware address
;; target's protocol address
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,412 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: bgp.ldb,v 1.8 1998/02/25 15:21:39 sra Exp
* --used --
* Id: ip.ldb,v 1.17 1998/02/25 15:21:40 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_BGP_H
#define EPILOGUE_LAYOUT_BGP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for BGP_HEADER */
#define SIZEOF_BGP_HEADER (19)
#define PTR_BGP_HEADER_MARKER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_BGP_HEADER_MARKER (16)
#define PTR_BGP_HEADER_MARKER_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(_X0_))
#define GET_BGP_HEADER_MARKER_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(_X0_))
#define SET_BGP_HEADER_MARKER_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(_X0_), GLUE_CAST08(_V_))
#define PTR_BGP_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_BGP_HEADER_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(16))
#define SET_BGP_HEADER_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST16(_V_))
#define PTR_BGP_HEADER_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(18))
#define GET_BGP_HEADER_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(18))
#define SET_BGP_HEADER_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(18), GLUE_CAST08(_V_))
#define BGP_HEADER_TYPE_is_OPEN GLUE_CAST08(1L)
#define BGP_HEADER_TYPE_is_UPDATE GLUE_CAST08(2L)
#define BGP_HEADER_TYPE_is_NOTIFICATION GLUE_CAST08(3L)
#define BGP_HEADER_TYPE_is_KEEPALIVE GLUE_CAST08(4L)
/* Definitions for BGP_NOTIFY */
#define SIZEOF_BGP_NOTIFY (21)
#define PTR_BGP_NOTIFY_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(19))
#define GET_BGP_NOTIFY_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(19))
#define SET_BGP_NOTIFY_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(19), GLUE_CAST08(_V_))
#define BGP_NOTIFY_CODE_is_HDR_ERR GLUE_CAST08(1L)
#define BGP_NOTIFY_CODE_is_OPEN_ERR GLUE_CAST08(2L)
#define BGP_NOTIFY_CODE_is_UPD_ERR GLUE_CAST08(3L)
#define BGP_NOTIFY_CODE_is_HOLD_TIMER GLUE_CAST08(4L)
#define BGP_NOTIFY_CODE_is_STATE_MACHINE GLUE_CAST08(5L)
#define BGP_NOTIFY_CODE_is_CEASE GLUE_CAST08(6L)
#define PTR_BGP_NOTIFY_HDR_ERR(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_BGP_NOTIFY_HDR_ERR(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(20))
#define SET_BGP_NOTIFY_HDR_ERR(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST08(_V_))
#define BGP_NOTIFY_HDR_ERR_is_CONN_NOT_SYNC GLUE_CAST08(1L)
#define BGP_NOTIFY_HDR_ERR_is_BAD_LENGTH GLUE_CAST08(2L)
#define BGP_NOTIFY_HDR_ERR_is_BAD_TYPE GLUE_CAST08(3L)
#define PTR_BGP_NOTIFY_OPEN_ERR(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_BGP_NOTIFY_OPEN_ERR(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(20))
#define SET_BGP_NOTIFY_OPEN_ERR(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST08(_V_))
#define BGP_NOTIFY_OPEN_ERR_is_VERSION_UNSUPPORTED GLUE_CAST08(1L)
#define BGP_NOTIFY_OPEN_ERR_is_BAD_AS GLUE_CAST08(2L)
#define BGP_NOTIFY_OPEN_ERR_is_BAD_IDENTIFIER GLUE_CAST08(3L)
#define BGP_NOTIFY_OPEN_ERR_is_PARAMETER_UNSUPPORTED GLUE_CAST08(4L)
#define BGP_NOTIFY_OPEN_ERR_is_AUTH_FAILURE GLUE_CAST08(5L)
#define BGP_NOTIFY_OPEN_ERR_is_BAD_HOLD_TIME GLUE_CAST08(6L)
#define PTR_BGP_NOTIFY_UPD_ERR(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_BGP_NOTIFY_UPD_ERR(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(20))
#define SET_BGP_NOTIFY_UPD_ERR(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST08(_V_))
#define BGP_NOTIFY_UPD_ERR_is_BAD_ATTRIBUTES GLUE_CAST08(1L)
#define BGP_NOTIFY_UPD_ERR_is_UNRECOGNIZED_ATTRIBUTE GLUE_CAST08(2L)
#define BGP_NOTIFY_UPD_ERR_is_MISSING_ATTRIBUTE GLUE_CAST08(3L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_FLAGS GLUE_CAST08(4L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_LENGTH GLUE_CAST08(5L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_ORIGIN GLUE_CAST08(6L)
#define BGP_NOTIFY_UPD_ERR_is_ROUTING_LOOP GLUE_CAST08(7L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_NEXT_HOP GLUE_CAST08(8L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_OPTIONAL_ATTRIBUTE GLUE_CAST08(9L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_NETWORK GLUE_CAST08(10L)
#define BGP_NOTIFY_UPD_ERR_is_BAD_AS_PATH GLUE_CAST08(11L)
#define PTR_BGP_NOTIFY_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(21))
#define SIZEOF_BGP_NOTIFY_DATA (0)
#define PTR_BGP_NOTIFY_DATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(21)+(_X0_))
#define GET_BGP_NOTIFY_DATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(21)+(_X0_))
#define SET_BGP_NOTIFY_DATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(21)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for BGP_ADDRESS_PREFIX */
#define SIZEOF_BGP_ADDRESS_PREFIX (1)
#define PTR_BGP_ADDRESS_PREFIX_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_ADDRESS_PREFIX_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_BGP_ADDRESS_PREFIX_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_BGP_ADDRESS_PREFIX_PREFIX(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define SIZEOF_BGP_ADDRESS_PREFIX_PREFIX (0)
#define PTR_BGP_ADDRESS_PREFIX_PREFIX_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(1)+(_X0_))
#define GET_BGP_ADDRESS_PREFIX_PREFIX_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1)+(_X0_))
#define SET_BGP_ADDRESS_PREFIX_PREFIX_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for BGP_UPDATE_REACHABLES */
#define SIZEOF_BGP_UPDATE_REACHABLES (0)
#define PTR_BGP_UPDATE_REACHABLES_PREFIXES(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_BGP_UPDATE_REACHABLES_PREFIXES (0)
/* Definitions for AS_NUMBER */
#define SIZEOF_AS_NUMBER (2)
#define GET_AS_NUMBER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_AS_NUMBER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
/* Definitions for BGP_KEEPALIVE_MSG */
#define SIZEOF_BGP_KEEPALIVE_MSG (19)
/* Definitions for BGP_LOCAL_PREF_ATTRIBUTE */
#define SIZEOF_BGP_LOCAL_PREF_ATTRIBUTE (4)
#define PTR_BGP_LOCAL_PREF_ATTRIBUTE_PREF(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_LOCAL_PREF_ATTRIBUTE_PREF(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_BGP_LOCAL_PREF_ATTRIBUTE_PREF(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
/* Definitions for BGP_UPDATE_UNFEASIBLES */
#define SIZEOF_BGP_UPDATE_UNFEASIBLES (2)
#define PTR_BGP_UPDATE_UNFEASIBLES_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_UPDATE_UNFEASIBLES_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_BGP_UPDATE_UNFEASIBLES_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_BGP_UPDATE_UNFEASIBLES_PREFIXES(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_UPDATE_UNFEASIBLES_PREFIXES (0)
/* Definitions for BGP_UPDATE_ATTRIBUTES */
#define SIZEOF_BGP_UPDATE_ATTRIBUTES (2)
#define PTR_BGP_UPDATE_ATTRIBUTES_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_UPDATE_ATTRIBUTES_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_BGP_UPDATE_ATTRIBUTES_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_BGP_UPDATE_ATTRIBUTES_ATTRIBUTES(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_UPDATE_ATTRIBUTES_ATTRIBUTES (0)
/* Definitions for BGP_OPEN_MSG */
#define SIZEOF_BGP_OPEN_MSG (29)
#define PTR_BGP_OPEN_MSG_VERSION(_P_)\
((GLUE_CAST_PTR(_P_))+(19))
#define GET_BGP_OPEN_MSG_VERSION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(19))
#define SET_BGP_OPEN_MSG_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(19), GLUE_CAST08(_V_))
#define PTR_BGP_OPEN_MSG_MY_AS(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_BGP_OPEN_MSG_MY_AS(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(20))
#define SET_BGP_OPEN_MSG_MY_AS(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST16(_V_))
#define PTR_BGP_OPEN_MSG_HOLD_TIME(_P_)\
((GLUE_CAST_PTR(_P_))+(22))
#define GET_BGP_OPEN_MSG_HOLD_TIME(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(22))
#define SET_BGP_OPEN_MSG_HOLD_TIME(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(22), GLUE_CAST16(_V_))
#define PTR_BGP_OPEN_MSG_IDENTIFIER(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define GET_BGP_OPEN_MSG_IDENTIFIER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(24))
#define SET_BGP_OPEN_MSG_IDENTIFIER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(24), GLUE_CAST32(_V_))
#define PTR_BGP_OPEN_MSG_PARAMETERS_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(28))
#define GET_BGP_OPEN_MSG_PARAMETERS_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(28))
#define SET_BGP_OPEN_MSG_PARAMETERS_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(28), GLUE_CAST08(_V_))
#define PTR_BGP_OPEN_MSG_PARAMETERS(_P_)\
((GLUE_CAST_PTR(_P_))+(29))
#define SIZEOF_BGP_OPEN_MSG_PARAMETERS (0)
/* Definitions for BGP_OPEN_PARAM */
#define SIZEOF_BGP_OPEN_PARAM (3)
#define PTR_BGP_OPEN_PARAM_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_OPEN_PARAM_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_BGP_OPEN_PARAM_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define BGP_OPEN_PARAM_TYPE_is_AUTH GLUE_CAST08(1L)
#define PTR_BGP_OPEN_PARAM_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_BGP_OPEN_PARAM_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_BGP_OPEN_PARAM_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_BGP_OPEN_PARAM_AUTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_OPEN_PARAM_AUTH (1)
#define PTR_BGP_OPEN_PARAM_AUTH_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_BGP_OPEN_PARAM_AUTH_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_BGP_OPEN_PARAM_AUTH_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_BGP_OPEN_PARAM_AUTH_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define SIZEOF_BGP_OPEN_PARAM_AUTH_DATA (0)
#define PTR_BGP_OPEN_PARAM_AUTH_DATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(3)+(_X0_))
#define GET_BGP_OPEN_PARAM_AUTH_DATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)+(_X0_))
#define SET_BGP_OPEN_PARAM_AUTH_DATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for BGP_UPDATE_MSG */
#define SIZEOF_BGP_UPDATE_MSG (19)
#define PTR_BGP_UPDATE_MSG_INFO(_P_)\
((GLUE_CAST_PTR(_P_))+(19))
#define SIZEOF_BGP_UPDATE_MSG_INFO (0)
/* Definitions for BGP_ATOMIC_AGGREGATE_ATTRIBUTE */
#define SIZEOF_BGP_ATOMIC_AGGREGATE_ATTRIBUTE (0)
/* Definitions for BGP_AS_PATH_ATTRIBUTE */
#define SIZEOF_BGP_AS_PATH_ATTRIBUTE (0)
#define PTR_BGP_AS_PATH_ATTRIBUTE_SEGMENTS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_BGP_AS_PATH_ATTRIBUTE_SEGMENTS (0)
/* Definitions for BGP_MULTI_EXIT_DISC_ATTRIBUTE */
#define SIZEOF_BGP_MULTI_EXIT_DISC_ATTRIBUTE (4)
#define PTR_BGP_MULTI_EXIT_DISC_ATTRIBUTE_METRIC(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_MULTI_EXIT_DISC_ATTRIBUTE_METRIC(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_BGP_MULTI_EXIT_DISC_ATTRIBUTE_METRIC(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
/* Definitions for BGP_ORIGIN_ATTRIBUTE */
#define SIZEOF_BGP_ORIGIN_ATTRIBUTE (1)
#define GET_BGP_ORIGIN_ATTRIBUTE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_BGP_ORIGIN_ATTRIBUTE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define BGP_ORIGIN_ATTRIBUTE_is_IGP GLUE_CAST08(0L)
#define BGP_ORIGIN_ATTRIBUTE_is_EGP GLUE_CAST08(1L)
#define BGP_ORIGIN_ATTRIBUTE_is_INCOMPLETE GLUE_CAST08(2L)
/* Definitions for BGP_ATTRIBUTE */
#define SIZEOF_BGP_ATTRIBUTE (4)
/* Can't define PTR_BGP_ATTRIBUTE_OPTIONAL because:
Size 1 is not a multiple of 8. */
#define GET_BGP_ATTRIBUTE_OPTIONAL(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x80L))
#define SET_BGP_ATTRIBUTE_OPTIONAL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_BGP_ATTRIBUTE_TRANSITIVE because:
Size 1 is not a multiple of 8. */
#define GET_BGP_ATTRIBUTE_TRANSITIVE(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x40L))
#define SET_BGP_ATTRIBUTE_TRANSITIVE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x40L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x40L)))
/* Can't define PTR_BGP_ATTRIBUTE_PARTIAL because:
Size 1 is not a multiple of 8. */
#define GET_BGP_ATTRIBUTE_PARTIAL(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x20L))
#define SET_BGP_ATTRIBUTE_PARTIAL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x20L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x20L)))
/* Can't define PTR_BGP_ATTRIBUTE_EXTENDED because:
Size 1 is not a multiple of 8. */
#define GET_BGP_ATTRIBUTE_EXTENDED(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x10L))
#define SET_BGP_ATTRIBUTE_EXTENDED(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x10L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x10L)))
#define PTR_BGP_ATTRIBUTE_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_BGP_ATTRIBUTE_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_BGP_ATTRIBUTE_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define BGP_ATTRIBUTE_TYPE_is_ORIGIN GLUE_CAST08(1L)
#define BGP_ATTRIBUTE_TYPE_is_AS_PATH GLUE_CAST08(2L)
#define BGP_ATTRIBUTE_TYPE_is_NEXT_HOP GLUE_CAST08(3L)
#define BGP_ATTRIBUTE_TYPE_is_MULTI_EXIT_DISC GLUE_CAST08(4L)
#define BGP_ATTRIBUTE_TYPE_is_LOCAL_PREF GLUE_CAST08(5L)
#define BGP_ATTRIBUTE_TYPE_is_ATOMIC_AGGREGATE GLUE_CAST08(6L)
#define BGP_ATTRIBUTE_TYPE_is_AGGREGATOR GLUE_CAST08(7L)
#define PTR_BGP_ATTRIBUTE_SHORT(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_ATTRIBUTE_SHORT (1)
#define PTR_BGP_ATTRIBUTE_SHORT_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_BGP_ATTRIBUTE_SHORT_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_BGP_ATTRIBUTE_SHORT_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_BGP_ATTRIBUTE_SHORT_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define SIZEOF_BGP_ATTRIBUTE_SHORT_DATA (0)
#define PTR_BGP_ATTRIBUTE_LONG(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_ATTRIBUTE_LONG (2)
#define PTR_BGP_ATTRIBUTE_LONG_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_BGP_ATTRIBUTE_LONG_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_BGP_ATTRIBUTE_LONG_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_BGP_ATTRIBUTE_LONG_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_BGP_ATTRIBUTE_LONG_DATA (0)
/* Definitions for BGP_NEXT_HOP_ATTRIBUTE */
#define SIZEOF_BGP_NEXT_HOP_ATTRIBUTE (4)
#define PTR_BGP_NEXT_HOP_ATTRIBUTE_ROUTER(_P_)\
((GLUE_CAST_PTR(_P_)))
/* Definitions for BGP_PATH_SEGMENT */
#define SIZEOF_BGP_PATH_SEGMENT (2)
#define PTR_BGP_PATH_SEGMENT_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_PATH_SEGMENT_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_BGP_PATH_SEGMENT_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define BGP_PATH_SEGMENT_TYPE_is_AS_SET GLUE_CAST08(1L)
#define BGP_PATH_SEGMENT_TYPE_is_AS_SEQUENCE GLUE_CAST08(2L)
#define PTR_BGP_PATH_SEGMENT_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_BGP_PATH_SEGMENT_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_BGP_PATH_SEGMENT_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_BGP_PATH_SEGMENT_AS(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_BGP_PATH_SEGMENT_AS (0)
#define PTR_BGP_PATH_SEGMENT_AS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(2)+(2)*(_X0_))
#define GET_BGP_PATH_SEGMENT_AS_ELT(_P_, _X0_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2)+(2)*(_X0_))
#define SET_BGP_PATH_SEGMENT_AS_ELT(_P_, _X0_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2)+(2)*(_X0_), GLUE_CAST16(_V_))
/* Definitions for BGP_AGGREGATOR_ATTRIBUTE */
#define SIZEOF_BGP_AGGREGATOR_ATTRIBUTE (6)
#define PTR_BGP_AGGREGATOR_ATTRIBUTE_AS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_BGP_AGGREGATOR_ATTRIBUTE_AS(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_BGP_AGGREGATOR_ATTRIBUTE_AS(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_BGP_AGGREGATOR_ATTRIBUTE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#endif /* EPILOGUE_LAYOUT_BGP_H */
@@ -0,0 +1,273 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/bgp.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for BGP
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: bgp.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.9 2001/01/19 22:22:32 paul
; Update copyright.
;
; Revision 1.8 1998/02/25 15:21:39 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.7 1998/02/25 04:53:50 sra
; Update copyrights.
;
; Revision 1.6 1998/02/20 04:02:36 sra
; Fix too-long layout macro names.
;
; Revision 1.5 1997/09/26 20:21:13 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.4 1997/06/04 05:46:20 alan
; Fix RCS keywords.
;
; Revision 1.3 1997/06/03 22:59:30 alan
; Use `define-rcs-info'.
;
; Revision 1.2 1997/04/22 20:59:25 alan
; Construction finished...
;
; Revision 1.1 1997/04/22 06:05:43 alan
; Still under construction.
(define-rcs-info "$Id: bgp.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(use-layouts "ip.ldb")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
; These layouts often use the convention that a `(struct (size 0))' usually
; signals a case where the layout language was unable to express something
; (usually having to do with lengths or offsets that vary). A nearby
; comment will usually explain what is going on.
(define-layout AS_NUMBER (unsigned 16))
(define-layout BGP_HEADER
(struct (size (* 19 8))
(field MARKER (array (count 16)
(type (unsigned 8))))
(field LENGTH (unsigned 16))
(field TYPE (enum (type (unsigned 8))
(value OPEN 1)
(value UPDATE 2)
(value NOTIFICATION 3)
(value KEEPALIVE 4)))))
;
; OPEN
;
(define-layout BGP_OPEN_MSG
(struct (fill (sizeof BGP_HEADER))
(field VERSION (unsigned 8)) ; Must be 4
(field MY_AS AS_NUMBER)
(field HOLD_TIME (unsigned 16))
(field IDENTIFIER (unsigned 32))
(field PARAMETERS_LENGTH (unsigned 8))
(field PARAMETERS (struct (size 0)))))
; The PARAMETERS are a sequence of the following:
(define-layout BGP_OPEN_PARAM
(struct (field TYPE (enum (type (unsigned 8))
(value AUTH 1)))
(field LENGTH (unsigned 8))
(union (field AUTH (struct (field CODE (unsigned 8))
(field DATA (array (count 0)
(type (unsigned 8))))))
)))
;
; KEEPALIVE
;
(define-layout BGP_KEEPALIVE_MSG
(struct (fill (sizeof BGP_HEADER))
))
;
; UPDATE
;
(define-layout BGP_UPDATE_MSG
(struct (fill (sizeof BGP_HEADER))
(field INFO (struct (size 0)))))
; INFO consists of the following three sections, in this order:
(define-layout BGP_UPDATE_UNFEASIBLES
(struct (field LENGTH (unsigned 16))
(field PREFIXES (struct (size 0)))))
(define-layout BGP_UPDATE_ATTRIBUTES
(struct (field LENGTH (unsigned 16))
(field ATTRIBUTES (struct (size 0)))))
(define-layout BGP_UPDATE_REACHABLES
(struct ;; LENGTH in this one is implicit
(field PREFIXES (struct (size 0)))))
; PREFIXES are used in two of the above three sections:
(define-layout BGP_ADDRESS_PREFIX
(struct (field LENGTH (unsigned 8))
(field PREFIX (array (count 0)
(type (unsigned 8))))))
; ATTRIBUTES are used in the other:
(define-layout BGP_ATTRIBUTE
(struct (struct (size 8)
(align 1)
(field OPTIONAL (boolean 1))
(field TRANSITIVE (boolean 1))
(field PARTIAL (boolean 1))
(field EXTENDED (boolean 1))
(fill 4) ; MBZ
)
(field TYPE (enum (type (unsigned 8))
(value ORIGIN 1) ; Len = 1
(value AS_PATH 2) ; Len varies
(value NEXT_HOP 3) ; Len = 4
(value MULTI_EXIT_DISC 4) ; Len = 4
(value LOCAL_PREF 5) ; Len = 4
(value ATOMIC_AGGREGATE 6) ; Len = 0
(value AGGREGATOR 7) ; Len = 6
))
(union (field SHORT (struct (field LENGTH (unsigned 8))
(field DATA (struct (size 0)))))
(field LONG (struct (field LENGTH (unsigned 16))
(field DATA (struct (size 0))))))))
; Depending on TYPE, DATA is one of the following:
; (This -could- be written as a seven-way union...)
(define-layout BGP_ORIGIN_ATTRIBUTE
(enum (type (unsigned 8))
(value IGP 0)
(value EGP 1)
(value INCOMPLETE 2)))
(define-layout BGP_NEXT_HOP_ATTRIBUTE
(struct (field ROUTER IP_ADDRESS)))
(define-layout BGP_MULTI_EXIT_DISC_ATTRIBUTE
(struct (field METRIC (unsigned 32))))
(define-layout BGP_LOCAL_PREF_ATTRIBUTE
(struct (field PREF (unsigned 32))))
(define-layout BGP_ATOMIC_AGGREGATE_ATTRIBUTE
(struct (size 0))) ; This attribute really is empty.
(define-layout BGP_AGGREGATOR_ATTRIBUTE
(struct (field AS AS_NUMBER)
(field ADDRESS IP_ADDRESS)))
(define-layout BGP_AS_PATH_ATTRIBUTE
(struct (field SEGMENTS (struct (size 0)))))
; The segments in a AS_PATH attribute are a sequence of the following:
(define-layout BGP_PATH_SEGMENT
(struct (field TYPE (enum (type (unsigned 8))
(value AS_SET 1)
(value AS_SEQUENCE 2)))
(field LENGTH (unsigned 8))
(field AS (array (count 0)
(type AS_NUMBER)))))
;
; NOTIFICATION
;
(define-layout BGP_NOTIFY
(struct (fill (sizeof BGP_HEADER))
(field CODE (enum (type (unsigned 8))
(value HDR_ERR 1)
(value OPEN_ERR 2)
(value UPD_ERR 3)
(value HOLD_TIMER 4)
(value STATE_MACHINE 5)
(value CEASE 6)))
(union (size 8) ; error subcode
(field HDR_ERR (enum (type (unsigned 8))
(value CONN_NOT_SYNC 1)
(value BAD_LENGTH 2)
(value BAD_TYPE 3)))
(field OPEN_ERR (enum (type (unsigned 8))
(value VERSION_UNSUPPORTED 1)
(value BAD_AS 2)
(value BAD_IDENTIFIER 3)
(value PARAMETER_UNSUPPORTED 4)
(value AUTH_FAILURE 5)
(value BAD_HOLD_TIME 6)))
(field UPD_ERR (enum (type (unsigned 8))
(value BAD_ATTRIBUTES 1)
(value UNRECOGNIZED_ATTRIBUTE 2)
(value MISSING_ATTRIBUTE 3)
(value BAD_FLAGS 4)
(value BAD_LENGTH 5)
(value BAD_ORIGIN 6)
(value ROUTING_LOOP 7)
(value BAD_NEXT_HOP 8)
(value BAD_OPTIONAL_ATTRIBUTE 9)
(value BAD_NETWORK 10)
(value BAD_AS_PATH 11))))
(field DATA (array (count 0)
(type (unsigned 8))))
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,125 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: chaos.ldb,v 1.7 1998/02/25 15:21:39 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_CHAOS_H
#define EPILOGUE_LAYOUT_CHAOS_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for CHAOS_PACKET */
#define SIZEOF_CHAOS_PACKET (16)
#define PTR_CHAOS_PACKET_OPCODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_CHAOS_PACKET_OPCODE(_P_)\
GLUE_GL08((GLUE_CAST_PTR(_P_))+(1))
#define SET_CHAOS_PACKET_OPCODE(_P_, _V_)\
GLUE_SL08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define CHAOS_PACKET_OPCODE_is_RFC GLUE_CAST08(01L)
#define CHAOS_PACKET_OPCODE_is_OPN GLUE_CAST08(02L)
#define CHAOS_PACKET_OPCODE_is_CLS GLUE_CAST08(03L)
#define CHAOS_PACKET_OPCODE_is_FWD GLUE_CAST08(04L)
#define CHAOS_PACKET_OPCODE_is_ANS GLUE_CAST08(05L)
#define CHAOS_PACKET_OPCODE_is_SNS GLUE_CAST08(06L)
#define CHAOS_PACKET_OPCODE_is_STS GLUE_CAST08(07L)
#define CHAOS_PACKET_OPCODE_is_RUT GLUE_CAST08(010L)
#define CHAOS_PACKET_OPCODE_is_LOS GLUE_CAST08(011L)
#define CHAOS_PACKET_OPCODE_is_LSN GLUE_CAST08(012L)
#define CHAOS_PACKET_OPCODE_is_MNT GLUE_CAST08(013L)
#define CHAOS_PACKET_OPCODE_is_EOF GLUE_CAST08(014L)
#define CHAOS_PACKET_OPCODE_is_UNC GLUE_CAST08(015L)
#define CHAOS_PACKET_OPCODE_is_BRD GLUE_CAST08(016L)
#define CHAOS_PACKET_OPCODE_is_DATA08 GLUE_CAST08(0200L)
#define CHAOS_PACKET_OPCODE_is_DATA16 GLUE_CAST08(0300L)
/* Can't define PTR_CHAOS_PACKET_DATA_COUNT because:
Size 12 is not a multiple of 8. */
/* Can't define (GET_CHAOS_PACKET_DATA_COUNT SET_CHAOS_PACKET_DATA_COUNT) because:
Unaligned unsigned-8bit-little: offset 16 size 12 dope () */
/* Can't define PTR_CHAOS_PACKET_FORWARDING_COUNT because:
Size 4 is not a multiple of 8. */
/* Can't define (GET_CHAOS_PACKET_FORWARDING_COUNT SET_CHAOS_PACKET_FORWARDING_COUNT) because:
Unaligned unsigned-8bit-little: offset 28 size 4 dope () */
#define PTR_CHAOS_PACKET_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define PTR_CHAOS_PACKET_DESTINATION_INDEX(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_CHAOS_PACKET_DESTINATION_INDEX(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(6))
#define SET_CHAOS_PACKET_DESTINATION_INDEX(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_CHAOS_PACKET_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_CHAOS_PACKET_SOURCE_INDEX(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define GET_CHAOS_PACKET_SOURCE_INDEX(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(10))
#define SET_CHAOS_PACKET_SOURCE_INDEX(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(10), GLUE_CAST16(_V_))
#define PTR_CHAOS_PACKET_PACKET_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_CHAOS_PACKET_PACKET_NUMBER(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(12))
#define SET_CHAOS_PACKET_PACKET_NUMBER(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST16(_V_))
#define PTR_CHAOS_PACKET_ACKNOWLEDGMENT(_P_)\
((GLUE_CAST_PTR(_P_))+(14))
#define GET_CHAOS_PACKET_ACKNOWLEDGMENT(_P_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(14))
#define SET_CHAOS_PACKET_ACKNOWLEDGMENT(_P_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(14), GLUE_CAST16(_V_))
#define PTR_CHAOS_PACKET_DATA08(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define SIZEOF_CHAOS_PACKET_DATA08 (0)
#define PTR_CHAOS_PACKET_DATA08_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(16)+(_X0_))
#define GET_CHAOS_PACKET_DATA08_ELT(_P_, _X0_)\
GLUE_GL08((GLUE_CAST_PTR(_P_))+(16)+(_X0_))
#define SET_CHAOS_PACKET_DATA08_ELT(_P_, _X0_, _V_)\
GLUE_SL08((GLUE_CAST_PTR(_P_))+(16)+(_X0_), GLUE_CAST08(_V_))
#define PTR_CHAOS_PACKET_DATA16(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define SIZEOF_CHAOS_PACKET_DATA16 (0)
#define PTR_CHAOS_PACKET_DATA16_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(16)+(2)*(_X0_))
#define GET_CHAOS_PACKET_DATA16_ELT(_P_, _X0_)\
GLUE_GL16((GLUE_CAST_PTR(_P_))+(16)+(2)*(_X0_))
#define SET_CHAOS_PACKET_DATA16_ELT(_P_, _X0_, _V_)\
GLUE_SL16((GLUE_CAST_PTR(_P_))+(16)+(2)*(_X0_), GLUE_CAST16(_V_))
/* Definitions for CHAOS_ADDRESS */
#define SIZEOF_CHAOS_ADDRESS (2)
#define PTR_CHAOS_ADDRESS_OPAQUE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_CHAOS_ADDRESS_OPAQUE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_CHAOS_ADDRESS_OPAQUE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_CHAOS_ADDRESS_HOST(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_CHAOS_ADDRESS_HOST(_P_)\
GLUE_GL08((GLUE_CAST_PTR(_P_)))
#define SET_CHAOS_ADDRESS_HOST(_P_, _V_)\
GLUE_SL08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_CHAOS_ADDRESS_SUBNET(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_CHAOS_ADDRESS_SUBNET(_P_)\
GLUE_GL08((GLUE_CAST_PTR(_P_))+(1))
#define SET_CHAOS_ADDRESS_SUBNET(_P_, _V_)\
GLUE_SL08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#endif /* EPILOGUE_LAYOUT_CHAOS_H */
@@ -0,0 +1,135 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/chaos.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for CHAOS
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: chaos.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.8 2001/01/19 22:22:32 paul
; Update copyright.
;
; Revision 1.7 1998/02/25 15:21:39 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.6 1998/02/25 04:53:52 sra
; Update copyrights.
;
; Revision 1.5 1997/09/26 20:21:14 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.4 1997/06/04 05:46:21 alan
; Fix RCS keywords.
;
; Revision 1.3 1997/06/03 22:59:31 alan
; Use `define-rcs-info'.
;
; Revision 1.2 1997/04/22 00:18:31 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:12 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.3 1995/06/05 19:48:22 alan
; Be consistently littlendian. Unfortunately this breaks the ".h" file until
; a better theory of endianness come along.
;
; Revision 1.2 1995/05/25 23:53:32 alan
; Some enums have a `base' attribute -- some other tweaking.
;
; Revision 1.1 1995/05/23 07:16:56 alan
; Basic network layouts.
(define-rcs-info "$Id: chaos.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout CHAOS_ADDRESS
(union (size 16)
(field OPAQUE (opaque 16))
(struct (size 16)
(field HOST (unsigned-8bit-little 8))
(field SUBNET (unsigned-8bit-little 8)))))
(define-layout CHAOS_PACKET
(struct (size (* 8 16))
(align 16)
(struct (align 8)
(fill 8)
(field OPCODE
(enum (type (unsigned-8bit-little 8))
(base 8)
(value RFC 1) (value OPN 2) (value CLS 3)
(value FWD 4) (value ANS 5) (value SNS 6)
(value STS 7) (value RUT 8) (value LOS 9)
(value LSN 10) (value MNT 11) (value EOF 12)
(value UNC 13) (value BRD 14)
(value DATA08 #o200)
(value DATA16 #o300)
)))
(struct (align 4)
;; There should be a better theory of endianness used
;; here. The current kludge actually makes these two
;; fields unusable from C...
(field DATA_COUNT (unsigned-8bit-little 12))
(field FORWARDING_COUNT (unsigned-8bit-little 4)))
(field DESTINATION_ADDRESS CHAOS_ADDRESS)
(field DESTINATION_INDEX (opaque 16))
(field SOURCE_ADDRESS CHAOS_ADDRESS)
(field SOURCE_INDEX (opaque 16))
(field PACKET_NUMBER (unsigned-8bit-little 16))
(field ACKNOWLEDGMENT (unsigned-8bit-little 16))
(union (field DATA08
(array (count 0) (type (unsigned-8bit-little 8))))
(field DATA16
(array (count 0) (type (unsigned-8bit-little 16)))))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,235 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: dhcp.ldb,v 1.1 1998/11/23 20:54:35 wes Exp
* --used --
* Id: ip.ldb,v 1.17 1998/02/25 15:21:40 sra Exp
* Id: arp.ldb,v 1.10 1998/02/25 15:21:38 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_DHCP_H
#define EPILOGUE_LAYOUT_DHCP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for DHCP_MSG */
#define SIZEOF_DHCP_MSG (548)
#define PTR_DHCP_MSG_OPCODE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_DHCP_MSG_OPCODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_DHCP_MSG_OPCODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_HTYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_DHCP_MSG_HTYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_DHCP_MSG_HTYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_HLEN(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_DHCP_MSG_HLEN(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_DHCP_MSG_HLEN(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_HOPS(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_DHCP_MSG_HOPS(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(3))
#define SET_DHCP_MSG_HOPS(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_XID(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_DHCP_MSG_XID(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_DHCP_MSG_XID(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_DHCP_MSG_SECS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_DHCP_MSG_SECS(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(8))
#define SET_DHCP_MSG_SECS(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST16(_V_))
#define PTR_DHCP_MSG_FLAGS(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define GET_DHCP_MSG_FLAGS(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(10))
#define SET_DHCP_MSG_FLAGS(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(10), GLUE_CAST16(_V_))
#define PTR_DHCP_MSG_CIADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define PTR_DHCP_MSG_YIADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define PTR_DHCP_MSG_SIADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define PTR_DHCP_MSG_GIADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define PTR_DHCP_MSG_CHADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(28))
#define SIZEOF_DHCP_MSG_CHADDR (16)
#define PTR_DHCP_MSG_CHADDR_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(28)+(_X0_))
#define GET_DHCP_MSG_CHADDR_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(28)+(_X0_))
#define SET_DHCP_MSG_CHADDR_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(28)+(_X0_), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_SNAME(_P_)\
((GLUE_CAST_PTR(_P_))+(44))
#define SIZEOF_DHCP_MSG_SNAME (64)
#define PTR_DHCP_MSG_SNAME_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(44)+(_X0_))
#define GET_DHCP_MSG_SNAME_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(44)+(_X0_))
#define SET_DHCP_MSG_SNAME_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(44)+(_X0_), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_FILE(_P_)\
((GLUE_CAST_PTR(_P_))+(108))
#define SIZEOF_DHCP_MSG_FILE (128)
#define PTR_DHCP_MSG_FILE_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(108)+(_X0_))
#define GET_DHCP_MSG_FILE_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(108)+(_X0_))
#define SET_DHCP_MSG_FILE_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(108)+(_X0_), GLUE_CAST08(_V_))
#define PTR_DHCP_MSG_COOKIE(_P_)\
((GLUE_CAST_PTR(_P_))+(236))
#define GET_DHCP_MSG_COOKIE(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(236))
#define SET_DHCP_MSG_COOKIE(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(236), GLUE_CAST32(_V_))
#define PTR_DHCP_MSG_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(236))
#define SIZEOF_DHCP_MSG_OPTIONS (312)
#define PTR_DHCP_MSG_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(236)+(_X0_))
#define GET_DHCP_MSG_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(236)+(_X0_))
#define SET_DHCP_MSG_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(236)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for DHCP_OPTION_HDR */
#define SIZEOF_DHCP_OPTION_HDR (2)
#define PTR_DHCP_OPTION_HDR_TAG(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_DHCP_OPTION_HDR_TAG(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_DHCP_OPTION_HDR_TAG(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_DHCP_OPTION_HDR_length(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_DHCP_OPTION_HDR_length(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_DHCP_OPTION_HDR_length(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
/* Definitions for DHCP_MSGTYPE */
#define SIZEOF_DHCP_MSGTYPE (1)
#define GET_DHCP_MSGTYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_DHCP_MSGTYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define DHCP_MSGTYPE_is_DHCPDISCOVER GLUE_CAST08(1L)
#define DHCP_MSGTYPE_is_DHCPOFFER GLUE_CAST08(2L)
#define DHCP_MSGTYPE_is_DHCPREQUEST GLUE_CAST08(3L)
#define DHCP_MSGTYPE_is_DHCPDECLINE GLUE_CAST08(4L)
#define DHCP_MSGTYPE_is_DHCPACK GLUE_CAST08(5L)
#define DHCP_MSGTYPE_is_DHCPNAK GLUE_CAST08(6L)
#define DHCP_MSGTYPE_is_DHCPRELEASE GLUE_CAST08(7L)
#define DHCP_MSGTYPE_is_DHCPINFORM GLUE_CAST08(8L)
/* Definitions for DHCP_TAG */
#define SIZEOF_DHCP_TAG (1)
#define GET_DHCP_TAG(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_DHCP_TAG(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define DHCP_TAG_is_PAD GLUE_CAST08(0L)
#define DHCP_TAG_is_SUBNET_MASK GLUE_CAST08(1L)
#define DHCP_TAG_is_TIMEOFFSET GLUE_CAST08(2L)
#define DHCP_TAG_is_ROUTER GLUE_CAST08(3L)
#define DHCP_TAG_is_TIMESERVER GLUE_CAST08(4L)
#define DHCP_TAG_is_IEN116SERVER GLUE_CAST08(5L)
#define DHCP_TAG_is_DNSSERVER GLUE_CAST08(6L)
#define DHCP_TAG_is_LOGSERVER GLUE_CAST08(7L)
#define DHCP_TAG_is_COOKIESERVER GLUE_CAST08(8L)
#define DHCP_TAG_is_LPRSERVER GLUE_CAST08(9L)
#define DHCP_TAG_is_IMPRESSSERVER GLUE_CAST08(10L)
#define DHCP_TAG_is_RLPSERVER GLUE_CAST08(11L)
#define DHCP_TAG_is_HOSTNAME GLUE_CAST08(12L)
#define DHCP_TAG_is_BOOTFILESIZE GLUE_CAST08(13L)
#define DHCP_TAG_is_MERITFILESIZE GLUE_CAST08(14L)
#define DHCP_TAG_is_DOMAINNAME GLUE_CAST08(15L)
#define DHCP_TAG_is_SWAPSERVER GLUE_CAST08(16L)
#define DHCP_TAG_is_ROOTPATH GLUE_CAST08(17L)
#define DHCP_TAG_is_EXTENSIONSPATH GLUE_CAST08(18L)
#define DHCP_TAG_is_IPFORWARD GLUE_CAST08(19L)
#define DHCP_TAG_is_SOURCEROUTE GLUE_CAST08(20L)
#define DHCP_TAG_is_POLICYFILT GLUE_CAST08(21L)
#define DHCP_TAG_is_MAX_REASSEMBLY GLUE_CAST08(22L)
#define DHCP_TAG_is_DEF_TTL GLUE_CAST08(23L)
#define DHCP_TAG_is_MTU_TIMEOUT GLUE_CAST08(24L)
#define DHCP_TAG_is_MTU_PLATEAUS GLUE_CAST08(25L)
#define DHCP_TAG_is_MTU_VALUE GLUE_CAST08(26L)
#define DHCP_TAG_is_MTU_SUBNETS_LOCAL GLUE_CAST08(27L)
#define DHCP_TAG_is_BROADCAST_ADDR GLUE_CAST08(28L)
#define DHCP_TAG_is_MASK_DISCOVER GLUE_CAST08(29L)
#define DHCP_TAG_is_MASK_SUPPLY GLUE_CAST08(30L)
#define DHCP_TAG_is_ROUTER_DISCOVER GLUE_CAST08(31L)
#define DHCP_TAG_is_ROUTER_SOLICIT_ADDR GLUE_CAST08(32L)
#define DHCP_TAG_is_STATIC_ROUTES GLUE_CAST08(33L)
#define DHCP_TAG_is_ARP_TRAILERS GLUE_CAST08(34L)
#define DHCP_TAG_is_ARP_TIMEOUT GLUE_CAST08(35L)
#define DHCP_TAG_is_ETHERNET_802_3 GLUE_CAST08(36L)
#define DHCP_TAG_is_TCP_TTL GLUE_CAST08(37L)
#define DHCP_TAG_is_TCP_KEEPALIVE_VALUE GLUE_CAST08(38L)
#define DHCP_TAG_is_TCP_KEEPALIVE_GARBAGE GLUE_CAST08(39L)
#define DHCP_TAG_is_NIS_DOMAIN GLUE_CAST08(40L)
#define DHCP_TAG_is_NIS_SERVERS GLUE_CAST08(41L)
#define DHCP_TAG_is_NTP_SERVERS GLUE_CAST08(42L)
#define DHCP_TAG_is_VENDOR_SPECIFIC GLUE_CAST08(43L)
#define DHCP_TAG_is_NB_NS GLUE_CAST08(44L)
#define DHCP_TAG_is_NB_DD GLUE_CAST08(45L)
#define DHCP_TAG_is_NB_NODETYPE GLUE_CAST08(46L)
#define DHCP_TAG_is_NB_SCOPE GLUE_CAST08(47L)
#define DHCP_TAG_is_X_FS GLUE_CAST08(48L)
#define DHCP_TAG_is_X_DM GLUE_CAST08(49L)
#define DHCP_TAG_is_REQ_ADDR GLUE_CAST08(50L)
#define DHCP_TAG_is_LEASE_TIME GLUE_CAST08(51L)
#define DHCP_TAG_is_OPT_OVERLOAD GLUE_CAST08(52L)
#define DHCP_TAG_is_MSG_TYPE GLUE_CAST08(53L)
#define DHCP_TAG_is_SERVER_ID GLUE_CAST08(54L)
#define DHCP_TAG_is_PARAMS_REQ GLUE_CAST08(55L)
#define DHCP_TAG_is_ERR_MESSAGE GLUE_CAST08(56L)
#define DHCP_TAG_is_MAX_MSG_SIZE GLUE_CAST08(57L)
#define DHCP_TAG_is_TIME_T1 GLUE_CAST08(58L)
#define DHCP_TAG_is_TIME_T2 GLUE_CAST08(59L)
#define DHCP_TAG_is_CLASS_ID GLUE_CAST08(60L)
#define DHCP_TAG_is_CLIENT_ID GLUE_CAST08(61L)
#define DHCP_TAG_is_END GLUE_CAST08(255L)
/* Definitions for BOOTP_OPCODE */
#define SIZEOF_BOOTP_OPCODE (1)
#define GET_BOOTP_OPCODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_BOOTP_OPCODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define BOOTP_OPCODE_is_REQUEST GLUE_CAST08(1L)
#define BOOTP_OPCODE_is_REPLY GLUE_CAST08(2L)
#endif /* EPILOGUE_LAYOUT_DHCP_H */
@@ -0,0 +1,139 @@
(define-rcs-info "$Id: dhcp.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(use-layouts "ip.ldb")
(use-layouts "arp.ldb")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout BOOTP_OPCODE
(enum (type (unsigned 8))
(value REQUEST 1)
(value REPLY 2)))
;; option tags
(define-layout DHCP_TAG
(enum (type (unsigned 8))
;; BOOTP-compatible
(value PAD 0)
(value SUBNET_MASK 1)
(value TIMEOFFSET 2)
(value ROUTER 3)
(value TIMESERVER 4)
(value IEN116SERVER 5)
(value DNSSERVER 6)
(value LOGSERVER 7)
(value COOKIESERVER 8)
(value LPRSERVER 9)
(value IMPRESSSERVER 10)
(value RLPSERVER 11)
(value HOSTNAME 12)
(value BOOTFILESIZE 13)
(value MERITFILESIZE 14)
(value DOMAINNAME 15)
(value SWAPSERVER 16)
(value ROOTPATH 17)
(value EXTENSIONSPATH 18)
;; IP per-host parameters
(value IPFORWARD 19)
(value SOURCEROUTE 20)
(value POLICYFILT 21)
(value MAX_REASSEMBLY 22)
(value DEF_TTL 23)
(value MTU_TIMEOUT 24)
(value MTU_PLATEAUS 25)
(value MTU_VALUE 26)
(value MTU_SUBNETS_LOCAL 27)
(value BROADCAST_ADDR 28)
(value MASK_DISCOVER 29)
(value MASK_SUPPLY 30)
(value ROUTER_DISCOVER 31)
(value ROUTER_SOLICIT_ADDR 32)
(value STATIC_ROUTES 33)
;; link layer per-interface parameters
(value ARP_TRAILERS 34)
(value ARP_TIMEOUT 35)
(value ETHERNET_802_3 36);; Ethernet encapsulation type
;; TCP per-interface parameters
(value TCP_TTL 37)
(value TCP_KEEPALIVE_VALUE 38)
(value TCP_KEEPALIVE_GARBAGE 39)
;; miscellaneous application parameters
(value NIS_DOMAIN 40)
(value NIS_SERVERS 41)
(value NTP_SERVERS 42)
(value VENDOR_SPECIFIC 43)
;; NetBIOS
(value NB_NS 44)
(value NB_DD 45)
(value NB_NODETYPE 46)
(value NB_SCOPE 47)
;; X Window System
(value X_FS 48)
(value X_DM 49)
;; DHCP-specific options
(value REQ_ADDR 50)
(value LEASE_TIME 51)
(value OPT_OVERLOAD 52)
(value MSG_TYPE 53)
(value SERVER_ID 54)
(value PARAMS_REQ 55)
(value ERR_MESSAGE 56)
(value MAX_MSG_SIZE 57)
(value TIME_T1 58)
(value TIME_T2 59)
(value CLASS_ID 60)
(value CLIENT_ID 61)
(value END 255)))
;; values of message type -- for DHCP_TAG_is_MSG_TYPE
(define-layout DHCP_MSGTYPE
(enum (type (unsigned 8))
(value DHCPDISCOVER 1)
(value DHCPOFFER 2)
(value DHCPREQUEST 3)
(value DHCPDECLINE 4)
(value DHCPACK 5)
(value DHCPNAK 6)
(value DHCPRELEASE 7)
(value DHCPINFORM 8)))
(define-layout DHCP_OPTION_HDR
(struct (field TAG DHCP_TAG)
(field length (unsigned 8))))
(define-layout DHCP_MSG
(struct (field OPCODE BOOTP_OPCODE)
(field HTYPE (unsigned 8)) ; same as ARP_HEADER_HARDWARE_TYPE
(field HLEN (unsigned 8)) ; hardware length
(field HOPS (unsigned 8)) ; number of ?agent? hops
(field XID (unsigned 32))
(field SECS (unsigned 16))
(field FLAGS (unsigned 16))
(field CIADDR IP_ADDRESS)
(field YIADDR IP_ADDRESS)
(field SIADDR IP_ADDRESS)
(field GIADDR IP_ADDRESS)
(field CHADDR (array (count 16)
(type (unsigned 8))))
(field SNAME (array (count 64)
(type (unsigned 8))))
(field FILE (array (count 128)
(type (unsigned 8))))
(union
(field COOKIE (unsigned 32))
(field OPTIONS
(array (count 312)
(type (unsigned 8)))))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,221 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: dns.ldb,v 1.7 1998/02/25 15:21:40 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_DNS_H
#define EPILOGUE_LAYOUT_DNS_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for DNS_SOA */
#define SIZEOF_DNS_SOA (20)
#define PTR_DNS_SOA_SERIAL(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_DNS_SOA_SERIAL(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_DNS_SOA_SERIAL(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_DNS_SOA_REFRESH(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_DNS_SOA_REFRESH(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_DNS_SOA_REFRESH(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_DNS_SOA_RETRY(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_DNS_SOA_RETRY(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_DNS_SOA_RETRY(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_DNS_SOA_EXPIRE(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_DNS_SOA_EXPIRE(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(12))
#define SET_DNS_SOA_EXPIRE(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_DNS_SOA_MINIMUM(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_DNS_SOA_MINIMUM(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(16))
#define SET_DNS_SOA_MINIMUM(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
/* Definitions for DNS_RR */
#define SIZEOF_DNS_RR (10)
#define PTR_DNS_RR_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_DNS_RR_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_DNS_RR_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_DNS_RR_CLASS(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_DNS_RR_CLASS(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(2))
#define SET_DNS_RR_CLASS(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_DNS_RR_TTL(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_DNS_RR_TTL(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_DNS_RR_TTL(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_DNS_RR_RDLENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_DNS_RR_RDLENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(8))
#define SET_DNS_RR_RDLENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST16(_V_))
#define PTR_DNS_RR_RDATA(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define SIZEOF_DNS_RR_RDATA (0)
#define PTR_DNS_RR_RDATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(10)+(_X0_))
#define GET_DNS_RR_RDATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(10)+(_X0_))
#define SET_DNS_RR_RDATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(10)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for DNS_HEADER */
#define SIZEOF_DNS_HEADER (12)
#define PTR_DNS_HEADER_ID(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_DNS_HEADER_ID(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_DNS_HEADER_ID(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
/* Can't define PTR_DNS_HEADER_QR because:
Size 1 is not a multiple of 8. */
#define GET_DNS_HEADER_QR(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x80L))
#define SET_DNS_HEADER_QR(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_DNS_HEADER_OPCODE because:
Size 4 is not a multiple of 8. */
#define GET_DNS_HEADER_OPCODE(_P_)\
GLUE_CAST08((GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x78L)) >> 3)
#define SET_DNS_HEADER_OPCODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), (GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x78L)) | ((GLUE_CAST08(_V_) << 3) & GLUE_CAST08(0x78L)))
#define DNS_HEADER_OPCODE_is_QUERY GLUE_CAST08(0L)
#define DNS_HEADER_OPCODE_is_IQUERY GLUE_CAST08(1L)
#define DNS_HEADER_OPCODE_is_STATUS GLUE_CAST08(2L)
/* Can't define PTR_DNS_HEADER_AA because:
Size 1 is not a multiple of 8. */
#define GET_DNS_HEADER_AA(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x4L))
#define SET_DNS_HEADER_AA(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x4L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x4L)))
/* Can't define PTR_DNS_HEADER_TC because:
Size 1 is not a multiple of 8. */
#define GET_DNS_HEADER_TC(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x2L))
#define SET_DNS_HEADER_TC(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x2L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x2L)))
/* Can't define PTR_DNS_HEADER_RD because:
Size 1 is not a multiple of 8. */
#define GET_DNS_HEADER_RD(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & GLUE_CAST08(0x1L))
#define SET_DNS_HEADER_RD(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) | GLUE_CAST08(0x1L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST08(0x1L)))
/* Can't define PTR_DNS_HEADER_RA because:
Size 1 is not a multiple of 8. */
#define GET_DNS_HEADER_RA(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST08(0x80L))
#define SET_DNS_HEADER_RA(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_DNS_HEADER_RCODE because:
Size 4 is not a multiple of 8. */
#define GET_DNS_HEADER_RCODE(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST08(0xFL))
#define SET_DNS_HEADER_RCODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), (GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST08(0xFL)) | (GLUE_CAST08(_V_) & GLUE_CAST08(0xFL)))
#define DNS_HEADER_RCODE_is_NO_ERROR GLUE_CAST08(0L)
#define DNS_HEADER_RCODE_is_FORMAT_ERROR GLUE_CAST08(1L)
#define DNS_HEADER_RCODE_is_SERVER_FAILURE GLUE_CAST08(2L)
#define DNS_HEADER_RCODE_is_NAME_ERROR GLUE_CAST08(3L)
#define DNS_HEADER_RCODE_is_NOT_IMPLEMENTED GLUE_CAST08(4L)
#define DNS_HEADER_RCODE_is_REFUSED GLUE_CAST08(5L)
#define PTR_DNS_HEADER_QDCOUNT(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_DNS_HEADER_QDCOUNT(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(4))
#define SET_DNS_HEADER_QDCOUNT(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_DNS_HEADER_ANCOUNT(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_DNS_HEADER_ANCOUNT(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_DNS_HEADER_ANCOUNT(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_DNS_HEADER_NSCOUNT(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_DNS_HEADER_NSCOUNT(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(8))
#define SET_DNS_HEADER_NSCOUNT(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST16(_V_))
#define PTR_DNS_HEADER_ARCOUNT(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define GET_DNS_HEADER_ARCOUNT(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(10))
#define SET_DNS_HEADER_ARCOUNT(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(10), GLUE_CAST16(_V_))
/* Definitions for DNS_CLASS */
#define SIZEOF_DNS_CLASS (2)
#define GET_DNS_CLASS(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_DNS_CLASS(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define DNS_CLASS_is_IN GLUE_OPAQUE16(GLUE_CAST16(1L))
#define DNS_CLASS_is_CS GLUE_OPAQUE16(GLUE_CAST16(2L))
#define DNS_CLASS_is_CH GLUE_OPAQUE16(GLUE_CAST16(3L))
#define DNS_CLASS_is_HS GLUE_OPAQUE16(GLUE_CAST16(4L))
#define DNS_CLASS_is_WILD GLUE_OPAQUE16(GLUE_CAST16(255L))
/* Definitions for DNS_TYPE */
#define SIZEOF_DNS_TYPE (2)
#define GET_DNS_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_DNS_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define DNS_TYPE_is_A GLUE_OPAQUE16(GLUE_CAST16(1L))
#define DNS_TYPE_is_NS GLUE_OPAQUE16(GLUE_CAST16(2L))
#define DNS_TYPE_is_MD GLUE_OPAQUE16(GLUE_CAST16(3L))
#define DNS_TYPE_is_MF GLUE_OPAQUE16(GLUE_CAST16(4L))
#define DNS_TYPE_is_CNAME GLUE_OPAQUE16(GLUE_CAST16(5L))
#define DNS_TYPE_is_SOA GLUE_OPAQUE16(GLUE_CAST16(6L))
#define DNS_TYPE_is_MB GLUE_OPAQUE16(GLUE_CAST16(7L))
#define DNS_TYPE_is_MG GLUE_OPAQUE16(GLUE_CAST16(8L))
#define DNS_TYPE_is_MR GLUE_OPAQUE16(GLUE_CAST16(9L))
#define DNS_TYPE_is_NULL GLUE_OPAQUE16(GLUE_CAST16(10L))
#define DNS_TYPE_is_WKS GLUE_OPAQUE16(GLUE_CAST16(11L))
#define DNS_TYPE_is_PTR GLUE_OPAQUE16(GLUE_CAST16(12L))
#define DNS_TYPE_is_HINFO GLUE_OPAQUE16(GLUE_CAST16(13L))
#define DNS_TYPE_is_MINFO GLUE_OPAQUE16(GLUE_CAST16(14L))
#define DNS_TYPE_is_MX GLUE_OPAQUE16(GLUE_CAST16(15L))
#define DNS_TYPE_is_TXT GLUE_OPAQUE16(GLUE_CAST16(16L))
#define DNS_TYPE_is_AAAA GLUE_OPAQUE16(GLUE_CAST16(28L))
#define DNS_TYPE_is_AXFR GLUE_OPAQUE16(GLUE_CAST16(252L))
#define DNS_TYPE_is_MAILB GLUE_OPAQUE16(GLUE_CAST16(253L))
#define DNS_TYPE_is_MAILA GLUE_OPAQUE16(GLUE_CAST16(254L))
#define DNS_TYPE_is_WILD GLUE_OPAQUE16(GLUE_CAST16(255L))
#endif /* EPILOGUE_LAYOUT_DNS_H */
@@ -0,0 +1,187 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/dns.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for DNS
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1996-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: dns.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.8 2001/01/19 22:22:32 paul
; Update copyright.
;
; Revision 1.7 1998/02/25 15:21:40 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.6 1998/02/25 04:53:54 sra
; Update copyrights.
;
; Revision 1.5 1997/09/26 20:21:14 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.4 1997/06/04 05:46:23 alan
; Fix RCS keywords.
;
; Revision 1.3 1997/06/03 22:59:32 alan
; Use `define-rcs-info'.
;
; Revision 1.2 1997/04/22 00:18:31 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:13 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.2 1996/12/03 07:51:11 alan
; Add AAAA type.
;
; Revision 1.1 1996/06/06 01:54:35 alan
; Added the file `dns.ldb'.
(define-rcs-info "$Id: dns.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout DNS_TYPE
(enum (type (opaque 16))
(value A 1)
(value NS 2)
(value MD 3)
(value MF 4)
(value CNAME 5)
(value SOA 6)
(value MB 7)
(value MG 8)
(value MR 9)
(value NULL 10)
(value WKS 11)
(value PTR 12)
(value HINFO 13)
(value MINFO 14)
(value MX 15)
(value TXT 16)
(value AAAA 28)
;; Following types can only be used in queries:
(value AXFR 252)
(value MAILB 253)
(value MAILA 254)
(value WILD 255) ; aka "*"
))
(define-layout DNS_CLASS
(enum (type (opaque 16))
(value IN 1)
(value CS 2)
(value CH 3)
(value HS 4)
;; Following types can only be used in queries:
(value WILD 255) ; aka "*"
))
(define-layout DNS_HEADER
(struct (size (* 6 16))
(field ID (opaque 16))
(struct (size 16)
(align 1)
(field QR (boolean 1))
(field OPCODE (enum (type (unsigned 4))
(value QUERY 0)
(value IQUERY 1)
(value STATUS 2)))
(field AA (boolean 1))
(field TC (boolean 1))
(field RD (boolean 1))
(field RA (boolean 1))
(fill 3) ; MBZ
(field RCODE (enum (type (unsigned 4))
(value NO_ERROR 0)
(value FORMAT_ERROR 1)
(value SERVER_FAILURE 2)
(value NAME_ERROR 3)
(value NOT_IMPLEMENTED 4)
(value REFUSED 5)
))
)
(field QDCOUNT (unsigned 16))
(field ANCOUNT (unsigned 16))
(field NSCOUNT (unsigned 16))
(field ARCOUNT (unsigned 16))
))
;; *NOTE* Some of the time fields here might actually want to be -signed-
;; quantities. RFC1035 is sometimes unclear about this. Fortunately, we are
;; saved from having to worry about this here by the fact that the `layout'
;; tool doesn't support the signed types completely...
(define-layout DNS_RR
(struct (size (* 5 16))
;; First comes NAME (a domain-name)
;; and then these fixed fields:
(field TYPE DNS_TYPE)
(field CLASS DNS_CLASS)
;; A Question would end here.
(field TTL (unsigned 32))
(field RDLENGTH (unsigned 16))
(field RDATA (array (count 0)
(type (unsigned 8))))
))
(define-layout DNS_SOA
(struct (size (* 5 32))
;; First comes MNAME (a domain-name)
;; and RNAME (a domain-name)
;; and then these fixed fields:
(field SERIAL (unsigned 32))
(field REFRESH (unsigned 32))
(field RETRY (unsigned 32))
(field EXPIRE (unsigned 32))
(field MINIMUM (unsigned 32))
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,184 @@
BNF for layout language:
<file> := <definition>*
<definition> := (define-layout <name> <form>)
| (define-layout-macro <pattern> <Scheme-procedure>)
| (define-rcs-info <RCS-keyword-string>)
| (use-layouts <pathname-string>)
| (C-include <test> <path>)
<form> := <type>
<form> := <expression>
<expression> := <name>
| <constant>
| (<op> <expression>*)
| (sizeof <type>)
<op> := + | - | * | octets
<type> := <name>
| (<type-constructor> <expression>*)
| (enum <enumeration-clause>*)
| (struct <aggregate-clause>*)
| (union <aggregate-clause>*)
| (array <array-clause>*)
<type-constructor> := opaque | boolean | signed | unsigned |
| signed-8bit-little | unsigned-8bit-little
<enumeration-clause> := (type <type>)
| (value <name> <expression>)
<aggregate-clause> := (field <name> <type>)
| (fill <expression>?)
| (union <aggregate-clause>*)
| (struct <aggregate-clause>*)
| (size <expression>)
| (align <expression>)
<array-clause> := (count <expression>)
| (type <type>)
| (size <expression>)
| (align <expression>)
| (spacing <expression>)
<constant> := ... any scheme constant ...
<name> := ... sequence of letters, digits and underscores ...
-----
Macros generated by `-makeh':
(Note that if it is impossible for some reason to generate a macro that
performs as expected, a comment will be generated explaining why. For
example, since C doesn't support pointers to single bits, we can't
generate `PTR_...' macros for boolean fields!)
SIZEOF_<type>
The size in bytes of the type <type>.
PTR_<type>_<field>(p)
GET_<type>_<field>(p)
SET_<type>_<field>(p, v)
p should be a pointer. v will be cast to the appropriate type.
Operate on the <field> field of the type <type> -- returning a pointer
to it or reading or writing its contents.
<type>_is_<name>
The constants in the enumeration type <type>. (Yes the word "is"
really is in lower case -- I'm open to alternate suggestions, but I
really like the look of `IP_PORT_is_DOMAIN'.)
-----
GLUE macros expected by `-makeh':
GLUE_CAST_PTR(p)
Convert p to bits8_t *. This could be a cast, or it could expand into
a call to a prototyped procedure if you wanted to enforce some type
safety.
GLUE_Gennh(p)
(Specifically:
GLUE_GB08, GLUE_GB16, GLUE_GB32, GLUE_GB32LS24, GLUE_GB32MS24,
GLUE_GL08, GLUE_GL16, GLUE_GL32, GLUE_GL32LS24, GLUE_GL32MS24,
GLUE_GU08, GLUE_GU16, GLUE_GU32, GLUE_GU32LS24, GLUE_GU32MS24.)
p is of type bits8_t *. Returns the appropriate type for nn bit bytes.
e is B for big endian, L for little endian, or U for un-endian.
h is LS24 or MS24 if the caller is only going to manipulate the least
significant 24 bits or most significant 24 bits. The macro may or may
not return the other byte in the 32 bit word.
GLUE_Sennh(p, v)
(Specifically:
GLUE_SB08, GLUE_SB16, GLUE_SB32, GLUE_SB32LS24, GLUE_SB32MS24,
GLUE_SL08, GLUE_SL16, GLUE_SL32, GLUE_SL32LS24, GLUE_SL32MS24,
GLUE_SU08, GLUE_SU16, GLUE_SU32, GLUE_SU32LS24, GLUE_SU32MS24.)
p is of type bits8_t *. v is of the appropriate type for nn bit bytes.
e is B for big endian, L for little endian, or U for un-endian.
h is LS24 or MS24 if the caller is only going to manipulate the least
significant 24 bits or most significant 24 bits. The macro may or may
not store the other byte in the 32 bit word. (But it -must- behave
consistent with the corresponding GLUE_G... macro!)
GLUE_CASTnn(v)
(Specifically: GLUE_CAST08, GLUE_CAST16, GLUE_CAST32.)
Cast v to be the appropriate unsigned scalar type for nn bit bytes.
GLUE_OPAQUEnn(v)
(Specifically: GLUE_OPAQUE08, GLUE_OPAQUE16, GLUE_OPAQUE32.)
These could be defined as:
#define GLUE_OPAQUE08(v) (GLUE_SB08(scratch, v), GLUE_GU08(scratch))
#define GLUE_OPAQUE16(v) (GLUE_SB16(scratch, v), GLUE_GU16(scratch))
#define GLUE_OPAQUE32(v) (GLUE_SB32(scratch, v), GLUE_GU32(scratch))
Assuming scratch is a bits8_t * pointer to 4 bytes of temporary storage.
-----
Command line interface:
ldbcomp [-define <defs>] -- Obsolete!
[-makesch <schfile>]
[-makeh <hfile>]
[-include-check <prefix>]
[-unique-names <length>]
<file> ...
First all the <defs> files are loaded in the order they appeared in the
command line. Definitions made in these files are added to the
built-in definitions. No output will be generated for the definitions
made in any <defs> file. (Note that the `-define' option can usefully
be used multiple times.) NOTE: The `-define' option has been made
obsolete by the new `use-layouts' top-level form.
Second, each <file> is loaded.
Third, if the `-makesch' option was specified, a Scheme->C header file
is generated named <schfile>.
Forth, if the `-makeh' option was specified, a C header file is
generated named <hfile>.
If `-include-check' was specified, the C header file will include code
to prevent multiple inclusion. <prefix> is the prefix to use for the
macro that will be tested to perform this check.
`-unique-names' controls how many characters in an identifier are
significant to the pre-processor. By default, ldbcomp checks to be
certain that the first 31 characters of all macro names are unique.
Example:
ldbcomp -include-check "LAYOUT_" -define ip.ldb -makeh tcp.h tcp.ldb
Loads `ip.ldb' and `tcp.ldb' and then writes `tcp.h'. `tcp.h' will
contain macro definitions for objects defined in `tcp.ldb'.
`tcp.h' will test `#ifndef LAYOUT_TCP_H' to prevent multiple inclusion.
-----
$Source: /usr/cvsroot/target/h/wrn/wm/util/layout/doc.txt,v $
$Id: doc.txt,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
@@ -0,0 +1,116 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: ethernet.ldb,v 1.7 1998/02/25 15:21:40 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_ETHERNET_H
#define EPILOGUE_LAYOUT_ETHERNET_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for IEEE802_HEADER */
#define SIZEOF_IEEE802_HEADER (22)
#define PTR_IEEE802_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_IEEE802_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define PTR_IEEE802_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_IEEE802_HEADER_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(12))
#define SET_IEEE802_HEADER_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST16(_V_))
#define PTR_IEEE802_HEADER_DSAP(_P_)\
((GLUE_CAST_PTR(_P_))+(14))
#define GET_IEEE802_HEADER_DSAP(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(14))
#define SET_IEEE802_HEADER_DSAP(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(14), GLUE_CAST08(_V_))
#define PTR_IEEE802_HEADER_SSAP(_P_)\
((GLUE_CAST_PTR(_P_))+(15))
#define GET_IEEE802_HEADER_SSAP(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(15))
#define SET_IEEE802_HEADER_SSAP(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(15), GLUE_CAST08(_V_))
#define PTR_IEEE802_HEADER_CONTROL(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_IEEE802_HEADER_CONTROL(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(16))
#define SET_IEEE802_HEADER_CONTROL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST08(_V_))
#define PTR_IEEE802_HEADER_ORGANIZATION(_P_)\
((GLUE_CAST_PTR(_P_))+(17))
#define GET_IEEE802_HEADER_ORGANIZATION(_P_)\
GLUE_CAST32(GLUE_GB32LS24((GLUE_CAST_PTR(_P_))+(16)) & GLUE_CAST32(0xFFFFFFL))
#define SET_IEEE802_HEADER_ORGANIZATION(_P_, _V_)\
GLUE_SB32LS24((GLUE_CAST_PTR(_P_))+(16), (GLUE_GB32LS24((GLUE_CAST_PTR(_P_))+(16)) & ~GLUE_CAST32(0xFFFFFFL)) | (GLUE_CAST32(_V_) & GLUE_CAST32(0xFFFFFFL)))
#define PTR_IEEE802_HEADER_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_IEEE802_HEADER_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(20))
#define SET_IEEE802_HEADER_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST16(_V_))
/* Definitions for ETHERNET_HEADER */
#define SIZEOF_ETHERNET_HEADER (14)
#define PTR_ETHERNET_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_ETHERNET_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define PTR_ETHERNET_HEADER_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_ETHERNET_HEADER_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(12))
#define SET_ETHERNET_HEADER_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST16(_V_))
/* Definitions for ETHERNET_TYPE */
#define SIZEOF_ETHERNET_TYPE (2)
#define GET_ETHERNET_TYPE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_ETHERNET_TYPE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define ETHERNET_TYPE_is_IP GLUE_OPAQUE16(GLUE_CAST16(0x800L))
#define ETHERNET_TYPE_is_CHAOS GLUE_OPAQUE16(GLUE_CAST16(0x804L))
#define ETHERNET_TYPE_is_ARP GLUE_OPAQUE16(GLUE_CAST16(0x806L))
#define ETHERNET_TYPE_is_RARP GLUE_OPAQUE16(GLUE_CAST16(0x8035L))
#define ETHERNET_TYPE_is_APPLETALK GLUE_OPAQUE16(GLUE_CAST16(0x809BL))
#define ETHERNET_TYPE_is_APPLETALK_ARP GLUE_OPAQUE16(GLUE_CAST16(0x80F3L))
#define ETHERNET_TYPE_is_IPV6 GLUE_OPAQUE16(GLUE_CAST16(0x86DDL))
#define ETHERNET_TYPE_is_LOOPBACK GLUE_OPAQUE16(GLUE_CAST16(0x9000L))
/* Definitions for ETHERNET_ADDRESS */
#define SIZEOF_ETHERNET_ADDRESS (6)
/* Can't define PTR_ETHERNET_ADDRESS_MULTICAST because:
Size 1 is not a multiple of 8. */
#define GET_ETHERNET_ADDRESS_MULTICAST(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x1L))
#define SET_ETHERNET_ADDRESS_MULTICAST(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x1L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x1L)))
#define PTR_ETHERNET_ADDRESS_BYTES(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ETHERNET_ADDRESS_BYTES (6)
#define PTR_ETHERNET_ADDRESS_BYTES_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(_X0_))
#define GET_ETHERNET_ADDRESS_BYTES_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(_X0_))
#define SET_ETHERNET_ADDRESS_BYTES_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(_X0_), GLUE_CAST08(_V_))
#endif /* EPILOGUE_LAYOUT_ETHERNET_H */
@@ -0,0 +1,138 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ethernet.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $
; Layout information for Ethernets
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: ethernet.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:19 tneale
; Tornado shuffle
;
; Revision 1.8 2001/01/19 22:22:33 paul
; Update copyright.
;
; Revision 1.7 1998/02/25 15:21:40 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.6 1998/02/25 04:53:56 sra
; Update copyrights.
;
; Revision 1.5 1997/09/26 20:21:14 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.4 1997/06/04 05:46:24 alan
; Fix RCS keywords.
;
; Revision 1.3 1997/06/03 22:59:33 alan
; Use `define-rcs-info'.
;
; Revision 1.2 1997/04/22 00:18:32 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:14 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.5 1997/03/05 00:51:44 alan
; Fix Copyright.
;
; Revision 1.4 1996/11/27 00:17:31 alan
; Add IPV6 type.
;
; Revision 1.3 1995/06/10 02:40:18 alan
; Add LOOPBACK ethernet type.
;
; Revision 1.2 1995/05/25 23:53:32 alan
; Some enums have a `base' attribute -- some other tweaking.
;
; Revision 1.1 1995/05/23 07:17:08 alan
; Basic network layouts.
(define-rcs-info "$Id: ethernet.ldb,v 1.1.1.1 2001/11/05 17:47:19 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout ETHERNET_ADDRESS
(union (size (* 6 8))
(struct (align 1)
(fill 7)
(field MULTICAST (boolean 1)))
(field BYTES
(array (count 6)
(type (unsigned 8))))))
(define-layout ETHERNET_TYPE
(enum (type (opaque 16))
(base 16)
(value IP #x0800)
(value CHAOS #x0804)
(value ARP #x0806)
(value RARP #x8035)
(value APPLETALK #x809B)
(value APPLETALK_ARP #x80F3)
(value IPV6 #x86DD)
(value LOOPBACK #x9000)
))
(define-layout ETHERNET_HEADER
(struct (field DESTINATION_ADDRESS ETHERNET_ADDRESS)
(field SOURCE_ADDRESS ETHERNET_ADDRESS)
;; type values less than #x0600 are probably 802.3 packets
(field TYPE ETHERNET_TYPE)))
(define-layout IEEE802_HEADER
(struct (field DESTINATION_ADDRESS ETHERNET_ADDRESS)
(field SOURCE_ADDRESS ETHERNET_ADDRESS)
(field LENGTH (unsigned 16))
(field DSAP (unsigned 8)) ; 170
(field SSAP (unsigned 8)) ; 170
(field CONTROL (unsigned 8)) ; 3 = Unnumbered Information
(field ORGANIZATION (unsigned 24))
(field TYPE ETHERNET_TYPE)))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,665 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: ip.ldb,v 1.18 1999/10/19 20:12:43 sar Exp
*/
#ifndef EPILOGUE_LAYOUT_IP_H
#define EPILOGUE_LAYOUT_IP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for TCP_OPTION_MSS */
#define SIZEOF_TCP_OPTION_MSS (4)
#define PTR_TCP_OPTION_MSS_SIZE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_TCP_OPTION_MSS_SIZE(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_TCP_OPTION_MSS_SIZE(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
/* Definitions for TCP_OPTION_HEADER */
#define SIZEOF_TCP_OPTION_HEADER (2)
#define PTR_TCP_OPTION_HEADER_KIND(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_TCP_OPTION_HEADER_KIND(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_TCP_OPTION_HEADER_KIND(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define TCP_OPTION_HEADER_KIND_is_END GLUE_CAST08(0L)
#define TCP_OPTION_HEADER_KIND_is_NOOP GLUE_CAST08(1L)
#define TCP_OPTION_HEADER_KIND_is_MSS GLUE_CAST08(2L)
#define PTR_TCP_OPTION_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_TCP_OPTION_HEADER_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_TCP_OPTION_HEADER_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
/* Definitions for TCP_HEADER */
#define SIZEOF_TCP_HEADER (20)
#define PTR_TCP_HEADER_SOURCE_PORT(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_TCP_HEADER_DESTINATION_PORT(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define PTR_TCP_HEADER_SEQUENCE_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_TCP_HEADER_SEQUENCE_NUMBER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_TCP_HEADER_SEQUENCE_NUMBER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_TCP_HEADER_ACKNOWLEDGE_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_TCP_HEADER_ACKNOWLEDGE_NUMBER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_TCP_HEADER_ACKNOWLEDGE_NUMBER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
/* Can't define PTR_TCP_HEADER_DATA_OFFSET because:
Size 4 is not a multiple of 8. */
#define GET_TCP_HEADER_DATA_OFFSET(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))+(12)) >> 4)
#define SET_TCP_HEADER_DATA_OFFSET(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(12), (GLUE_GB08((GLUE_CAST_PTR(_P_))+(12)) & ~GLUE_CAST08(0xF0L)) | ((GLUE_CAST08(_V_) << 4) & GLUE_CAST08(0xF0L)))
/* Can't define PTR_TCP_HEADER_URG because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_URG(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x20L))
#define SET_TCP_HEADER_URG(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x20L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x20L)))
/* Can't define PTR_TCP_HEADER_ACK because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_ACK(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x10L))
#define SET_TCP_HEADER_ACK(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x10L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x10L)))
/* Can't define PTR_TCP_HEADER_PSH because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_PSH(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x8L))
#define SET_TCP_HEADER_PSH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x8L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x8L)))
/* Can't define PTR_TCP_HEADER_RST because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_RST(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x4L))
#define SET_TCP_HEADER_RST(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x4L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x4L)))
/* Can't define PTR_TCP_HEADER_SYN because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_SYN(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x2L))
#define SET_TCP_HEADER_SYN(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x2L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x2L)))
/* Can't define PTR_TCP_HEADER_FIN because:
Size 1 is not a multiple of 8. */
#define GET_TCP_HEADER_FIN(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & GLUE_CAST08(0x1L))
#define SET_TCP_HEADER_FIN(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(13), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) | GLUE_CAST08(0x1L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(13)) & ~GLUE_CAST08(0x1L)))
#define PTR_TCP_HEADER_WINDOW(_P_)\
((GLUE_CAST_PTR(_P_))+(14))
#define GET_TCP_HEADER_WINDOW(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(14))
#define SET_TCP_HEADER_WINDOW(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(14), GLUE_CAST16(_V_))
#define PTR_TCP_HEADER_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_TCP_HEADER_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(16))
#define SET_TCP_HEADER_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST16(_V_))
#define PTR_TCP_HEADER_URGENT_POINTER(_P_)\
((GLUE_CAST_PTR(_P_))+(18))
#define GET_TCP_HEADER_URGENT_POINTER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(18))
#define SET_TCP_HEADER_URGENT_POINTER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(18), GLUE_CAST16(_V_))
#define PTR_TCP_HEADER_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define SIZEOF_TCP_HEADER_OPTIONS (0)
/* Definitions for UDP_HEADER */
#define SIZEOF_UDP_HEADER (8)
#define PTR_UDP_HEADER_SOURCE_PORT(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_UDP_HEADER_DESTINATION_PORT(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define PTR_UDP_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_UDP_HEADER_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(4))
#define SET_UDP_HEADER_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_UDP_HEADER_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_UDP_HEADER_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_UDP_HEADER_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
/* Definitions for ICMP_MESSAGE */
#define SIZEOF_ICMP_MESSAGE (28)
#define PTR_ICMP_MESSAGE_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_ICMP_MESSAGE_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_ICMP_MESSAGE_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_TYPE_is_ECHO_REPLY GLUE_CAST08(0L)
#define ICMP_MESSAGE_TYPE_is_DESTINATION_UNREACHABLE GLUE_CAST08(3L)
#define ICMP_MESSAGE_TYPE_is_SOURCE_QUENCH GLUE_CAST08(4L)
#define ICMP_MESSAGE_TYPE_is_REDIRECT GLUE_CAST08(5L)
#define ICMP_MESSAGE_TYPE_is_ECHO GLUE_CAST08(8L)
#define ICMP_MESSAGE_TYPE_is_ROUTER_ADVERTISEMENT GLUE_CAST08(9L)
#define ICMP_MESSAGE_TYPE_is_ROUTER_SOLICITATION GLUE_CAST08(10L)
#define ICMP_MESSAGE_TYPE_is_TIME_EXCEEDED GLUE_CAST08(11L)
#define ICMP_MESSAGE_TYPE_is_PARAMETER_PROBLEM GLUE_CAST08(12L)
#define ICMP_MESSAGE_TYPE_is_TIMESTAMP GLUE_CAST08(13L)
#define ICMP_MESSAGE_TYPE_is_TIMESTAMP_REPLY GLUE_CAST08(14L)
#define ICMP_MESSAGE_TYPE_is_INFO_REQUEST GLUE_CAST08(15L)
#define ICMP_MESSAGE_TYPE_is_INFO_REPLY GLUE_CAST08(16L)
#define PTR_ICMP_MESSAGE_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_ICMP_MESSAGE_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_ICMP_MESSAGE_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_ICMP_MESSAGE_IDENTIFICATION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP_MESSAGE_IDENTIFICATION(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP_MESSAGE_IDENTIFICATION(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_ICMP_MESSAGE_SEQUENCE_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_ICMP_MESSAGE_SEQUENCE_NUMBER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_ICMP_MESSAGE_SEQUENCE_NUMBER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_ICMP_MESSAGE_HEADER(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP_MESSAGE_MINIMUM_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_MINIMUM_HEADER (8)
#define PTR_ICMP_MESSAGE_DU(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_DU (2)
#define PTR_ICMP_MESSAGE_DU_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_DU_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_DU_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_DU_CODE_is_NET GLUE_CAST08(0L)
#define ICMP_MESSAGE_DU_CODE_is_HOST GLUE_CAST08(1L)
#define ICMP_MESSAGE_DU_CODE_is_PROTOCOL GLUE_CAST08(2L)
#define ICMP_MESSAGE_DU_CODE_is_PORT GLUE_CAST08(3L)
#define ICMP_MESSAGE_DU_CODE_is_CANT_FRAGMENT GLUE_CAST08(4L)
#define ICMP_MESSAGE_DU_CODE_is_ROUTE_FAILED GLUE_CAST08(5L)
#define PTR_ICMP_MESSAGE_SQ(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_SQ (2)
#define PTR_ICMP_MESSAGE_SQ_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_SQ_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_SQ_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_SQ_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_RD(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_RD (8)
#define PTR_ICMP_MESSAGE_RD_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_RD_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_RD_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_RD_CODE_is_NET GLUE_CAST08(0L)
#define ICMP_MESSAGE_RD_CODE_is_HOST GLUE_CAST08(1L)
#define ICMP_MESSAGE_RD_CODE_is_TOS_NET GLUE_CAST08(2L)
#define ICMP_MESSAGE_RD_CODE_is_TOS_HOST GLUE_CAST08(3L)
#define PTR_ICMP_MESSAGE_RD_GATEWAY(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define PTR_ICMP_MESSAGE_TE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_TE (2)
#define PTR_ICMP_MESSAGE_TE_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_TE_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_TE_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_TE_CODE_is_TTL GLUE_CAST08(0L)
#define ICMP_MESSAGE_TE_CODE_is_REASSEMBLY GLUE_CAST08(1L)
#define PTR_ICMP_MESSAGE_PP(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_PP (5)
#define PTR_ICMP_MESSAGE_PP_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_PP_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_PP_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_PP_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_PP_POINTER(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP_MESSAGE_PP_POINTER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP_MESSAGE_PP_POINTER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
#define PTR_ICMP_MESSAGE_ECHO(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_ECHO (8)
#define PTR_ICMP_MESSAGE_ECHO_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_ECHO_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_ECHO_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_ECHO_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_ECHO_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_ICMP_MESSAGE_ECHO_DATA (0)
#define PTR_ICMP_MESSAGE_ECHO_DATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define GET_ICMP_MESSAGE_ECHO_DATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define SET_ICMP_MESSAGE_ECHO_DATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP_MESSAGE_TIMESTAMP(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_TIMESTAMP (20)
#define PTR_ICMP_MESSAGE_TIMESTAMP_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_TIMESTAMP_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_TIMESTAMP_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_TIMESTAMP_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_TIMESTAMP_ORIGINATE(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_ICMP_MESSAGE_TIMESTAMP_ORIGINATE(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_ICMP_MESSAGE_TIMESTAMP_ORIGINATE(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_ICMP_MESSAGE_TIMESTAMP_RECEIVE(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_ICMP_MESSAGE_TIMESTAMP_RECEIVE(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(12))
#define SET_ICMP_MESSAGE_TIMESTAMP_RECEIVE(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_ICMP_MESSAGE_TIMESTAMP_TRANSMIT(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_ICMP_MESSAGE_TIMESTAMP_TRANSMIT(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(16))
#define SET_ICMP_MESSAGE_TIMESTAMP_TRANSMIT(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
#define PTR_ICMP_MESSAGE_INFO(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_INFO (8)
#define PTR_ICMP_MESSAGE_INFO_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_INFO_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_INFO_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_INFO_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_RS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_RS (8)
#define PTR_ICMP_MESSAGE_RS_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_RS_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_RS_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_RS_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_RS_RESERVED(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP_MESSAGE_RS_RESERVED(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP_MESSAGE_RS_RESERVED(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_ICMP_MESSAGE_RA(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP_MESSAGE_RA (8)
#define PTR_ICMP_MESSAGE_RA_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP_MESSAGE_RA_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP_MESSAGE_RA_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP_MESSAGE_RA_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP_MESSAGE_RA_NUM_ADDRS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP_MESSAGE_RA_NUM_ADDRS(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP_MESSAGE_RA_NUM_ADDRS(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
#define PTR_ICMP_MESSAGE_RA_ADDR_ENTRY_SIZE(_P_)\
((GLUE_CAST_PTR(_P_))+(5))
#define GET_ICMP_MESSAGE_RA_ADDR_ENTRY_SIZE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(5))
#define SET_ICMP_MESSAGE_RA_ADDR_ENTRY_SIZE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(5), GLUE_CAST08(_V_))
#define PTR_ICMP_MESSAGE_RA_LIFETIME(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_ICMP_MESSAGE_RA_LIFETIME(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_ICMP_MESSAGE_RA_LIFETIME(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_ICMP_MESSAGE_RA_ENTRY(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_ICMP_MESSAGE_RA_ENTRY (0)
#define PTR_ICMP_MESSAGE_RA_ENTRY_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(8)*(_X0_))
#define SIZEOF_ICMP_MESSAGE_RA_ENTRY_ELT (8)
#define PTR_ICMP_MESSAGE_RA_ENTRY_ELT_ADDRESS(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(8)*(_X0_))
#define PTR_ICMP_MESSAGE_RA_ENTRY_ELT_PREFERENCE(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(12)+(8)*(_X0_))
#define GET_ICMP_MESSAGE_RA_ENTRY_ELT_PREFERENCE(_P_, _X0_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(12)+(8)*(_X0_))
#define SET_ICMP_MESSAGE_RA_ENTRY_ELT_PREFERENCE(_P_, _X0_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(12)+(8)*(_X0_), GLUE_CAST32(_V_))
/* Definitions for IGMP_MESSAGE */
#define SIZEOF_IGMP_MESSAGE (8)
/* Can't define PTR_IGMP_MESSAGE_VERSION because:
Size 4 is not a multiple of 8. */
#define GET_IGMP_MESSAGE_VERSION(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 4)
#define SET_IGMP_MESSAGE_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xF0L)) | ((GLUE_CAST08(_V_) << 4) & GLUE_CAST08(0xF0L)))
/* Can't define PTR_IGMP_MESSAGE_TYPE because:
Size 4 is not a multiple of 8. */
#define GET_IGMP_MESSAGE_TYPE(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0xFL))
#define SET_IGMP_MESSAGE_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xFL)) | (GLUE_CAST08(_V_) & GLUE_CAST08(0xFL)))
#define IGMP_MESSAGE_TYPE_is_QUERY GLUE_CAST08(1L)
#define IGMP_MESSAGE_TYPE_is_REPORT GLUE_CAST08(2L)
#define PTR_IGMP_MESSAGE_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_IGMP_MESSAGE_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_IGMP_MESSAGE_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_IGMP_MESSAGE_GROUP_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
/* Definitions for IP_PSEUDO_HEADER */
#define SIZEOF_IP_PSEUDO_HEADER (12)
#define PTR_IP_PSEUDO_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_IP_PSEUDO_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define PTR_IP_PSEUDO_HEADER_PROTOCOL(_P_)\
((GLUE_CAST_PTR(_P_))+(9))
#define GET_IP_PSEUDO_HEADER_PROTOCOL(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(9))
#define SET_IP_PSEUDO_HEADER_PROTOCOL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(9), GLUE_CAST08(_V_))
#define PTR_IP_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define GET_IP_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(10))
#define SET_IP_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(10), GLUE_CAST16(_V_))
/* Definitions for IP_HEADER */
#define SIZEOF_IP_HEADER (20)
/* Can't define PTR_IP_HEADER_VERSION because:
Size 4 is not a multiple of 8. */
#define GET_IP_HEADER_VERSION(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 4)
#define SET_IP_HEADER_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xF0L)) | ((GLUE_CAST08(_V_) << 4) & GLUE_CAST08(0xF0L)))
#define IP_HEADER_VERSION_is_IPV4 GLUE_CAST08(4L)
#define IP_HEADER_VERSION_is_IPV6 GLUE_CAST08(6L)
/* Can't define PTR_IP_HEADER_HEADER_LENGTH because:
Size 4 is not a multiple of 8. */
#define GET_IP_HEADER_HEADER_LENGTH(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0xFL))
#define SET_IP_HEADER_HEADER_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xFL)) | (GLUE_CAST08(_V_) & GLUE_CAST08(0xFL)))
#define PTR_IP_HEADER_TYPE_OF_SERVICE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP_HEADER_TYPE_OF_SERVICE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP_HEADER_TYPE_OF_SERVICE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP_HEADER_TOTAL_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_IP_HEADER_TOTAL_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_IP_HEADER_TOTAL_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_IP_HEADER_IDENTIFICATION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP_HEADER_IDENTIFICATION(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP_HEADER_IDENTIFICATION(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_IP_HEADER_FRAGMENT(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define SIZEOF_IP_HEADER_FRAGMENT (2)
/* Can't define PTR_IP_HEADER_FRAGMENT_DONT because:
Size 1 is not a multiple of 8. */
#define GET_IP_HEADER_FRAGMENT_DONT(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) & GLUE_CAST08(0x40L))
#define SET_IP_HEADER_FRAGMENT_DONT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(6), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) | GLUE_CAST08(0x40L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) & ~GLUE_CAST08(0x40L)))
/* Can't define PTR_IP_HEADER_FRAGMENT_MORE because:
Size 1 is not a multiple of 8. */
#define GET_IP_HEADER_FRAGMENT_MORE(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) & GLUE_CAST08(0x20L))
#define SET_IP_HEADER_FRAGMENT_MORE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(6), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) | GLUE_CAST08(0x20L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(6)) & ~GLUE_CAST08(0x20L)))
/* Can't define PTR_IP_HEADER_FRAGMENT_OFFSET because:
Size 13 is not a multiple of 8. */
#define GET_IP_HEADER_FRAGMENT_OFFSET(_P_)\
GLUE_CAST16(GLUE_GB16((GLUE_CAST_PTR(_P_))+(6)) & GLUE_CAST16(0x1FFFL))
#define SET_IP_HEADER_FRAGMENT_OFFSET(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), (GLUE_GB16((GLUE_CAST_PTR(_P_))+(6)) & ~GLUE_CAST16(0x1FFFL)) | (GLUE_CAST16(_V_) & GLUE_CAST16(0x1FFFL)))
#define PTR_IP_HEADER_TIME_TO_LIVE(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_IP_HEADER_TIME_TO_LIVE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(8))
#define SET_IP_HEADER_TIME_TO_LIVE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST08(_V_))
#define PTR_IP_HEADER_PROTOCOL(_P_)\
((GLUE_CAST_PTR(_P_))+(9))
#define GET_IP_HEADER_PROTOCOL(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(9))
#define SET_IP_HEADER_PROTOCOL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(9), GLUE_CAST08(_V_))
#define PTR_IP_HEADER_HEADER_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(10))
#define GET_IP_HEADER_HEADER_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(10))
#define SET_IP_HEADER_HEADER_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(10), GLUE_CAST16(_V_))
#define PTR_IP_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define PTR_IP_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define PTR_IP_HEADER_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define SIZEOF_IP_HEADER_OPTIONS (0)
#define PTR_IP_HEADER_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(20)+(_X0_))
#define GET_IP_HEADER_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(20)+(_X0_))
#define SET_IP_HEADER_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(20)+(_X0_), GLUE_CAST08(_V_))
#define IP_HEADER_OPTIONS_ELT_is_END GLUE_CAST08(0L)
#define IP_HEADER_OPTIONS_ELT_is_NOOP GLUE_CAST08(1L)
#define IP_HEADER_OPTIONS_ELT_is_RECORD_ROUTE GLUE_CAST08(7L)
#define IP_HEADER_OPTIONS_ELT_is_TIMESTAMP GLUE_CAST08(68L)
#define IP_HEADER_OPTIONS_ELT_is_SECURITY GLUE_CAST08(130L)
#define IP_HEADER_OPTIONS_ELT_is_LSRR GLUE_CAST08(131L)
#define IP_HEADER_OPTIONS_ELT_is_STREAM_ID GLUE_CAST08(136L)
#define IP_HEADER_OPTIONS_ELT_is_SSRR GLUE_CAST08(137L)
/* Definitions for IP4_TYPE_OF_SERVICE */
#define SIZEOF_IP4_TYPE_OF_SERVICE (1)
/* Can't define PTR_IP4_TYPE_OF_SERVICE_PRECEDENCE because:
Size 3 is not a multiple of 8. */
#define GET_IP4_TYPE_OF_SERVICE_PRECEDENCE(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 5)
#define SET_IP4_TYPE_OF_SERVICE_PRECEDENCE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xE0L)) | ((GLUE_CAST08(_V_) << 5) & GLUE_CAST08(0xE0L)))
/* Can't define PTR_IP4_TYPE_OF_SERVICE_LOW_DELAY because:
Size 1 is not a multiple of 8. */
#define GET_IP4_TYPE_OF_SERVICE_LOW_DELAY(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x10L))
#define SET_IP4_TYPE_OF_SERVICE_LOW_DELAY(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x10L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x10L)))
/* Can't define PTR_IP4_TYPE_OF_SERVICE_HIGH_THROUGHPUT because:
Size 1 is not a multiple of 8. */
#define GET_IP4_TYPE_OF_SERVICE_HIGH_THROUGHPUT(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x8L))
#define SET_IP4_TYPE_OF_SERVICE_HIGH_THROUGHPUT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x8L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x8L)))
/* Can't define PTR_IP4_TYPE_OF_SERVICE_HIGH_RELIABILITY because:
Size 1 is not a multiple of 8. */
#define GET_IP4_TYPE_OF_SERVICE_HIGH_RELIABILITY(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x4L))
#define SET_IP4_TYPE_OF_SERVICE_HIGH_RELIABILITY(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x4L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x4L)))
/* Definitions for IP_PORT */
#define SIZEOF_IP_PORT (2)
#define PTR_IP_PORT_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_PORT_NUMBER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_IP_PORT_NUMBER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define PTR_IP_PORT_OPAQUE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_PORT_OPAQUE(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_)))
#define SET_IP_PORT_OPAQUE(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define IP_PORT_OPAQUE_is_ECHO GLUE_OPAQUE16(GLUE_CAST16(7L))
#define IP_PORT_OPAQUE_is_DISCARD GLUE_OPAQUE16(GLUE_CAST16(9L))
#define IP_PORT_OPAQUE_is_USERS GLUE_OPAQUE16(GLUE_CAST16(11L))
#define IP_PORT_OPAQUE_is_DAYTIME GLUE_OPAQUE16(GLUE_CAST16(13L))
#define IP_PORT_OPAQUE_is_QUOTE GLUE_OPAQUE16(GLUE_CAST16(17L))
#define IP_PORT_OPAQUE_is_FTP GLUE_OPAQUE16(GLUE_CAST16(21L))
#define IP_PORT_OPAQUE_is_SSH GLUE_OPAQUE16(GLUE_CAST16(22L))
#define IP_PORT_OPAQUE_is_TELNET GLUE_OPAQUE16(GLUE_CAST16(23L))
#define IP_PORT_OPAQUE_is_SMTP GLUE_OPAQUE16(GLUE_CAST16(25L))
#define IP_PORT_OPAQUE_is_TIME GLUE_OPAQUE16(GLUE_CAST16(37L))
#define IP_PORT_OPAQUE_is_DOMAIN GLUE_OPAQUE16(GLUE_CAST16(53L))
#define IP_PORT_OPAQUE_is_TFTP GLUE_OPAQUE16(GLUE_CAST16(69L))
#define IP_PORT_OPAQUE_is_GOPHER GLUE_OPAQUE16(GLUE_CAST16(70L))
#define IP_PORT_OPAQUE_is_FINGER GLUE_OPAQUE16(GLUE_CAST16(79L))
#define IP_PORT_OPAQUE_is_WWW GLUE_OPAQUE16(GLUE_CAST16(80L))
#define IP_PORT_OPAQUE_is_SUPDUP GLUE_OPAQUE16(GLUE_CAST16(95L))
#define IP_PORT_OPAQUE_is_SUNRPC GLUE_OPAQUE16(GLUE_CAST16(111L))
#define IP_PORT_OPAQUE_is_NNTP GLUE_OPAQUE16(GLUE_CAST16(119L))
#define IP_PORT_OPAQUE_is_NTP GLUE_OPAQUE16(GLUE_CAST16(123L))
#define IP_PORT_OPAQUE_is_IMAP2 GLUE_OPAQUE16(GLUE_CAST16(143L))
#define IP_PORT_OPAQUE_is_PCMAIL GLUE_OPAQUE16(GLUE_CAST16(158L))
#define IP_PORT_OPAQUE_is_SNMP GLUE_OPAQUE16(GLUE_CAST16(161L))
#define IP_PORT_OPAQUE_is_SNMP_TRAP GLUE_OPAQUE16(GLUE_CAST16(162L))
#define IP_PORT_OPAQUE_is_BGP GLUE_OPAQUE16(GLUE_CAST16(179L))
#define IP_PORT_OPAQUE_is_SMUX GLUE_OPAQUE16(GLUE_CAST16(199L))
#define IP_PORT_OPAQUE_is_IMAP3 GLUE_OPAQUE16(GLUE_CAST16(220L))
#define IP_PORT_OPAQUE_is_BSD_TCP_EXEC GLUE_OPAQUE16(GLUE_CAST16(512L))
#define IP_PORT_OPAQUE_is_BSD_UDP_BIFF GLUE_OPAQUE16(GLUE_CAST16(512L))
#define IP_PORT_OPAQUE_is_BSD_TCP_LOGIN GLUE_OPAQUE16(GLUE_CAST16(513L))
#define IP_PORT_OPAQUE_is_BSD_UDP_WHO GLUE_OPAQUE16(GLUE_CAST16(513L))
#define IP_PORT_OPAQUE_is_BSD_TCP_SHELL GLUE_OPAQUE16(GLUE_CAST16(514L))
#define IP_PORT_OPAQUE_is_BSD_UDP_SYSLOG GLUE_OPAQUE16(GLUE_CAST16(514L))
#define IP_PORT_OPAQUE_is_BSD_PRINTER GLUE_OPAQUE16(GLUE_CAST16(515L))
#define IP_PORT_OPAQUE_is_BSD_TALK GLUE_OPAQUE16(GLUE_CAST16(517L))
#define IP_PORT_OPAQUE_is_BSD_NTALK GLUE_OPAQUE16(GLUE_CAST16(518L))
#define IP_PORT_OPAQUE_is_RIP GLUE_OPAQUE16(GLUE_CAST16(520L))
#define IP_PORT_OPAQUE_is_BSD_TIMED GLUE_OPAQUE16(GLUE_CAST16(525L))
#define IP_PORT_OPAQUE_is_BSD_TEMPO GLUE_OPAQUE16(GLUE_CAST16(526L))
#define IP_PORT_OPAQUE_is_BSD_COURIER GLUE_OPAQUE16(GLUE_CAST16(530L))
#define IP_PORT_OPAQUE_is_BSD_CONFERENCE GLUE_OPAQUE16(GLUE_CAST16(531L))
#define IP_PORT_OPAQUE_is_BSD_NETNEWS GLUE_OPAQUE16(GLUE_CAST16(532L))
#define IP_PORT_OPAQUE_is_BSD_NETWALL GLUE_OPAQUE16(GLUE_CAST16(533L))
#define IP_PORT_OPAQUE_is_BSD_UUCP GLUE_OPAQUE16(GLUE_CAST16(540L))
#define IP_PORT_OPAQUE_is_KLOGIN GLUE_OPAQUE16(GLUE_CAST16(543L))
#define IP_PORT_OPAQUE_is_KSHELL GLUE_OPAQUE16(GLUE_CAST16(544L))
#define IP_PORT_OPAQUE_is_BSD_REMOTEFS GLUE_OPAQUE16(GLUE_CAST16(556L))
#define IP_PORT_OPAQUE_is_KERBEROS_ADM GLUE_OPAQUE16(GLUE_CAST16(749L))
#define IP_PORT_OPAQUE_is_WEBSTER GLUE_OPAQUE16(GLUE_CAST16(765L))
/* Definitions for IP_ADDRESS */
#define SIZEOF_IP_ADDRESS (4)
#define PTR_IP_ADDRESS_BYTES(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP_ADDRESS_BYTES (4)
#define PTR_IP_ADDRESS_BYTES_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(_X0_))
#define GET_IP_ADDRESS_BYTES_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(_X0_))
#define SET_IP_ADDRESS_BYTES_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(_X0_), GLUE_CAST08(_V_))
#define PTR_IP_ADDRESS_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_ADDRESS_NUMBER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_IP_ADDRESS_NUMBER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_IP_ADDRESS_OPAQUE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_ADDRESS_OPAQUE(_P_)\
GLUE_GU32((GLUE_CAST_PTR(_P_)))
#define SET_IP_ADDRESS_OPAQUE(_P_, _V_)\
GLUE_SU32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
/* Definitions for IP_PROTOCOL */
#define SIZEOF_IP_PROTOCOL (1)
#define GET_IP_PROTOCOL(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP_PROTOCOL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define IP_PROTOCOL_is_HOP_BY_HOP_OPTIONS GLUE_CAST08(0L)
#define IP_PROTOCOL_is_ICMP GLUE_CAST08(1L)
#define IP_PROTOCOL_is_IGMP GLUE_CAST08(2L)
#define IP_PROTOCOL_is_IPV4 GLUE_CAST08(4L)
#define IP_PROTOCOL_is_TCP GLUE_CAST08(6L)
#define IP_PROTOCOL_is_UDP GLUE_CAST08(17L)
#define IP_PROTOCOL_is_IPV6 GLUE_CAST08(41L)
#define IP_PROTOCOL_is_ROUTING GLUE_CAST08(43L)
#define IP_PROTOCOL_is_FRAGMENT GLUE_CAST08(44L)
#define IP_PROTOCOL_is_ESP GLUE_CAST08(50L)
#define IP_PROTOCOL_is_AUTHENTICATION GLUE_CAST08(51L)
#define IP_PROTOCOL_is_ICMPV6 GLUE_CAST08(58L)
#define IP_PROTOCOL_is_NO_NEXT GLUE_CAST08(59L)
#define IP_PROTOCOL_is_DESTINATION_OPTIONS GLUE_CAST08(60L)
#define IP_PROTOCOL_is_OSPF GLUE_CAST08(89L)
#endif /* EPILOGUE_LAYOUT_IP_H */
@@ -0,0 +1,447 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ip.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for IP protocols
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: ip.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.19 2001/01/19 22:22:33 paul
; Update copyright.
;
; Revision 1.18 1999/10/19 20:12:43 sar
; Update ip and ip6 files with ip6 information
;
; Revision 1.17 1998/02/25 15:21:40 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.16 1998/02/25 04:53:59 sra
; Update copyrights.
;
; Revision 1.15 1998/02/20 04:02:37 sra
; Fix too-long layout macro names.
;
; Revision 1.14 1998/01/20 23:03:23 mrf
; Added IP_PROTOCOL_is_IPV4 definition for tunnels
;
; Revision 1.13 1997/09/26 20:21:15 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.12 1997/09/13 03:11:58 alan
; Add IGMP_MESSAGE, and ICMP messages of type Router Solicitation and
; Router Advertisement.
;
; Revision 1.11 1997/06/04 05:46:25 alan
; Fix RCS keywords.
;
; Revision 1.10 1997/06/03 22:59:34 alan
; Use `define-rcs-info'.
;
; Revision 1.9 1997/05/28 05:13:51 alan
; Fix ICMP layouts so that they no longer use internal unions. This makes
; the size of the variants be what people expect.
;
; Revision 1.8 1997/05/21 07:15:30 alan
; Split out IP4_TYPE_OF_SERVICE.
;
; Revision 1.7 1997/05/17 06:43:54 alan
; Add some more values to IP_PROTOCOL.
;
; Revision 1.6 1997/05/15 00:39:23 alan
; Generate: SIZEOF_ICMP_MESSAGE_MINIMUM_HEADER.
;
; Revision 1.5 1997/05/12 23:39:57 alan
; Add definitions: TCP_OPTION_HEADER and TCP_OPTION_MSS.
;
; Revision 1.4 1997/05/12 21:14:14 alan
; Add definition for `IP_PSEUDO_HEADER'.
;
; Revision 1.3 1997/04/22 21:06:02 alan
; Add BGP to IP_PORT enumeration.
;
; Revision 1.2 1997/04/22 00:08:57 alan
; Fix copyright.
; Update IP port numbers.
;
; Revision 1.1 1997/04/19 04:12:15 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.6 1996/12/03 07:52:12 alan
; Some changes for IPv6.
;
; Revision 1.5 1995/08/19 06:22:50 alan
; Allow getting IP address as a number.
;
; Revision 1.4 1995/06/28 23:57:03 alan
; Add some more port numbers
;
; Revision 1.3 1995/06/04 18:35:38 alan
; Fix typo
;
; Revision 1.2 1995/05/25 23:53:33 alan
; Some enums have a `base' attribute -- some other tweaking.
;
; Revision 1.1 1995/05/23 07:17:19 alan
; Basic network layouts.
(define-rcs-info "$Id: ip.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout IP_PROTOCOL
(enum (type (unsigned 8))
(value HOP_BY_HOP_OPTIONS 0) ; v6
(value ICMP 1)
(value IGMP 2)
(value IPV4 4)
(value TCP 6)
(value UDP 17)
(value IPV6 41)
(value ROUTING 43) ; v6
(value FRAGMENT 44) ; v6
(value ESP 50) ; "Encapsulating Secure Payload"
(value AUTHENTICATION 51)
(value ICMPV6 58) ; v6
(value NO_NEXT 59) ; v6
(value DESTINATION_OPTIONS 60) ; v6
(value OSPF 89)
))
(define-layout IP_ADDRESS
(union (size (* 4 8))
(field BYTES (array (count 4) (type (unsigned 8))))
(field NUMBER (unsigned (* 4 8)))
(field OPAQUE (opaque (* 4 8)))))
(define-layout IP_PORT
(union (size 16)
(field NUMBER (unsigned 16))
(field OPAQUE (enum (type (opaque 16))
(value ECHO 7)
(value DISCARD 9)
(value USERS 11)
(value DAYTIME 13)
(value QUOTE 17)
(value FTP 21)
(value SSH 22)
(value TELNET 23)
(value SMTP 25)
(value TIME 37)
(value DOMAIN 53)
(value TFTP 69)
(value GOPHER 70)
(value FINGER 79)
(value WWW 80)
(value SUPDUP 95)
(value SUNRPC 111)
(value NNTP 119)
(value NTP 123)
(value IMAP2 143)
(value PCMAIL 158)
(value SNMP 161)
(value SNMP_TRAP 162)
(value BGP 179)
(value SMUX 199)
(value IMAP3 220)
(value BSD_TCP_EXEC 512)
(value BSD_UDP_BIFF 512)
(value BSD_TCP_LOGIN 513)
(value BSD_UDP_WHO 513)
(value BSD_TCP_SHELL 514)
(value BSD_UDP_SYSLOG 514)
(value BSD_PRINTER 515)
(value BSD_TALK 517)
(value BSD_NTALK 518)
(value RIP 520)
(value BSD_TIMED 525)
(value BSD_TEMPO 526)
(value BSD_COURIER 530)
(value BSD_CONFERENCE 531)
(value BSD_NETNEWS 532)
(value BSD_NETWALL 533)
(value BSD_UUCP 540)
(value BSD_REMOTEFS 556)
(value KLOGIN 543)
(value KSHELL 544)
(value KERBEROS_ADM 749)
(value WEBSTER 765)))))
(define-layout IP4_TYPE_OF_SERVICE
(struct (size 8)
(align 1)
(field PRECEDENCE (unsigned 3))
(field LOW_DELAY (boolean 1))
(field HIGH_THROUGHPUT (boolean 1))
(field HIGH_RELIABILITY (boolean 1))
(fill 2) ; MBZ
))
(define-layout IP_HEADER
(struct (size (* 5 32)) ; error check
(struct (align 4)
(field VERSION
(enum (type (unsigned 4))
(value IPV4 4)
(value IPV6 6)))
(field HEADER_LENGTH (unsigned 4)))
(field TYPE_OF_SERVICE (unsigned (sizeof IP4_TYPE_OF_SERVICE)))
(field TOTAL_LENGTH (unsigned 16))
(field IDENTIFICATION (opaque 16))
(field FRAGMENT
(struct (size 16) ; error check
(align 1)
(fill 1) ; MBZ
(field DONT (boolean 1))
(field MORE (boolean 1))
(field OFFSET (unsigned 13))))
(field TIME_TO_LIVE (unsigned 8))
(field PROTOCOL IP_PROTOCOL)
(field HEADER_CHECKSUM (unsigned 16))
(field SOURCE_ADDRESS IP_ADDRESS)
(field DESTINATION_ADDRESS IP_ADDRESS)
(field OPTIONS
(array (count 0)
(type (enum (type (unsigned 8)) ; <Length>
(value END 0) ; 1
(value NOOP 1) ; 1
(value SECURITY 130) ; 11
(value LSRR 131)
(value SSRR 137)
(value RECORD_ROUTE 7)
(value STREAM_ID 136) ; 4
(value TIMESTAMP 68)
))))
))
(define-layout IP_PSEUDO_HEADER
;; for computing UDP or TCP checksums
(struct (size (* 3 32))
(field SOURCE_ADDRESS IP_ADDRESS)
(field DESTINATION_ADDRESS IP_ADDRESS)
(fill 8) ; MBZ
(field PROTOCOL IP_PROTOCOL)
(field PAYLOAD_LENGTH (unsigned 16))))
(define-layout IGMP_MESSAGE
(struct (size (* 2 32)) ; error check
(struct (align 4)
(field VERSION (unsigned 4))
(field TYPE (enum (type (unsigned 4))
(value QUERY 1)
(value REPORT 2))))
(fill 8) ; MBZ
(field CHECKSUM (unsigned 16))
(field GROUP_ADDRESS IP_ADDRESS)
))
(define-layout ICMP_MESSAGE
(union (struct ;; Many ICMP messages share these fields:
(field TYPE (enum (type (unsigned 8))
(value ECHO_REPLY 0)
(value DESTINATION_UNREACHABLE 3)
(value SOURCE_QUENCH 4)
(value REDIRECT 5)
(value ECHO 8)
(value ROUTER_ADVERTISEMENT 9)
(value ROUTER_SOLICITATION 10)
(value TIME_EXCEEDED 11)
(value PARAMETER_PROBLEM 12)
(value TIMESTAMP 13)
(value TIMESTAMP_REPLY 14)
(value INFO_REQUEST 15)
(value INFO_REPLY 16)
))
(fill 8) ; the CODE
(field CHECKSUM (unsigned 16)) ; always
(field IDENTIFICATION (opaque 16)) ; sometimes
(field SEQUENCE_NUMBER (unsigned 16)) ; sometimes
(field HEADER IP_HEADER) ; sometimes
)
;; Usefull size to know
(field MINIMUM_HEADER (struct (size (* 8 8)) ; error check
(fill 8) ; TYPE
(fill 8) ; CODE
(fill 16) ; CHECKSUM
(fill 16) ; IDENTIFICATION
(fill 16) ; SEQUENCE_NUMBER
))
;; Destination Unreachable Message
(field DU (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value NET 0)
(value HOST 1)
(value PROTOCOL 2)
(value PORT 3)
(value CANT_FRAGMENT 4)
(value ROUTE_FAILED 5)))
;; contains a datagram
))
;; Source Quench Message:
(field SQ (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
;; contains a datagram
))
;; Redirect Message:
(field RD (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value NET 0)
(value HOST 1)
(value TOS_NET 2)
(value TOS_HOST 3)))
(fill 16) ; checksum
(field GATEWAY IP_ADDRESS)
;; contains a datagram
))
;; Time Exceeded Message:
(field TE (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value TTL 0)
(value REASSEMBLY 1)))
;; contains a datagram
))
;; Parameter Problem Message:
(field PP (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(field POINTER (unsigned 8))
;; contains a datagram
))
;; Echo or Echo Reply Message:
(field ECHO (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 48) ; checksum+ident+sequence
(field DATA (array (count 0)
(type (unsigned 8))))))
;; Timestamp or Timestamp Reply Message:
(field TIMESTAMP (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 48) ; checksum+ident+sequence
(field ORIGINATE (unsigned 32))
(field RECEIVE (unsigned 32))
(field TRANSMIT (unsigned 32))))
;; Information Request or Information Reply Message:
(field INFO (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 48) ; checksum+ident+sequence
))
;; Router Solicitation Message:
(field RS (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(field RESERVED (unsigned 32))))
;; Router Advertisement Message:
(field RA (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(field NUM_ADDRS (unsigned 8))
(field ADDR_ENTRY_SIZE (unsigned 8))
(field LIFETIME (unsigned 16))
(field ENTRY
(array (count 0)
(type (struct (field ADDRESS
IP_ADDRESS)
(field PREFERENCE
(unsigned 32))
))))
))
))
(define-layout UDP_HEADER
(struct (size (* 2 32)) ; error check
(field SOURCE_PORT IP_PORT)
(field DESTINATION_PORT IP_PORT)
(field LENGTH (unsigned 16))
(field CHECKSUM (unsigned 16))))
(define-layout TCP_HEADER
(struct (size (* 5 32)) ; error check
(field SOURCE_PORT IP_PORT)
(field DESTINATION_PORT IP_PORT)
(field SEQUENCE_NUMBER (unsigned 32))
(field ACKNOWLEDGE_NUMBER (unsigned 32))
(struct (size 16) ; error check
(align 1)
(field DATA_OFFSET (unsigned 4))
(fill 6)
(field URG (boolean 1))
(field ACK (boolean 1))
(field PSH (boolean 1))
(field RST (boolean 1))
(field SYN (boolean 1))
(field FIN (boolean 1)))
(field WINDOW (unsigned 16))
(field CHECKSUM (unsigned 16))
(field URGENT_POINTER (unsigned 16))
(field OPTIONS (struct (size 0)))
))
(define-layout TCP_OPTION_HEADER
(struct (field KIND (enum (type (unsigned 8)) ; <Length>
(value END 0) ; 1
(value NOOP 1) ; 1
(value MSS 2) ; 4
))
(field LENGTH (unsigned 8))))
(define-layout TCP_OPTION_MSS
(struct (fill (sizeof TCP_OPTION_HEADER))
(field SIZE (unsigned 16))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,637 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: ip6.ldb,v 1.13 2000/12/02 20:22:20 sar Exp
* --used --
* Id: ip.ldb,v 1.18 1999/10/19 20:12:43 sar Exp
*/
#ifndef EPILOGUE_LAYOUT_IP6_H
#define EPILOGUE_LAYOUT_IP6_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for IP6_ND_OPT */
#define SIZEOF_IP6_ND_OPT (48)
#define PTR_IP6_ND_OPT_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP6_ND_OPT_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP6_ND_OPT_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define IP6_ND_OPT_TYPE_is_SOURCE_LINK_LAYER_ADDRESS GLUE_CAST08(1L)
#define IP6_ND_OPT_TYPE_is_TARGET_LINK_LAYER_ADDRESS GLUE_CAST08(2L)
#define IP6_ND_OPT_TYPE_is_PREFIX_INFORMATION GLUE_CAST08(3L)
#define IP6_ND_OPT_TYPE_is_REDIRECTED_HEADER GLUE_CAST08(4L)
#define IP6_ND_OPT_TYPE_is_MTU GLUE_CAST08(5L)
#define PTR_IP6_ND_OPT_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP6_ND_OPT_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP6_ND_OPT_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP6_ND_OPT_LINK_LAYER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP6_ND_OPT_LINK_LAYER (2)
#define PTR_IP6_ND_OPT_LINK_LAYER_ADDR(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_IP6_ND_OPT_LINK_LAYER_ADDR (0)
#define PTR_IP6_ND_OPT_LINK_LAYER_ADDR_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(2)+(_X0_))
#define GET_IP6_ND_OPT_LINK_LAYER_ADDR_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)+(_X0_))
#define SET_IP6_ND_OPT_LINK_LAYER_ADDR_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2)+(_X0_), GLUE_CAST08(_V_))
#define PTR_IP6_ND_OPT_PREFIX(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP6_ND_OPT_PREFIX (32)
#define PTR_IP6_ND_OPT_PREFIX_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_IP6_ND_OPT_PREFIX_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_IP6_ND_OPT_PREFIX_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
/* Can't define PTR_IP6_ND_OPT_PREFIX_ON_LINK_P because:
Size 1 is not a multiple of 8. */
#define GET_IP6_ND_OPT_PREFIX_ON_LINK_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST08(0x80L))
#define SET_IP6_ND_OPT_PREFIX_ON_LINK_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_IP6_ND_OPT_PREFIX_AUTONOMOUS_P because:
Size 1 is not a multiple of 8. */
#define GET_IP6_ND_OPT_PREFIX_AUTONOMOUS_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST08(0x40L))
#define SET_IP6_ND_OPT_PREFIX_AUTONOMOUS_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) | GLUE_CAST08(0x40L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST08(0x40L)))
#define PTR_IP6_ND_OPT_PREFIX_VALID_LIFETIME(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP6_ND_OPT_PREFIX_VALID_LIFETIME(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP6_ND_OPT_PREFIX_VALID_LIFETIME(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_IP6_ND_OPT_PREFIX_PREFERRED_LIFETIME(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_IP6_ND_OPT_PREFIX_PREFERRED_LIFETIME(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_IP6_ND_OPT_PREFIX_PREFERRED_LIFETIME(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_IP6_ND_OPT_PREFIX_PREFIX(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define PTR_IP6_ND_OPT_REDIRECTED(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP6_ND_OPT_REDIRECTED (48)
#define PTR_IP6_ND_OPT_REDIRECTED_HEADER(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_IP6_ND_OPT_MTU(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP6_ND_OPT_MTU (8)
#define PTR_IP6_ND_OPT_MTU_MTU(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP6_ND_OPT_MTU_MTU(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP6_ND_OPT_MTU_MTU(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
/* Definitions for ICMP6_MSG */
#define SIZEOF_ICMP6_MSG (48)
/* Can't define PTR_ICMP6_MSG_INFO_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_INFO_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x80L))
#define SET_ICMP6_MSG_INFO_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x80L)))
#define PTR_ICMP6_MSG_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_ICMP6_MSG_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_ICMP6_MSG_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define ICMP6_MSG_TYPE_is_DESTINATION_UNREACHABLE GLUE_CAST08(1L)
#define ICMP6_MSG_TYPE_is_PACKET_TOO_BIG GLUE_CAST08(2L)
#define ICMP6_MSG_TYPE_is_TIME_EXCEEDED GLUE_CAST08(3L)
#define ICMP6_MSG_TYPE_is_PARAMETER_PROBLEM GLUE_CAST08(4L)
#define ICMP6_MSG_TYPE_is_ECHO_REQUEST GLUE_CAST08(128L)
#define ICMP6_MSG_TYPE_is_ECHO_REPLY GLUE_CAST08(129L)
#define ICMP6_MSG_TYPE_is_GM_QUERY GLUE_CAST08(130L)
#define ICMP6_MSG_TYPE_is_GM_REPORT GLUE_CAST08(131L)
#define ICMP6_MSG_TYPE_is_GM_REDUCTION GLUE_CAST08(132L)
#define ICMP6_MSG_TYPE_is_ROUTER_SOLICITATION GLUE_CAST08(133L)
#define ICMP6_MSG_TYPE_is_ROUTER_ADVERTISEMENT GLUE_CAST08(134L)
#define ICMP6_MSG_TYPE_is_NEIGHBOR_SOLICITATION GLUE_CAST08(135L)
#define ICMP6_MSG_TYPE_is_NEIGHBOR_ADVERTISEMENT GLUE_CAST08(136L)
#define ICMP6_MSG_TYPE_is_REDIRECT GLUE_CAST08(137L)
#define PTR_ICMP6_MSG_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_CHECKSUM(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_ICMP6_MSG_CHECKSUM(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_ICMP6_MSG_CHECKSUM(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_ICMP6_MSG_IDENTIFICATION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_IDENTIFICATION(_P_)\
GLUE_GU16((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_IDENTIFICATION(_P_, _V_)\
GLUE_SU16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_ICMP6_MSG_SEQUENCE_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_ICMP6_MSG_SEQUENCE_NUMBER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_ICMP6_MSG_SEQUENCE_NUMBER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_ICMP6_MSG_HEADER(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP6_MSG_MINIMUM_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_MINIMUM_HEADER (8)
#define PTR_ICMP6_MSG_DU(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_DU (8)
#define PTR_ICMP6_MSG_DU_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_DU_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_DU_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_DU_CODE_is_NO_ROUTE GLUE_CAST08(0L)
#define ICMP6_MSG_DU_CODE_is_PROHIBITED GLUE_CAST08(1L)
#define ICMP6_MSG_DU_CODE_is_ADDRESS GLUE_CAST08(3L)
#define ICMP6_MSG_DU_CODE_is_PORT GLUE_CAST08(4L)
#define PTR_ICMP6_MSG_PTB(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_PTB (8)
#define PTR_ICMP6_MSG_PTB_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_PTB_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_PTB_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_PTB_MTU(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_PTB_MTU(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_PTB_MTU(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_ICMP6_MSG_TE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_TE (8)
#define PTR_ICMP6_MSG_TE_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_TE_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_TE_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_TE_CODE_is_HOPS GLUE_CAST08(0L)
#define ICMP6_MSG_TE_CODE_is_REASSEMBLY GLUE_CAST08(1L)
#define PTR_ICMP6_MSG_TE_MTU(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_TE_MTU(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_TE_MTU(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_ICMP6_MSG_PP(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_PP (8)
#define PTR_ICMP6_MSG_PP_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_PP_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_PP_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_PP_CODE_is_ZERO GLUE_CAST08(0L)
#define ICMP6_MSG_PP_CODE_is_UNREC_HEADER GLUE_CAST08(1L)
#define ICMP6_MSG_PP_CODE_is_UNREC_OPTION GLUE_CAST08(2L)
#define PTR_ICMP6_MSG_PP_POINTER(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_PP_POINTER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_PP_POINTER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_ICMP6_MSG_ECHO(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_ECHO (8)
#define PTR_ICMP6_MSG_ECHO_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_ECHO_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_ECHO_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_ECHO_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_ECHO_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_ICMP6_MSG_ECHO_DATA (0)
#define PTR_ICMP6_MSG_ECHO_DATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define GET_ICMP6_MSG_ECHO_DATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define SET_ICMP6_MSG_ECHO_DATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_GM(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_GM (24)
#define PTR_ICMP6_MSG_GM_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_GM_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_GM_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_GM_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_GM_DELAY(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_GM_DELAY(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_GM_DELAY(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_ICMP6_MSG_GM_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP6_MSG_RS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_RS (8)
#define PTR_ICMP6_MSG_RS_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_RS_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_RS_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_RS_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_RS_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_ICMP6_MSG_RS_OPTIONS (0)
#define PTR_ICMP6_MSG_RS_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define GET_ICMP6_MSG_RS_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_))
#define SET_ICMP6_MSG_RS_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(8)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_RA(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_RA (16)
#define PTR_ICMP6_MSG_RA_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_RA_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_RA_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_RA_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_RA_HOP_LIMIT(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_ICMP6_MSG_RA_HOP_LIMIT(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_ICMP6_MSG_RA_HOP_LIMIT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
/* Can't define PTR_ICMP6_MSG_RA_MANAGED_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_RA_MANAGED_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) & GLUE_CAST08(0x80L))
#define SET_ICMP6_MSG_RA_MANAGED_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(5), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_ICMP6_MSG_RA_OTHER_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_RA_OTHER_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) & GLUE_CAST08(0x40L))
#define SET_ICMP6_MSG_RA_OTHER_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(5), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) | GLUE_CAST08(0x40L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(5)) & ~GLUE_CAST08(0x40L)))
#define PTR_ICMP6_MSG_RA_ROUTER_LIFETIME(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_ICMP6_MSG_RA_ROUTER_LIFETIME(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_ICMP6_MSG_RA_ROUTER_LIFETIME(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_ICMP6_MSG_RA_REACHABLE_TIME(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_ICMP6_MSG_RA_REACHABLE_TIME(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_ICMP6_MSG_RA_REACHABLE_TIME(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_ICMP6_MSG_RA_RETRANSMIT_TIME(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_ICMP6_MSG_RA_RETRANSMIT_TIME(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(12))
#define SET_ICMP6_MSG_RA_RETRANSMIT_TIME(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_ICMP6_MSG_RA_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define SIZEOF_ICMP6_MSG_RA_OPTIONS (0)
#define PTR_ICMP6_MSG_RA_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(16)+(_X0_))
#define GET_ICMP6_MSG_RA_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(16)+(_X0_))
#define SET_ICMP6_MSG_RA_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(16)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_NS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_NS (24)
#define PTR_ICMP6_MSG_NS_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_NS_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_NS_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_NS_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_NS_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP6_MSG_NS_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define SIZEOF_ICMP6_MSG_NS_OPTIONS (0)
#define PTR_ICMP6_MSG_NS_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(24)+(_X0_))
#define GET_ICMP6_MSG_NS_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(24)+(_X0_))
#define SET_ICMP6_MSG_NS_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(24)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_NA(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_NA (24)
#define PTR_ICMP6_MSG_NA_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_NA_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_NA_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_NA_CODE_is_ZERO GLUE_CAST08(0L)
/* Can't define PTR_ICMP6_MSG_NA_ROUTER_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_NA_ROUTER_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & GLUE_CAST08(0x80L))
#define SET_ICMP6_MSG_NA_ROUTER_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) | GLUE_CAST08(0x80L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & ~GLUE_CAST08(0x80L)))
/* Can't define PTR_ICMP6_MSG_NA_SOLICITED_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_NA_SOLICITED_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & GLUE_CAST08(0x40L))
#define SET_ICMP6_MSG_NA_SOLICITED_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) | GLUE_CAST08(0x40L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & ~GLUE_CAST08(0x40L)))
/* Can't define PTR_ICMP6_MSG_NA_OVERRIDE_P because:
Size 1 is not a multiple of 8. */
#define GET_ICMP6_MSG_NA_OVERRIDE_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & GLUE_CAST08(0x20L))
#define SET_ICMP6_MSG_NA_OVERRIDE_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) | GLUE_CAST08(0x20L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)) & ~GLUE_CAST08(0x20L)))
#define PTR_ICMP6_MSG_NA_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP6_MSG_NA_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define SIZEOF_ICMP6_MSG_NA_OPTIONS (0)
#define PTR_ICMP6_MSG_NA_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(24)+(_X0_))
#define GET_ICMP6_MSG_NA_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(24)+(_X0_))
#define SET_ICMP6_MSG_NA_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(24)+(_X0_), GLUE_CAST08(_V_))
#define PTR_ICMP6_MSG_RE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_ICMP6_MSG_RE (40)
#define PTR_ICMP6_MSG_RE_CODE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_ICMP6_MSG_RE_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_ICMP6_MSG_RE_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define ICMP6_MSG_RE_CODE_is_ZERO GLUE_CAST08(0L)
#define PTR_ICMP6_MSG_RE_TARGET_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_ICMP6_MSG_RE_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define PTR_ICMP6_MSG_RE_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(40))
#define SIZEOF_ICMP6_MSG_RE_OPTIONS (0)
#define PTR_ICMP6_MSG_RE_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(40)+(_X0_))
#define GET_ICMP6_MSG_RE_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(40)+(_X0_))
#define SET_ICMP6_MSG_RE_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(40)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for IP6_PSEUDO_HEADER */
#define SIZEOF_IP6_PSEUDO_HEADER (40)
#define PTR_IP6_PSEUDO_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_)))
#define PTR_IP6_PSEUDO_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define PTR_IP6_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(32))
#define GET_IP6_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(32))
#define SET_IP6_PSEUDO_HEADER_PAYLOAD_LENGTH(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(32), GLUE_CAST32(_V_))
#define PTR_IP6_PSEUDO_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_))+(39))
#define GET_IP6_PSEUDO_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(39))
#define SET_IP6_PSEUDO_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(39), GLUE_CAST08(_V_))
/* Definitions for IP6_FRAGMENT_HEADER */
#define SIZEOF_IP6_FRAGMENT_HEADER (8)
#define PTR_IP6_FRAGMENT_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP6_FRAGMENT_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP6_FRAGMENT_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
/* Can't define PTR_IP6_FRAGMENT_HEADER_OFFSET because:
Size 13 is not a multiple of 8. */
#define GET_IP6_FRAGMENT_HEADER_OFFSET(_P_)\
GLUE_CAST16(GLUE_GB16((GLUE_CAST_PTR(_P_))+(2)) >> 3)
#define SET_IP6_FRAGMENT_HEADER_OFFSET(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), (GLUE_GB16((GLUE_CAST_PTR(_P_))+(2)) & ~GLUE_CAST16(0xFFF8L)) | ((GLUE_CAST16(_V_) << 3) & GLUE_CAST16(0xFFF8L)))
/* Can't define PTR_IP6_FRAGMENT_HEADER_MORE_P because:
Size 1 is not a multiple of 8. */
#define GET_IP6_FRAGMENT_HEADER_MORE_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & GLUE_CAST08(0x1L))
#define SET_IP6_FRAGMENT_HEADER_MORE_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) | GLUE_CAST08(0x1L) : GLUE_GB08((GLUE_CAST_PTR(_P_))+(3)) & ~GLUE_CAST08(0x1L)))
#define PTR_IP6_FRAGMENT_HEADER_IDENTIFICATION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP6_FRAGMENT_HEADER_IDENTIFICATION(_P_)\
GLUE_GU32((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP6_FRAGMENT_HEADER_IDENTIFICATION(_P_, _V_)\
GLUE_SU32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
/* Definitions for IP6_ROUTING_HEADER */
#define SIZEOF_IP6_ROUTING_HEADER (8)
#define PTR_IP6_ROUTING_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP6_ROUTING_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP6_ROUTING_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_IP6_ROUTING_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP6_ROUTING_HEADER_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP6_ROUTING_HEADER_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP6_ROUTING_HEADER_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_IP6_ROUTING_HEADER_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_IP6_ROUTING_HEADER_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define IP6_ROUTING_HEADER_TYPE_is_TYPE0 GLUE_CAST08(0L)
#define PTR_IP6_ROUTING_HEADER_SEGMENTS_LEFT(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_IP6_ROUTING_HEADER_SEGMENTS_LEFT(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(3))
#define SET_IP6_ROUTING_HEADER_SEGMENTS_LEFT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_IP6_ROUTING_HEADER_STRICT(_P_)\
((GLUE_CAST_PTR(_P_))+(5))
#define SIZEOF_IP6_ROUTING_HEADER_STRICT (3)
/* Can't define PTR_IP6_ROUTING_HEADER_STRICT_ELT because:
Size 1 is not a multiple of 8. */
/* Can't define (GET_IP6_ROUTING_HEADER_STRICT_ELT SET_IP6_ROUTING_HEADER_STRICT_ELT) because:
Array elements are not aligned on octet boundaries: ((1 0 23)) */
#define PTR_IP6_ROUTING_HEADER_HOP(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_IP6_ROUTING_HEADER_HOP (0)
#define PTR_IP6_ROUTING_HEADER_HOP_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(16)*(_X0_))
/* Definitions for IP6_OPTION */
#define SIZEOF_IP6_OPTION (6)
/* Can't define PTR_IP6_OPTION_ACTION because:
Size 2 is not a multiple of 8. */
#define GET_IP6_OPTION_ACTION(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 6)
#define SET_IP6_OPTION_ACTION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xC0L)) | ((GLUE_CAST08(_V_) << 6) & GLUE_CAST08(0xC0L)))
#define IP6_OPTION_ACTION_is_IGNORE GLUE_CAST08(0L)
#define IP6_OPTION_ACTION_is_NEVER_COMPLAIN GLUE_CAST08(1L)
#define IP6_OPTION_ACTION_is_ALWAYS_COMPLAIN GLUE_CAST08(2L)
#define IP6_OPTION_ACTION_is_COMPLAIN GLUE_CAST08(3L)
/* Can't define PTR_IP6_OPTION_MAY_CHANGE_P because:
Size 1 is not a multiple of 8. */
#define GET_IP6_OPTION_MAY_CHANGE_P(_P_)\
(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x20L))
#define SET_IP6_OPTION_MAY_CHANGE_P(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), ((_V_) ? GLUE_GB08((GLUE_CAST_PTR(_P_))) | GLUE_CAST08(0x20L) : GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x20L)))
#define PTR_IP6_OPTION_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP6_OPTION_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP6_OPTION_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define IP6_OPTION_TYPE_is_PAD1 GLUE_CAST08(0L)
#define IP6_OPTION_TYPE_is_PADN GLUE_CAST08(1L)
#define IP6_OPTION_TYPE_is_JUMBO GLUE_CAST08(194L)
#define PTR_IP6_OPTION_DATA_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP6_OPTION_DATA_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP6_OPTION_DATA_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP6_OPTION_JUMBO_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_IP6_OPTION_JUMBO_LENGTH(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(2))
#define SET_IP6_OPTION_JUMBO_LENGTH(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST32(_V_))
/* Definitions for IP6_OPTIONS_HEADER */
#define SIZEOF_IP6_OPTIONS_HEADER (8)
#define PTR_IP6_OPTIONS_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP6_OPTIONS_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP6_OPTIONS_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_IP6_OPTIONS_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP6_OPTIONS_HEADER_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP6_OPTIONS_HEADER_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP6_OPTIONS_HEADER_OPTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_IP6_OPTIONS_HEADER_OPTIONS (6)
#define PTR_IP6_OPTIONS_HEADER_OPTIONS_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(2)+(_X0_))
#define GET_IP6_OPTIONS_HEADER_OPTIONS_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2)+(_X0_))
#define SET_IP6_OPTIONS_HEADER_OPTIONS_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for IP6_HEADER */
#define SIZEOF_IP6_HEADER (40)
/* Can't define PTR_IP6_HEADER_VERSION because:
Size 4 is not a multiple of 8. */
#define GET_IP6_HEADER_VERSION(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 4)
#define SET_IP6_HEADER_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xF0L)) | ((GLUE_CAST08(_V_) << 4) & GLUE_CAST08(0xF0L)))
#define IP6_HEADER_VERSION_is_IPV4 GLUE_CAST08(4L)
#define IP6_HEADER_VERSION_is_IPV6 GLUE_CAST08(6L)
/* Can't define PTR_IP6_HEADER_TRAFFIC_CLASS because:
Offset 4 is not a multiple of 8. */
#define GET_IP6_HEADER_TRAFFIC_CLASS(_P_)\
GLUE_CAST08((GLUE_GB16((GLUE_CAST_PTR(_P_))) & GLUE_CAST16(0xFF0L)) >> 4)
#define SET_IP6_HEADER_TRAFFIC_CLASS(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), (GLUE_GB16((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST16(0xFF0L)) | ((GLUE_CAST16(_V_) << 4) & GLUE_CAST16(0xFF0L)))
/* Can't define PTR_IP6_HEADER_FLOW_LABEL because:
Size 20 is not a multiple of 8. */
#define GET_IP6_HEADER_FLOW_LABEL(_P_)\
GLUE_CAST32(GLUE_GB32LS24((GLUE_CAST_PTR(_P_))) & GLUE_CAST32(0xFFFFFL))
#define SET_IP6_HEADER_FLOW_LABEL(_P_, _V_)\
GLUE_SB32LS24((GLUE_CAST_PTR(_P_)), (GLUE_GB32LS24((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST32(0xFFFFFL)) | (GLUE_CAST32(_V_) & GLUE_CAST32(0xFFFFFL)))
#define PTR_IP6_HEADER_PAYLOAD_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP6_HEADER_PAYLOAD_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP6_HEADER_PAYLOAD_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST16(_V_))
#define PTR_IP6_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_IP6_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(6))
#define SET_IP6_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST08(_V_))
#define PTR_IP6_HEADER_HOP_LIMIT(_P_)\
((GLUE_CAST_PTR(_P_))+(7))
#define GET_IP6_HEADER_HOP_LIMIT(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(7))
#define SET_IP6_HEADER_HOP_LIMIT(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(7), GLUE_CAST08(_V_))
#define PTR_IP6_HEADER_SOURCE_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_IP6_HEADER_DESTINATION_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
/* Definitions for IP6_ADDRESS */
#define SIZEOF_IP6_ADDRESS (16)
#define PTR_IP6_ADDRESS_BYTES(_P_)\
((GLUE_CAST_PTR(_P_)))
#define SIZEOF_IP6_ADDRESS_BYTES (16)
#define PTR_IP6_ADDRESS_BYTES_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(_X0_))
#define GET_IP6_ADDRESS_BYTES_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(_X0_))
#define SET_IP6_ADDRESS_BYTES_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(_X0_), GLUE_CAST08(_V_))
#endif /* EPILOGUE_LAYOUT_IP6_H */
@@ -0,0 +1,452 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ip6.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for IPv6 protocols
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1996-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: ip6.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.15 2001/01/19 22:22:33 paul
; Update copyright.
;
; Revision 1.14 2000/12/04 02:35:49 sar
; Removed a description of FLOW_LABEL that had been replaced but not
; previously removed.
;
; Revision 1.13 2000/12/02 20:22:20 sar
; Update the packet layouts this includes
; changing priority to traffic class
; modifying the size of flow label from 24 to 20
; in v6 icmp message updating the CODE field
; in du message changing option 2 (not a neighbor) to reserved
; in ptb message removing the option types
; in te message adding checksum and mtu fields
; in pp message adding unrecognized header and option types
; changing redirect from RD to RE
;
; Revision 1.12 2000/03/13 21:21:48 paul
; Removed some code that we are no longer working on.
;
; Revision 1.9 1998/02/25 15:21:41 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.8 1998/02/25 04:54:00 sra
; Update copyrights.
;
; Revision 1.7 1998/02/20 04:02:37 sra
; Fix too-long layout macro names.
;
; Revision 1.6 1997/09/26 20:21:15 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.5 1997/06/04 05:46:27 alan
; Fix RCS keywords.
;
; Revision 1.4 1997/06/03 22:59:35 alan
; Use `define-rcs-info'.
;
; Revision 1.3 1997/05/28 05:13:54 alan
; Fix ICMP layouts so that they no longer use internal unions. This makes
; the size of the variants be what people expect.
;
; Revision 1.2 1997/04/22 00:18:33 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:16 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.5 1997/04/18 22:50:01 alan
; Add ICMP6_MESSAGE_MINIMUM_HEADER ...
;
; Revision 1.4 1996/12/06 02:20:58 alan
; First supposedly working version.
;
; Revision 1.3 1996/12/04 19:57:42 alan
; Fix bugs...
;
; Revision 1.2 1996/12/03 07:52:46 alan
; A lot of this is now right.
;
; Revision 1.1 1996/12/02 19:28:26 alan
; Still bogus, but here it is...
(define-rcs-info "$Id: ip6.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(use-layouts "ip.ldb")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout IP6_ADDRESS
(union (size 128)
(field BYTES (array (count 16)
(type (unsigned 8))))))
(define-layout IP6_HEADER
(struct (size (* 10 32)) ; error check
(struct (align 4)
(field VERSION
(enum (type (unsigned 4))
(value IPV4 4)
(value IPV6 6)))
(field TRAFFIC_CLASS (unsigned 8))
(field FLOW_LABEL (unsigned 20)))
(field PAYLOAD_LENGTH (unsigned 16))
(field NEXT_HEADER IP_PROTOCOL)
(field HOP_LIMIT (unsigned 8))
(field SOURCE_ADDRESS IP6_ADDRESS)
(field DESTINATION_ADDRESS IP6_ADDRESS)
))
;
; Hop-by-Hop or Destination Options Header
;
(define-layout IP6_OPTIONS_HEADER
(struct (size (* 2 32))
(field NEXT_HEADER IP_PROTOCOL)
(field LENGTH (unsigned 8))
(field OPTIONS (array (count 6)
(type (unsigned 8))))))
(define-layout IP6_OPTION
(struct (union (size 8)
(struct (size 8)
(align 1)
(field ACTION (enum (type (unsigned 2))
(value IGNORE 0)
(value NEVER_COMPLAIN 1)
(value ALWAYS_COMPLAIN 2)
(value COMPLAIN 3)))
(field MAY_CHANGE_P (boolean 1))
(fill 5))
(field TYPE (enum (type (unsigned 8))
(value PAD1 0) ; special case: no data
(value PADN 1)
(value JUMBO 194) ; length = 4
)))
(field DATA_LENGTH (unsigned 8))
(union (field JUMBO_LENGTH (unsigned 32))
)))
;
; Routing Header
;
(define-layout IP6_ROUTING_HEADER
(struct (field NEXT_HEADER IP_PROTOCOL)
(field LENGTH (unsigned 8))
(field TYPE (enum (type (unsigned 8))
(value TYPE0 0) ; name???
))
(field SEGMENTS_LEFT (unsigned 8))
(union ;; Type 0:
(struct (fill 8) ; MBZ
(field STRICT (array (count 24)
(align 1)
(type (boolean 1))))
(field HOP (array (count 0)
(type IP6_ADDRESS))))
)))
;
; Fragment Header
;
(define-layout IP6_FRAGMENT_HEADER
(struct (size (* 2 32))
(field NEXT_HEADER IP_PROTOCOL)
(fill 8) ; MBZ
(struct (size 16)
(align 1)
(field OFFSET (unsigned 13))
(fill 2) ; MBZ
(field MORE_P (boolean 1)))
(field IDENTIFICATION (opaque 32))))
;
; Etc.
;
(define-layout IP6_PSEUDO_HEADER
;; for computing ICMP, UDP or TCP checksums
(struct (size (* 10 32))
(field SOURCE_ADDRESS IP6_ADDRESS)
(field DESTINATION_ADDRESS IP6_ADDRESS)
(field PAYLOAD_LENGTH (unsigned 32))
(fill 24) ; MBZ
(field NEXT_HEADER IP_PROTOCOL)))
;
; ICMPv6
;
(define-layout ICMP6_MSG
(union (struct ;; Many ICMP messages share these fields:
(union (size 8)
(struct (size 8)
(align 1)
(field INFO_P (boolean 1))
(fill 7))
(field TYPE
(enum (type (unsigned 8))
(value DESTINATION_UNREACHABLE 1)
(value PACKET_TOO_BIG 2)
(value TIME_EXCEEDED 3)
(value PARAMETER_PROBLEM 4)
(value ECHO_REQUEST 128)
(value ECHO_REPLY 129)
(value GM_QUERY 130)
(value GM_REPORT 131)
(value GM_REDUCTION 132)
;; Neighbor Discovery Types:
(value ROUTER_SOLICITATION 133)
(value ROUTER_ADVERTISEMENT 134)
(value NEIGHBOR_SOLICITATION 135)
(value NEIGHBOR_ADVERTISEMENT 136)
(value REDIRECT 137)
)))
(field CODE (unsigned 8)) ; the CODE
(field CHECKSUM (unsigned 16)) ; always
(field IDENTIFICATION (opaque 16)) ; sometimes
(field SEQUENCE_NUMBER (unsigned 16)) ; sometimes
(field HEADER IP6_HEADER) ; sometimes
)
;; Usefull size to know
(field MINIMUM_HEADER (struct (size (* 8 8)) ; error check
(fill 8) ; TYPE
(fill 8) ; CODE
(fill 16) ; CHECKSUM
(fill 16) ; IDENTIFICATION
(fill 16) ; SEQUENCE_NUMBER
))
;; Destination Unreachable Message
(field DU (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value NO_ROUTE 0)
(value PROHIBITED 1)
;; 2 is reserved
(value ADDRESS 3)
(value PORT 4)))
(fill 16) ; checksum
(fill 32) ; reserved
;; contains a datagram
))
;; Packet Too Big Message
(field PTB (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
;; no types defined
))
(fill 16) ; checksum
(field MTU (unsigned 32))
;; contains a datagram
))
;; Time Exceeded Message:
(field TE (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value HOPS 0)
(value REASSEMBLY 1)))
(fill 16) ; checksum
(field MTU (unsigned 32))
;; contains a datagram
))
;; Parameter Problem Message:
(field PP (struct (fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)
(value UNREC_HEADER 1)
(value UNREC_OPTION 2)))
(fill 16) ; checksum
(field POINTER (unsigned 32))
;; contains a datagram
))
;; Echo Request or Reply Message:
(field ECHO
(struct (size (* 8 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 48) ; checksum+ident+sequence
(field DATA (array (count 0)
(type (unsigned 8))))))
;; Group Membership Query, Report or Reduction Message:
(field GM
(struct (size (* 24 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(field DELAY (unsigned 16))
(fill 16) ; MBZ
(field ADDRESS IP6_ADDRESS)))
;; ----- Neighbor Discovery Messages -----
;; Router Solicitation Message:
(field RS
(struct (size (* 8 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(fill 32) ; MBZ
(field OPTIONS (array (count 0)
(type (unsigned 8))))))
;; Router Advertisement Message:
(field RA
(struct (size (* 16 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(field HOP_LIMIT (unsigned 8))
(struct (size 8)
(align 1)
(field MANAGED_P (boolean 1))
(field OTHER_P (boolean 1))
(fill 6) ; MBZ
)
(field ROUTER_LIFETIME (unsigned 16))
(field REACHABLE_TIME (unsigned 32))
(field RETRANSMIT_TIME (unsigned 32))
(field OPTIONS (array (count 0)
(type (unsigned 8))))))
;; Neighbor Solicitation Message:
(field NS
(struct (size (* 24 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(fill 32) ; MBZ
(field ADDRESS IP6_ADDRESS)
(field OPTIONS (array (count 0)
(type (unsigned 8))))))
;; Neighbor Advertisement Message:
(field NA
(struct (size (* 24 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(struct (size 32)
(align 1)
(field ROUTER_P (boolean 1))
(field SOLICITED_P (boolean 1))
(field OVERRIDE_P (boolean 1))
(fill 29) ; MBZ
)
(field ADDRESS IP6_ADDRESS)
(field OPTIONS (array (count 0)
(type (unsigned 8))))))
;; Redirect Message:
(field RE
(struct (size (* 40 8)) ; error check
(fill 8) ; the TYPE
(field CODE (enum (type (unsigned 8))
(value ZERO 0)))
(fill 16) ; checksum
(fill 32) ; MBZ
(field TARGET_ADDRESS IP6_ADDRESS)
(field DESTINATION_ADDRESS IP6_ADDRESS)
(field OPTIONS (array (count 0)
(type (unsigned 8))))))
))
(define-layout IP6_ND_OPT
;; for RS, RA, NS, NA and RE variants above...
(union (struct ;; All options share these fields:
(size 16) ; error check
(field TYPE
(enum (type (unsigned 8))
(value SOURCE_LINK_LAYER_ADDRESS 1)
(value TARGET_LINK_LAYER_ADDRESS 2)
(value PREFIX_INFORMATION 3) ; length = 4
(value REDIRECTED_HEADER 4)
(value MTU 5) ; length = 1
))
(field LENGTH (unsigned 8)))
(field LINK_LAYER (struct (fill 16) ; TYPE & LENGTH
(field ADDR
(array (count 0)
(type (unsigned 8))))))
(field PREFIX (struct (size (* 32 8)) ; error check
(fill 16) ; TYPE & LENGTH
(field LENGTH (unsigned 8))
(struct (size 8)
(align 1)
(field ON_LINK_P (boolean 1))
(field AUTONOMOUS_P (boolean 1))
(fill 6) ; MBZ
)
(field VALID_LIFETIME (unsigned 32))
(field PREFERRED_LIFETIME (unsigned 32))
(fill 32) ; MBZ
(field PREFIX IP6_ADDRESS)))
(field REDIRECTED (struct (fill 16) ; TYPE & LENGTH
(fill (* 6 8))
(field HEADER IP6_HEADER)))
(field MTU (struct (fill 16) ; TYPE & LENGTH
(fill 16)
(field MTU (unsigned 32))))
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,55 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/layout.cfg,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; The standard configuration for the layout tool
;
; Don't modify this file. If you want to change any of these values,
; do so by putting overriding definitions into your main config file.
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; disabled by default, install in the OEM's config file if wanted
install LAYOUT
; Default definition: where is scsh?
equate SCSH "scsh"
@@ -0,0 +1,88 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/dumpit.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; Dump out an excutable for the layout tool.
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
(let ((target (nth command-line-arguments 0))
(image (nth command-line-arguments 1)))
(let* ((psarg (format #F "ww~A" (pid)))
(scshvm (symbol->string (nth (run/sexps (ps ,psarg)) 11)))
(lscshvm (string-length scshvm)))
(unless (and (char=? #\/ (string-ref scshvm 0))
(string=? "/scshvm"
(substring scshvm (- lscshvm 7) lscshvm)))
(err 'dumpit "Bad scshvm pathname: ~S" scshvm))
(set! user-layouts-package (get-package 'user-layouts))
(call-with-output-file target
(lambda (port)
(display "#!/bin/sh -" port)
(newline port)
(display scshvm port)
(display " -i " port)
(display image port)
(display " \"$@\"" port)
(newline port)
))
(set-file-mode target #o755)
(set-err-should-exit? #T)
(dump-scsh-program do-layout-command-line image)))
; $Log: dumpit.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:35 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:20 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:39 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; End:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,228 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/lists.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; List manipulation, mapping, folding, reducing...
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
(define (last-pair l)
(let loop ((cell l)
(next (cdr l)))
(if (pair? next)
(loop next (cdr next))
cell)))
(define (cons* first . rest)
(cond ((null? rest) first)
((null? (cdr rest)) (cons first (car rest)))
(else (let loop ((a rest)
(b (cdr rest))
(c (cddr rest)))
(if (null? c)
(set-cdr! a (car b))
(loop b c (cdr c))))
(cons first rest))))
(define (reverse! lst)
(reverse*! lst '()))
(define (reverse*! lst tail)
(let loop ((in lst) (out tail))
(cond ((null? in) out)
((pair? in)
(let ((x (cdr in)))
(set-cdr! in out)
(loop x in)))
(else (err 'reverse*! "Not a proper list: ~S" in)))))
(define (reverse* lst tail)
(let loop ((in lst) (out tail))
(cond ((null? in) out)
((pair? in) (loop (cdr in) (cons (car in) out)))
(else (err 'reverse* "Not a proper list: ~S" lst)))))
(define (append! lst tail)
(cond ((pair? lst)
(let loop ((prev lst) (l (cdr lst)))
(if (pair? l)
(loop l (cdr l))
(set-cdr! prev tail)))
lst)
(else tail)))
(define (map* tail proc lst)
(let loop ((l lst))
(cond ((null? l) tail)
((pair? l)
(cons (proc (car l))
(loop (cdr l))))
(else (err 'map* "Not a proper list: ~S" lst)))))
(define (append-map proc lst) (append-map* '() proc lst))
(define (append-map* tail proc lst)
(let loop ((l lst))
(cond ((null? l) tail)
((pair? l)
(append (proc (car l))
(loop (cdr l))))
(else (err 'append-map* "Not a proper list: ~S" lst)))))
(define (append-map! proc lst) (append-map*! '() proc lst))
(define (append-map*! tail proc lst)
(let loop ((l lst))
(cond ((null? l) tail)
((pair? l)
(append! (proc (car l))
(loop (cdr l))))
(else (err 'append-map*! "Not a proper list: ~S" lst)))))
(define (there-exists? list predicate)
(let loop ((list list))
(and (not (null? list))
(or (predicate (car list))
(loop (cdr list))))))
(define (for-all? list predicate)
(let loop ((list list))
(or (null? list)
(and (predicate (car list))
(loop (cdr list))))))
(define (reduce procedure initial list)
(if (null? list)
initial
(let loop ((val (car list))
(l (cdr list)))
(if (null? l)
val
(loop (procedure val (car l))
(cdr l))))))
(define (reduce-right procedure initial list)
(if (null? list)
initial
(let loop ((first (car list))
(rest (cdr list)))
(if (null? rest)
first
(procedure first (loop (car rest) (cdr rest)))))))
(define (reduce-map reduce-proc initial map-proc lst)
(if (null? lst)
initial
(let loop ((val (map-proc (car lst)))
(l (cdr lst)))
(if (null? l)
val
(loop (reduce-proc val (map-proc (car l))) (cdr l))))))
(define (reduce-right-map reduce-proc initial map-proc lst)
(if (null? lst)
initial
(let loop ((val (map-proc (car lst)))
(l (cdr lst)))
(if (null? l)
val
(reduce-proc val (loop (map-proc (car l)) (cdr l)))))))
(define (fold fold-proc lst)
(fold* fold-proc '() lst))
(define (fold* fold-proc tail lst)
(let loop ((l lst))
(cond ((null? l) tail)
((pair? l) (fold-proc (car l) (loop (cdr l))))
(else (err 'fold* "Not a proper list: ~S" lst)))))
(define (fold-map fold-proc map-proc lst)
(fold-map* fold-proc '() map-proc lst))
(define (fold-map* fold-proc tail map-proc lst)
(let loop ((l lst))
(cond ((null? l) tail)
((pair? l)
(fold-proc (map-proc (car l))
(loop (cdr l))))
(else (err 'fold-map* "Not a proper list: ~S" lst)))))
(define (fold-reverse fold-proc lst)
(fold-reverse* fold-proc '() lst))
(define (fold-reverse* fold-proc tail lst)
(let loop ((l lst)
(v tail))
(cond ((null? l) v)
((pair? l) (loop (cdr l) (fold-proc (car l) v)))
(else (err 'fold-reverse* "Not a proper list: ~S" lst)))))
(define (fold-reverse-map fold-proc map-proc lst)
(fold-reverse-map* fold-proc '() map-proc lst))
(define (fold-reverse-map* fold-proc tail map-proc lst)
(let loop ((l lst)
(v tail))
(cond ((null? l) v)
((pair? l) (loop (cdr l) (fold-proc (map-proc (car l)) v)))
(else (err 'fold-reverse-map* "Not a proper list: ~S" lst)))))
; $Log: lists.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:35 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:27 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:40 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; eval: (put 'for-all\? 'scheme-indent-hook 1)
; eval: (put 'there-exists\? 'scheme-indent-hook 1)
; End:
@@ -0,0 +1,22 @@
#
# Make the layout compiler
#
$#equate(PRODUCTH)
$#makefile-init()
$#equate(SCMFILES packages.scm dumpit.scm
utils.scm lists.scm strings.scm match.scm layout.scm)
all: ldbcomp $#dummy()
ldbcomp: $(SCMFILES)
$(SCSH) -lm packages.scm -m layout-language -s \
dumpit.scm $@ $#filepath($(SRCDIR) layout ldbcomp ldbcomp.img)
sizes: $#dummy()
clean: $#dummy()
-$(RM) ldbcomp ldbcomp.img
$#clean()
@@ -0,0 +1,137 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/match.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; Simple matcher
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
(define (match? pat x)
(cond ((pair? pat)
((case (car pat)
((quote) match-quote)
((?) match-?)
((*) match-*)
((+) match-+)
((or) match-or)
((and) match-and)
((not) match-not)
(else match-pair))
pat x))
((symbol? pat)
(case pat
((any anything) #T)
((symbol) (symbol? x))
((string) (string? x))
((symbol/string) (or (symbol? x) (string? x))) ; very common
((number) (number? x))
((integer) (integer? x))
((char) (char? x))
((pair) (pair? x))
((list) (list? x))
((boolean) (boolean? x))
((vector) (vector? x))
;; ((record) (record? x))
(else (err 'match "Bad pattern: ~S" pat))))
((procedure? pat) (pat x))
(else (eqv? pat x))))
(define (match-quote pat x)
(equal? (cadr pat) x))
(define (match-? pat x)
(or (and (pair? x)
(match? (cadr pat) (car x))
(match? (cddr pat) (cdr x)))
(match? (cddr pat) x)))
(define (match-* pat x)
(let ((p1 (cadr pat))
(p2 (cddr pat)))
(let loop ((x x))
(or (match? p2 x)
(and (pair? x)
(match? p1 (car x))
(loop (cdr x)))))))
(define (match-+ pat x)
(and (pair? x)
(match? (cadr pat) (car x))
(match-* pat (cdr x))))
(define (match-pair pat x)
(and (pair? x)
(match? (car pat) (car x))
(match? (cdr pat) (cdr x))))
(define (match-or pat x)
(let loop ((l (cdr pat)))
(and (not (null? l))
(or (match? (car l) x)
(loop (cdr l))))))
(define (match-and pat x)
(let loop ((l (cdr pat)))
(or (null? l)
(and (match? (car l) x)
(loop (cdr l))))))
(define (match-not pat x)
(not (match? (cadr pat) x)))
; $Log: match.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:35 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:29 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:40 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,167 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/packages.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; Package definitions for the layout tool.
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
(define-structure utils
(export (defmac :syntax)
(comment :syntax)
(define-constant :syntax)
(define-in-line :syntax)
(define-integrable :syntax)
(when :syntax) (unless :syntax)
set-err-should-exit?
err
make-string-hash-table
make-symbol-hash-table
hash-table/lookup
hash-table/get hash-table/put! hash-table/modify!
hash-table/clear! hash-table/for-each
parse-options
)
;; Eventually weed some of these out...
(open defrec-package
scsh ; order matters
;;signals
;;conditions
;;handle
tables
;;sort
scheme
)
(files utils
))
(define-structure lists
(export last-pair cons*
reverse! reverse*! reverse* append!
map* append-map append-map* append-map! append-map*!
there-exists? for-all?
reduce reduce-right reduce-map reduce-right-map
fold fold* fold-map fold-map*
fold-reverse fold-reverse* fold-reverse-map fold-reverse-map*
)
(open utils
scheme
)
(files lists
))
(define-structure strings
(export string-search-forwards string-ci-search-forwards
string-search-forwards-not string-ci-search-forwards-not
string-search-backwards string-ci-search-backwards
string-search-backwards-not string-ci-search-backwards-not
string-downcase string-downcase!
string-upcase string-upcase!
string-capitalize string-capitalize!
pathname-entry-name pathname-directory-name
pathname-append
pathname-relative?
pathname->list
list->pathname
canonicalize-pathname-list
canonicalize-pathname
symbol-append
encode-integer-in-base
)
(open lists
utils
scheme
)
(files strings
))
(define-structure match (export match?)
(open utils
scheme
)
(files match
))
(define-structure layout-language (export (define-layout :syntax)
(define-layout-macro :syntax)
define-rcs-info
use-layouts
(C-include :syntax)
)
(open match
strings
lists
utils
defrec-package
scsh ; order matters
sort
evaluation ; Ick
environments ; Yuck!
package-commands-internal ; Gag!!
scheme
)
(files layout
))
; This is the package we actually load .ldb files into:
(define-structure user-layouts (export)
(open layout-language
scheme
))
; $Log: packages.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:36 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:31 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:41 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,302 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/strings.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; Strings and pathnames
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
;
; Case
;
(define (string-upcase str)
(let* ((len (string-length str))
(new (make-string len)))
(do ((i (- len 1) (- i 1)))
((< i 0))
(string-set! new i (char-upcase (string-ref str i))))
new))
(define (string-downcase str)
(let* ((len (string-length str))
(new (make-string len)))
(do ((i (- len 1) (- i 1)))
((< i 0))
(string-set! new i (char-downcase (string-ref str i))))
new))
(define (string-upcase! str)
(do ((i (- (string-length str) 1) (- i 1)))
((< i 0))
(string-set! str i (char-upcase (string-ref str i))))
str)
(define (string-downcase! str)
(do ((i (- (string-length str) 1) (- i 1)))
((< i 0))
(string-set! str i (char-downcase (string-ref str i))))
str)
(define (string-capitalize str)
(let* ((len (string-length str))
(new (make-string len)))
(let loop ((i 0)
(last-alpha? #F))
(when (< i len)
(let ((c (string-ref str i)))
(string-set! new i (if last-alpha?
(char-downcase c)
(char-upcase c)))
(loop (+ i 1) (char-alphabetic? c)))))
new))
(define (string-capitalize! str)
(let ((len (string-length str)))
(let loop ((i 0)
(last-alpha? #F))
(when (< i len)
(let ((c (string-ref str i)))
(string-set! str i (if last-alpha?
(char-downcase c)
(char-upcase c)))
(loop (+ i 1) (char-alphabetic? c)))))
str))
;
; Searching
;
; These all assume that you won't pass bogus values of `beg' and `end'.
; It is safe to compare characters using `eq?' in Scheme48...
(define (string-search-forwards chr str beg end)
(let loop ((i beg))
(cond ((>= i end) #F)
((eq? chr (string-ref str i)) i)
(else (loop (+ i 1))))))
(define (string-search-forwards-not chr str beg end)
(let loop ((i beg))
(cond ((>= i end) #F)
((not (eq? chr (string-ref str i))) i)
(else (loop (+ i 1))))))
(define (string-search-backwards chr str beg end)
(let loop ((i (- end 1)))
(cond ((< i beg) #F)
((eq? chr (string-ref str i)) i)
(else (loop (- i 1))))))
(define (string-search-backwards-not chr str beg end)
(let loop ((i (- end 1)))
(cond ((< i beg) #F)
((not (eq? chr (string-ref str i))) i)
(else (loop (- i 1))))))
; And the -ci versions:
(define (string-ci-search-forwards chr str beg end)
(let loop ((i beg))
(cond ((>= i end) #F)
((char-ci=? chr (string-ref str i)) i)
(else (loop (+ i 1))))))
(define (string-ci-search-forwards-not chr str beg end)
(let loop ((i beg))
(cond ((>= i end) #F)
((not (char-ci=? chr (string-ref str i))) i)
(else (loop (+ i 1))))))
(define (string-ci-search-backwards chr str beg end)
(let loop ((i (- end 1)))
(cond ((< i beg) #F)
((char-ci=? chr (string-ref str i)) i)
(else (loop (- i 1))))))
(define (string-ci-search-backwards-not chr str beg end)
(let loop ((i (- end 1)))
(cond ((< i beg) #F)
((not (char-ci=? chr (string-ref str i))) i)
(else (loop (- i 1))))))
;
; Pathnames
;
(define (pathname-entry-name pathname)
(let* ((len (string-length pathname))
(j (string-search-backwards-not #\/ pathname 0 len)))
(if (not j)
"."
(let ((i (string-search-backwards #\/ pathname 0 j)))
(if (not i)
(substring pathname 0 (+ 1 j))
(substring pathname (+ 1 i) (+ 1 j)))))))
(define (pathname-directory-name pathname)
;; Always ends with a "/", both for convenience in concatenation, and so
;; that the root directory has a non-empty name.
(let* ((len (string-length pathname))
(j (string-search-backwards-not #\/ pathname 0 len)))
(if (not j)
"/"
(let ((i (string-search-backwards #\/ pathname 0 j)))
(if (not i)
"./"
(let ((h (string-search-backwards-not #\/ pathname 0 i)))
(if (not h)
"/"
(substring pathname 0 (+ h 2)))))))))
(define (pathname-append pn1 pn2)
(let ((len1 (string-length pn1))
(len2 (string-length pn2)))
(cond ((= 0 len1) pn2)
((= 0 len2) pn1)
((eq? #\/ (string-ref pn2 0)) pn2)
((eq? #\/ (string-ref pn1 (- len1 1)))
(string-append pn1 pn2))
(else (string-append pn1 "/" pn2)))))
(define (pathname-relative? pn)
(or (= 0 (string-length pn))
(not (eq? #\/ (string-ref pn 0)))))
(define (pathname->list pathname)
(let ((end (string-length pathname)))
(if (= 0 end)
'(relative)
(cons (if (eq? #\/ (string-ref pathname 0))
'absolute
'relative)
(let loop ((beg 0))
(let ((i (string-search-forwards-not #\/ pathname beg end)))
(if (not i)
'()
(let ((j (string-search-forwards #\/ pathname i end)))
(if (not j)
(list (substring pathname i end))
(cons (substring pathname i j)
(loop j)))))))))))
(define (list->pathname lst)
(define (process lst)
(if (null? lst)
'()
(cons* "/" (car lst) (process (cdr lst)))))
(case (car lst)
((absolute)
(if (null? (cdr lst))
"/"
(apply string-append (process (cdr lst)))))
((relative)
(if (null? (cdr lst))
"."
(apply string-append (cdr (process (cdr lst))))))
(else (err 'list->pathname "Bad pathname list: ~S" lst))))
(define (canonicalize-pathname-list lst)
(let loop ((l (cdr lst))
(p '())
(r '()))
(cond ((null? l)
(cons (car lst) (append! p (reverse! r))))
((string=? "." (car l))
(loop (cdr l) p r))
((string=? ".." (car l))
(if (null? r)
(loop (cdr l) (cons ".." p) r)
(loop (cdr l) p (cdr r))))
(else
(loop (cdr l) p (cons (car l) r))))))
(define (canonicalize-pathname pathname)
(list->pathname (canonicalize-pathname-list (pathname->list pathname))))
;
; Making things into strings
;
(define (symbol-append . args)
(define (->string arg)
(cond ((string? arg) arg)
((symbol? arg) (symbol->string arg))
((char? arg) (string arg))
((and (integer? arg) (exact? arg))
(number->string arg 10))
(else (err 'symbol-append "Don't know how to use: ~S" arg))))
(string->symbol (apply string-append (map ->string args))))
(define (encode-integer-in-base n base digits)
(define (loop n l)
(if (< n base)
(cons (string-ref digits n) l)
(loop (quotient n base)
(cons (string-ref digits (modulo n base)) l))))
(unless (integer? n)
(err 'encode-integer-in-base "Not an integer: ~S" n))
(unless (and (integer? base) (> base 1))
(err 'encode-integer-in-base "Bad base: ~S" base))
(unless (<= base (string-length digits))
(err 'encode-integer-in-base "Not enough digits for base ~S: ~S"
base digits))
(list->string (if (< n 0)
(cons #\- (loop (- n) '()))
(loop n '()))))
; $Log: strings.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:36 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:33 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:41 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,233 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbcomp/utils.scm,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $
; Utilities for the layout tool.
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
;
; Macrology
;
(define-syntax defmac
(syntax-rules ()
((defmac (name . bvl) def)
(define-syntax name
(syntax-rules ()
((name . bvl) def))))))
(defmac (comment . stuff)
(quote (comment)))
(defmac (define-constant . stuff)
(define . stuff))
(defmac (define-in-line (name . bvl) expr)
(define-syntax name
(syntax-rules ()
((name . bvl) expr))))
(defmac (define-integrable . stuff)
(define . stuff))
(defmac (when test first . rest)
(if test (begin first . rest)))
(defmac (unless test first . rest)
(if (not test) (begin first . rest)))
;
; Errors
;
(define err-should-exit? #F)
(define (set-err-should-exit? flag)
(set! err-should-exit? flag))
(define (err id format-string . format-args)
(format (error-output-port) "layout: ")
(unless (eq? id 'layout)
(format (error-output-port) "~A: " id))
(apply format (error-output-port) format-string format-args)
(cond (err-should-exit?
(newline (error-output-port))
(exit 1))
(else
(apply error format-string format-args))))
;
; (Hash) Tables
;
(define-record hash-table
table
init
)
(define (make-string-hash-table initial-size)
(make-hash-table (make-string-table) make-string-table))
(define (make-symbol-hash-table initial-size)
(make-hash-table (make-symbol-table) make-symbol-table))
(define (hash-table/clear! table)
(set-hash-table:table table ((hash-table:init table))))
(define (hash-table/get table key default)
(let ((cell (table-ref (hash-table:table table) key)))
(if cell (car cell) default)))
(define (hash-table/put! table key value)
(let* ((table (hash-table:table table))
(cell (table-ref table key)))
(if cell
(set-car! cell value)
(table-set! table key (list value)))))
(define (hash-table/modify! table key default proc)
(let* ((table (hash-table:table table))
(cell (table-ref table key)))
(if cell
(set-car! cell (proc (car cell)))
(table-set! table key (list (proc default))))))
(define (hash-table/lookup table key win lose)
(let ((cell (table-ref (hash-table:table table) key)))
(if cell
(win (car cell))
(lose))))
(define (hash-table/for-each table procedure)
(table-walk (lambda (key cell)
(procedure key (car cell)))
(hash-table:table table)))
;
; Operating system interface
;
(define (parse-options args specs)
;; each spec is of the form: ("-foo" <kind> foo)
;; "--" is understood
;; Possible <kind>s:
;; #F or FLAG boolean flag
;; #T or ARG next argument is the value
;; EXEC arguments up to ";" are values
;; (like "find ... -exec ... \;". Yuck!)
(let ((alist (let loop ((alist '())
(specs specs))
(if (null? specs)
alist
(case (cadr (car specs))
((#F flag)
(loop alist (cdr specs)))
((arg #T exec)
(loop (cons (cons (caddr (car specs)) '()) alist)
(cdr specs)))
(else
(err 'parse-options "bad spec: ~S" (car specs))))))))
(define (add prop vals)
(let ((p (assq prop alist)))
(if p
(set-cdr! p (append (cdr p) vals))
(set! alist (cons (cons prop vals) alist)))))
(let loop ((args args))
(if (null? args)
(add 'args '())
(let ((opt (car args)))
(if (and (<= 2 (string-length opt))
(char=? #\- (string-ref opt 0)))
(let ((spec (assoc opt specs)))
(cond (spec
(case (cadr spec)
((#F flag)
(add (caddr spec) '())
(loop (cdr args)))
((#T arg)
(when (null? (cdr args))
(err 'parse-options
"option requires argument: ~A" opt))
(add (caddr spec) (list (cadr args)))
(loop (cddr args)))
((exec)
(let l ((args (cdr args))
(vals '()))
(cond ((null? args)
(err 'parse-options
"missing `;': ~A" opt))
((string=? ";" (car args))
(add (caddr spec) (list (reverse vals)))
(loop (cdr args)))
(else
(l (cdr args) (cons (car args) vals))))))
(else
(err 'parse-options
"unknown option type: ~A" (cadr spec)))))
((string=? opt "--")
(add 'args (cdr args)))
(else
(err 'parse-options "unknown option: ~A" opt))))
(add 'args args)))))
alist))
; $Log: utils.scm,v $
; Revision 1.1.1.1 2001/11/05 17:47:21 tneale
; Tornado shuffle
;
; Revision 1.3 2001/01/19 22:22:36 paul
; Update copyright.
;
; Revision 1.2 1998/02/25 04:54:36 sra
; Update copyrights.
;
; Revision 1.1 1997/09/26 20:14:41 alan
; Initial Revision
;
; Local Variables:
; mode: Scheme
; eval: (put 'hash-table/modify! 'scheme-indent-hook 3)
; eval: (put 'hash-table/lookup 'scheme-indent-hook 2)
; eval: (put 'hash-table/for-each 'scheme-indent-hook 1)
; End:
@@ -0,0 +1,272 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ldbglue.h,v 1.2 2003/01/15 14:00:24 josh Exp $
* Byte manipulation glue macros
*/
/****************************************************************************
*
* *** Restricted Rights Legend ***
*
* The programs and information contained herein are licensed only
* pursuant to a license agreement that contains use, reverse
* engineering, disclosure, and other restrictions; accordingly, it
* is "Unpublished--all rights reserved under the applicable
* copyright laws".
*
* Use duplication, or disclosure by the Government is subject to
* restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Licensed Programs clause of DFARS
* 52.227 7013.
*
* Copyright 2000-2001 Wind River Systems, Inc.
* Copyright 1995-1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
*
* *** Government Use ***
*
* The Licensed Programs and their documentation were developed at
* private expense and no part of them is in the public domain.
*
* The Licensed Programs are "Restricted Computer Software" as that
* term is defined in Clause 52.227-19 of the Federal Acquisition
* Regulations (FAR) and are "Commercial Computer Software" as that
* term is defined in Subpart 227.401 of the Department of Defense
* Federal Acquisition Regulation Supplement (DFARS).
*
* (i) If the licensed Programs are supplied to the Department of
* Defense (DoD), the Licensed Programs are classified as
* "Commercial Computer Software" and the Government is acquiring
* only "restricted rights" in the Licensed Programs and their
* documentation as that term is defined in Clause 52.227
* 7013(c)(1) of the DFARS, and
*
* (ii) If the Licensed Programs are supplied to any unit or agency
* of the United States Government other than DoD, the
* Government's rights in the Licensed Programs and their
* documentation will be as defined in Clause 52.227-19(c)(2) of
* the FAR.
****************************************************************************/
/*
* $Log: ldbglue.h,v $
* Revision 1.2 2003/01/15 14:00:24 josh
* directory structure shifting
*
* Revision 1.1.1.1 2001/11/05 17:47:20 tneale
* Tornado shuffle
*
* Revision 1.12 2001/01/23 01:42:59 paul
* Reworked 'set' macros to avoid evaluating arguments multiple times.
*
* Revision 1.11 2001/01/19 22:22:33 paul
* Update copyright.
*
* Revision 1.10 2000/03/17 00:16:06 meister
* Update copyright message
*
* Revision 1.9 1998/06/08 18:00:42 sra
* Get rid of some lingering <types.h> references.
*
* Revision 1.8 1998/02/25 04:54:04 sra
* Update copyrights.
*
* Revision 1.7 1997/09/26 20:23:39 alan
* Be certain about install.h and types.h
*
* Revision 1.6 1997/06/04 05:46:28 alan
* Fix RCS keywords.
*
* Revision 1.5 1997/06/03 23:02:48 alan
* Fix RCS keywords.
*
* Revision 1.4 1997/05/16 03:47:17 alan
* Add extra casts for bogus compilers.
*
* Revision 1.3 1997/05/14 06:30:56 alan
* Multiple inclusion check.
*
* Revision 1.2 1997/04/22 00:18:34 alan
* Fix copyright.
*
* Revision 1.1 1997/04/19 03:56:16 alan
* Layout glue macros.
*
* Revision 1.2 1997/01/24 22:21:42 alan
* Add extra parens for bogus compilers.
*
* Revision 1.1 1995/08/19 06:35:30 alan
* Add `glue.h' -- generic byte manipulation glue macros
*/
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#define EPILOGUE_LAYOUT_LDBGLUE_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#if (INSTALL_OEM_LAYOUT_GLUE_MACROS + INSTALL_UNALIGNED_BIGENDIAN_LAYOUT_GLUE_MACROS + INSTALL_TYPECHECKING_LAYOUT_GLUE_MACROS) > 1
#error "You can only ask for -one- kind of layout glue macros."
#endif
#if INSTALL_OEM_LAYOUT_GLUE_MACROS
#include <ldbglue.h>
#elif INSTALL_UNALIGNED_BIGENDIAN_LAYOUT_GLUE_MACROS
#error "Need to write unaligned bigendian layout glue macros."
#elif INSTALL_TYPECHECKING_LAYOUT_GLUE_MACROS
#error "Need to write typechecking layout glue macros."
#else /* INSTALL_(generic)_LAYOUT_GLUE_MACROS */
/* Here are the completely generic layout glue macros.
* These should work on -any- hardware.
*/
#define GLUE_CAST_PTR(p) ((bits8_t *) (p))
#define GLUE_CAST08(v) ((ldb_int8_t) (v))
#define GLUE_CAST16(v) ((ldb_int16_t) (v))
#define GLUE_CAST32(v) ((ldb_int32_t) (v))
/* ---- Generic Get ---- */
/* Seemingly redundant parentheses are needed for some buggy compilers
* (irix 5.2). Leave them alone!
*/
#define GLUE_GB08(p) ((ldb_int8_t)((p)[0]))
#define GLUE_GB16(p) ( ((ldb_int16_t)((p)[0]) << 8) \
| ((ldb_int16_t)((p)[1]) ))
#define GLUE_GB32(p) ( ((ldb_int32_t)((p)[0]) << 24) \
| ((ldb_int32_t)((p)[1]) << 16) \
| ((ldb_int32_t)((p)[2]) << 8) \
| ((ldb_int32_t)((p)[3]) ))
#define GLUE_GB32LS24(p) ( ((ldb_int32_t)((p)[1]) << 16) \
| ((ldb_int32_t)((p)[2]) << 8) \
| ((ldb_int32_t)((p)[3]) ))
#define GLUE_GB32MS24(p) ( ((ldb_int32_t)((p)[0]) << 24) \
| ((ldb_int32_t)((p)[1]) << 16) \
| ((ldb_int32_t)((p)[2]) << 8))
#define GLUE_GL08(p) ((ldb_int8_t)((p)[0]))
#define GLUE_GL16(p) ( ((ldb_int16_t)((p)[1]) << 8) \
| ((ldb_int16_t)((p)[0]) ))
#define GLUE_GL32(p) ( ((ldb_int32_t)((p)[3]) << 24) \
| ((ldb_int32_t)((p)[2]) << 16) \
| ((ldb_int32_t)((p)[1]) << 8) \
| ((ldb_int32_t)((p)[0]) ))
#define GLUE_GL32LS24(p) ( ((ldb_int32_t)((p)[2]) << 16) \
| ((ldb_int32_t)((p)[1]) << 8) \
| ((ldb_int32_t)((p)[0]) ))
#define GLUE_GL32MS24(p) ( ((ldb_int32_t)((p)[3]) << 24) \
| ((ldb_int32_t)((p)[2]) << 16) \
| ((ldb_int32_t)((p)[1]) << 8))
/* ---- Generic Set ---- */
/* Seemingly unnecessary casts to bits8_t are needed for some
* buggy compilers (GCC 2.6.3). Leave them alone!
*/
#define GLUE_SB08(p, v) ((p)[0] = ((bits8_t) (v)))
#define GLUE_SB16(p, v) do { \
bits16_t _v_ = (bits16_t)(v); \
(p)[0] = ((bits8_t) ((_v_) >> 8)); \
(p)[1] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SB32(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[0] = ((bits8_t) ((_v_) >> 24)); \
(p)[1] = ((bits8_t) ((_v_) >> 16)); \
(p)[2] = ((bits8_t) ((_v_) >> 8)); \
(p)[3] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SB32LS24(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[1] = ((bits8_t) ((_v_) >> 16)); \
(p)[2] = ((bits8_t) ((_v_) >> 8)); \
(p)[3] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SB32MS24(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[0] = ((bits8_t) ((v) >> 24)); \
(p)[1] = ((bits8_t) ((v) >> 16)); \
(p)[2] = ((bits8_t) ((v) >> 8)); \
} while (0)
#define GLUE_SL08(p, v) ((p)[0] = ((bits8_t) (v)))
#define GLUE_SL16(p, v) do { \
bits16_t _v_ = (bits16_t)(v); \
(p)[1] = ((bits8_t) ((_v_) >> 8)); \
(p)[0] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SL32(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[3] = ((bits8_t) ((_v_) >> 24)); \
(p)[2] = ((bits8_t) ((_v_) >> 16)); \
(p)[1] = ((bits8_t) ((_v_) >> 8)); \
(p)[0] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SL32LS24(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[2] = ((bits8_t) ((_v_) >> 16)); \
(p)[1] = ((bits8_t) ((_v_) >> 8)); \
(p)[0] = ((bits8_t) ((_v_) )); \
} while (0)
#define GLUE_SL32MS24(p, v) do { \
bits32_t _v_ = (bits32_t)(v); \
(p)[3] = ((bits8_t) ((_v_) >> 24)); \
(p)[2] = ((bits8_t) ((_v_) >> 16)); \
(p)[1] = ((bits8_t) ((_v_) >> 8)); \
} while (0)
/* ---- Generic Opaque values ---- */
/* Since the GLUE_OPAQUEnn macros are defined to take bigendian arguments,
* the easiest implementation of opaque values is to just define
* them to be the same as bigendian values!
*/
#define GLUE_GU08 GLUE_GB08
#define GLUE_GU16 GLUE_GB16
#define GLUE_GU32 GLUE_GB32
#define GLUE_GU32LS24 GLUE_GB32LS24
#define GLUE_GU32MS24 GLUE_GB32MS24
#define GLUE_SU08 GLUE_SB08
#define GLUE_SU16 GLUE_SB16
#define GLUE_SU32 GLUE_SB32
#define GLUE_SU32LS24 GLUE_SB32LS24
#define GLUE_SU32MS24 GLUE_SB32MS24
#define GLUE_OPAQUE08(v) (v)
#define GLUE_OPAQUE16(v) (v)
#define GLUE_OPAQUE32(v) (v)
#endif /* INSTALL_(whatever)_LAYOUT_GLUE_MACROS */
#endif /* EPILOGUE_LAYOUT_LDBGLUE_H */
@@ -0,0 +1,55 @@
#
# Top-level makefile for layouts
#
$#equate(LAYOUT_DIRS ldbcomp)
$##make-makefiles($#@($#(LAYOUT_DIRS)))
$#equate(HFILES agentx.h apple.h arp.h bgp.h chaos.h dhcp.h dns.h
ethernet.h ip.h ip6.h netime.h ppp.h rip.h
secure.h tftp.h)
$#equate(LDBCOMP $#filepath(ldbcomp ldbcomp))
$#equate(PRODUCTH)
$#makefile-init()
.SUFFIXES: .ldb
.ldb.h:
$(LDBCOMP) -include-check "EPILOGUE_LAYOUT_" -makeh $@ $*.ldb
all: subdirs $(HFILES) $#objs(test) $#dummy()
subdirs: $#dummy()
$##make-all($#@($#(LAYOUT_DIRS)))
sizes: $#dummy()
$##make-sizes($#@($#(LAYOUT_DIRS)))
clean: $#dummy()
-$(RM) $#objs(test)
$#clean()$##make-clean($#@($#(LAYOUT_DIRS)))
realclean: $#dummy()
-$(RM) $(HFILES)
agentx.h: agentx.ldb
apple.h: apple.ldb
arp.h: arp.ldb
bgp.h: bgp.ldb ip.ldb
chaos.h: chaos.ldb
dhcp.h: dhcp.ldb
dns.h: dns.ldb
ethernet.h: ethernet.ldb
ip.h: ip.ldb
ip6.h: ip6.ldb ip.ldb
netime.h: netime.ldb
ppp.h: ppp.ldb
rip.h: rip.ldb ip.ldb
secure.h: secure.ldb ip.ldb
tftp.h: tftp.ldb
$#objs(test): test.c $#filepath($(SRCDIR) install.h) $#filepath($(SRCDIR) common h types.h) ldbglue.h $(HFILES)
@@ -0,0 +1,33 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: netime.ldb,v 1.1 1998/04/08 17:01:14 wes Exp
*/
#ifndef EPILOGUE_LAYOUT_NETIME_H
#define EPILOGUE_LAYOUT_NETIME_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for NETIME_MESSAGE */
#define SIZEOF_NETIME_MESSAGE (4)
#define PTR_NETIME_MESSAGE_TIMESTAMP(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_NETIME_MESSAGE_TIMESTAMP(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_)))
#define SET_NETIME_MESSAGE_TIMESTAMP(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#endif /* EPILOGUE_LAYOUT_NETIME_H */
@@ -0,0 +1,14 @@
(define-rcs-info "$Id: netime.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout NETIME_MESSAGE
(struct (field TIMESTAMP (unsigned 32))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,202 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: ppp.ldb,v 1.4 1999/08/16 18:53:32 bala Exp
*/
#ifndef EPILOGUE_LAYOUT_PPP_H
#define EPILOGUE_LAYOUT_PPP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for PPP_STRING */
#define SIZEOF_PPP_STRING (1)
#define PTR_PPP_STRING_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_PPP_STRING_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_PPP_STRING_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_PPP_STRING_VALUE(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define SIZEOF_PPP_STRING_VALUE (0)
/* Definitions for PPP_CHAP_HDR */
#define SIZEOF_PPP_CHAP_HDR (4)
#define PTR_PPP_CHAP_HDR_CODE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_PPP_CHAP_HDR_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_PPP_CHAP_HDR_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PPP_CHAP_HDR_CODE_is_CHALLENGE GLUE_CAST08(1L)
#define PPP_CHAP_HDR_CODE_is_RESPONSE GLUE_CAST08(2L)
#define PPP_CHAP_HDR_CODE_is_SUCCESS GLUE_CAST08(3L)
#define PPP_CHAP_HDR_CODE_is_FAILURE GLUE_CAST08(4L)
#define PTR_PPP_CHAP_HDR_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_PPP_CHAP_HDR_ID(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_PPP_CHAP_HDR_ID(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_PPP_CHAP_HDR_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_CHAP_HDR_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_CHAP_HDR_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_PPP_CHAP_HDR_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_PPP_CHAP_HDR_DATA (0)
/* Definitions for PPP_LCP_OPT_AUTH_CHAP */
#define SIZEOF_PPP_LCP_OPT_AUTH_CHAP (5)
#define PTR_PPP_LCP_OPT_AUTH_CHAP_ALGORITHM(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_PPP_LCP_OPT_AUTH_CHAP_ALGORITHM(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_PPP_LCP_OPT_AUTH_CHAP_ALGORITHM(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
#define PPP_LCP_OPT_AUTH_CHAP_ALGORITHM_is_MD5 GLUE_CAST08(5L)
#define PPP_LCP_OPT_AUTH_CHAP_ALGORITHM_is_MSCHAP GLUE_CAST08(128L)
/* Definitions for PPP_PAP_HDR */
#define SIZEOF_PPP_PAP_HDR (4)
#define PTR_PPP_PAP_HDR_CODE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_PPP_PAP_HDR_CODE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_PPP_PAP_HDR_CODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PPP_PAP_HDR_CODE_is_REQUEST GLUE_CAST08(1L)
#define PPP_PAP_HDR_CODE_is_ACK GLUE_CAST08(2L)
#define PPP_PAP_HDR_CODE_is_NAK GLUE_CAST08(3L)
#define PTR_PPP_PAP_HDR_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_PPP_PAP_HDR_ID(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_PPP_PAP_HDR_ID(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_PPP_PAP_HDR_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_PAP_HDR_LENGTH(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_PAP_HDR_LENGTH(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_PPP_PAP_HDR_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_PPP_PAP_HDR_DATA (0)
/* Definitions for PPP_LCP_OPT_AUTH_PAP */
#define SIZEOF_PPP_LCP_OPT_AUTH_PAP (4)
/* Definitions for PPP_LCP_OPT_ACFC */
#define SIZEOF_PPP_LCP_OPT_ACFC (2)
/* Definitions for PPP_LCP_OPT_PFC */
#define SIZEOF_PPP_LCP_OPT_PFC (2)
/* Definitions for PPP_LCP_OPT_MAGIC_NUMBER */
#define SIZEOF_PPP_LCP_OPT_MAGIC_NUMBER (6)
#define PTR_PPP_LCP_OPT_MAGIC_NUMBER_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_LCP_OPT_MAGIC_NUMBER_NUMBER(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_LCP_OPT_MAGIC_NUMBER_NUMBER(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST32(_V_))
/* Definitions for PPP_LCP_OPT_QUALITY */
#define SIZEOF_PPP_LCP_OPT_QUALITY (4)
#define PTR_PPP_LCP_OPT_QUALITY_PROTO(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_LCP_OPT_QUALITY_PROTO(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_LCP_OPT_QUALITY_PROTO(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PPP_LCP_OPT_QUALITY_PROTO_is_LQR GLUE_CAST16(49189L)
#define PTR_PPP_LCP_OPT_QUALITY_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_PPP_LCP_OPT_QUALITY_DATA (0)
/* Definitions for PPP_LCP_OPT_AUTH */
#define SIZEOF_PPP_LCP_OPT_AUTH (4)
#define PTR_PPP_LCP_OPT_AUTH_PROTO(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_LCP_OPT_AUTH_PROTO(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_LCP_OPT_AUTH_PROTO(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PPP_LCP_OPT_AUTH_PROTO_is_PAP GLUE_CAST16(49187L)
#define PPP_LCP_OPT_AUTH_PROTO_is_CHAP GLUE_CAST16(49699L)
#define PTR_PPP_LCP_OPT_AUTH_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_PPP_LCP_OPT_AUTH_DATA (0)
/* Definitions for PPP_LCP_OPT_ACCM */
#define SIZEOF_PPP_LCP_OPT_ACCM (6)
#define PTR_PPP_LCP_OPT_ACCM_ACCM(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_LCP_OPT_ACCM_ACCM(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_LCP_OPT_ACCM_ACCM(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST32(_V_))
/* Definitions for PPP_LCP_OPT_MRU */
#define SIZEOF_PPP_LCP_OPT_MRU (4)
#define PTR_PPP_LCP_OPT_MRU_MRU(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_PPP_LCP_OPT_MRU_MRU(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_PPP_LCP_OPT_MRU_MRU(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
/* Definitions for PPP_LCP_OPT */
#define SIZEOF_PPP_LCP_OPT (2)
#define PTR_PPP_LCP_OPT_TYPE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_PPP_LCP_OPT_TYPE(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_PPP_LCP_OPT_TYPE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PPP_LCP_OPT_TYPE_is_MRU GLUE_CAST08(1L)
#define PPP_LCP_OPT_TYPE_is_ACCM GLUE_CAST08(2L)
#define PPP_LCP_OPT_TYPE_is_AUTH GLUE_CAST08(3L)
#define PPP_LCP_OPT_TYPE_is_QUALITY GLUE_CAST08(4L)
#define PPP_LCP_OPT_TYPE_is_MAGIC_NUMBER GLUE_CAST08(5L)
#define PPP_LCP_OPT_TYPE_is_PFC GLUE_CAST08(7L)
#define PPP_LCP_OPT_TYPE_is_ACFC GLUE_CAST08(8L)
#define PTR_PPP_LCP_OPT_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_PPP_LCP_OPT_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_PPP_LCP_OPT_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_PPP_LCP_OPT_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define SIZEOF_PPP_LCP_OPT_DATA (0)
#endif /* EPILOGUE_LAYOUT_PPP_H */
@@ -0,0 +1,198 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/ppp.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: ppp.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.7 2001/01/19 22:22:33 paul
; Update copyright.
;
; Revision 1.6 2000/10/16 19:21:14 paul
; Restore Bala's new PPP.
;
; Revision 1.5 2000/03/13 21:21:50 paul
; Removed some code that we are no longer working on.
;
; Revision 1.4 1999/08/16 18:53:32 bala
; MSCHAP option value added
;
; Revision 1.3 1998/02/25 15:21:41 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.2 1998/02/25 04:54:06 sra
; Update copyrights.
;
; Revision 1.1 1997/11/18 03:18:34 sra
; Brand new PAP and CHAP code for PPP.
;
(define-rcs-info "$Id: ppp.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
; Eventually this should include all the header definitions
; for PPP, for now it's just the ones I need, primarily PAP and CHAP.
;
; I'm trying a new idiom for nested headers, using (fill (sizeof ...))
; as a form of class inheritance instead of the N-level-deep unions of
; structs that we've used elsewhere. Dunno if it'll work, but if it
; does perhaps it'll be easier to understand.
; LCP option negotiations
(define-layout PPP_LCP_OPT
(struct (size (* 2 8))
(field TYPE (enum (type (unsigned 8))
(value MRU 1)
(value ACCM 2)
(value AUTH 3)
(value QUALITY 4)
(value MAGIC_NUMBER 5)
(value PFC 7)
(value ACFC 8)
))
(field LENGTH (unsigned 8))
(field DATA (struct (size 0)))))
(define-layout PPP_LCP_OPT_MRU
(struct (size (* 4 8))
(fill (sizeof PPP_LCP_OPT))
(field MRU (unsigned 16))))
(define-layout PPP_LCP_OPT_ACCM
(struct (size (* 6 8))
(fill (sizeof PPP_LCP_OPT))
(field ACCM (unsigned 32))))
(define-layout PPP_LCP_OPT_AUTH
(struct (size (* 4 8))
(fill (sizeof PPP_LCP_OPT))
(field PROTO (enum (type (unsigned 16))
(value PAP #xC023)
(value CHAP #xC223)))
(field DATA (struct (size 0)))))
(define-layout PPP_LCP_OPT_QUALITY
(struct (size (* 4 8))
(fill (sizeof PPP_LCP_OPT))
(field PROTO (enum (type (unsigned 16))
(value LQR #xc025)))
(field DATA (struct (size 0)))))
(define-layout PPP_LCP_OPT_MAGIC_NUMBER
(struct (size (* 6 8))
(fill (sizeof PPP_LCP_OPT))
(field NUMBER (unsigned 32))))
(define-layout PPP_LCP_OPT_PFC
(struct (size (* 2 8))
(fill (sizeof PPP_LCP_OPT))))
(define-layout PPP_LCP_OPT_ACFC
(struct (size (* 2 8))
(fill (sizeof PPP_LCP_OPT))))
; Authentication protocol headers
; Password Authentication Protocol (RFC-1334)
(define-layout PPP_LCP_OPT_AUTH_PAP
(struct (size (* 4 8))
(fill (sizeof PPP_LCP_OPT_AUTH))))
(define-layout PPP_PAP_HDR
(struct (size (* 4 8))
(field CODE (enum (type (unsigned 8))
(value REQUEST 1)
(value ACK 2)
(value NAK 3)))
(field ID (unsigned 8))
(field LENGTH (unsigned 16))
(field DATA (struct (size 0)))
; Rest of packet is variable format
))
; Challenge Handshake Authentication Protococl (RFC-1994)
(define-layout PPP_LCP_OPT_AUTH_CHAP
(struct (size (* 5 8))
(fill (sizeof PPP_LCP_OPT_AUTH))
(field ALGORITHM (enum (type (unsigned 8))
(value MD5 5)
(value MSCHAP #x80)))))
(define-layout PPP_CHAP_HDR
(struct (size (* 4 8))
(field CODE (enum (type (unsigned 8))
(value CHALLENGE 1)
(value RESPONSE 2)
(value SUCCESS 3)
(value FAILURE 4)))
(field ID (unsigned 8))
(field LENGTH (unsigned 16))
(field DATA (struct (size 0)))
; Rest of packet is variable format
))
; Random data type
(define-layout PPP_STRING
; This is a bit of a crock, but better than the alternatives.
; To make things even more crockish, the various PPP options
; aren't consistant about whether they use this format or just
; expect you to figure out the length from the packet size.
(struct (size (* 1 8))
(field LENGTH (unsigned 8))
(field VALUE (struct (size 0)))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,137 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: rip.ldb,v 1.7 1998/02/25 15:21:41 sra Exp
* --used --
* Id: ip.ldb,v 1.17 1998/02/25 15:21:40 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_RIP_H
#define EPILOGUE_LAYOUT_RIP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for TRIGGER_RIP_HEADER */
#define SIZEOF_TRIGGER_RIP_HEADER (8)
#define PTR_TRIGGER_RIP_HEADER_VERSION(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_TRIGGER_RIP_HEADER_VERSION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4))
#define SET_TRIGGER_RIP_HEADER_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST08(_V_))
#define PTR_TRIGGER_RIP_HEADER_FLUSH(_P_)\
((GLUE_CAST_PTR(_P_))+(5))
#define GET_TRIGGER_RIP_HEADER_FLUSH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(5))
#define SET_TRIGGER_RIP_HEADER_FLUSH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(5), GLUE_CAST08(_V_))
#define PTR_TRIGGER_RIP_HEADER_SEQUENCE_NUMBER(_P_)\
((GLUE_CAST_PTR(_P_))+(6))
#define GET_TRIGGER_RIP_HEADER_SEQUENCE_NUMBER(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(6))
#define SET_TRIGGER_RIP_HEADER_SEQUENCE_NUMBER(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(6), GLUE_CAST16(_V_))
#define PTR_TRIGGER_RIP_HEADER_ENTRIES(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_TRIGGER_RIP_HEADER_ENTRIES (0)
#define PTR_TRIGGER_RIP_HEADER_ENTRIES_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(8)+(20)*(_X0_))
/* Definitions for RIP_HEADER */
#define SIZEOF_RIP_HEADER (4)
#define PTR_RIP_HEADER_CMD(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_RIP_HEADER_CMD(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_RIP_HEADER_CMD(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define RIP_HEADER_CMD_is_REQUEST GLUE_CAST08(1L)
#define RIP_HEADER_CMD_is_RESPONSE GLUE_CAST08(2L)
#define RIP_HEADER_CMD_is_TRACEON GLUE_CAST08(3L)
#define RIP_HEADER_CMD_is_TRACEOFF GLUE_CAST08(4L)
#define RIP_HEADER_CMD_is_SUN_RESERVED GLUE_CAST08(5L)
#define RIP_HEADER_CMD_is_UPDATE_REQUEST GLUE_CAST08(9L)
#define RIP_HEADER_CMD_is_UPDATE_RESPONSE GLUE_CAST08(10L)
#define RIP_HEADER_CMD_is_UPDATE_ACKNOWLEDGE GLUE_CAST08(11L)
#define PTR_RIP_HEADER_VERSION(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_RIP_HEADER_VERSION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_RIP_HEADER_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_RIP_HEADER_UNUSED(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_RIP_HEADER_UNUSED(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_RIP_HEADER_UNUSED(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_RIP_HEADER_ENTRIES(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_RIP_HEADER_ENTRIES (0)
#define PTR_RIP_HEADER_ENTRIES_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(20)*(_X0_))
/* Definitions for RIP_AUTH_ENTRY */
#define SIZEOF_RIP_AUTH_ENTRY (20)
#define PTR_RIP_AUTH_ENTRY_AUTHENTICATION_TYPE(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_RIP_AUTH_ENTRY_AUTHENTICATION_TYPE(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_RIP_AUTH_ENTRY_AUTHENTICATION_TYPE(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define RIP_AUTH_ENTRY_AUTHENTICATION_TYPE_is_PASSWORD GLUE_CAST16(2L)
#define PTR_RIP_AUTH_ENTRY_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_RIP_AUTH_ENTRY_DATA (16)
#define PTR_RIP_AUTH_ENTRY_DATA_ELT(_P_, _X0_)\
((GLUE_CAST_PTR(_P_))+(4)+(_X0_))
#define GET_RIP_AUTH_ENTRY_DATA_ELT(_P_, _X0_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(4)+(_X0_))
#define SET_RIP_AUTH_ENTRY_DATA_ELT(_P_, _X0_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(4)+(_X0_), GLUE_CAST08(_V_))
/* Definitions for RIP_ENTRY */
#define SIZEOF_RIP_ENTRY (20)
#define PTR_RIP_ENTRY_ADDRESS_FAMILY(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_RIP_ENTRY_ADDRESS_FAMILY(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_RIP_ENTRY_ADDRESS_FAMILY(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define RIP_ENTRY_ADDRESS_FAMILY_is_IP GLUE_CAST16(2L)
#define RIP_ENTRY_ADDRESS_FAMILY_is_AUTHENTICATION GLUE_CAST16(65535L)
#define PTR_RIP_ENTRY_ROUTE_TAG(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_RIP_ENTRY_ROUTE_TAG(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_RIP_ENTRY_ROUTE_TAG(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_RIP_ENTRY_ADDRESS(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define PTR_RIP_ENTRY_MASK(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define PTR_RIP_ENTRY_NEXT_HOP(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define PTR_RIP_ENTRY_METRIC(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_RIP_ENTRY_METRIC(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(16))
#define SET_RIP_ENTRY_METRIC(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
#endif /* EPILOGUE_LAYOUT_RIP_H */
@@ -0,0 +1,140 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/rip.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for RIP
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: rip.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.8 2001/01/19 22:22:34 paul
; Update copyright.
;
; Revision 1.7 1998/02/25 15:21:41 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.6 1998/02/25 04:54:09 sra
; Update copyrights.
;
; Revision 1.5 1998/02/20 04:02:38 sra
; Fix too-long layout macro names.
;
; Revision 1.4 1997/09/26 20:21:16 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.3 1997/06/04 05:46:30 alan
; Fix RCS keywords.
;
; Revision 1.2 1997/06/03 22:59:36 alan
; Use `define-rcs-info'.
;
; Revision 1.1 1997/04/22 00:07:00 alan
; Initial Revision
(define-rcs-info "$Id: rip.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(use-layouts "ip.ldb")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout RIP_ENTRY
(struct (size (* 5 32)) ; error check
(field ADDRESS_FAMILY (enum (type (unsigned 16))
(value IP 2)
(value AUTHENTICATION #xFFFF)))
(field ROUTE_TAG (unsigned 16)) ; MBZ in v1
(field ADDRESS IP_ADDRESS)
(field MASK IP_ADDRESS) ; MBZ in v1
(field NEXT_HOP IP_ADDRESS) ; MBZ in v1
(field METRIC (unsigned 32)) ; 0 .. 16, where 16 = infinity...
))
(define-layout RIP_AUTH_ENTRY
(struct (size (sizeof RIP_ENTRY)) ; error check
(fill 16) ; #xFFFF
(field AUTHENTICATION_TYPE (enum (type (unsigned 16))
(value PASSWORD 2)))
(field DATA (array (count 16) (type (unsigned 8))))
))
(define-layout RIP_HEADER
(struct (size 32) ; error check
(field CMD (enum (type (unsigned 8))
(value REQUEST 1)
(value RESPONSE 2)
(value TRACEON 3) ; obsolete
(value TRACEOFF 4) ; obsolete
(value SUN_RESERVED 5) ; Ask SUN...
;; What happened to 6, 7 & 8?
(value UPDATE_REQUEST 9)
(value UPDATE_RESPONSE 10)
(value UPDATE_ACKNOWLEDGE 11)
))
(field VERSION (unsigned 8))
(field UNUSED (unsigned 16)) ; MBZ in verison 1
(field ENTRIES (array (count 0)
(type RIP_ENTRY)))))
; A TRIGGER_RIP_HEADER is used in the case where the
; COMMAND is one of the UPDATE_* cases. It is defined to include
; the word that contains the plain RIP_HEADER, so that you don't
; have to do any additional pointer gyrations to get at the values
; in the update header.
(define-layout TRIGGER_RIP_HEADER
(struct (size (* 2 32)) ; error check
(fill (sizeof RIP_HEADER))
(field VERSION (unsigned 8))
(field FLUSH (unsigned 8))
(field SEQUENCE_NUMBER (unsigned 16))
(field ENTRIES (array (count 0)
(type RIP_ENTRY)))))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,63 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: secure.ldb,v 1.8 1998/02/25 15:21:42 sra Exp
* --used --
* Id: ip.ldb,v 1.17 1998/02/25 15:21:40 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_SECURE_H
#define EPILOGUE_LAYOUT_SECURE_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for IP_ESP_HEADER */
#define SIZEOF_IP_ESP_HEADER (4)
#define PTR_IP_ESP_HEADER_SPI(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_ESP_HEADER_SPI(_P_)\
GLUE_GU32((GLUE_CAST_PTR(_P_)))
#define SET_IP_ESP_HEADER_SPI(_P_, _V_)\
GLUE_SU32((GLUE_CAST_PTR(_P_)), GLUE_CAST32(_V_))
#define PTR_IP_ESP_HEADER_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define SIZEOF_IP_ESP_HEADER_DATA (0)
/* Definitions for IP_AUTH_HEADER */
#define SIZEOF_IP_AUTH_HEADER (8)
#define PTR_IP_AUTH_HEADER_NEXT_HEADER(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_IP_AUTH_HEADER_NEXT_HEADER(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_)))
#define SET_IP_AUTH_HEADER_NEXT_HEADER(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), GLUE_CAST08(_V_))
#define PTR_IP_AUTH_HEADER_LENGTH(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_IP_AUTH_HEADER_LENGTH(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_IP_AUTH_HEADER_LENGTH(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define PTR_IP_AUTH_HEADER_SPI(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_IP_AUTH_HEADER_SPI(_P_)\
GLUE_GU32((GLUE_CAST_PTR(_P_))+(4))
#define SET_IP_AUTH_HEADER_SPI(_P_, _V_)\
GLUE_SU32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_IP_AUTH_HEADER_DATA(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define SIZEOF_IP_AUTH_HEADER_DATA (0)
#endif /* EPILOGUE_LAYOUT_SECURE_H */
@@ -0,0 +1,108 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/secure.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for IP Security protocols (AH, ESP, ...)
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1996-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: secure.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.9 2001/01/19 22:22:34 paul
; Update copyright.
;
; Revision 1.8 1998/02/25 15:21:42 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.7 1998/02/25 04:54:11 sra
; Update copyrights.
;
; Revision 1.6 1997/09/26 20:21:16 alan
; Use features of new layout compiler: `use-layouts' and `C-include'.
;
; Revision 1.5 1997/06/04 05:46:31 alan
; Fix RCS keywords.
;
; Revision 1.4 1997/06/03 22:59:37 alan
; Use `define-rcs-info'.
;
; Revision 1.3 1997/04/22 20:58:12 alan
; Use `(struct (size 0))' where appropriate.
;
; Revision 1.2 1997/04/22 00:18:35 alan
; Fix copyright.
;
; Revision 1.1 1997/04/19 04:12:17 alan
; Move all .ldb files into the `layout' directory.
;
; Revision 1.1 1996/12/02 22:16:58 alan
; Initial Revision
(define-rcs-info "$Id: secure.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $")
(use-layouts "ip.ldb")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout IP_AUTH_HEADER
(struct (size (* 2 32)) ; error check
(field NEXT_HEADER IP_PROTOCOL)
(field LENGTH (unsigned 8))
(fill 16) ; MBZ
(field SPI (opaque 32)) ; or unsigned?
(field DATA (struct (size 0)))
))
(define-layout IP_ESP_HEADER
(struct (size (* 1 32)) ; error check
(field SPI (opaque 32)) ; or unsigned?
(field DATA (struct (size 0)))
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,142 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
*/
#ifndef EPILOGUE_LAYOUT_SNTP_H
#define EPILOGUE_LAYOUT_SNTP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for SNTP */
#define SIZEOF_SNTP (48)
/* Can't define PTR_SNTP_LEAP_INDICATOR because:
Size 2 is not a multiple of 8. */
#define GET_SNTP_LEAP_INDICATOR(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) >> 6)
#define SET_SNTP_LEAP_INDICATOR(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0xC0L)) | ((GLUE_CAST08(_V_) << 6) & GLUE_CAST08(0xC0L)))
#define SNTP_LEAP_INDICATOR_is_NOWARNING GLUE_CAST08(0L)
#define SNTP_LEAP_INDICATOR_is_61_IN_LAST_MINUTE GLUE_CAST08(1L)
#define SNTP_LEAP_INDICATOR_is_59_IN_LAST_MINUTE GLUE_CAST08(2L)
#define SNTP_LEAP_INDICATOR_is_ALARM GLUE_CAST08(3L)
/* Can't define PTR_SNTP_VERSION because:
Size 3 is not a multiple of 8. */
#define GET_SNTP_VERSION(_P_)\
GLUE_CAST08((GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x38L)) >> 3)
#define SET_SNTP_VERSION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x38L)) | ((GLUE_CAST08(_V_) << 3) & GLUE_CAST08(0x38L)))
/* Can't define PTR_SNTP_MODE because:
Size 3 is not a multiple of 8. */
#define GET_SNTP_MODE(_P_)\
GLUE_CAST08(GLUE_GB08((GLUE_CAST_PTR(_P_))) & GLUE_CAST08(0x7L))
#define SET_SNTP_MODE(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_)), (GLUE_GB08((GLUE_CAST_PTR(_P_))) & ~GLUE_CAST08(0x7L)) | (GLUE_CAST08(_V_) & GLUE_CAST08(0x7L)))
#define SNTP_MODE_is_RESERVED GLUE_CAST08(0L)
#define SNTP_MODE_is_SYMMETRIC_ACTIVE GLUE_CAST08(1L)
#define SNTP_MODE_is_SYMMETRIC_PASSIVE GLUE_CAST08(2L)
#define SNTP_MODE_is_CLIENT GLUE_CAST08(3L)
#define SNTP_MODE_is_SERVER GLUE_CAST08(4L)
#define SNTP_MODE_is_BROADCAST GLUE_CAST08(5L)
#define SNTP_MODE_is_RESERVED_NTP GLUE_CAST08(6L)
#define SNTP_MODE_is_RESERVED_PRIVATE GLUE_CAST08(7L)
#define PTR_SNTP_STRATUM(_P_)\
((GLUE_CAST_PTR(_P_))+(1))
#define GET_SNTP_STRATUM(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(1))
#define SET_SNTP_STRATUM(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(1), GLUE_CAST08(_V_))
#define SNTP_STRATUM_is_UNSPECIFIED GLUE_CAST08(0L)
#define SNTP_STRATUM_is_PRIMARY_REFERENCE GLUE_CAST08(1L)
#define PTR_SNTP_POLL_INTERVAL(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_SNTP_POLL_INTERVAL(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_SNTP_POLL_INTERVAL(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_SNTP_PRECISION(_P_)\
((GLUE_CAST_PTR(_P_))+(3))
#define GET_SNTP_PRECISION(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(3))
#define SET_SNTP_PRECISION(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(3), GLUE_CAST08(_V_))
#define PTR_SNTP_ROOT_DELAY(_P_)\
((GLUE_CAST_PTR(_P_))+(4))
#define GET_SNTP_ROOT_DELAY(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(4))
#define SET_SNTP_ROOT_DELAY(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(4), GLUE_CAST32(_V_))
#define PTR_SNTP_ROOT_DISPERSION(_P_)\
((GLUE_CAST_PTR(_P_))+(8))
#define GET_SNTP_ROOT_DISPERSION(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(8))
#define SET_SNTP_ROOT_DISPERSION(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(8), GLUE_CAST32(_V_))
#define PTR_SNTP_REFERENCE_ID(_P_)\
((GLUE_CAST_PTR(_P_))+(12))
#define GET_SNTP_REFERENCE_ID(_P_)\
GLUE_GU32((GLUE_CAST_PTR(_P_))+(12))
#define SET_SNTP_REFERENCE_ID(_P_, _V_)\
GLUE_SU32((GLUE_CAST_PTR(_P_))+(12), GLUE_CAST32(_V_))
#define PTR_SNTP_REFERENCE_TIMESTAMP_SECONDS(_P_)\
((GLUE_CAST_PTR(_P_))+(16))
#define GET_SNTP_REFERENCE_TIMESTAMP_SECONDS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(16))
#define SET_SNTP_REFERENCE_TIMESTAMP_SECONDS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(16), GLUE_CAST32(_V_))
#define PTR_SNTP_REFERENCE_TIMESTAMP_FRACTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(20))
#define GET_SNTP_REFERENCE_TIMESTAMP_FRACTIONS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(20))
#define SET_SNTP_REFERENCE_TIMESTAMP_FRACTIONS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(20), GLUE_CAST32(_V_))
#define PTR_SNTP_ORIGINATE_TIMESTAMP_SECONDS(_P_)\
((GLUE_CAST_PTR(_P_))+(24))
#define GET_SNTP_ORIGINATE_TIMESTAMP_SECONDS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(24))
#define SET_SNTP_ORIGINATE_TIMESTAMP_SECONDS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(24), GLUE_CAST32(_V_))
#define PTR_SNTP_ORIGINATE_TIMESTAMP_FRACTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(28))
#define GET_SNTP_ORIGINATE_TIMESTAMP_FRACTIONS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(28))
#define SET_SNTP_ORIGINATE_TIMESTAMP_FRACTIONS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(28), GLUE_CAST32(_V_))
#define PTR_SNTP_RECEIVE_TIMESTAMP_SECONDS(_P_)\
((GLUE_CAST_PTR(_P_))+(32))
#define GET_SNTP_RECEIVE_TIMESTAMP_SECONDS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(32))
#define SET_SNTP_RECEIVE_TIMESTAMP_SECONDS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(32), GLUE_CAST32(_V_))
#define PTR_SNTP_RECEIVE_TIMESTAMP_FRACTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(36))
#define GET_SNTP_RECEIVE_TIMESTAMP_FRACTIONS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(36))
#define SET_SNTP_RECEIVE_TIMESTAMP_FRACTIONS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(36), GLUE_CAST32(_V_))
#define PTR_SNTP_TRANSMIT_TIMESTAMP_SECONDS(_P_)\
((GLUE_CAST_PTR(_P_))+(40))
#define GET_SNTP_TRANSMIT_TIMESTAMP_SECONDS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(40))
#define SET_SNTP_TRANSMIT_TIMESTAMP_SECONDS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(40), GLUE_CAST32(_V_))
#define PTR_SNTP_TRANSMIT_TIMESTAMP_FRACTIONS(_P_)\
((GLUE_CAST_PTR(_P_))+(44))
#define GET_SNTP_TRANSMIT_TIMESTAMP_FRACTIONS(_P_)\
GLUE_GB32((GLUE_CAST_PTR(_P_))+(44))
#define SET_SNTP_TRANSMIT_TIMESTAMP_FRACTIONS(_P_, _V_)\
GLUE_SB32((GLUE_CAST_PTR(_P_))+(44), GLUE_CAST32(_V_))
#endif /* EPILOGUE_LAYOUT_SNTP_H */
@@ -0,0 +1,111 @@
; $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/sntp.ldb,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $
; Layout information for SNTP
;****************************************************************************
;
; *** Restricted Rights Legend ***
;
; The programs and information contained herein are licensed only
; pursuant to a license agreement that contains use, reverse
; engineering, disclosure, and other restrictions; accordingly, it
; is "Unpublished--all rights reserved under the applicable
; copyright laws".
;
; Use duplication, or disclosure by the Government is subject to
; restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
; in Technical Data and Computer Licensed Programs clause of DFARS
; 52.227 7013.
;
; Copyright 2000-2001 Wind River Systems, Inc.
; Copyright 1995-1997 Epilogue Technology Corporation.
; Copyright 1998 Integrated Systems, Inc.
; All rights reserved.
;
; *** Government Use ***
;
; The Licensed Programs and their documentation were developed at
; private expense and no part of them is in the public domain.
;
; The Licensed Programs are "Restricted Computer Software" as that
; term is defined in Clause 52.227-19 of the Federal Acquisition
; Regulations (FAR) and are "Commercial Computer Software" as that
; term is defined in Subpart 227.401 of the Department of Defense
; Federal Acquisition Regulation Supplement (DFARS).
;
; (i) If the licensed Programs are supplied to the Department of
; Defense (DoD), the Licensed Programs are classified as
; "Commercial Computer Software" and the Government is acquiring
; only "restricted rights" in the Licensed Programs and their
; documentation as that term is defined in Clause 52.227
; 7013(c)(1) of the DFARS, and
;
; (ii) If the Licensed Programs are supplied to any unit or agency
; of the United States Government other than DoD, the
; Government's rights in the Licensed Programs and their
; documentation will be as defined in Clause 52.227-19(c)(2) of
; the FAR.
;****************************************************************************
; $Log: sntp.ldb,v $
; Revision 1.1.1.1 2001/11/05 17:47:20 tneale
; Tornado shuffle
;
; Revision 1.4 2001/01/19 22:22:34 paul
; Update copyright.
;
; Revision 1.3 1998/02/25 15:21:42 sra
; Finish moving types.h, bug.h, and bugdef.h to common/h/.
;
; Revision 1.2 1998/02/25 04:54:13 sra
; Update copyrights.
;
; Revision 1.1 1998/01/20 22:57:26 mrf
; Initial revision
;
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout SNTP
(struct (align 1)
(field LEAP_INDICATOR (enum (type (unsigned 2))
(value NOWARNING 0)
(value 61_IN_LAST_MINUTE 1)
(value 59_IN_LAST_MINUTE 2)
(value ALARM 3)
))
(field VERSION (unsigned 3))
(field MODE (enum (type (unsigned 3))
(value RESERVED 0)
(value SYMMETRIC_ACTIVE 1)
(value SYMMETRIC_PASSIVE 2)
(value CLIENT 3)
(value SERVER 4)
(value BROADCAST 5)
(value RESERVED_NTP 6)
(value RESERVED_PRIVATE 7)
))
(field STRATUM (enum (type (unsigned 8))
(value UNSPECIFIED 0)
(value PRIMARY_REFERENCE 1)
))
(field POLL_INTERVAL (unsigned 8))
(field PRECISION (unsigned 8))
(field ROOT_DELAY (unsigned 32))
(field ROOT_DISPERSION (unsigned 32))
(field REFERENCE_ID (opaque 32))
(field REFERENCE_TIMESTAMP_SECONDS (unsigned 32))
(field REFERENCE_TIMESTAMP_FRACTIONS (unsigned 32))
(field ORIGINATE_TIMESTAMP_SECONDS (unsigned 32))
(field ORIGINATE_TIMESTAMP_FRACTIONS (unsigned 32))
(field RECEIVE_TIMESTAMP_SECONDS (unsigned 32))
(field RECEIVE_TIMESTAMP_FRACTIONS (unsigned 32))
(field TRANSMIT_TIMESTAMP_SECONDS (unsigned 32))
(field TRANSMIT_TIMESTAMP_FRACTIONS (unsigned 32))
;Optional Authenticator field follows
))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,134 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/layout/test.c,v 1.1.1.1 2001/11/05 17:47:20 tneale Exp $ */
/****************************************************************************
*
* *** Restricted Rights Legend ***
*
* The programs and information contained herein are licensed only
* pursuant to a license agreement that contains use, reverse
* engineering, disclosure, and other restrictions; accordingly, it
* is "Unpublished--all rights reserved under the applicable
* copyright laws".
*
* Use duplication, or disclosure by the Government is subject to
* restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Licensed Programs clause of DFARS
* 52.227 7013.
*
* Copyright 2000-2001 Wind River Systems, Inc.
* Copyright 1997 Epilogue Technology Corporation.
* Copyright 1998 Integrated Systems, Inc.
* All rights reserved.
*
* *** Government Use ***
*
* The Licensed Programs and their documentation were developed at
* private expense and no part of them is in the public domain.
*
* The Licensed Programs are "Restricted Computer Software" as that
* term is defined in Clause 52.227-19 of the Federal Acquisition
* Regulations (FAR) and are "Commercial Computer Software" as that
* term is defined in Subpart 227.401 of the Department of Defense
* Federal Acquisition Regulation Supplement (DFARS).
*
* (i) If the licensed Programs are supplied to the Department of
* Defense (DoD), the Licensed Programs are classified as
* "Commercial Computer Software" and the Government is acquiring
* only "restricted rights" in the Licensed Programs and their
* documentation as that term is defined in Clause 52.227
* 7013(c)(1) of the DFARS, and
*
* (ii) If the Licensed Programs are supplied to any unit or agency
* of the United States Government other than DoD, the
* Government's rights in the Licensed Programs and their
* documentation will be as defined in Clause 52.227-19(c)(2) of
* the FAR.
****************************************************************************/
/*
* Test the .h files generated from .ldb files.
*/
/*
* $Log: test.c,v $
* Revision 1.1.1.1 2001/11/05 17:47:20 tneale
* Tornado shuffle
*
* Revision 1.10 2001/01/19 22:22:34 paul
* Update copyright.
*
* Revision 1.9 2000/03/17 00:16:06 meister
* Update copyright message
*
* Revision 1.8 1998/11/23 20:54:36 wes
* Add layout-macro description for DHCP packets.
*
* Revision 1.7 1998/04/09 21:49:12 wes
* Make netime use layout macros
*
* Revision 1.6 1998/04/08 17:01:13 wes
* Add TFTP layout macros
*
* Revision 1.5 1998/02/25 04:54:15 sra
* Update copyrights.
*
* Revision 1.4 1997/11/18 03:18:35 sra
* Brand new PAP and CHAP code for PPP.
*
* Revision 1.3 1997/10/30 19:29:20 sra
* Silence a silly warning.
*
* Revision 1.2 1997/09/26 20:37:47 alan
* Don't include types.h and ldbglue.h -- let other files pull
* them in...
*
* Revision 1.1 1997/09/10 07:42:37 alan
* I've been using this file myself for a while -- others may find it useful
* in the future.
*
*/
/* Include -all- of the automatically generated .h files.
* This catches bugs like duplicated names,
* and perhaps (in some environments) names that are too long.
* We explicitly do -not- include ldbglue.h, types.h, etc. here
* because we want to make sure that the .h files do it right
* themselves.
*/
#include "agentx.h"
#include "apple.h"
#include "arp.h"
#include "bgp.h"
#include "chaos.h"
#include "dhcp.h"
#include "dns.h"
#include "ethernet.h"
#include "ip.h"
#include "ip6.h"
#include "netime.h"
#include "ppp.h"
#include "rip.h"
#include "secure.h"
#include "tftp.h"
/* Now some test code.
* Currently we are only interested in whether this code compiles.
* Someday, to do a complete test you may have to actually -run-
* the executable.
*/
int
main(int argc, char **argv)
{
bits8_t buffer[1000];
/* Once upon a time, this generated some code that caused certain recent
* versions of GCC (2.6.3 at least) to issue an (incorrect) warning.
* There is a comment in ldbglue.h about this.
* Make sure that never happens again.
*/
SET_ETHERNET_HEADER_TYPE(buffer, ETHERNET_TYPE_is_IPV6);
return 0;
}
@@ -0,0 +1,64 @@
/* This file was automatically generated by Epilogue Technology's
* network datastructure layout tool.
*
* DO NOT MODIFY THIS FILE BY HAND.
*
* Source file information:
* Id: ip6.ldb,v 1.9 1998/02/25 15:21:41 sra Exp
*/
#ifndef EPILOGUE_LAYOUT_TFTP_H
#define EPILOGUE_LAYOUT_TFTP_H
#ifndef EPILOGUE_INSTALL_H
#include <wrn/wm/common/install.h>
#endif
#ifndef EPILOGUE_TYPES_H
#include <wrn/wm/common/types.h>
#endif
#ifndef EPILOGUE_LAYOUT_LDBGLUE_H
#include <wrn/wm/util/layout/ldbglue.h>
#endif
/* Definitions for TFTP_MESSAGE */
#define SIZEOF_TFTP_MESSAGE (4)
#define PTR_TFTP_MESSAGE_OPCODE(_P_)\
((GLUE_CAST_PTR(_P_)))
#define GET_TFTP_MESSAGE_OPCODE(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_)))
#define SET_TFTP_MESSAGE_OPCODE(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_)), GLUE_CAST16(_V_))
#define TFTP_MESSAGE_OPCODE_is_OP_RRQ GLUE_CAST16(1L)
#define TFTP_MESSAGE_OPCODE_is_OP_WRQ GLUE_CAST16(2L)
#define TFTP_MESSAGE_OPCODE_is_OP_DATA GLUE_CAST16(3L)
#define TFTP_MESSAGE_OPCODE_is_OP_ACK GLUE_CAST16(4L)
#define TFTP_MESSAGE_OPCODE_is_OP_ERROR GLUE_CAST16(5L)
#define PTR_TFTP_MESSAGE_FILENAME(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_TFTP_MESSAGE_FILENAME(_P_)\
GLUE_GB08((GLUE_CAST_PTR(_P_))+(2))
#define SET_TFTP_MESSAGE_FILENAME(_P_, _V_)\
GLUE_SB08((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST08(_V_))
#define PTR_TFTP_MESSAGE_BLOCK(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_TFTP_MESSAGE_BLOCK(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_TFTP_MESSAGE_BLOCK(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define PTR_TFTP_MESSAGE_ERROR(_P_)\
((GLUE_CAST_PTR(_P_))+(2))
#define GET_TFTP_MESSAGE_ERROR(_P_)\
GLUE_GB16((GLUE_CAST_PTR(_P_))+(2))
#define SET_TFTP_MESSAGE_ERROR(_P_, _V_)\
GLUE_SB16((GLUE_CAST_PTR(_P_))+(2), GLUE_CAST16(_V_))
#define TFTP_MESSAGE_ERROR_is_ERR_USEMSG GLUE_CAST16(0L)
#define TFTP_MESSAGE_ERROR_is_ERR_NOFILE GLUE_CAST16(1L)
#define TFTP_MESSAGE_ERROR_is_ERR_ACCESS GLUE_CAST16(2L)
#define TFTP_MESSAGE_ERROR_is_ERR_DISKFULL GLUE_CAST16(3L)
#define TFTP_MESSAGE_ERROR_is_ERR_ILLEGALOP GLUE_CAST16(4L)
#define TFTP_MESSAGE_ERROR_is_ERR_BADTID GLUE_CAST16(5L)
#define TFTP_MESSAGE_ERROR_is_ERR_EXISTS GLUE_CAST16(6L)
#define TFTP_MESSAGE_ERROR_is_ERR_NOUSER GLUE_CAST16(7L)
#endif /* EPILOGUE_LAYOUT_TFTP_H */
@@ -0,0 +1,48 @@
(define-rcs-info "$Id: tftp.ldb,v 1.1.1.1 2001/11/05 17:47:21 tneale Exp $")
(C-include EPILOGUE_INSTALL_H <install.h>)
(C-include EPILOGUE_TYPES_H <common/h/types.h>)
(C-include EPILOGUE_LAYOUT_LDBGLUE_H <layout/ldbglue.h>)
(define-layout TFTP_MESSAGE
(union (struct
(field OPCODE (enum (type (unsigned 16))
(value OP_RRQ 1)
(value OP_WRQ 2)
(value OP_DATA 3)
(value OP_ACK 4)
(value OP_ERROR 5)))
)
(struct
;; OP_RRQ/OP_WRQ
(fill 16) ;opcode
(field FILENAME (unsigned 8)) ; well, not really, but....
)
(struct
;; OP_DATA/OP_ACK
(fill 16) ;opcode
(field BLOCK (unsigned 16))
;; followed by data
)
(struct
;; OP_ERROR
(fill 16) ;opcode
(field ERROR (enum (type (unsigned 16))
(value ERR_USEMSG 0)
(value ERR_NOFILE 1)
(value ERR_ACCESS 2)
(value ERR_DISKFULL 3)
(value ERR_ILLEGALOP 4)
(value ERR_BADTID 5)
(value ERR_EXISTS 6)
(value ERR_NOUSER 7)))
;;; rest of packet is error message
)))
; Local Variables:
; mode: Scheme
; End:
@@ -0,0 +1,375 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/attache.h,v 1.3 2003/01/15 14:00:25 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: attache.h,v $
* Revision 1.3 2003/01/15 14:00:25 josh
* directory structure shifting
*
* Revision 1.2 2002/02/26 18:22:52 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.20 2001/01/19 22:22:53 paul
* Update copyright.
*
* Revision 1.19 2000/11/16 21:29:38 paul
* Moved glue_set_deferred_io_handler to sockport.h.
*
* Revision 1.18 2000/10/16 19:21:44 paul
* Restore sockets and mempool code.
*
* Revision 1.17 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 1.16 2000/03/15 19:39:49 paul
* Whoops, we actually needed one of those revs.
*
* Revision 1.15 2000/03/13 21:21:52 paul
* Removed some code that we are no longer working on.
*
* Revision 1.14 1999/06/13 19:38:20 mrf
* Add attache/h/packet.h include for glue function with packet parameter
*
* Revision 1.13 1999/03/31 23:18:40 wes
* Minimal hooks for pool sanity checking..
*
* Revision 1.12 1999/02/18 04:41:25 wes
* Sockets merge: Everything Else
* - memory pools
* - thread support
* - port-specific headers
*
* Revision 1.11.4.3 1999/02/01 23:15:34 paul
* added GLUE_ALLOC_FROM_POOL, GLUE_FREE_TO_POOL
*
* Revision 1.11.4.2 1998/10/22 21:09:55 wes
* Change glue_set_deferred_io_handler prototype; add it to other ports.
* (oops, missed this the other day).
*
* Revision 1.11.4.1 1998/09/23 19:16:56 wes
* Merge socket-branch-1 changes to socket-branch-2
*
* Revision 1.11 1998/09/06 08:11:06 sra
* Packet filtering hooks in Attache, rudimentary firewall
* implementation in Snark.
*
* Revision 1.10 1998/03/12 18:23:43 meister
* GLUE_IPSEC_RCV_SA_NOTUNNEL()
*
* Revision 1.9 1998/03/10 00:36:59 meister
* Added back all my IPSEC glue functions which seem to have disappeared
* when Mrf made her last update.
*
* Revision 1.8 1998/03/03 20:37:52 mrf
* Change GLUE_SNTP_SET_TIME macro to take packet pointer
*
* Revision 1.7 1998/03/03 15:26:16 mrf
* Comment out PRINTF declarations.
*
* Revision 1.6 1998/02/25 04:56:45 sra
* Update copyrights.
*
* Revision 1.5 1998/02/18 22:34:58 sra
* Add ip_loopback(), eradicate glue_pkt_handle().
*
* Revision 1.4 1998/02/13 00:42:46 mrf
* Add conditionalized SNTP Client macro
*
* Revision 1.3 1997/09/15 15:48:26 sra
* GLUE_NOW() migration version skew.
*
* Revision 1.2 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 1.1 1997/08/13 15:17:29 mrf
* added def for MAX_HW_ADDRESS_LEN for ipv6 nd
*
* Revision 1.0 1997/08/08 22:11:10 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.8 1997/08/07 23:01:26 meister
* Added a do-nothing comment to attache.h
*
* Revision 0.7 1997/07/01 04:37:59 mrf
* add commented-out PRINTF definition
*
* Revision 0.6 1997/05/14 06:22:12 sra
* Enable inline byteswapping to silence some warnings.
*
* Revision 0.5 1997/04/15 06:00:14 sra
* Update debugging code, add default TCP timeout handler.
*
* Revision 0.4 1997/03/20 06:57:57 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.2 1996/10/30 04:51:35 sra
* Move glue stuff down to postamble section.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
/* previous revision history when this was netbsd/attache.h
*
* Revision 2.7 1996/10/16 16:44:02 sar
* Added ifndefs around the memory and string functions so we
* don't get compiler warnings.
*
* Revision 2.6 1996/03/22 10:05:39 sra
* Update copyrights prior to Attache 3.2 release.
*
* Revision 2.5 1996/02/13 21:07:54 sra
* Fun with BUG() macros.
*
* Revision 2.4 1995/07/20 11:24:01 sra
* More fun and games with optimized byte swapping.
*
* Revision 2.3 1995/06/28 19:41:56 sra
* Add cookie argument to BUG() macro. Change inline byteswap macros to
* use GCC expression statements.
*
* Revision 2.2 1995/06/27 23:57:33 sra
* Add BUG() definition for testing.
*
* Revision 2.1 1995/06/22 05:29:06 sra
* Preliminary changes for multicast and OSPF.
*
* Revision 2.0 1995/05/10 22:38:15 sra
* Attache release 3.0.
*
* Revision 1.6 1995/05/01 20:59:29 sra
* Have to test CONFIG_PREAMBLE with #ifdef, not #if.
*
* Revision 1.5 1995/01/06 00:52:48 sra
* Update copyright notice for 2.1 release.
*
* Revision 1.4 1994/12/20 22:13:08 sra
* Fix signature for crufty glue_pkt_handle() declaration.
*
* Revision 1.3 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 1.2 1994/09/04 06:13:38 sra
* Clean up antique type names and install macros.
*
* Revision 1.1 1993/07/05 21:54:24 sra
* Initial revision
*
*/
/* comment to test CVS */
#ifdef CONFIG_PREAMBLE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_PACKETS 20
#define IP_MAX_PKTSIZE 1536
#define TCP_MAXCONN 128
#define TCP_DEFAULT_MAX_RETRANSMISSIONS 0
/* include PRINTF definition to enable printing/debugging code
#ifndef PRINTF
#define PRINTF printf
#endif
*/
/*
* Fun with our new run-time debugging facility.
* This is still experimental, and defaults to uninstalled.
*/
#if defined(INSTALL_SNARK_BUG_CONF) && INSTALL_SNARK_BUG_CONF
#include <wrn/wm/util/demo/bug_conf.h>
#endif
/*
* Backwards compatability with old braindamage can be a real pain.
* Since this port file is strictly for debugging, we set a couple
* of configuration parameters to more reasonable values here.
*/
/* Please do install a retransmission timeout handler */
#define TCP_DEFAULT_MAX_RETRANSMISSIONS 0
/* Please buffer a reasonable number of ahead-of-sequence segments */
#define TCP_AHEAD_Q_MAX_DEFAULT 25
/* Maximum hardware address length, in bytes */
#define ATTACHE_MAX_HW_ADDRESS_LEN 6
#else /* CONFIG_PREAMBLE */
#include <wrn/wm/common/install.h>
#include <wrn/wm/attache/packet.h>
#ifndef GLUE_NOW
#define GLUE_NOW() glue_now()
extern bits32_t glue_now (void);
#endif
#ifndef GLUE_ALLOC
#define GLUE_ALLOC(x) ((void *) malloc(x))
#endif
#ifndef GLUE_FREE
#define GLUE_FREE(x) free((char *) (x))
#endif
#define GLUE_CKSUM(x, y) glue_cksum((bits16_t *)(x), (y))
#define GLUE_CALLIN(x, y) glue_callin(x, y)
/* define the GLUE_SNTP_SET_TIME macro if using SNTP Client */
#if INSTALL_ATTACHE_MULTICAST && INSTALL_ATTACHE_SNTP_CLIENT
#ifndef GLUE_SNTP_SET_TIME
#define GLUE_SNTP_SET_TIME(p, s, f) glue_set_time((p),(s),(f))
#endif
#endif
/*
* Fun with optimized ways of swapping bytes in GCC.
*/
#if 1
/*
* "Safe" inline swap expressions using GCC "statement expressions".
* Don't try these unless you're using GCC...
*/
#define GLUE_SWAP32(x) \
({ bits32_t _x_ = (x);\
((((_x_ & 0x000000ff) << 24) & 0xff000000)|\
(((_x_ & 0x0000ff00) << 8) & 0x00ff0000)|\
(((_x_ & 0x00ff0000) >> 8) & 0x0000ff00)|\
(((_x_ & 0xff000000) >> 24) & 0x000000ff)); })
#define GLUE_SWAP16(x) \
({ bits16_t _x_ = (x);\
((((_x_ & 0x00ff) << 8) & 0xff00)|\
(((_x_ & 0xff00) >> 8) & 0x00ff)); })
#else
static __inline__ bits32_t GLUE_SWAP32(bits32_t x)
{
return ((((x & 0x000000ff) << 24) & 0xff000000)|
(((x & 0x0000ff00) << 8) & 0x00ff0000)|
(((x & 0x00ff0000) >> 8) & 0x0000ff00)|
(((x & 0xff000000) >> 24) & 0x000000ff));
}
static __inline__ bits16_t GLUE_SWAP16(bits16_t x)
{
return ((((x & 0x00ff) << 8) & 0xff00)|
(((x & 0xff00) >> 8) & 0x00ff));
}
#endif
extern int glue_intlock (int);
extern bits16_t glue_cksum (bits16_t *, unsigned);
extern void glue_callin (bits32_t, void (*)(void));
extern void glue_set_time(packet *, bits32_t, bits32_t);
#ifndef PRINTF
#define PRINTF printf
#endif
#ifdef ATTACHE_IPSEC_H
#define GLUE_IPSEC_SA_EXPIRED(W,X,Y,Z) \
glue_ipsec_sa_expired(W,X,Y,Z)
extern void glue_ipsec_sa_expired (ipsec_sa_dir_t, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_SND_PKT_DENIED(W,X,Y,Z) \
glue_ipsec_snd_pkt_denied((W),(X),(Y),(Z))
extern void glue_ipsec_snd_pkt_denied(packet *, ipaddr_t *, ipaddr_t *, int);
#define GLUE_IPSEC_RCV_PKT_BADSPI(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_badspi((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_badspi(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_NOTPARTY(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_notparty((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_SA_NOTUNNEL(V,W,X,Y,Z) \
glue_ipsec_rcv_sa_notunnel((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_sa_notunnel(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTIP(U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notip((U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notip(packet *, packet *, ipaddr_t *,
ipaddr_t *, bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTPARTY(S,T,U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notparty((S),(T),(U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_BADAH(V,W,X,Y) \
glue_ipsec_rcv_pkt_badah((V),(W),(X),(Y))
extern void glue_ipsec_rcv_pkt_badah(packet *, ipaddr_t *, ipaddr_t *,
bits32_t);
#define GLUE_IPSEC_RCV_PKT_DENIED(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_denied((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_denied(packet *, ipaddr_t *, ipaddr_t *,
ipsec_policy_flags_t, bits16_t);
#endif /* ATTACHE_IPSEC_H */
/*
* Fun with our new firewall toy. This is experimental and defaults to uninstalled.
*/
#if defined(INSTALL_SNARK_FIREWALL) && INSTALL_SNARK_FIREWALL
#include <wrn/wm/demo/firewall.h>
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,73 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/common.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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:08 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:53 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:46 sra
* Update copyrights.
*
* Revision 1.1 1997/08/21 17:23:45 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
-------------------
*/
/*
* Common definitions for all Epilogue products on 4.4-BSD derived systems.
*/
#ifdef CONFIG_PREAMBLE
#include <string.h>
#ifndef STRICMP
#define STRICMP(x, y) strcasecmp(x, y)
#endif
#ifndef STRNICMP
#define STRNICMP(x, y, z) strncasecmp(x, y, z)
#endif
#else /* CONFIG_PREAMBLE */
#ifndef GLUE_NOW
#define GLUE_NOW() glue_now()
extern bits32_t glue_now (void);
#endif
#ifndef GLUE_SEED_PRNG
#define GLUE_SEED_PRNG(x,y) glue_seed_prng(x,y)
extern unsigned glue_seed_prng(bits8_t *, unsigned);
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,195 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/decorum.h,v 1.3 2003/01/15 14:00:25 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: decorum.h,v $
* Revision 1.3 2003/01/15 14:00:25 josh
* directory structure shifting
*
* Revision 1.2 2002/02/26 18:22:52 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 2.4 2001/01/19 22:22:54 paul
* Update copyright.
*
* Revision 2.3 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 2.2 1998/02/25 04:56:46 sra
* Update copyrights.
*
* Revision 2.1 1998/02/16 21:33:42 josh
* decorum port file now uses epilogue_char_t where appropriate
*
* Revision 2.0 1997/09/11 15:06:30 josh
* updating version numbers for release
*
* Revision 1.0 1997/08/08 22:11:11 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.12 1997/08/07 23:03:46 meister
* added do-nothing comment to decorum.h
*
* Revision 0.11 1997/07/27 19:41:56 alan
* Add ETC_STDIO_WRITE.
*
* Revision 0.10 1997/07/24 21:15:11 alan
* Decorum now has: DECORUM_MAX_PACKET_SIZE, DECORUM_DEFAULT_RECEIVE_BUFLEN
*
* Revision 0.9 1997/07/23 07:10:49 alan
* Add support for ETC_STDIO_LAST_MODIFIED_TIME().
*
* Revision 0.8 1997/07/17 04:46:48 alan
* New in here: DECORUM_ALLOC, DECORUM_FREE
* New conditionalization: INSTALL_DECORUM_PROXY
*
* Revision 0.7 1997/03/20 06:57:58 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.6 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.5 1996/10/29 23:01:55 sar
* added some includes to keep the compilers happy
*
* Revision 0.4 1996/10/28 17:49:31 sar
* added use of decorum_size_t
*
* Revision 0.3 1996/10/27 16:49:10 lowell
* ETC_STDIO_SIZE
*
* Revision 0.3 1996/10/17 18:00:17 sar
* Added read mode for etc stdio
*
* Revision 0.2 1996/10/16 16:44:56 sar
* Added decorum_get_rawtime
*
* Revision 0.1 1996/10/15 17:26:43 sar
* initial version
*
*/
/*
/* [clearcase]
modification history
-------------------
*/
/* do-nothing comment to test CVS */
#if (!defined(decorum_inc))
#define decorum_inc
#include <stdlib.h>
#include <string.h>
#include <wrn/wm/common/types.h>
#include <stdio.h>
#include <unistd.h>
#ifndef DECORUM_ALLOC
#define DECORUM_ALLOC(x) ((void *) malloc(x))
#endif
#ifndef DECORUM_FREE
#define DECORUM_FREE(x) (free((char *) (x)))
#endif
/* This first should be the same as SNMP_MAX_PACKET_SIZE in envoy.h */
#define DECORUM_MAX_PACKET_SIZE (1400)
#define DECORUM_DEFAULT_RECEIVE_BUFLEN (512)
/* needed for OIDC_T definition */
#if INSTALL_DECORUM_PROXY && (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
/* Some input routines, these are provided but may be replaced with
more efficient implentations if desired */
extern sbits16_t decorum_parse_sbits32 (epilogue_char_t *,
epilogue_char_t **,
sbits32_t *);
extern sbits16_t decorum_parse_bits32 (epilogue_char_t *,
epilogue_char_t **,
bits32_t *);
extern sbits16_t decorum_parse_hexstring (epilogue_char_t *,
epilogue_char_t *,
decorum_size_t);
#define ETC_STRING_GET_SBITS32 decorum_parse_sbits32
#define ETC_STRING_GET_BITS32 decorum_parse_bits32
#define ETC_STRING_GET_HEXSTRING decorum_parse_hexstring
/* a routine to output a number to a byte string, used to create
file/stream names */
#define ETC_STDIO_SPRINTF(buf, num, str) sprintf(buf, "%lu%s", num, str)
/* Define the structure that will be used for holding output
until we are done */
typedef FILE etc_stdio_t;
/* Macros for opening, closing and removing a stream */
#define ETC_STDIO_MODE_READ "r"
#define ETC_STDIO_MODE_WRITE "w+"
#define ETC_STDIO_OPEN(fname, how) fopen(fname, how)
#define ETC_STDIO_CLOSE(outstream) fclose(outstream)
#define ETC_STDIO_REMOVE(fname) unlink(fname)
/* READ returns number of bytes read */
#define ETC_STDIO_READ(instream, size, buf) \
fread((buf), 1, (size), (instream))
#define ETC_STDIO_WRITE(outstream, size, buf) \
fwrite((buf), 1, (size), (outstream))
extern bits32_t file_size_32(char * fname);
#define ETC_STDIO_SIZE(fname) (file_size_32(fname))
struct decorum_rawtime;
extern void file_last_modified_time(char *, struct decorum_rawtime *);
#define ETC_STDIO_LAST_MODIFIED_TIME(fname, tvp) \
(file_last_modified_time((fname), (tvp)))
/* Define the base output routines */
extern sbits16_t decorum_put_string (etc_stdio_t *, epilogue_char_t *,
decorum_size_t);
extern sbits16_t decorum_put_sbits32 (etc_stdio_t *, sbits32_t);
extern sbits16_t decorum_put_bits32 (etc_stdio_t *, bits32_t);
extern sbits16_t decorum_put_hex_string (etc_stdio_t *, bits8_t *,
decorum_size_t);
#define ETC_STDIO_PUT_STRING decorum_put_string
#define ETC_STDIO_PUT_SBITS32 decorum_put_sbits32
#define ETC_STDIO_PUT_BITS32 decorum_put_bits32
#define ETC_STDIO_PUT_HEX_STRING decorum_put_hex_string
#if INSTALL_DECORUM_PROXY
/* Define a more complex output routine, this may use the
base routines (as the example code does) or may be more direct */
extern sbits16_t decorum_put_oid (etc_stdio_t *, OIDC_T *, decorum_size_t);
#define ETC_STDIO_PUT_OID decorum_put_oid
#endif /* INSTALL_DECORUM_PROXY */
/* Define a string comparison routine */
#define ETC_STRING_STRCASECMP strcasecmp
/* Define a string length routine */
#define ETC_STRING_STRLEN strlen
/* Define a routine that gets the current time. */
#define DECORUM_GET_RAWTIME(timeval_p) unix_glue_getime ((timeval_p));
/* Define a routine that figgers out how big a buffer to use for a chunk
* of outgoing data. */
#define DECORUM_SENDBUF_LEN(http_sb) (512)
#endif /* #if (!defined(decorum_inc)) */
@@ -0,0 +1,109 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/emissary.h,v 1.3 2003/01/15 14:00:26 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: emissary.h,v $
* Revision 1.3 2003/01/15 14:00:26 josh
* directory structure shifting
*
* Revision 1.2 2002/02/26 18:22:52 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.7 2001/01/19 22:22:54 paul
* Update copyright.
*
* Revision 1.6 2000/10/16 19:21:44 paul
* Restore sockets and mempool code.
*
* Revision 1.5 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 1.4 2000/03/13 21:21:53 paul
* Removed some code that we are no longer working on.
*
* Revision 1.3 1999/04/09 15:43:11 wes
* Call a kludge a kludge..
*
* Revision 1.2 1999/02/18 04:41:25 wes
* Sockets merge: Everything Else
* - memory pools
* - thread support
* - port-specific headers
*
* Revision 1.1.10.2 1998/11/17 20:12:57 wes
* one more SNARK->ATTACHE_THREADS change..
*
* Revision 1.1.10.1 1998/09/23 19:16:57 wes
* Merge socket-branch-1 changes to socket-branch-2
*
* Revision 1.1.8.1 1998/08/19 13:25:51 wes
* Merge sockets-pthreads work to shared branch
*
* Revision 1.1.2.1 1998/08/04 19:47:39 wes
* XXX XXX work around bug in mit-pthreads on NetBSD
*
* Revision 1.1 1998/02/25 04:56:47 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:11 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:57:59 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/file.h>
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <memory.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <limits.h>
#if INSTALL_EMISSARY_THREAD_KLUDGE
/*
* Work around bug in mit-pthreads on NetBSD which requires
* threads library to be inited even if they're not in use..
*/
#include <wrn/wm/common/thread.h>
#define EMISSARY_OS_DEPENDENT_INIT(argc,argv) GLUE_THREAD_INIT()
#endif
@@ -0,0 +1,209 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/envoy.h,v 1.2 2002/02/26 18:22:52 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: envoy.h,v $
* Revision 1.2 2002/02/26 18:22:52 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.11 2001/01/19 22:22:54 paul
* Update copyright.
*
* Revision 1.10 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.9 1998/06/21 21:53:04 sar
* Moved the porting stuff that is common to all of our demos to generic/envoy.h
* and included that file here.
*
* Revision 1.8 1998/06/17 04:58:43 sar
* Restore the 1445 view macos
* Tidy up the rest of the file to bring it in line with the
* other envoy.h files
*
* Revision 1.7 1998/06/07 02:05:34 sar
* Remove attache specific define for ENVOY_NOW, instead we expect
* envoy_now() to be defined, if using attache just make it call
* glue_now().
*
* Revision 1.6 1998/06/03 20:20:19 sar
* Moved nvutils.h to snark/h to allow it to be shared.
* Changed the style for the string routines. They are now hidden
* behind a macro that the user can define. If the user doesn't
* have them they can install them in the common library using makmak
*
* Revision 1.5 1998/05/28 18:39:28 sar
* Added options for v3
*
* Revision 1.4 1998/02/25 04:56:47 sra
* Update copyrights.
*
* Revision 1.3 1997/11/04 00:29:35 sar
* Changed the agentx sub agent timeout period from 10000 (10 seconds)
* which was used for testing to 1000 (1 second).
*
* Revision 1.2 1997/10/22 03:01:21 sar
* Changed ENVOY_MASTER_AGENT to ENVOY_EPI_MASTER for clarity,
*
* Started using ENVOY_AGENTX_MASTER & ENVOY_AGENTX_SUB for better
* granularity
*
* Revision 1.1 1997/10/21 03:00:28 sar
* Added agentx macro defintions
*
* Revision 1.0 1997/08/08 22:11:12 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.5 1997/07/24 21:15:13 alan
* Decorum now has: DECORUM_MAX_PACKET_SIZE, DECORUM_DEFAULT_RECEIVE_BUFLEN
*
* Revision 0.4 1997/03/20 06:57:59 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/03/18 23:30:10 sar
* Made use of glue_now or envoy_now depend on Attache being
* installed.
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
/* previous revision history when this was netbsd/envoy.h
*
* Revision 2.6 1996/10/16 00:10:00 sar
* Corrected proxy_release_private to use a pointer.
*
* Revision 2.5 1996/10/15 20:13:59 sar
* Added declaration for proxy release
*
* Revision 2.4 1996/10/15 17:37:53 sar
* Added proxy release and timer routine definitions.
*
* Revision 2.3 1996/03/22 10:05:39 sra
* Update copyrights prior to Attache 3.2 release.
*
* Revision 2.2 1996/02/27 00:04:18 sar
* removed validate_address, made v2 use validate_community and
* updated partytime to be usectime.
*
* Revision 2.1 1995/05/23 23:22:33 sar
* Added some more lock macros.
*
* Revision 2.0 1995/05/10 22:38:15 sra
* Attache release 3.0.
*
* Revision 1.10 1995/05/03 01:00:11 sar
* Added default envoy timer macros.
*
* Revision 1.9 1995/05/01 21:27:13 sar
* Put ifdef statements around the example lock macros
*
* Revision 1.8 1995/05/01 20:59:29 sra
* Have to test CONFIG_PREAMBLE with #ifdef, not #if.
*
* Revision 1.7 1995/04/26 08:03:12 sra
* Back out to pre-NVutil version until the NVutil changes
* compile correctly in this configuration. Sorry, SAR.
*
* Revision 1.6 1995/03/24 17:01:35 sar
* Updated to have definitions for the nvutils code and the timer code.
*
* Revision 1.5 1995/01/06 00:52:48 sra
* Update copyright notice for 2.1 release.
*
* Revision 1.4 1994/10/20 19:21:21 sar
* Added resetsysuptime and a simple lock scheme to allow the lock code
* to be compiled.
*
* Revision 1.3 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 1.2 1993/08/03 22:03:39 sra
* Don't use defined() to test install options.
*
* Revision 1.1 1993/07/05 21:54:24 sra
* Initial revision
*
*/
/*****************************************************************
This is the platform specific part of envoy.h for use with the
example code. It contains only the platform specific pieces of
the port code. The common porting code is in generic/envoy.h.
In general customers will have one envoy.h file per platform
that combines this file and the platform specific information,
we use two files as there is a lot of shared code between our
demos.
*****************************************************************/
#ifdef CONFIG_PREAMBLE
/*****************************************************************
System Includes:
Envoy uses memcpy(), memset(), and strlen(). The appropriate
include file should be put here to see that these routines are
properly declared. If no such include file exists on the system
then declare memcpy() and memset() here directly. Envoy also
uses min() and max(). Include the system's definition or use the
macros supplied below.
*****************************************************************/
#include <string.h>
/*****************************************************************
Memory allocation routines. Envoy needs to allocate memory to
decode the packet into and also to store the response data
Make sure that the routines used by the SNMP_memory_alloc() and
SNMP_memory_free() macros are declared. If system memory routines
are used (e.g. malloc() and free()) then include the appropriate
system header file here.
*****************************************************************/
/* Get malloc and free declarations */
#include <stdlib.h>
#define SNMP_memory_alloc(need) malloc(need)
#define SNMP_memory_free(buf) free(buf)
#include <wrn/wm/util/port/generic/envoy.h>
#else /* config preamble */
#include <wrn/wm/util/port/generic/envoy.h>
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,48 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/liaison.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: liaison.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:54 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:48 sra
* Update copyrights.
*
* Revision 1.1 1997/11/18 19:59:33 josh
* liaison.h is a dummy file for now, but it will probably have stuff
* in the future
*
*/
/* [clearcase]
modification history
-------------------
*/
#if (!defined(liaison_inc))
#define liaison_inc
#endif /* #if (!defined(liaison_inc)) */
@@ -0,0 +1,61 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: oemtypes.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:54 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.2 1999/05/13 00:31:06 wes
* kludge around some header-ordering issues.
*
* Revision 1.1 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:12 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:00 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* We need to supply size_t. Everything else in <types.h> works on NetBSD.
*/
#include <sys/types.h>
#ifdef __NetBSD__
#include <sys/time.h>
#endif
@@ -0,0 +1,83 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/snark.h,v 1.2 2002/02/27 21:41:34 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: snark.h,v $
* Revision 1.2 2002/02/27 21:41:34 josh
* a little hack for BSD/OS
*
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:55 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.1 1997/08/21 17:23:45 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.0 1997/08/08 22:11:13 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:00 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/03/09 18:37:03 sra
* Add STRICMP().
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <string.h>
#include <stdlib.h>
#ifndef GLUE_ALLOC
#define GLUE_ALLOC(x) ((void *) malloc(x))
#endif
#ifndef GLUE_FREE
#define GLUE_FREE(x) free((char *) (x))
#endif
#ifndef STRICMP
#define STRICMP(x, y) strcasecmp(x, y)
#endif
#ifndef STRNICMP
#define STRNICMP(x, y, z) strncasecmp(x, y, z)
#endif
#if INSTALL_on_bsdos
#define NO_ETHADDR_STRUCT 1
#endif
@@ -0,0 +1,71 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/snmptalk.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: snmptalk.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.5 2001/01/19 22:22:55 paul
* Update copyright.
*
* Revision 1.4 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.3 1998/06/07 02:06:34 sar
* Add include of unistd.h
*
* Revision 1.2 1998/06/03 20:20:20 sar
* Moved nvutils.h to snark/h to allow it to be shared.
* Changed the style for the string routines. They are now hidden
* behind a macro that the user can define. If the user doesn't
* have them they can install them in the common library using makmak
*
* Revision 1.1 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:14 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:01 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
/* defines for nvutils for file manipulation */
#define SNMP_READONLY "r"
#define SNMP_READPLUS "r+"
#define SNMP_WRITEPLUS "w+"
#define SNMP_REMOVE_FILE(fname) unlink(fname)
#include <sys/param.h>
@@ -0,0 +1,152 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/sockport.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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-1999 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: sockport.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.12 2001/05/24 20:35:12 paul
* Include errno.h if needed.
*
* Revision 1.11 2001/05/17 19:10:32 paul
* Added SOCKTABLE_MIN_FD.
*
* Revision 1.10 2001/01/19 22:22:55 paul
* Update copyright.
*
* Revision 1.9 2000/11/16 21:30:04 paul
* Moved glue_set_deferred_io_handler from attache.h.
* Removed stuff that is now defaulted in attache/sockets/sockintl.h.
*
* Revision 1.8 2000/10/16 19:21:45 paul
* Restore sockets and mempool code.
*
* Revision 1.6 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.5 1999/05/14 20:31:19 paul
* Moved send[to]/recv[from] wrappers from sockets.c to socktop.c. Now
* the mainline sockets code only has entry points for sendmsg/recvmsg.
*
* Revision 1.4 1999/05/12 19:03:17 paul
* Added socktable_iterate.
*
* Revision 1.3 1999/03/04 15:43:32 paul
* added sockets_shutdown, socktable_dump
*
* Revision 1.2 1999/02/18 04:41:26 wes
* Sockets merge: Everything Else
* - memory pools
* - thread support
* - port-specific headers
*
* Revision 1.1.4.10 1999/02/05 20:17:24 paul
* Changed DEFAULT_* to SOCK_DFLT_*, moved fallback definitions to sockintl.h.
* Changed SETERROR to SOCK_SET_ERRNO to reduce possibility of name
* collision with customer code.
*
* Revision 1.1.4.9 1999/02/02 23:44:08 wes
* GLUE_ALLOC is Just Wrong(tm) for GLUE_ALLOC_SOCKPIO since the units are
* wrong. use glue_alloc_sockpio() instead.
*
* Revision 1.1.4.8 1999/02/01 23:12:31 paul
* removed GLUE_ALLOC_SOCKPROTO
* added GLUE_ALLOC_SOCKPIO, GLUE_FREE_SOCKPIO
*
* Revision 1.1.4.7 1999/01/29 06:34:21 paul
* 1) Added a new internal API to facilitate calling through a syscall
* interface; these sock_* functions carry an opaque cookie pointer,
* which may be used to for task- or thread-specific data. This cookie
* is passed to the SOCKTABLE functions.
* 2) Added SETERROR; moved errno here from sockets.h.
* 3) Added GLUE_ALLOC_SOCKPROTO (allocate a protocol-specific
* structure).
*
* Revision 1.1.4.6 1999/01/22 19:49:39 paul
* removed GLUE_SOCKALLOC/GLUE_SOCKFREE
*
* Revision 1.1.4.5 1998/11/09 21:43:31 paul
* Added copyright notice.
*
*/
/* [clearcase]
modification history
-------------------
*/
#ifndef _SOCKPORT_H
#define _SOCKPORT_H
#if !INSTALL_ATTACHE_SOCKETS_DEFINE_ERRORS
#include <errno.h>
#endif
extern int errno; /* needs to be per-thread/per-task */
#define SOCK_SET_ERRNO(x) (errno = (x))
void glue_set_deferred_io_handler (void (*first)(void), void (*handler)(void));
#define GLUE_SET_DEFERRED_IO_HANDLER(x,y) glue_set_deferred_io_handler(x,y)
/* Other things you can set here:
*
* If you are using the built-in socket table code:
* SOCKTABLE_MIN_FD
* SOCKTABLE_MAX_FDS
* SOCKTABLE_HASH_BUCKETS
*
* If you are supplying your own socket table code:
* SOCKTABLE_INIT
* SOCKTABLE_LOOKUP
* SOCKTABLE_ADD
* SOCKTABLE_DEL
* SOCKTABLE_ITERATE
* SOCKTABLE_DUMP
*
* If you want to insert your own system-call type interface between
* the user socket library and the real sockets code:
* SOCK_SOCKETS_INIT
* SOCK_SOCKETS_SHUTDOWN
* SOCK_SOCKET
* SOCK_BIND
* SOCK_LISTEN
* SOCK_ACCEPT
* SOCK_CONNECT
* SOCK_GETSOCKNAME
* SOCK_GETPEERNAME
* SOCK_SHUTDOWN
* SOCK_CLOSE
* SOCK_SENDMSG
* SOCK_RECVMSG
* SOCK_SELECT
* SOCK_SETSOCKOPT
* SOCK_GETSOCKOPT
* SOCK_IOCTL
*
* Default parameters for sending and receiving:
* SOCK_DFLT_UDP_SNDBUF
* SOCK_DFLT_TCP_SNDBUF
* SOCK_DFLT_RAW_SNDBUF
* SOCK_DFLT_UDP_RCVBUF
* SOCK_DFLT_TCP_RCVBUF
* SOCK_DFLT_RAW_RCVBUF
* SOCK_DFLT_SNDLOWAT
* SOCK_DFLT_RCVLOWAT
*/
#endif /* _SOCKPORT_H */
@@ -0,0 +1,77 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/telnet.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: telnet.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:22:55 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:50 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:15 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:57:56 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* Use '\n' for local newline convention in both directions.
*/
#define TN_LOCAL_NEWLINE '\n'
/*
* All the windowing stuff for server telnet connections is controlled
* by the sty code, so shunt the decisions off to the sty_tn interface module.
*
* For client telnet connections we're not buffering output, so we just
* return a constant window size.
*/
#define TN_INITIAL_ACTIVE_WINDOW_SIZE (4096)
#define TN_INITIAL_PASSIVE_WINDOW_SIZE (stytn_space_initial)
#define GLUE_TN_WINDOW_SIZE(_tn_) \
(tn_get_flags((_tn_), TN_FLG_ACT_AS_SERVER) \
? stytn_space_left((_tn_)) \
: TN_INITIAL_ACTIVE_WINDOW_SIZE)
extern unsigned stytn_space_initial, stytn_space_left();
@@ -0,0 +1,93 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/bsd44/thdport.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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-1999 Integrated Systems, Inc.
* All rights reserved.
****************************************************************************/
/*
* $Log: thdport.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.9 2001/03/22 16:54:16 paul
* Removed GLUE_COND_TIMEDWAIT().
*
* Revision 1.8 2001/03/20 17:11:15 paul
* Removed unused timeout macros.
*
* Revision 1.7 2001/01/19 22:22:56 paul
* Update copyright.
*
* Revision 1.6 2000/10/16 19:21:45 paul
* Restore sockets and mempool code.
*
* Revision 1.4 2000/03/17 00:08:58 meister
* Update copyright message
*
* Revision 1.3 1999/11/08 19:16:06 paul
* Added copyright.
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <pthread.h>
/* !!! checking return codes here? */
#define GLUE_MUTEX_PRIO_MAX 100
#define GLUE_MUTEX_PRIO_HIGH 80
#define GLUE_MUTEX_PRIO_MID 40
#define GLUE_MUTEX_PRIO_LOW 20
#define GLUE_MUTEX_PRIO_MIN 10
typedef pthread_mutex_t glue_mutex_t;
typedef pthread_cond_t glue_cond_t;
typedef pthread_t glue_thread_t;
#define GLUE_MUTEX_INIT(lock, prio) pthread_mutex_init(lock, NULL)
#define GLUE_MUTEX_INIT_MAGIC(lock) pthread_mutex_init(lock, NULL)
#define GLUE_MUTEX_LOCK(lock, prio) pthread_mutex_lock(lock)
#define GLUE_MUTEX_UNLOCK(lock, prio) pthread_mutex_unlock(lock)
#define GLUE_MUTEX_TRYLOCK(lock, prio) pthread_mutex_trylock(lock)
#define GLUE_MUTEX_DESTROY(lock) pthread_mutex_destroy(lock)
#define GLUE_COND_INIT(cond, mutex) pthread_cond_init(cond, NULL)
#define GLUE_COND_WAIT(cond, mutex) pthread_cond_wait(cond, mutex)
#define GLUE_COND_WAKEUP(cond, mutex) pthread_cond_signal(cond)
#define GLUE_COND_BROADCAST(cond, mutex) pthread_cond_broadcast(cond)
#define GLUE_COND_DESTROY(cond) pthread_cond_destroy(cond)
#define GLUE_THD_SELF() pthread_self()
#define GLUE_THD_YIELD() pthread_yield()
#define GLUE_THD_CREATE(thread, func, arg) pthread_create(thread, NULL, func, arg)
#define GLUE_THD_WAIT(thread) pthread_join(thread, NULL)
#define GLUE_THD_EXIT() pthread_exit(NULL)
#define GLUE_THREAD_INIT() pthread_init()
pthread_key_t debug_state_key;
#define GLUE_THD_COOKIE_INIT(freertn) pthread_key_create (&debug_state_key, freertn);
#define GLUE_THD_COOKIE_GET(y) *(y) = pthread_getspecific(debug_state_key)
#define GLUE_THD_COOKIE_SET(x) pthread_setspecific(debug_state_key, x)
@@ -0,0 +1,73 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/common.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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:08 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:14 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.3 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:46 sra
* Update copyrights.
*
* Revision 1.1 1997/08/21 17:23:45 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
-------------------
*/
/*
* Common definitions for all Epilogue products on 4.4-BSD derived systems.
*/
#ifdef CONFIG_PREAMBLE
#include <string.h>
#ifndef STRICMP
#define STRICMP(x, y) strcasecmp(x, y)
#endif
#ifndef STRNICMP
#define STRNICMP(x, y, z) strncasecmp(x, y, z)
#endif
#else /* CONFIG_PREAMBLE */
#ifndef GLUE_NOW
#define GLUE_NOW() glue_now()
extern bits32_t glue_now (void);
#endif
#ifndef GLUE_SEED_PRNG
#define GLUE_SEED_PRNG(x,y) glue_seed_prng(x,y)
extern unsigned glue_seed_prng(bits8_t *, unsigned);
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,70 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/emissary.h,v 1.1.1.1 2001/11/05 17:47:08 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: emissary.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:08 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:14 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.5 2000/03/17 00:08:56 meister
* Update copyright message
*
* Revision 1.4 2000/03/13 21:21:53 paul
* Removed some code that we are no longer working on.
*
* Revision 1.1 1998/02/25 04:56:47 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:11 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:57:59 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/file.h>
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <memory.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <limits.h>
@@ -0,0 +1,206 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/envoy.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: envoy.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:14 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.10 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.9 1998/06/21 21:53:04 sar
* Moved the porting stuff that is common to all of our demos to generic/envoy.h
* and included that file here.
*
* Revision 1.8 1998/06/17 04:58:43 sar
* Restore the 1445 view macos
* Tidy up the rest of the file to bring it in line with the
* other envoy.h files
*
* Revision 1.7 1998/06/07 02:05:34 sar
* Remove attache specific define for ENVOY_NOW, instead we expect
* envoy_now() to be defined, if using attache just make it call
* glue_now().
*
* Revision 1.6 1998/06/03 20:20:19 sar
* Moved nvutils.h to snark/h to allow it to be shared.
* Changed the style for the string routines. They are now hidden
* behind a macro that the user can define. If the user doesn't
* have them they can install them in the common library using makmak
*
* Revision 1.5 1998/05/28 18:39:28 sar
* Added options for v3
*
* Revision 1.4 1998/02/25 04:56:47 sra
* Update copyrights.
*
* Revision 1.3 1997/11/04 00:29:35 sar
* Changed the agentx sub agent timeout period from 10000 (10 seconds)
* which was used for testing to 1000 (1 second).
*
* Revision 1.2 1997/10/22 03:01:21 sar
* Changed ENVOY_MASTER_AGENT to ENVOY_EPI_MASTER for clarity,
*
* Started using ENVOY_AGENTX_MASTER & ENVOY_AGENTX_SUB for better
* granularity
*
* Revision 1.1 1997/10/21 03:00:28 sar
* Added agentx macro defintions
*
* Revision 1.0 1997/08/08 22:11:12 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.5 1997/07/24 21:15:13 alan
* Decorum now has: DECORUM_MAX_PACKET_SIZE, DECORUM_DEFAULT_RECEIVE_BUFLEN
*
* Revision 0.4 1997/03/20 06:57:59 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/03/18 23:30:10 sar
* Made use of glue_now or envoy_now depend on Attache being
* installed.
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* previous revision history when this was netbsd/envoy.h
*
* Revision 2.6 1996/10/16 00:10:00 sar
* Corrected proxy_release_private to use a pointer.
*
* Revision 2.5 1996/10/15 20:13:59 sar
* Added declaration for proxy release
*
* Revision 2.4 1996/10/15 17:37:53 sar
* Added proxy release and timer routine definitions.
*
* Revision 2.3 1996/03/22 10:05:39 sra
* Update copyrights prior to Attache 3.2 release.
*
* Revision 2.2 1996/02/27 00:04:18 sar
* removed validate_address, made v2 use validate_community and
* updated partytime to be usectime.
*
* Revision 2.1 1995/05/23 23:22:33 sar
* Added some more lock macros.
*
* Revision 2.0 1995/05/10 22:38:15 sra
* Attache release 3.0.
*
* Revision 1.10 1995/05/03 01:00:11 sar
* Added default envoy timer macros.
*
* Revision 1.9 1995/05/01 21:27:13 sar
* Put ifdef statements around the example lock macros
*
* Revision 1.8 1995/05/01 20:59:29 sra
* Have to test CONFIG_PREAMBLE with #ifdef, not #if.
*
* Revision 1.7 1995/04/26 08:03:12 sra
* Back out to pre-NVutil version until the NVutil changes
* compile correctly in this configuration. Sorry, SAR.
*
* Revision 1.6 1995/03/24 17:01:35 sar
* Updated to have definitions for the nvutils code and the timer code.
*
* Revision 1.5 1995/01/06 00:52:48 sra
* Update copyright notice for 2.1 release.
*
* Revision 1.4 1994/10/20 19:21:21 sar
* Added resetsysuptime and a simple lock scheme to allow the lock code
* to be compiled.
*
* Revision 1.3 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 1.2 1993/08/03 22:03:39 sra
* Don't use defined() to test install options.
*
* Revision 1.1 1993/07/05 21:54:24 sra
* Initial revision
*
*/
/* [clearcase]
modification history
-------------------
*/
/*****************************************************************
This is the platform specific part of envoy.h for use with the
example code. It contains only the platform specific pieces of
the port code. The common porting code is in generic/envoy.h.
In general customers will have one envoy.h file per platform
that combines this file and the platform specific information,
we use two files as there is a lot of shared code between our
demos.
*****************************************************************/
#ifdef CONFIG_PREAMBLE
/*****************************************************************
System Includes:
Envoy uses memcpy(), memset(), and strlen(). The appropriate
include file should be put here to see that these routines are
properly declared. If no such include file exists on the system
then declare memcpy() and memset() here directly. Envoy also
uses min() and max(). Include the system's definition or use the
macros supplied below.
*****************************************************************/
#include <string.h>
/*****************************************************************
Memory allocation routines. Envoy needs to allocate memory to
decode the packet into and also to store the response data
Make sure that the routines used by the SNMP_memory_alloc() and
SNMP_memory_free() macros are declared. If system memory routines
are used (e.g. malloc() and free()) then include the appropriate
system header file here.
*****************************************************************/
/* Get malloc and free declarations */
#include <stdlib.h>
#define SNMP_memory_alloc(need) malloc(need)
#define SNMP_memory_free(buf) free(buf)
#include <port/generic/envoy.h>
#else /* config preamble */
#include <port/generic/envoy.h>
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,61 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: oemtypes.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:15 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.3 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.2 1999/05/13 00:31:06 wes
* kludge around some header-ordering issues.
*
* Revision 1.1 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:12 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:00 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* We need to supply size_t. Everything else in <types.h> works on NetBSD.
*/
#include <sys/types.h>
#ifdef __NetBSD__
#include <sys/time.h>
#endif
@@ -0,0 +1,78 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/snark.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: snark.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:15 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.3 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.1 1997/08/21 17:23:45 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.0 1997/08/08 22:11:13 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:00 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/03/09 18:37:03 sra
* Add STRICMP().
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/23 00:18:21 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <string.h>
#include <stdlib.h>
#ifndef GLUE_ALLOC
#define GLUE_ALLOC(x) ((void *) malloc(x))
#endif
#ifndef GLUE_FREE
#define GLUE_FREE(x) free((char *) (x))
#endif
#ifndef STRICMP
#define STRICMP(x, y) strcasecmp(x, y)
#endif
#ifndef STRNICMP
#define STRNICMP(x, y, z) strncasecmp(x, y, z)
#endif
#define NO_ETHADDR_STRUCT 1
@@ -0,0 +1,71 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/cygnusnt/snmptalk.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: snmptalk.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.1 2000/07/10 15:55:15 mrf
* Add configuration for Cygnus NT environment with associated changes.
*
* Revision 1.4 2000/03/17 00:08:57 meister
* Update copyright message
*
* Revision 1.3 1998/06/07 02:06:34 sar
* Add include of unistd.h
*
* Revision 1.2 1998/06/03 20:20:20 sar
* Moved nvutils.h to snark/h to allow it to be shared.
* Changed the style for the string routines. They are now hidden
* behind a macro that the user can define. If the user doesn't
* have them they can install them in the common library using makmak
*
* Revision 1.1 1998/02/25 04:56:49 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:14 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:01 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
/* defines for nvutils for file manipulation */
#define SNMP_READONLY "r"
#define SNMP_READPLUS "r+"
#define SNMP_WRITEPLUS "w+"
#define SNMP_REMOVE_FILE(fname) unlink(fname)
#include <sys/param.h>
@@ -0,0 +1,332 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/envtest/envoy.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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.
****************************************************************************/
/*
* Configuration for Envoy on MSDOS with Attache.
*/
/*
* $Log: envoy.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:56 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:09:53 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:50 sra
* Update copyrights.
*
* Revision 1.1 1997/10/29 01:31:28 sar
* Updated the master agent installation option.
*
* Revision 1.0 1997/08/08 22:11:15 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:09 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 19:57:20 sar
* Initial Version
*
* Revision 7.0 1996/03/18 20:25:57 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.1 1995/11/06 20:05:58 sar
* removed validate_community's dependency on install v1
*
* Revision 6.0 1995/05/31 22:00:34 sra
* Release 6.0.
*
* Revision 5.4 1995/05/22 19:39:49 sar
* Modified the lock code to add some new macros.
*
* Revision 5.3 1995/05/05 22:30:05 sar
* Added some default macros for the timer code.
*
* Revision 5.2 1995/05/01 21:57:42 sar
* Put the example lock macros in an if def block.
*
* Revision 5.1 1994/10/25 20:03:13 sar
* Added some simple lock code for testing and as an example, also
* added a definition for snmpresetsysuptime.
*
* Revision 5.0 1994/05/16 17:24:02 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 17:47:40 sar
* Updated rev to 4.0 and copyright to 93
*
* Revision 1.1 1993/06/09 20:37:06 sar
* Initial revision
*/
/* [clearcase]
modification history
-------------------
*/
#if defined(CONFIG_PREAMBLE)
/*****************************************************************
*
* System Includes:
*
* The SNMP uses memcpy(), memset(), and strlen(). The appropriate
* include file should be put here to see that these routines are
* properly declared. If no such include file exists on the system
* then declare memcpy() and memset() here directly.
*****************************************************************/
/* zortech, watcom and intel 960 don't have a memory.h so away it goes */
#if (!defined(INSTALL_on_ztc) && !defined(INSTALL_on_watcom) && !defined(INSTALL_on_i960))
#include <memory.h>
#endif /* INSTALL_on_ztc */
#include <string.h>
/*****************************************************************
* Memory allocation routines. The SNMP needs to allocate memory to
* decode the packet into and also to store the response data for GET's
* and GET-NEXT's.
*****************************************************************/
/* Fix up mach 386's improper declaration of the mem* routines */
#if defined(INSTALL_on_mach386)
#define MEMCPY(dst, src, n) memcpy((char *)(dst), (char *)(src), n)
#define MEMSET(dst, val, n) memset((char *)(dst), val, n)
#define MEMCMP(dst, src, n) memcmp((char *)(dst), (char *)(src), n)
#endif
/*----------------------------------------------------------------
* Make sure that the routines used by the SNMP_memory_alloc() and
* SNMP_memory_free() macros are declared. If system memory routines
* are used (e.g. malloc() and free()) then include the appropriate
* system header file here.
----------------------------------------------------------------*/
/* The memory allocation macros */
#if defined(INSTALL_on_unix)
extern void *malloc __((unsigned));
extern void free __((void *));
#endif
#if defined(INSTALL_on_msdos)
#include <stdlib.h>
#endif
#define SNMP_memory_alloc(need) malloc(need)
#define SNMP_memory_free(buf) free(buf)
/* Define the maximum packet size this implementation will accept. */
/* There is no hard upper limit. SNMP_MAX_PACKET_SIZE should not be */
/* reduced below the value of SNMP_MIN_PACKET_SIZE. */
#define SNMP_MAX_PACKET_SIZE 1400
#define SNMP_MIN_PACKET_SIZE 484 /* shouldn't change */
/* Say what is the maximum number of components of an object identifer */
/* which we can handle, including those in the instance. */
#define MAX_OID_COUNT 32
#if (INSTALL_ENVOY_SNMP_LOCK)
typedef struct ENVOY_LOCK_S
{
int readers;
int writers;
} ENVOY_LOCK_T;
#endif
#else /* CONFIG_PREAMBLE */
/*
* Here goes all the user exit macro definitions and function declarations
* to match.
*/
/*****************************************************************
*
* The following macro definitions allow access to the user configurable
* part of the SNMP code.
*
*****************************************************************/
/*****************************************************************
* Include any declarations needed for the routines specified below
* by the macros.
*****************************************************************/
extern int validate_SNMP_community __((SNMP_PKT_T *, SNMPADDR_T *,
SNMPADDR_T *));
/*----------------------------------------------------------------
SNMP_validate_community -- Check an operation against the community name.
Parameters:
SNMP_PKT_T *pkt The received packet (decoded format)
SNMPADDR_T *src Source of the packet
SNMPADDR_T *dst Destination of the packet (most likely
the address of the machine on which this
code is running.)
Returns:
This procedure should return 0 if happy with the community string
and 1 if not.
This routine should fill in the packet structure with the mib
view mask associated with the community string.
This routine may hang additional data onto the "private" field of
the packet structure. The user will be given the opportinity to
release that memory via SNMP_release_private().
----------------------------------------------------------------*/
#define SNMP_validate_community(pkt, src, dst) \
validate_SNMP_community(pkt, src, dst)
#if defined(INSTALL_ENVOY_SNMP_VERSION_2)
/* The time routine, this must be defined */
#define SNMP_PARTYTIME (UINT_32_T)0L
#endif /* INSTALL_ENVOY_SNMP_VERSION_2 */
#if (INSTALL_ENVOY_EPI_MASTER)
#define SNMP_RESETSYSUPTIME
#endif
/*----------------------------------------------------------------
SNMP_release_private -- Get rid of a any private data attached to the packet
structure. May be left undefined in which case nothing
is done with the private field when the SNMP packet
structure is freed.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns: Nothing
----------------------------------------------------------------*/
/* #define SNMP_release_private(pkt) release_private(pkt) */
/*----------------------------------------------------------------
SNMP_user_get_encode_buffer -- Allows the user the opportunity to get the
buffer that the SNMP packet will be encoded into.
If not used then leave undefined.
Parameters:
SNMP_PKT_T *pkt The packet being encoded.
unsigned int need The amount of storage needed.
EBUFFER_T *ebuffp The ebuffer to fill in with the actual
buffer.
Returns:
0 successful
1 not successful
----------------------------------------------------------------*/
/* #define SNMP_user_get_encode_buffer(pkt, need, ebuffp) 0 */
/*----------------------------------------------------------------
SNMP_trace_input
SNMP_trace_output
-- for implementing packet tracing through the
SNMP code. If not used then define as nothing.
Parameters:
SNMP_PKT_T *pkt The packet being traced
Returns: Nothing
----------------------------------------------------------------*/
#define SNMP_TRACE_INPUT(pkt)
#define SNMP_TRACE_OUTPUT(pkt)
/*****************************************************************
* The next series of macros are hooks into the processing of SET PDUs.
* For most uses you should be able to leave these undefined.
*****************************************************************/
/*----------------------------------------------------------------
SNMP_validate_set_pdu -- Perform a global validation of a SET PDU.
May be left undefined.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns:
-1 If the PDU is bad and should be rejected with a GEN_ERR.
0 If the PDU is good and normal handling should proceed.
+1 If the PDU is good and this routine has performed all of
the set operations internally.
----------------------------------------------------------------*/
/* #define SNMP_validate_set_pdu(pkt) validate_set_pdu(pkt) */
/*----------------------------------------------------------------
SNMP_user_pre_set -- Perform a global validation of a SET PDU after all of the
test procedures have been called and given the "go ahead".
May be left undefined.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns:
-1 If the PDU is bad and should be rejected with a GEN_ERR.
0 If the PDU is good and normal handling should proceed.
+1 If the PDU is good and this routine has performed all of
the set operations internally.
----------------------------------------------------------------*/
/* #define SNMP_user_pre_set(pkt) user_pre_set(pkt) */
/*----------------------------------------------------------------
SNMP_user_post_set -- Perform any final activities after all of the set
procedures have been called. May be left undefined.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns: Nothing
----------------------------------------------------------------*/
/* #define SNMP_user_post_set(pkt) user_post_set(pkt) */
#if (INSTALL_ENVOY_SNMP_LOCK)
/* Here's a simple example to test the locking code, a lock is 2 uints
one for reading, one for writing. When a routine gets a lock the
value is incremented by 1, when a routine frees a lock it is decremented
by 1. We are allowed multiple readers and 1 writer. This code
won't block so if a lock can't be an error is returned */
#define ENVOY_SNMP_LOCK(name) ENVOY_LOCK_T name = {0, 0}
#define ENVOY_SNMP_LOCK_EXTERN(name) extern ENVOY_LOCK_T name
#define ENVOY_SNMP_INIT_LOCK(name) ((name).readers = 0, (name).writers = 0)
#define ENVOY_SNMP_GET_READ_LOCK(name) \
(((name).writers) ? 1 : ((name).readers++, 0))
#define ENVOY_SNMP_RELEASE_READ_LOCK(name) ((name).readers--)
#define ENVOY_SNMP_GET_WRITE_LOCK(name) \
(((name).readers || (name).writers) ? 1 : ((name).writers++, 0))
#define ENVOY_SNMP_RELEASE_WRITE_LOCK(name) ((name).writers--)
#endif /* (INSTALL_ENVOY_SNMP_LOCK) */
#define ENVOY_CALL_TIMER(T, H)
#define ENVOY_NOW() 0
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,77 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/envtest/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: oemtypes.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:22:56 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:09:53 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:51 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:15 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:09 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 19:57:20 sar
* Initial Version
*
* Revision 7.0 1996/03/18 20:25:57 sar
* Updated rev to 7.0 and copyright to 96
*
* Revision 6.0 1995/05/31 21:51:00 sra
* Release 6.0.
*
* Revision 5.0 1994/05/16 17:24:02 sar
* Updated revision to 5.0 and copyright to include 1994
*
* Revision 4.0 1993/06/24 17:47:40 sar
* Updated rev to 4.0 and copyright to 93
*
* Revision 1.1 1993/06/09 20:37:06 sar
* Initial revision
*/
/* [clearcase]
modification history
-------------------
*/
/* We need to supply size_t. Everything else in <types.h> will
* work fine on with MSDOS compilers.
*/
#if defined(INSTALL_on_unix)
#include <sys/types.h>
#endif
#if defined(INSTALL_on_msdos)
#include <stddef.h>
#endif
@@ -0,0 +1,667 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/generic/envoy.h,v 1.3 2002/05/23 18:51:11 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: envoy.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 15:58:50 tneale
* Update for newest file layout
*
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.10.4.3 2001/09/21 18:30:05 josh
* updating porting files with new information for proxy and
* coexistence
*
* Revision 1.10.4.2 2001/08/24 15:35:19 josh
* add nonvolatile access definitions for proxy and community tables
*
* Revision 1.10.4.1 2001/08/24 14:59:45 josh
* definition for generic (unix) proxy send routine
*
* Revision 1.10 2001/01/19 22:22:57 paul
* Update copyright.
*
* Revision 1.9 2000/06/09 14:57:34 josh
* updating header files to correspond with new installation options and
* new code
*
* Revision 1.8 2000/03/17 00:09:56 meister
* Update copyright message
*
* Revision 1.7 1999/11/10 22:16:33 josh
* adding prototype for envoy_ax_translate_context()
*
* Revision 1.6 1999/10/19 15:15:28 josh
* added NV macros for Notify code
*
* Revision 1.5 1999/05/27 16:16:30 josh
* added context translation userexit, ENVOY_AX_TRANSLATE_CONTEXT
*
* Revision 1.4 1998/07/20 01:49:37 sar
* Add () to the FINISHED and ENVOY_TIME macros
*
* Revision 1.3 1998/07/06 01:06:53 sar
* Add a void to make compilers happy
*
* Revision 1.2 1998/07/01 17:06:55 josh
* include snark/h/bug_conf.h when appropriate
*
* Revision 1.1 1998/06/21 21:48:47 sar
* first revision
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* Fun with our new run-time debugging facility.
* This is still experimental, and defaults to uninstalled.
*/
#if defined(INSTALL_SNARK_BUG_CONF) && INSTALL_SNARK_BUG_CONF
#include <wrn/wm/demo/bug_conf.h>
#endif
/*****************************************************************
This is a generic version of envoy.h for use with the example
code. It contains all the macros and definitions that are
common to all of the demo code. Any platform specific information
should be placed in the platforme specific files. The platform
specific files should include this file twice, once when the
preamble flag is on and once when it isn't.
In general customers will have one envoy.h file per platform
that combines this file and the platform specific information,
we use two files as there is a lot of shared code between our
demos.
*****************************************************************/
#ifdef CONFIG_PREAMBLE
/*****************************************************************
System Includes:
Envoy uses memcpy(), memset(), and strlen(). The appropriate
include file should be put here to see that these routines are
properly declared. If no such include file exists on the system
then declare memcpy() and memset() here directly. Envoy also
uses min() and max(). Include the system's definition or use the
macros supplied below.
If necessary these should be in the platform specific files
*****************************************************************/
/*****************************************************************
Memory allocation routines. Envoy needs to allocate memory to
decode the packet into and also to store the response data
Make sure that the routines used by the SNMP_memory_alloc() and
SNMP_memory_free() macros are declared. If system memory routines
are used (e.g. malloc() and free()) then include the appropriate
system header file here.
If necessary these should be defined in the platform specific files.
*****************************************************************/
/*****************************************************************
Size limitations.
Define the maximum packet size this implementation will accept.
There is no hard upper limit. SNMP_MAX_PACKET_SIZE should not
be reduced below the value of SNMP_MIN_PACKET_SIZE, and
SNMP_MIN_PACKET_SIZE shouldn't be changed.
Also define the maximum number of components for an object identifer
which we should be able to handle, including those in the instance.
The first, MAX, should be the same as DECORUM_MAX_PACKET_SIZE in decorum.h
*****************************************************************/
#define SNMP_MAX_PACKET_SIZE 8192
#define SNMP_MIN_PACKET_SIZE 484
#define MAX_OID_COUNT 32
/*****************************************************************
Demo lock structure. This lock is for testing purposes only.
You will probably want to change this to suit your system.
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_LOCK)
typedef struct ENVOY_LOCK_S
{
int readers;
int writers;
} ENVOY_LOCK_T;
#endif
#else /* config preamble */
/*****************************************************************
The following macro definitions allow access to the user configurable
part of the SNMP code.
Include any declarations needed for the routines specified below
by the macros. Don't put <snmp.h> here because this file is
included by that one.
We start with the more generic macros and then get into macros
required by specific options.
*****************************************************************/
/****************************************************************
SNMP_release_private
Get rid of a any private data attached to the packet
structure. May be left undefined in which case nothing
is done with the private field when the SNMP packet
structure is freed.
proxy_release_private is part of the code for demoing
proxies
Parameters: SNMP_PKT_T *pkt The packet itself
Returns: Nothing
#define SNMP_release_private(pkt) release_private(pkt)
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_PROXY)
extern void proxy_release_private __((SNMP_PKT_T *));
#define SNMP_release_private(pkt) proxy_release_private(pkt)
#endif
/*****************************************************************
SNMP_user_get_encode_buffer
Allows the user the opportunity to get the buffer that the SNMP
packet will be encoded into. If not used then leave undefined.
Parameters:
SNMP_PKT_T *pkt The packet being encoded.
unsigned int need The amount of storage needed.
EBUFFER_T *ebuffp The ebuffer to fill in with the actual
buffer.
Returns:
0 successful
1 not successful
#define SNMP_user_get_encode_buffer(pkt, need, ebuffp) 0
****************************************************************/
/*****************************************************************
SNMP_trace_input
SNMP_trace_output
for implementing packet tracing through the SNMP code.
May not be left undefined but may instead be defined as nothing.
Parameters:
SNMP_PKT_T *pkt The packet being traced
Returns: Nothing
****************************************************************/
#define SNMP_TRACE_INPUT(pkt)
#define SNMP_TRACE_OUTPUT(pkt)
/*****************************************************************
The next series of macros are hooks into the processing of SET PDUs.
For most uses you should be able to leave these undefined.
SNMP_validate_set_pdu -- Perform a global validation of a SET PDU.
SNMP_user_pre_set -- Perform a global validation of a SET PDU
after all of the test procedures have been
called and given the "go ahead".
SNMP_user_post_set -- Perform any final activities after all
the set procedures have been called.
Parameters: SNMP_PKT_T *pkt The packet itself
Returns for SNMP_Validate_set_pdu and SNMP_user_pre_set:
-1 If the PDU is bad and should be rejected with a GEN_ERR.
0 If the PDU is good and normal handling should proceed.
+1 If the PDU is good and this routine has performed all of
the set operations internally.
Returns for SNMP_user_post_set: nothing
#define SNMP_validate_set_pdu(pkt) validate_set_pdu(pkt)
#define SNMP_user_pre_set(pkt) user_pre_set(pkt)
#define SNMP_user_post_set(pkt) user_post_set(pkt)
*****************************************************************/
/*****************************************************************
Timer routines. These connect the Envoy timer routines to the
system. These are required for some of the options.
ENVOY_CALL_TIMER - this routine should cause the system to call
the handler routine in the specified number
of milliseconds.
ENVOY_NOW - this routine returns a clock with millisecond
granularity. If attache is installed it can
be defined to be glue_now. We don't do that
here so that this file can be used by multiple
demos. Instead we define envoy_now() which
may be the real function or may simply be a shim.
*****************************************************************/
extern void envoy_call_timer __((bits32_t, void (*)(void)));
#define ENVOY_CALL_TIMER(T, H) envoy_call_timer(T, H)
extern bits32_t envoy_now __((void));
#define ENVOY_NOW() envoy_now()
/******************************************************************
SNMP_validate_community
Check an operation against the community name. If the community
is accepted this routine must set the view mask, number or name
(depending on the view scheme in use) and attach the source and
destination addresses to the packet. It may attach proxy information
to the packet or choose a non-default mib tree for use with the
give community.
This routine may hang additional data onto the "private" field of
the packet structure. The user will be given the opportinity to
release that memory via SNMP_release_private().
Parameters:
SNMP_PKT_T *pkt The received packet (decoded format)
SNMPADDR_T *src Source of the packet
SNMPADDR_T *dst Destination of the packet (most likely
the address of the machine on which this
code is running.)
Returns:
0 - community is ok and processing should continue
1 - community isn't okay, drop the packet, any stats have been updated
2 - community isn't okay, drop the packet, update BadCommunityNames
3 - community isn't okay, drop the packet, update BadCommunityUses
*****************************************************************/
extern int validate_SNMP_community __((SNMP_PKT_T *,
SNMPADDR_T *,
SNMPADDR_T *));
#define SNMP_validate_community(p, s, d) validate_SNMP_community(p, s, d)
/*****************************************************************
The following are a series of macros that will connect the method
routines we supplied for the RFC1445 or RFC2275 view schemes to
your non-volatile storage areas. You should consult the manuals
for more information about these macros.
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
#include <wrn/wm/demo/nvutils.h>
#define SNMP_VIEW_CREATE_TEST(PKT, NEW) SNMP_NV_View_Add_Mod(NEW, 0)
#define SNMP_VIEW_UPDATE_TEST(PKT, OLD, NEW) SNMP_NV_View_Add_Mod(NEW, 0)
#define SNMP_VIEW_DESTROY_TEST(PKT, OLD) SNMP_NV_View_Add_Mod(OLD, 1)
#define SNMP_VIEW_BACKOUT_HOOK(NEW) SNMP_NV_Clean()
#define SNMP_VIEW_CREATE_UNDO(NEW) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_UPDATE_UNDO(OLD, NEW) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_DESTROY_UNDO(OLD) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_DESTROY_BACKOUT(OLD) SNMP_NV_Clean()
#define SNMP_VIEW_FINISHED SNMP_NV_Doit()
#endif /* #if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS) */
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
#include <wrn/wm/demo/nvutils.h>
#define SNMP_VIEW_2275_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_View_2275_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_VIEW_2275_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_View_2275_Add_Mod(CUR, NEW, 0)
#define SNMP_VIEW_2275_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_View_2275_Add_Mod(CUR, NEW, 0)
#define SNMP_VIEW_2275_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_VIEW_2275_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_VIEW_2275_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_VIEW_2275_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_2275_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_2275_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_2275_FINISHED() SNMP_NV_Doit()
#endif /* #if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS) */
/*****************************************************************
If version 3 is installed we may need the following macros.
ENVOY_TIME - returns a clock with a granularity of seconds
PARAMETERS: none
returns: bits32_t
SNMP_validate_address
This routine gives the user a chance to examine the address
information as well as most of the packet itself before a v3
packet is processed. The routine must attach the address
information to the packet. It may attach a non-default mib
tree if desired. Note: in some error cases the packet will
not be decoded when this routine is called.
Parameters:
SNMP_PKT_T *pkt The received packet (decoded format)
SNMPADDR_T *src Source of the packet
SNMPADDR_T *dst Destination of the packet (most likely
the address of the machine on which this
code is running.)
returns:
0 - ok
1 - failure, drop the packet
Lastly are are a series of macros that will connect the method
routines we supplied for the v3 tables to your non-volatile
storage areas. You should consult the manuals for more information
about these macros.
*****************************************************************/
#if INSTALL_ENVOY_SNMP_VERSION_3
#include <wrn/wm/demo/nvutils.h>
extern long time(long *);
#define ENVOY_TIME() (time((long *) 0))
extern int validate_SNMP_V3_address __((SNMP_PKT_T *,
SNMPADDR_T *,
SNMPADDR_T *));
#define SNMP_validate_address(p, s, d) validate_SNMP_V3_address(p, s, d)
#define SNMP_V3_GROUP_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Group_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_GROUP_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Group_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_GROUP_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Group_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_GROUP_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_GROUP_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_GROUP_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_GROUP_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_GROUP_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_GROUP_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_GROUP_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_ACCESS_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Access_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_ACCESS_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Access_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_ACCESS_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Access_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_ACCESS_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_ACCESS_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_ACCESS_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_ACCESS_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_ACCESS_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_ACCESS_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_ACCESS_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_USER_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_User_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_USER_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_User_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_USER_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_User_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_USER_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_USER_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_USER_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_USER_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_USER_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_USER_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_USER_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_TADDR_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TAddr_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_TADDR_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TAddr_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_TADDR_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TAddr_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_TADDR_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TADDR_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TADDR_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TADDR_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TADDR_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TADDR_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TADDR_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_TPARAM_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TParam_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_TPARAM_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TParam_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_TPARAM_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_TParam_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_TPARAM_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TPARAM_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TPARAM_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_TPARAM_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TPARAM_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TPARAM_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_TPARAM_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_NOTIFY_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Notify_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_NOTIFY_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Notify_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NOTIFY_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Notify_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NOTIFY_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NOTIFY_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NOTIFY_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NOTIFY_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NOTIFY_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NOTIFY_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NOTIFY_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_NPROF_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NProf_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_NPROF_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NProf_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NPROF_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NProf_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NPROF_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NPROF_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NPROF_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NPROF_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NPROF_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NPROF_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NPROF_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_NFILT_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NFilt_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_NFILT_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NFilt_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NFILT_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_NFilt_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_NFILT_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NFILT_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NFILT_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_NFILT_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NFILT_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NFILT_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_NFILT_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_PROXY_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Proxy_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_PROXY_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Proxy_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_PROXY_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_V3_Proxy_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_PROXY_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_PROXY_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_PROXY_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_PROXY_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_PROXY_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_PROXY_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_PROXY_FINISHED() SNMP_NV_Doit()
#define SNMP_V3_COMM_DESTROY_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_Community_Add_Mod(CUR, NEW, NV_MOD_DESTROY)
#define SNMP_V3_COMM_CREATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_Community_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_COMM_UPDATE_TEST(PKT, VBP, CUR, NEW) \
SNMP_NV_Community_Add_Mod(CUR, NEW, 0)
#define SNMP_V3_COMM_DESTROY_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_COMM_CREATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_COMM_UPDATE_BACKOUT(CUR, NEW) SNMP_NV_Clean()
#define SNMP_V3_COMM_CREATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_COMM_UPDATE_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_COMM_DESTROY_UNDO(PKT, VBP, CUR, SAV) (SNMP_NV_Clean(), 0)
#define SNMP_V3_COMM_FINISHED() SNMP_NV_Doit()
#if INSTALL_ENVOY_SNMP_V3_PROXY
#if INSTALL_ATTACHE
void envoy_snmp_send_proxy __((SNMPADDR_T *, SNMPADDR_T *,
PTR_T, ALENGTH_T));
#define ENVOY_SNMP_SEND_PROXY(FOR, LOC, PKT, SIZ) \
envoy_snmp_send_proxy((FOR), (LOC), (PKT), (SIZ))
#endif
#endif /* #if INSTALL_ENVOY_SNMP_V3_PROXY */
#endif /* #if INSTALL_ENVOY_SNMP_VERSION_3 */
/*****************************************************************
If usec is installed we may need the following macros.
NOTE WELL: usec was an experimental protocol for providing security
to snmp. It has been superseeded by v3. It should not be used and
will be removed in a future release.
SNMP_USECTIME - returns a clock with a granularity of seconds
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_VERSION_USEC)
typedef long USECTIME_T;
extern long time(long *);
#define SNMP_USECTIME ((USECTIME_T)time((long *)0))
#endif /* INSTALL_ENVOY_SNMP_VERSION_USEC */
/*****************************************************************
A macro for use with the epilogue master agent.
*****************************************************************/
#if (INSTALL_ENVOY_EPI_MASTER)
#define SNMP_RESETSYSUPTIME
#endif
#if (INSTALL_ENVOY_AGENTX_MASTER) || (INSTALL_ENVOY_ENTITY_MIB)
extern bits32_t envoy_get_sysuptime(void);
#define ENVOY_GET_SYSUPTIME(CON) envoy_get_sysuptime()
#endif /* #if (INSTALL_ENVOY_AGENTX_MASTER) || (INSTALL_ENVOY_ENTITY_MIB) */
/*****************************************************************
AgentX routines and macros for the master
Defaults are fine for the following macros:
#define ENVOY_AX_DEFAULT_TIMEOUT 1
#define ENVOY_AX_FIND_MIB(CONTEXT) (EBufferUsed(CONTEXT) ? 0 : &mib_root_node)
#define ENVOY_AX_MA_AC_ADD(PKTP, MIBROOT) GEN_ERR
#define ENVOY_AX_MA_AC_REMOVE(PKTP, MIBROOT) GEN_ERR
#define ENVOY_AX_MA_AC_CLEAN(SESS_ID)
*****************************************************************/
#if INSTALL_ENVOY_AGENTX_MASTER
extern sbits32_t envoy_ax_transport_type(ptr_t);
extern int envoy_ax_transport_string(ptr_t, ALENGTH_T *,
bits8_t **, int *);
extern void envoy_ax_translate_context(SNMP_PKT_T *pktp,
struct ENVOY_AX_PKT_S *query_pkt);
#define ENVOY_AX_TRANSPORT_TYPE(COOKIE) envoy_ax_transport_type(COOKIE)
#define ENVOY_AX_TRANSPORT_STRING(COOKIE, NEED, BUF, DYN) \
envoy_ax_transport_string(COOKIE, NEED, BUF, DYN)
#define ENVOY_AX_TRANSPORTS_SUPPORTED {0}
#define ENVOY_AX_TRANSLATE_CONTEXT(PKT, AX_PKT) \
envoy_ax_translate_context(PKT, AX_PKT)
#endif /* #if INSTALL_ENVOY_AGENTX_MASTER */
/*****************************************************************
AgentX routines and macros for the sub agent
Defaults are fine for the following macros:
#define ENVOY_AX_SA_MIB_ROOT_NODE(CKE, PKT) 0
#define ENVOY_AX_SA_TIMEOUT 1000
*****************************************************************/
/*****************************************************************
Lock Test Code:
The following macros define a simple example to test the locking
code. NOTE WELL: this code doesn't block and so is not acceptable
for use as the locking code, it is only here for test purposes.
A lock is 2 uints one for reading and one for writing. When a
routine gets a lock the value is incremented by 1, when a routine
frees a lock it is decremented by 1. We are allowing multiple
readers and one writer. As this code can't block we simply return
an error if we can't get a lock, real locking code must block in
that case.
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_LOCK)
#define ENVOY_SNMP_LOCK(name) ENVOY_LOCK_T name = {0, 0}
#define ENVOY_SNMP_LOCK_EXTERN(name) extern ENVOY_LOCK_T name
#define ENVOY_SNMP_INIT_LOCK(name) ((name).readers = 0, (name).writers = 0)
#define ENVOY_SNMP_GET_READ_LOCK(name) \
(((name).writers) ? 1 : ((name).readers++, 0))
#define ENVOY_SNMP_RELEASE_READ_LOCK(name) ((name).readers--)
#define ENVOY_SNMP_GET_WRITE_LOCK(name) \
(((name).readers || (name).writers) ? 1 : ((name).writers++, 0))
#define ENVOY_SNMP_RELEASE_WRITE_LOCK(name) ((name).writers--)
#endif /* (INSTALL_ENVOY_SNMP_LOCK) */
#endif /* CONFIG_PREAMBLE */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,56 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/common.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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:09 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:22:57 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:00 meister
* Update copyright message
*
* Revision 1.1 1998/06/28 21:18:27 josh
* updating/bugfixing for SNMp
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* NIY....
*/
#ifdef CONFIG_PREAMBLE
#if INSTALL_BUG
#define BUG_OUT stdout
#define BUG(w,x,y,z) fprintf z; fprintf (stdout, "\n");
#endif
#else /* CONFIG_PREAMBLE */
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,815 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/envoy.h,v 1.2 2001/11/09 17:45:08 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: envoy.h,v $
* Revision 1.2 2001/11/09 17:45:08 josh
* pSOS-related path fixes
*
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.13.4.1 2001/09/21 18:30:06 josh
* updating porting files with new information for proxy and
* coexistence
*
* Revision 1.13 2001/01/19 22:22:57 paul
* Update copyright.
*
* Revision 1.12 2000/06/09 14:57:35 josh
* updating header files to correspond with new installation options and
* new code
*
* Revision 1.11 2000/04/05 19:40:51 josh
* clearing up some additional warnings for pSOS+ 3.0
*
* Revision 1.10 2000/03/17 00:10:01 meister
* Update copyright message
*
* Revision 1.9 1999/11/10 22:15:31 josh
* adding support for the envoy_ax_translate_context userexit
*
* Revision 1.8 1999/11/10 18:28:05 josh
* adding notification support to pSOS Envoy and fixing a few bugs
*
* Revision 1.7 1998/09/22 03:28:35 sar
* correct a typo in a type
*
* Revision 1.6 1998/09/16 19:54:30 sar
* Fixed up some user exits to allow binary customers a standard api
*
* Revision 1.5 1998/08/19 20:03:16 josh
* removing extraneous () from things
*
* Revision 1.4 1998/08/13 22:56:05 josh
* bringing in line with latest code changes
*
* Revision 1.3 1998/08/13 20:11:31 josh
* updates for pSOS
*
* Revision 1.2 1998/06/28 21:18:28 josh
* updating/bugfixing for SNMp
*
* Revision 1.1 1998/06/19 16:09:05 josh
* port files for building SNMp
*
*/
/* [clearcase]
modification history
-------------------
*/
#if INSTALL_ON_ISIX86
#ifndef NVRAM_START
#define NVRAM_START 0xf000
#endif
#ifndef P386
#define P386 1
#endif
#endif
#ifdef CONFIG_PREAMBLE
#include <string.h>
extern void * SNMP_memory_alloc(int );
extern void SNMP_memory_free(void *);
/* pSOS port */
extern int max_packet_size;
extern int max_oid_count;
extern int protect_critical_section;
/*----------------------------------------------------------------------*/
/* To tailor snmp for different applications */
/*----------------------------------------------------------------------*/
typedef struct snmp_cfg
{
/*--------------------------------------------------------------------*/
/* Maximum snmp packet size this entity allows. */
/*--------------------------------------------------------------------*/
int max_packet_size;
/*--------------------------------------------------------------------*/
/* Maximum number of oid components allowed in a valid object id. */
/*--------------------------------------------------------------------*/
int max_oid_count;
/*--------------------------------------------------------------------*/
/* snmp enters critical section before the testproc and leaves it */
/* after it has returned from the setproc/getproc. Application should*/
/* indicate whether to turn off task preemption globally when entering*/
/* the critical section and to turn it back on at exit. If this is */
/* set to FALSE, then the testproc/setproc/getproc for each individual*/
/* mib object should properly implement the necessary locking */
/* mechanism to ensure the atomicity of the GET/SET operations. */
/*--------------------------------------------------------------------*/
int protect_critical_section; /* TRUE/FALSE */
} snmp_cfg;
extern void SNMP_Init(snmp_cfg *);
/* pSOS port */
/*----------------------------------------------------------------------*/
/* locks for local databases access */
/*----------------------------------------------------------------------*/
typedef struct
{
unsigned char type; /* READLOCK or WRITELOCK */
#define NO_LOCK 0x0
#define READLOCK 0x1
#define WRITELOCK 0x2
unsigned long sema; /* Semaphore id */
int count; /* how many readlocks obtained */
} LOCK_T;
#define ENVOY_LOCK_T LOCK_T
#else
/* This first should be the same as DECORUM_MAX_PACKET_SIZE in decorum.h */
#define SNMP_MAX_PACKET_SIZE max_packet_size
#define SNMP_MIN_PACKET_SIZE 484
#define MAX_OID_COUNT max_oid_count
#define validate_SNMP_version(x) ((x) == SNMP_VERSION_1)
extern int validate_SNMP_community
__((SNMP_PKT_T *, SNMPADDR_T *, SNMPADDR_T *));
/*----------------------------------------------------------------
SNMP_validate_community -- Check an operation against the community name.
Parameters:
SNMP_PKT_T *pkt The received packet (decoded format)
SNMPADDR_T *src Source of the packet
SNMPADDR_T *dst Destination of the packet (most likely
the address of the machine on which this
code is running.)
Returns:
This procedure should return 0 if happy with the community and
1 if not.
This routine should fill in the packet structure with the mib
view mask associated with the community string.
This routine may hang additional data onto the "private" field of
the packet structure. The user will be given the opportinity to
release that memory via SNMP_release_private().
----------------------------------------------------------------*/
#define SNMP_validate_community(x, y, z) validate_SNMP_community(x,y,z)
/*----------------------------------------------------------------
SNMP_release_private -- Get rid of a any private data attached to the packet
structure. May be left undefined in which case nothing
is done with the private field when the SNMP packet
structure is freed.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns: Nothing
----------------------------------------------------------------*/
extern void release_private __((SNMP_PKT_T *));
#define SNMP_release_private(pkt) release_private(pkt)
/*----------------------------------------------------------------
SNMP_user_get_encode_buffer -- Allows the user the opportunity to get the
buffer that the SNMP packet will be encoded into.
If not used then leave undefined.
Parameters:
SNMP_PKT_T *pkt The packet being encoded.
unsigned int need The amount of storage needed.
EBUFFER_T *ebuffp The ebuffer to fill in with the actual
buffer.
Returns:
0 successful
1 not successful
----------------------------------------------------------------*/
extern int user_get_encode_buffer(SNMP_PKT_T *, unsigned int, EBUFFER_T *);
#define SNMP_user_get_encode_buffer(pkt, need, ebuffp) \
user_get_encode_buffer(pkt, need, ebuffp)
/*----------------------------------------------------------------
SNMP_trace_input
SNMP_trace_output
-- for implementing packet tracing through the
SNMP code. May not be left undefined but may
instead be defined as nothing.
Parameters:
SNMP_PKT_T *pkt The packet being traced
Returns: Nothing
----------------------------------------------------------------*/
extern void TRACE_INPUT(SNMP_PKT_T *pkt);
extern void TRACE_OUTPUT(SNMP_PKT_T *pkt);
#define SNMP_TRACE_INPUT(pkt) TRACE_INPUT(pkt)
#define SNMP_TRACE_OUTPUT(pkt) TRACE_OUTPUT(pkt)
/*****************************************************************
* The next series of macros are hooks into the processing of SET PDUs.
* For most uses you should be able to leave these undefined.
*****************************************************************/
/*----------------------------------------------------------------
SNMP_validate_set_pdu -- Perform a global validation of a SET PDU.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns:
-1 If the PDU is bad and should be rejected with a GEN_ERR.
0 If the PDU is good and normal handling should proceed.
+1 If the PDU is good and this routine has performed all of
the set operations internally.
----------------------------------------------------------------*/
extern int validate_set_pdu(SNMP_PKT_T *pkt);
#define SNMP_validate_set_pdu(pkt) validate_set_pdu(pkt)
/*----------------------------------------------------------------
SNMP_user_pre_set -- Perform a global validation of a SET PDU after all of the
test procedures have been called and given the "go ahead".
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns:
-1 If the PDU is bad and should be rejected with a GEN_ERR.
0 If the PDU is good and normal handling should proceed.
+1 If the PDU is good and this routine has performed all of
the set operations internally.
----------------------------------------------------------------*/
extern int user_pre_set(SNMP_PKT_T *pkt);
#define SNMP_user_pre_set(pkt) user_pre_set(pkt)
/*----------------------------------------------------------------
SNMP_user_post_set -- Perform any final activities after all of the set
procedures have been called.
Parameters:
SNMP_PKT_T *pkt The packet itself
Returns: Nothing
----------------------------------------------------------------*/
extern void user_post_set(SNMP_PKT_T *pkt);
#define SNMP_user_post_set(pkt) user_post_set(pkt)
/*****************************************************************
The following are a series of macros that will connect the method
routines we supplied for the RFC1445 or RFC2275 view schemes to
your non-volatile storage areas. You should consult the manuals
for more information about these macros.
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS)
#include <wrn/wm/demo/nvutils.h>
#define SNMP_VIEW_CREATE_TEST(PKT, NEW) SNMP_NV_View_Add_Mod(NEW, 0)
#define SNMP_VIEW_UPDATE_TEST(PKT, OLD, NEW) SNMP_NV_View_Add_Mod(NEW, 0)
#define SNMP_VIEW_DESTROY_TEST(PKT, OLD) SNMP_NV_View_Add_Mod(OLD, 1)
#define SNMP_VIEW_BACKOUT_HOOK(NEW) SNMP_NV_Clean()
#define SNMP_VIEW_CREATE_UNDO(NEW) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_UPDATE_UNDO(OLD, NEW) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_DESTROY_UNDO(OLD) (SNMP_NV_Clean(), 0)
#define SNMP_VIEW_DESTROY_BACKOUT(OLD) SNMP_NV_Clean()
#define SNMP_VIEW_FINISHED SNMP_NV_Doit()
#endif /* #if (INSTALL_ENVOY_SNMP_RFC1445_VIEWS) */
#if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS)
#include <wrn/wm/demo/nvutils.h>
#define SNMP_VIEW_2275_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_view_2275_test(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_view_2275_test(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_view_2275_test(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_view_2275_set(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_view_2275_set(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_view_2275_set(PKT, VBP, CUR, NEW)
#define SNMP_VIEW_2275_DESTROY_BACKOUT(CUR, NEW) \
snmp_view_2275_backout(CUR, NEW)
#define SNMP_VIEW_2275_CREATE_BACKOUT(CUR, NEW) \
snmp_view_2275_backout(CUR, NEW)
#define SNMP_VIEW_2275_UPDATE_BACKOUT(CUR, NEW) \
snmp_view_2275_backout(CUR, NEW)
#define SNMP_VIEW_2275_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_view_2275_undo(PKT, VBP, CUR, SAV)
#define SNMP_VIEW_2275_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_view_2275_undo(PKT, VBP, CUR, SAV)
#define SNMP_VIEW_2275_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_view_2275_undo(PKT, VBP, CUR, SAV)
#define SNMP_VIEW_2275_FINISHED() snmp_view_2275_finished()
#endif /* #if (INSTALL_ENVOY_SNMP_RFC2275_VIEWS) */
/*****************************************************************
If version 3 is installed we may need the following macros.
ENVOY_TIME - returns a clock with a granularity of seconds
PARAMETERS: none
returns: bits32_t
SNMP_validate_address
This routine gives the user a chance to examine the address
information as well as most of the packet itself before a v3
packet is processed. The routine must attach the address
information to the packet. It may attach a non-default mib
tree if desired. Note: in some error cases the packet will
not be decoded when this routine is called.
Parameters:
SNMP_PKT_T *pkt The received packet (decoded format)
SNMPADDR_T *src Source of the packet
SNMPADDR_T *dst Destination of the packet (most likely
the address of the machine on which this
code is running.)
returns:
0 - ok
1 - failure, drop the packet
Lastly are are a series of macros that will connect the method
routines we supplied for the v3 tables to your non-volatile
storage areas. You should consult the manuals for more information
about these macros.
*****************************************************************/
#if INSTALL_ENVOY_SNMP_VERSION_3
#include <wrn/wm/demo/nvutils.h>
extern bits32_t get_curtime(void);
#define ENVOY_TIME() get_curtime()
extern int validate_SNMP_address __((SNMP_PKT_T *,
SNMPADDR_T *,
SNMPADDR_T *));
#define SNMP_validate_address(p, s, d) validate_SNMP_address(p, s, d)
#if INSTALL_ENVOY_SNMP_V3_TARGET
extern int envoy_snmpaddr_to_taddress __((SNMPADDR_T *, OBJ_ID_T *,
EBUFFER_T *));
extern int envoy_taddress_to_snmpaddr __((SNMPADDR_T *, OBJ_ID_T *,
EBUFFER_T *));
#define ENVOY_TADDRESS_TO_SNMPADDR(A, D, T) \
envoy_taddress_to_snmpaddr(A, D, T)
#define ENVOY_SNMPADDR_TO_TADDRESS(A, D, T) \
envoy_snmpaddr_to_taddress(A, D, T)
#endif
#define SNMP_V3_GROUP_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_group_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_group_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_group_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_group_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_group_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_group_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_GROUP_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_group_backout(CUR, NEW)
#define SNMP_V3_GROUP_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_group_backout(CUR, NEW)
#define SNMP_V3_GROUP_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_group_backout(CUR, NEW)
#define SNMP_V3_GROUP_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_group_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_GROUP_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_group_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_GROUP_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_group_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_GROUP_FINISHED() snmp_v3_group_finished()
#define SNMP_V3_ACCESS_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_access_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_access_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_access_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_access_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_access_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_access_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_ACCESS_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_access_backout(CUR, NEW)
#define SNMP_V3_ACCESS_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_access_backout(CUR, NEW)
#define SNMP_V3_ACCESS_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_access_backout(CUR, NEW)
#define SNMP_V3_ACCESS_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_access_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_ACCESS_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_access_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_ACCESS_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_access_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_ACCESS_FINISHED() snmp_v3_access_finished()
#define SNMP_V3_USER_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_user_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_user_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_user_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_user_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_user_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_user_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_USER_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_user_backout(CUR, NEW)
#define SNMP_V3_USER_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_user_backout(CUR, NEW)
#define SNMP_V3_USER_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_user_backout(CUR, NEW)
#define SNMP_V3_USER_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_user_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_USER_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_user_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_USER_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_user_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_USER_FINISHED() snmp_v3_user_finished()
#define SNMP_V3_TADDR_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_taddr_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TADDR_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_taddr_backout(CUR, NEW)
#define SNMP_V3_TADDR_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_taddr_backout(CUR, NEW)
#define SNMP_V3_TADDR_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_taddr_backout(CUR, NEW)
#define SNMP_V3_TADDR_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_taddr_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TADDR_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_taddr_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TADDR_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_taddr_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TADDR_FINISHED() snmp_v3_taddr_finished()
#define SNMP_V3_TPARAM_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_tparam_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_TPARAM_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_tparam_backout(CUR, NEW)
#define SNMP_V3_TPARAM_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_tparam_backout(CUR, NEW)
#define SNMP_V3_TPARAM_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_tparam_backout(CUR, NEW)
#define SNMP_V3_TPARAM_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_tparam_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TPARAM_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_tparam_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TPARAM_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_tparam_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_TPARAM_FINISHED() snmp_v3_tparam_finished()
#define SNMP_V3_NOTIFY_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_notify_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_notify_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_notify_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_notify_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_notify_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_notify_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NOTIFY_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_notify_backout(CUR, NEW)
#define SNMP_V3_NOTIFY_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_notify_backout(CUR, NEW)
#define SNMP_V3_NOTIFY_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_notify_backout(CUR, NEW)
#define SNMP_V3_NOTIFY_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_notify_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NOTIFY_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_notify_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NOTIFY_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_notify_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NOTIFY_FINISHED() snmp_v3_notify_finished()
#define SNMP_V3_NPROF_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nprof_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NPROF_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_nprof_backout(CUR, NEW)
#define SNMP_V3_NPROF_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_nprof_backout(CUR, NEW)
#define SNMP_V3_NPROF_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_nprof_backout(CUR, NEW)
#define SNMP_V3_NPROF_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nprof_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NPROF_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nprof_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NPROF_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nprof_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NPROF_FINISHED() snmp_v3_nprof_finished()
#define SNMP_V3_NFILT_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_nfilt_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_NFILT_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_nfilt_backout(CUR, NEW)
#define SNMP_V3_NFILT_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_nfilt_backout(CUR, NEW)
#define SNMP_V3_NFILT_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_nfilt_backout(CUR, NEW)
#define SNMP_V3_NFILT_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nfilt_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NFILT_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nfilt_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NFILT_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_nfilt_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_NFILT_FINISHED() snmp_v3_nfilt_finished()
#define SNMP_V3_PROXY_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_v3_proxy_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_PROXY_DESTROY_BACKOUT(CUR, NEW) \
snmp_v3_proxy_backout(CUR, NEW)
#define SNMP_V3_PROXY_CREATE_BACKOUT(CUR, NEW) \
snmp_v3_proxy_backout(CUR, NEW)
#define SNMP_V3_PROXY_UPDATE_BACKOUT(CUR, NEW) \
snmp_v3_proxy_backout(CUR, NEW)
#define SNMP_V3_PROXY_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_proxy_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_PROXY_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_proxy_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_PROXY_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_v3_proxy_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_PROXY_FINISHED() snmp_v3_proxy_finished()
#define SNMP_V3_COMM_DESTROY_TEST(PKT, VBP, CUR, NEW) \
snmp_community_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_CREATE_TEST(PKT, VBP, CUR, NEW) \
snmp_community_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_UPDATE_TEST(PKT, VBP, CUR, NEW) \
snmp_community_test(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_DESTROY_SET(PKT, VBP, CUR, NEW) \
snmp_community_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_CREATE_SET(PKT, VBP, CUR, NEW) \
snmp_community_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_UPDATE_SET(PKT, VBP, CUR, NEW) \
snmp_community_set(PKT, VBP, CUR, NEW)
#define SNMP_V3_COMM_DESTROY_BACKOUT(CUR, NEW) \
snmp_community_backout(CUR, NEW)
#define SNMP_V3_COMM_CREATE_BACKOUT(CUR, NEW) \
snmp_community_backout(CUR, NEW)
#define SNMP_V3_COMM_UPDATE_BACKOUT(CUR, NEW) \
snmp_community_backout(CUR, NEW)
#define SNMP_V3_COMM_CREATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_community_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_COMM_UPDATE_UNDO(PKT, VBP, CUR, SAV) \
snmp_community_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_COMM_DESTROY_UNDO(PKT, VBP, CUR, SAV) \
snmp_community_undo(PKT, VBP, CUR, SAV)
#define SNMP_V3_COMM_FINISHED() snmp_community_finished()
#endif /* #if INSTALL_ENVOY_SNMP_VERSION_3 */
#if (INSTALL_ENVOY_EPI_MASTER)
#define SNMP_RESETSYSUPTIME
#endif
/*****************************************************************
AgentX routines and macros for the master
Defaults are fine for the following macros:
#define ENVOY_AX_DEFAULT_TIMEOUT 1
#define ENVOY_AX_FIND_MIB(CONTEXT) (EBufferUsed(CONTEXT) ? 0 : &mib_root_node)
#define ENVOY_AX_MA_AC_ADD(PKTP, MIBROOT) GEN_ERR
#define ENVOY_AX_MA_AC_REMOVE(PKTP, MIBROOT) GEN_ERR
#define ENVOY_AX_MA_AC_CLEAN(SESS_ID)
*****************************************************************/
#if INSTALL_ENVOY_AGENTX_MASTER
#if 0
extern bits32_t envoy_get_sysuptime();
extern sbits32_t envoy_ax_transport_type(ptr_t);
extern int envoy_ax_transport_string(ptr_t, ALENGTH_T *,
bits8_t **, int *);
#define ENVOY_GET_SYSUPTIME(CON) envoy_get_sysuptime()
#define ENVOY_AX_TRANSPORT_TYPE(COOKIE) envoy_ax_transport_type(COOKIE)
#define ENVOY_AX_TRANSPORT_STRING(COOKIE, NEED, BUF, DYN) \
envoy_ax_transport_string(COOKIE, NEED, BUF, DYN)
#define ENVOY_AX_TRANSPORTS_SUPPORTED {0}
#endif
extern bits32_t ENVOY_GET_SYSUPTIME(EBUFFER_T *);
extern sbits32_t ENVOY_AX_TRANSPORT_TYPE(ptr_t);
extern int ENVOY_AX_TRANSPORT_STRING(ptr_t, ALENGTH_T *,
bits8_t **, int *);
#define ENVOY_AX_TRANSPORTS_SUPPORTED {0}
extern struct MIBNODE_S * ENVOY_AX_FIND_MIB(EBUFFER_T *);
extern bits16_t ENVOY_AX_MA_AC_ADD(struct ENVOY_AX_PKT_S *,
struct MIBNODE_S *);
extern bits16_t ENVOY_AX_MA_AC_REMOVE(struct ENVOY_AX_PKT_S *,
struct MIBNODE_S *);
extern void ENVOY_AX_MA_AC_CLEAN(bits32_t);
extern void envoy_ax_translate_context(SNMP_PKT_T *,
struct ENVOY_AX_PKT_S *query_pkt);
#define ENVOY_AX_TRANSLATE_CONTEXT(PKT, AX_PKT) \
envoy_ax_translate_context((PKT), (AX_PKT))
#endif /* #if INSTALL_ENVOY_AGENTX_MASTER */
/*****************************************************************
AgentX routines and macros for the sub agent
Defaults are fine for the following macros:
#define ENVOY_AX_SA_MIB_ROOT_NODE(CKE, PKT) 0
#define ENVOY_AX_SA_TIMEOUT 1000
*****************************************************************/
#if (INSTALL_ENVOY_SNMP_LOCK)
/* Implemented as user exit routines */
extern int get_read_lock(LOCK_T *);
extern void release_lock(LOCK_T *, unsigned char );
extern int get_write_lock(LOCK_T *);
extern int init_rw_lock(LOCK_T *, char *);
/* Don't use the lock stuff if the user doesn't define it */
#define ENVOY_SNMP_LOCK(lock) LOCK_T lock = {0,0,0}
#define ENVOY_SNMP_LOCK_EXTERN(lock) extern LOCK_T lock
#define ENVOY_SNMP_INIT_LOCK_TAG(lock,str) init_rw_lock(&lock, str)
#define ENVOY_SNMP_GET_READ_LOCK(lock) get_read_lock(&lock)
#define ENVOY_SNMP_RELEASE_READ_LOCK(lock) release_lock(&lock, READLOCK)
#define ENVOY_SNMP_GET_WRITE_LOCK(lock) get_write_lock(&lock)
#define ENVOY_SNMP_RELEASE_WRITE_LOCK(lock) release_lock(&lock, WRITELOCK)
#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; }
/*
* declare all Lock externs here
*/
ENVOY_SNMP_LOCK_EXTERN(SNMP_CoarseLock);
ENVOY_SNMP_LOCK_EXTERN(SNMP_SubagentLock);
#if INSTALL_ENVOY_SNMP_VERSION_2
ENVOY_SNMP_LOCK_EXTERN(SNMP_TimeStampLock);
#endif
#if INSTALL_ENVOY_SNMP_PROXY
ENVOY_SNMP_LOCK_EXTERN(SNMP_ProxyLock);
#endif
ENVOY_SNMP_LOCK_EXTERN(SNMP_TimerLock);
#endif /* (INSTALL_ENVOY_SNMP_LOCK) */
/* Prototypes for these functions, just to keep things clear. */
extern bits32_t ENVOY_NOW(void);
extern void ENVOY_CALL_TIMER(bits32_t when, void (*what)());
/* If SC_SOCAKDDR hasn't been defined by now, define it. */
#ifndef SC_SOCKADDR
#define SC_SOCKADDR sockaddr_in
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,444 @@
#* @(#) pSOSystem PowerPC/V2.5.0-BETA2: configs/ppc/config.mk 4.2 98/07/01 08:29:48 *
#***********************************************************************
#* *
#* MODULE: configs/std/config.mk *
#* DATE: 98/07/01 *
#* PURPOSE: Macro definitions, linker commands, etc, for "make" *
#* *
#*---------------------------------------------------------------------*
#* *
#* Copyright 1991 - 1998, Integrated Systems, Inc. *
#* ALL RIGHTS RESERVED *
#* *
#* Permission is hereby granted to licensees of Integrated Systems, *
#* Inc. products to use or abstract this computer program for the *
#* sole purpose of implementing a product based on Integrated *
#* Systems, Inc. products. No other rights to reproduce, use, *
#* or disseminate this computer program, whether in part or in *
#* whole, are granted. *
#* *
#* Integrated Systems, Inc. makes no representation or warranties *
#* with respect to the performance of this computer program, and *
#* specifically disclaims any responsibility for any damages, *
#* special or consequential, connected with the use of this program. *
#* *
#*---------------------------------------------------------------------*
#***********************************************************************
#
#------------------------------------------------------------------------
# Compiler commands and command-line options
#------------------------------------------------------------------------
# Add following option to COPTS_FILE2 to generate listing files
# -W:as:,-l -Xpass-source
#------------------------------------------------------------------------
CC = dcc
CXX = dplus
COMP_OPTS1 = -O -t$(DTARGET)E$(DFP):psos -Xstruct-best-align=0
COMP_OPTS2 = -Xstrict-ansi $(PSS_APPCOPTS) -D__DIAB -DPPC
COPTS_FILE1 = -I. $(PSS_APPINCS) -I$(PSS_ROOT)/include -I$(PSS_BSP)
COPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@ -c
CXX_OPTS = -Xexception
COPTS = -@c.opt
CXXOPTS = -@cxx.opt
#------------------------------------------------------------------------
# Assembler command-line options
#------------------------------------------------------------------------
AS = das
#------------------------------------------------------------------------
# Added target switch for the assembler
# The target definition is located in bsp.mk of the bsp you are using
#------------------------------------------------------------------------
# Add following option to AOPTS_FILE1 to generate listing files -l
#------------------------------------------------------------------------
AOPTS_FILE1 = -I. $(PSS_APPINCS) -I$(PSS_ROOT)/include -I$(PSS_BSP)
AOPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@
AOPTS_FILE3 = -t$(DTARGET)E$(DFP)
AOPTS = -@a.opt
#------------------------------------------------------------------------
# Linker command name
#------------------------------------------------------------------------
LD = dld
LOPTS = -t$(DTARGET)E$(DFP) -Xsupress-dot -Xreloc-bug -m2 $(PSS_APPLOPTS)
#------------------------------------------------------------------------
# Librarian command name and options
#------------------------------------------------------------------------
LIB = dar
LIBOPTS = -qf
LIBOPTS_SORT = -sR
#========================================================================
# Link everything together
#========================================================================
CFG1_OBJS= bspcfg.o philecfg.o pnacfg.o prepccfg.o dialog.o rarp.o
CFG2_OBJS= probecfg.o prpccfg.o psecfg.o psoscfg.o pmontcfg.o
CFG3_OBJS= pollio.o sysinit.o gsblkcfg.o plmcfg.o pnetcfg.o ldcfg.o
ram.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_APPOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/ram.lnk
@cat $(PSS_BSP)/ram.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o ram.elf -Wm cmd.lnk begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > ram.map
ddump -tv ram.elf >> ram.map
ram.hex: ram.elf
ddump -Rv ram.elf -o ram.hex
rom.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/rom.lnk
@cat $(PSS_BSP)/rom.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o rom.elf -Wm cmd.lnk begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > rom.map
ddump -tv rom.elf >> rom.map
rom.hex: rom.elf
ddump -Rv rom.elf -o rom.hex
os.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/os.lnk
@cat $(PSS_BSP)/os.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o os.elf -Wm cmd.lnk begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > os.map
ddump -tv os.elf >> os.map
os.hex: os.elf
ddump -Rv os.elf -o os.hex
app.elf: cxx.opt c.opt a.opt ill.opt beginapp.o bspcalls.o \
makefile \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/app.lnk
@cat $(PSS_BSP)/app.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o app.elf -Wm cmd.lnk beginapp.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app.map
ddump -tv app.elf >> app.map
app_ld.elf: app.elf
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.elf app.elf
@rm -f ld_prep.def
app.hex: app.elf
ddump -Rv app.elf -o app.hex
app_ld.hex: app.hex
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.hex app.hex
@rm -f ld_prep.def
driver.elf: cxx.opt c.opt a.opt ill.opt lddriver.o bspcalls.o \
ldblcfg.o \
makefile \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/app.lnk
@cat $(PSS_BSP)/app.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o driver.elf cmd.lnk lddriver.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > driver.map
@ddump -tv driver.elf >> driver.map
lddriver.elf: driver.elf
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o lddriver.elf driver.elf
@rm -f ld_prep.def
lib.elf: cxx.opt c.opt a.opt ill.opt bspcalls.o \
makefile \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_BSP)/anchor.lnk \
$(PSS_BSP)/app.lnk
@cat $(PSS_BSP)/app.lnk >cmd.lnk
@cat $(PSS_BSP)/anchor.lnk >>cmd.lnk
@echo $(LOPTS) -o lib.elf cmd.lnk > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > lib.map
@ddump -tv lib.elf >> lib.map
lib_ld.elf: lib.elf
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.elf lib.elf
@rm -f ld_prep.def
lib.hex: lib.elf
ddump -Rv lib.elf -o lib.hex
lib_ld.hex: lib.hex
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.hex lib.hex
@rm -f ld_prep.def
#------------------------------------------------------------------------
# Compile or assemble modules which are always used.
#------------------------------------------------------------------------
begin.o: makefile $(PSS_CONFIG)/config.mk
begin.o: $(PSS_CONFIG)/begin.s
$(AS) $(AOPTS) -o $@ $<
beginapp.o: makefile $(PSS_CONFIG)/config.mk
beginapp.o: $(PSS_CONFIG)/beginapp.s
$(AS) $(AOPTS) -o $@ $<
lddriver.o: makefile $(PSS_CONFIG)/config.mk
lddriver.o: $(PSS_CONFIG)/lddriver.s
$(AS) $(AOPTS) -o $@ $<
bspcalls.o: makefile $(PSS_CONFIG)/config.mk
bspcalls.o: $(PSS_BSP)/bspcalls.s
$(AS) $(AOPTS) -o $@ $<
gsblkcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h
gsblkcfg.o: $(PSS_CONFIG)/gsblkcfg.c
$(CC) $(COPTS) -o $@ $<
sysinit.o: qpsos.tmp \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
sysinit.o: $(PSS_CONFIG)/sysinit.c
$(CC) $(COPTS) -o sysinit.tmp $<
@$(LD) $(LOPTS) -r -Xsupress-dot -Xreloc-bug -o sysinit.o sysinit.tmp qpsos.tmp > qpsos.map
@rm -f sysinit.tmp qpsos.o qpsos.map
qpsos.tmp: $(PSS_ROOT)/sys/os/qpsos.s
@$(AS) $(AOPTS) -o qpsos.o $<
@$(LIB) r qpsos.tmp qpsos.o
philecfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
philecfg.o: $(PSS_CONFIG)/philecfg.c
$(CC) $(COPTS) -o $@ $<
pnacfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
pnacfg.o: $(PSS_CONFIG)/pnacfg.c
$(CC) $(COPTS) -o $@ $<
pnetcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
pnetcfg.o: $(PSS_CONFIG)/pnetcfg.c
$(CC) $(COPTS) -o $@ $<
prepccfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
prepccfg.o: $(PSS_CONFIG)/prepccfg.c
$(CC) $(COPTS) -o $@ $<
probecfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
probecfg.o: $(PSS_CONFIG)/probecfg.c
$(CC) $(COPTS) -o $@ $<
prpccfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
prpccfg.o: $(PSS_CONFIG)/prpccfg.c
$(CC) $(COPTS) -o $@ $<
psecfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
psecfg.o: $(PSS_CONFIG)/psecfg.c
$(CC) $(COPTS) -o $@ $<
psoscfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
psoscfg.o: $(PSS_CONFIG)/psoscfg.c
$(CC) $(COPTS) -o $@ $<
pmontcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
pmontcfg.o: $(PSS_CONFIG)/pmontcfg.c
$(CC) $(COPTS) -o $@ $<
dialog.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
dialog.o: $(PSS_CONFIG)/dialog.c
$(CC) $(COPTS) -o $@ $<
pollio.o: makefile $(PSS_CONFIG)/config.mk \
$(PSS_BSP)/bsp.h
pollio.o: $(PSS_CONFIG)/pollio.c
$(CC) $(COPTS) -o $@ $<
bspcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
bspcfg.o: $(PSS_BSP)/bspcfg.c
$(CC) $(COPTS) -o $@ $<
plmcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
plmcfg.o: $(PSS_CONFIG)/plmcfg.c
$(CC) $(COPTS) -o $@ $<
ldcfg.o: makefile $(PSS_CONFIG)/config.mk sys_conf.h
ldcfg.o: $(PSS_CONFIG)/ldcfg.c
$(CC) $(COPTS) -o $@ $<
c.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > c.opt
@echo $(COMP_OPTS2) >> c.opt
@echo $(COPTS_FILE1) >> c.opt
@echo $(COPTS_FILE2) >> c.opt
cxx.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > cxx.opt
@echo $(COMP_OPTS2) >> cxx.opt
@echo $(COPTS_FILE1) >> cxx.opt
@echo $(COPTS_FILE2) >> cxx.opt
@echo $(CXX_OPTS) >> cxx.opt
a.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(AOPTS_FILE1) > a.opt
@echo $(AOPTS_FILE2) >> a.opt
@echo $(AOPTS_FILE3) >> a.opt
ill.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(LOPTS) > ill.opt
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,979 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/mcf250/sys_conf.h,v 1.1.1.1 2001/11/05 17:47:10 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: sys_conf.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:10 tneale
* Tornado shuffle
*
* Revision 1.1 2000/02/24 16:05:56 josh
* configuration files for pSOS for ColdFire
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* @(#) pSOSystem PowerPC/V2.5.0-BETA1: apps.v22/xxxx/sys_conf.h (snmpsa ppc) 3.72 98/06/05 11:02:22 */
/***********************************************************************/
/* */
/* MODULE: sys_conf.h */
/* DATE: 98/06/05 */
/* PURPOSE: pSOSystem configuration definitions */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1991 - 1997, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* This is a header file which defines all of the system-level */
/* parameters that are likely to need changing. */
/* */
/* It has been set up to be as close as possible to the settings */
/* which are appropriate for this application. However, you may */
/* need to make some changes to parameters to reflect your */
/* environment, such as IP addresses, etc. */
/* */
/* Chapter 7 of the pSOSystem Getting Started manual contains a */
/* complete description of the symbols that are defined in this */
/* file. */
/* */
/***********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _SYS_CONF_H
#define _SYS_CONF_H
/***********************************************************************/
/* */
/* SC_APP_PARMS Must be defined before you include sysvars.h file. */
/* Since "sysvars.h" file depends on SC_APP_PARMS and BSP_PARMS */
/* to define the Storage Parms Structure. */
/* */
/* Defining this variable to a Non-Zero Value will create a space in */
/* the Storage Parms. structure for your application use. */
/* */
/***********************************************************************/
#define SC_APP_PARMS 0
#define SC_APP_NAME "snmpsa Application"
/*---------------------------------------------------------------------*/
/* types.h contains common definitions for example YES and NO */
/*---------------------------------------------------------------------*/
#include <types.h>
/***********************************************************************/
/* sysvars.h contains the structures and definitions for the system */
/* variables that are stored in NVRAM. These structures and */
/* definitions are also used when creating the boot rom for the */
/* target system. By using the same sysvars.h file it will insure the */
/* consistency of the values stored by the boot rom and later read by */
/* the downloaded application. */
/***********************************************************************/
#include <sysvars.h>
/*---------------------------------------------------------------------*/
/* include psos.h for defines IO_AUTOINIT and IO_NOAUTOINIT */
/*---------------------------------------------------------------------*/
#include <psos.h>
/***********************************************************************/
/* */
/* These symbols are used to define other symbols in this file. */
/* They should never be changed. */
/* */
/***********************************************************************/
#define USE_RARP 0
/***********************************************************************/
/* */
/* B A S I C P A R A M E T E R S */
/* */
/* The parameters in this section determine the fashion in which */
/* many of the other parameters in this file will be used. */
/* */
/* Many of the parameters in this file have names beginning with */
/* either "SC_" or "SD_". Those beginning with "SC_" are ALWAYS */
/* controlled by the values you set in this file. The values of */
/* the "SD_" parameters can be determined either by the definitions */
/* given in this file, or by the data found in the target board's */
/* parameter storage area. SC_SD_PARAMETERS determines this. If */
/* SC_SD_PARAMETERS is "SYS_CONF", then the values given in this */
/* file will be used for the SD_ parameters. If SC_SD_PARAMETERS */
/* is "STORAGE", then pSOSystem will attempt to use the values found */
/* in the board's parameter storage area for the SD_ variables. If */
/* the parameter storage area has not been initialized or has been */
/* corrupted, then the values given in this file will be used. They */
/* will also be written to the storage area. */
/* */
/* If SC_SD_PARAMETERS is STORAGE, you may enable a "startup dialog" */
/* which will allow you to view, and optionally change, the */
/* parameter values found in the storage area. The dialog is enabled */
/* by setting SC_STARTUP_DIALOG to YES. In this case, */
/* SD_STARTUP_DELAY specifies the number of seconds that the dialog */
/* will wait for input before proceeding to boot the system. */
/* */
/* SC_SD_DEBUG_MODE determines how the system will operate, as follows:*/
/* */
/* DBG_SA: Boot pROBE+ in standalone mode. */
/* */
/* DBG_XS: Boot into pROBE+ and wait for the host debugger */
/* via a serial connection */
/* */
/* DBG_XN: Boot into pROBE+ and wait for the host debugger */
/* via a network connection */
/* */
/* DBG_AP: Same as DBG_SA, but also does a pROBE+ "silent startup",*/
/* meaning that pROBE+ initializes itself without */
/* printing a startup banner. pROBE+ then initializes */
/* pSOS+ and starts the application running. This mode */
/* was created to simplify implementation of the pSOSystem */
/* Boot ROMs. Note that when this mode is used, the value */
/* you specify for RC_SMODE (see "pROBE+ Configuration */
/* Parameters", below) is overridden. */
/* */
/* STORAGE: Use the mode (DBG_SA, DBG_XS, or DBG_XN) found in the */
/* parameter storage area. If a valid mode is not found, */
/* then use DBG_SA. */
/* */
/* An important consequence of using SC_SD_DEBUG_MODE=STORAGE should */
/* be noted. If you use the TFTP bootloader in the pSOSystem ROMs */
/* to download and start your system, you will be setting */
/* SC_SD_DEBUG_MODE = DBG_AP in your target board's parameter storage */
/* area. Thus, if you have left SC_SD_DEBUG_MODE set to STORAGE in */
/* this file, your downloaded system will also use DBG_AP, meaning */
/* that the application will begin running immediately after the */
/* TFTP bootloader has loaded and started your system. */
/* */
/***********************************************************************/
#define SC_SD_PARAMETERS STORAGE
#define SC_STARTUP_DIALOG NO
#define SC_BOOT_ROM NO
#define SD_STARTUP_DELAY 60
#define SC_SD_DEBUG_MODE STORAGE
/***********************************************************************/
/* */
/* O P E R A T I N G S Y S T E M C O M P O N E N T S */
/* */
/* Setting the definition line to YES will cause that component to */
/* be built into the system. NO means the component will NOT be */
/* put into the system. It is an error to specify both SC_PSOS */
/* and SC_PSOSM as present! */
/* */
/***********************************************************************/
#define SC_PSOS YES /* pSOS+ real-time kernel */
#define SC_PSOSM NO /* pSOS+ real-time multiproc kernel */
#define SC_PSOS_QUERY NO /* pSOS+ Query Services */
#define SC_PROBE NO /* pROBE+ (processor svcs) */
#define SC_PROBE_DISASM NO /* pROBE+ (disassembler) */
#define SC_PROBE_CIE NO /* pROBE+ (console executive) */
#define SC_PROBE_QUERY NO /* pROBE+ (query services) */
#define SC_PROBE_DEBUG NO /* pROBE+ (debug interface executive) */
#define SC_PROBE_HELP NO /* pROBE+ Help command Handler. */
#define SC_PHILE YES /* pHILE+ file system manager */
#define SC_PHILE_PHILE YES /* pHILE+ (pHILE+ real-time file sys) */
#define SC_PHILE_MSDOS NO /* pHILE+ (MS-DOS FAT file system) */
#define SC_PHILE_NFS NO /* pHILE+ (NFS client) */
#define SC_PHILE_CDROM NO /* pHILE+ (ISO 9660 CD-ROM file sys) */
#define SC_PREPC YES /* pREPC+ C run-time library */
#define SC_PNA YES /* pNA+ TCP/IP networking manager */
#define SC_PNET NO /* pNET Library for BOOT ROMS */
#define SC_PRPC NO /* pRPC+ RPC component */
#define SC_PSE_PRPC NO /* pRPC+ RPC component Over pSE+ */
#define SC_PSE NO /* pSE+ streams component */
#define SC_PSKT NO /* pSKT+ SKT library component */
#define SC_PTLI NO /* pTLI+ TLI library component */
#define SC_PMONT NO /* pMONT+ */
#define SC_PLM NO /* pLM+ Shared library manager */
#define SC_PROFILER NO /* Profiler is enabled/Disabled */
#define SC_RTEC NO /* Diab's Run time error checker */
/*---------------------------------------------------------------------*/
/* If SC_QBIND is set to YES then the Quick bindings for pSOS+ System */
/* calls will be used. If it is set to NO then the normal bindings */
/* will be used. */
/* */
/* Quick bindings will not be supported for the applications with */
/* USER mode Tasks. So make sure your Application does not have any */
/* USER mode Tasks. */
/*---------------------------------------------------------------------*/
#define SC_QBIND NO /* Quick bindings for pSOSystem calls*/
/*---------------------------------------------------------------------*/
/* If set to IO_AUTOINIT device drivers that are installed be the */
/* InstallDriver function will have their autoinit field set. This */
/* will cause pSOS+ call the drivers initialization function when */
/* pSOS+ starts up. The de_init call will not have to be called for */
/* each driver if this is done. */
/* */
/* NOTE: This Auto Initialization will not work on all drivers. */
/* Setting IO_AUTOINIT only effects drivers that can use the Auto */
/* Initialization feature. */
/* */
/* If set to IO_NOAUTOINIT no automatic driver initialization will */
/* happen. */
/*---------------------------------------------------------------------*/
#define SC_AUTOINIT IO_AUTOINIT
/*---------------------------------------------------------------------*/
/* If SC_PMONT SC_AUTOINIT will always be set to 1 because pMONT needs */
/* drivers to be automatically initialized. */
/*---------------------------------------------------------------------*/
#if SC_PMONT
#undef SC_AUTOINIT
#define SC_AUTOINIT IO_AUTOINIT
#endif
/*---------------------------------------------------------------------*/
/* If set to YES, an initial devices name table is set-up to contain */
/* Deivce names for all the Drivers configured in the system. */
/* */
/* NOTE: Any initial device name table enteries are in addition to the */
/* KC_MAXDNTENT value specified below in pSOS+ configuration params. */
/*---------------------------------------------------------------------*/
#define SC_INIT_DNTABLE YES
/***********************************************************************/
/* */
/* S E R I A L C H A N N E L C O N F I G U R A T I O N */
/* */
/* * SD_DEF_BAUD specifies the default baud rate to be used for the */
/* serial channels */
/* * SC_APP_CONSOLE specifies the serial channel number (starting */
/* from 1) which should be used for the application's "console". */
/* * SC_PROBE_CONSOLE specifies the serial channel number (starting */
/* from 1) which pROBE+ should use to display output and receive */
/* commands, or to communicate with the host debugger. */
/* * SC_RBUG_PORT specifies the serial channel number (starting */
/* from 1) which should be used for the pROBE+ REMOTE channel. */
/* This is not normally required, so it can be disabled by */
/* using a value of 0. */
/* */
/* Above three macros SC_PROBE_CONSOLE, SC_APP_CONSOLE and */
/* SC_RBUG_PORT uses SERIAL_DRVRNUM(0) as default. This means that */
/* the Low-Level Serial Driver 0 (1) is being used default. */
/* */
/* If you need to use another driver for any of the above macros */
/* and another macro for pMONT PM_DEV, You need to change "0" to */
/* the driver number you want. Consult the "README" file in BSP */
/* directory for number of different drivers supported and for the */
/* SERIAL_DRVRNUM mapping for those drivers. */
/* */
/***********************************************************************/
#define SD_DEF_BAUD 9600
#define SC_APP_CONSOLE (1 + SERIAL_DRVRNUM(0))
#define SC_PROBE_CONSOLE (1 + SERIAL_DRVRNUM(0))
#define SC_RBUG_PORT (0 + SERIAL_DRVRNUM(0))
/***********************************************************************/
/* SC_NumNon_pSOSChan is the number of non pSOS users of serial */
/* channels. These are users that will be initiated before pSOS */
/* such as pROBE. */
/* NOTE: These channels will not be closed on a soft reset. */
/***********************************************************************/
#if (SC_RBUG_PORT && SC_PROBE_CONSOLE && (SC_PROBE_CONSOLE != PCCON))
#define SC_NumNon_pSOSChan 2
#else
#define SC_NumNon_pSOSChan 1
#endif
/***********************************************************************/
/* */
/* L A N C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_LAN1 YES /* Disable the LAN interface */
#define SD_LAN1_IP 0x80E0C1A3 /* (REC) IP address of the node */
#define SD_LAN1_SUBNET_MASK 0xFFFFFF00
/*---------------------------------------------------------------------*/
/* Maximum number of multicast addresses to be used by the lan */
/* interface. Must not exceed maximum supported by the lan driver. */
/*---------------------------------------------------------------------*/
#define SC_LAN1_NMCAST 0
/***********************************************************************/
/* */
/* S H A R E D M E M O R Y C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
/***********************************************************************/
/* */
/* B U S C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_VME_BASE_ADDR 0x01000000
/*---------------------------------------------------------------------*/
/* If you want to build a Shared Memory Interface for the network or */
/* multi-processing pSOS+m, set SD_SM_NODE (a non-zero value) to the */
/* node number of THIS node. */
/*---------------------------------------------------------------------*/
#define SD_SM_NODE 0
/*---------------------------------------------------------------------*/
/* Shared memory network interface - SC_NISM_LEVEL should be 1 if this */
/* will be the FIRST system to use the SMNI on this board. It should */
/* be 2 if this will not be the first system to use the SMNI on this */
/* board. Usually this means that SC_NISM_LEVEL should be 1 if you */
/* are building Boot ROMs, and 2 for a system that will be downloaded */
/* and started using the Boot ROMs. See the comments at the beginning */
/* of drivers/ni_smem.c for more explanation. */
/*---------------------------------------------------------------------*/
#define SD_NISM NO
#define SD_NISM_IP 0x00000000
#define SD_NISM_DIRADDR 0x00000400
#define SC_NISM_BUFFS 30
#define SC_NISM_LEVEL 2
#define SD_NISM_SUBNET_MASK 0x00000000
/*---------------------------------------------------------------------*/
/* If you want to build a multi-node pSOS+m system, set SD_KISM */
/* to the number of nodes in the system. */
/*---------------------------------------------------------------------*/
#define SD_KISM 0
#define SD_KISM_DIRADDR 0x00000580
#define SC_KISM_BUFFS 100
/***********************************************************************/
/* */
/* M I S C E L L A N E O U S N E T W O R K I N G */
/* P A R A M E T E R S */
/* */
/***********************************************************************/
#define SD_DEF_GTWY_IP 0x80E0C105
/***********************************************************************/
/* SC_RAM_SIZE */
/* */
/* Normally, pSOSystem uses ALL of the memory remaining on a board for */
/* dynamic allocation ("region 0"). You may override this by setting */
/* SC_RAM_SIZE to a non-zero value. If you do, pSOSystem will not */
/* touch any memory after address (BSP_RAM_BASE + SC_RAM_SIZE - 1). */
/* */
/* NOTE: This is useful when making a BOOT ROM and you want to ensure */
/* that the ROM's RAM area does not overflow the space alloted for it. */
/***********************************************************************/
#define SC_RAM_SIZE 0
/***********************************************************************/
/* */
/* I / O D E V I C E S */
/* */
/* Each device may be included in the system by specifying a major */
/* number for it, which determines its slot in the pSOS+ I/O switch */
/* table. To leave a device driver out of the system, use NO for */
/* the major number. */
/* */
/* Note the following: */
/* * Major device 0 is reserved and cannot be used for any of these */
/* devices. Setting a device number to 0 here is the same as NO. */
/* * No device number may be higher than SC_DEVMAX (SC_DEVMAX may */
/* be increased, if desired) */
/* * The lines defining the symbols DEV_SERIAL, DEV_TIMER, etc, */
/* should not be changed. These are for use by application */
/* programs as the "device number" parameter on de_* calls. */
/* */
/***********************************************************************/
#define SC_DEV_SERIAL 1 /* Serial driver */
#define SC_DEV_TIMER 2 /* Periodic tick timer */
#define SC_DEV_RAMDISK NO /* RAM disk */
#define SC_DEV_CONSOLE NO /* PC-Console driver */
#define SC_DEV_SCSI NO /* SCSI bus */
#define SC_DEV_SCSI_TAPE NO /* SCSI bus, tape device */
#define SC_DEV_IDE NO /* IDE Driver */
#define SC_DEV_FLOPPY NO /* Floppy Driver */
#define SC_DEV_TFTP NO /* TFTP pseudo driver */
#define SC_DEV_SPI NO /* SPI driver */
#define SC_DEV_DLPI NO /* DLPI pseudo driver */
#define SC_DEV_OTCP NO /* 12 TCP/IP for OpEN */
#define SC_IP SC_DEV_OTCP /* 12 IP */
#define SC_ARP NO /* 13 ARP */
#define SC_TCP NO /* 14 TCP */
#define SC_UDP NO /* 15 UDP */
#define SC_RAW NO /* 16 RAW */
#define SC_LOOP NO /* 17 LOOP = (SC_DEV_OTCP + 5) */
#define SC_DEV_SOSI NO /* 18 OSI for OpEN */
#define SC_DEV_PSCONSOLE NO /* Pseudo Console driver */
#define SC_DEV_NULL NO /* Null Device Driver */
#define SC_DEV_PARALLEL NO /* Parallel Port Driver */
#define SC_DEV_CMOS NO /* CMOS Driver */
#define SC_DEV_WATCHDOG NO /* Watchdog Driver */
#define SC_DEV_OLAP NO /* LAP Drivers */
#define SC_PHPI (SC_DEV_OLAP) /* Phpi driver */
#define SC_LAPB (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 1 */
#define SC_DEV_OX25 NO /* X25 Drivers */
#define SC_X25 (SC_DEV_OX25) /* X.25 plp driver */
#define SC_SNDCF NO /* sndcf driver */
#define SC_IPCONV NO /* ip convergence driver */
#define SC_DEV_ISDN NO /* ISDN Drivers */
#define SC_PH (SC_DEV_ISDN) /* PH driver */
#define SC_LAPD (SC_DEV_ISDN + 0)/* LAPD driver Change 0 to 1 */
#define SC_IPCD (SC_DEV_ISDN + 0)/* IPCD driver Change 0 to 2 */
#define SC_DEV_MLPP NO /* MultiLink PPP Drivers */
#define SC_FRMUX (SC_DEV_MLPP) /* FRMUX driver */
#define SC_PPP (SC_DEV_MLPP + 0)/* PPP driver Change 0 to 1 */
#define SC_PIM (SC_DEV_MLPP + 0)/* PIM driver Change 0 to 2 */
#define SC_DEV_LOG NO
#define SC_DEV_PSMUX NO /* Sample Mux driver */
#define SC_DEV_PSLWR NO /* Sample loopback driver */
#define SC_DEV_SLLWR NO /* Sample loopback driver */
#define SC_DEVMAX 39 /* Maximum device number */
#define DEV_SERIAL (SC_DEV_SERIAL << 16)
#define DEV_PARALLEL (SC_DEV_PARALLEL << 16)
#define DEV_TIMER (SC_DEV_TIMER << 16)
#define DEV_RAMDISK (SC_DEV_RAMDISK << 16)
#define DEV_SCSI (SC_DEV_SCSI << 16)
#define DEV_SCSI_TAPE (SC_DEV_SCSI_TAPE << 16)
#define DEV_PSCONSOLE (SC_DEV_PSCONSOLE << 16)
#define DEV_NULL (SC_DEV_NULL << 16)
#define DEV_SYSCONSOLE ((SC_DEV_PSCONSOLE << 16) + SYSCONSOLE_DEV)
#define DEV_PSEUDO ((SC_DEV_PSCONSOLE << 16) + PSEUDO_DEV)
#define DEV_DLPI (SC_DEV_DLPI << 16)
#define DEV_TFTP (SC_DEV_TFTP << 16)
#define DEV_SPI (SC_DEV_SPI << 16)
#define DEV_WATCHDOG (SC_DEV_WATCHDOG << 16)
#define DEV_FLOPPY (SC_DEV_FLOPPY << 16)
#define DEV_IDE (SC_DEV_IDE << 16)
#define DEV_CMOS (SC_DEV_CMOS << 16)
#define DEV_CONSOLE (SC_DEV_CONSOLE << 16)
#define DEV_IP (SC_IP << 16)
#define DEV_ARP (SC_ARP << 16)
#define DEV_TCP (SC_TCP << 16)
#define DEV_UDP (SC_UDP << 16)
#define DEV_RAW (SC_RAW << 16)
#define DEV_LOOP (SC_LOOP << 16)
#define DEV_PHPI (SC_PHPI << 16)
#define DEV_LAPB (SC_LAPB << 16)
#define DEV_X25 (SC_X25 << 16)
#define DEV_SNDCF (SC_SNDCF << 16)
#define DEV_IPCONV (SC_IPCONV << 16)
#define DEV_PH (SC_PH << 16)
#define DEV_LAPD (SC_LAPD << 16)
#define DEV_IPCD (SC_IPCD << 16)
#define DEV_FRMUX (SC_FRMUX << 16)
#define DEV_PIM (SC_PIM << 16)
#define DEV_PPP (SC_PPP << 16)
#define DEV_LOG (SC_DEV_LOG << 16)
#define DEV_PSMUX (SC_DEV_PSMUX << 16)
#define DEV_PSLWR (SC_DEV_PSLWR << 16)
#define DEV_SLLWR (SC_DEV_SLLWR << 16)
#if (BSP_CPUFAMILY == FAMILY_X86) && (SC_APP_CONSOLE == PCCON)
#define CONSOLE DEV_CONSOLE
#else
#define CONSOLE DEV_SERIAL
#endif
/***********************************************************************/
/* TFTP Configuration Parameters. */
/***********************************************************************/
#if DEV_TFTP
#define SC_MAX_TFTP_CHAN 1
#endif
/***********************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T L I B R A R Y P A R A M S */
/* */
/***********************************************************************/
#define SC_MMULIB NO
/***********************************************************************/
/* */
/* C O M P O N E N T C O N F I G U R A T I O N P A R A M E T E R S */
/* */
/* These parameters should work as is for this application. You */
/* may want to change some of them if you start customizing this */
/* application. */
/* */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/* pSOS+ configuration parameters */
/*---------------------------------------------------------------------*/
#define KC_RN0USIZE 0x100 /* region 0 unit size */
#define KC_NTASK 25 /* max number of tasks */
#define KC_NQUEUE 10 /* max number of message queues */
#define KC_NSEMA4 30 /* max number of semaphores */
#define KC_NMSGBUF 256 /* max number of message buffers */
#define KC_NTIMER 10 /* max number of timers */
#define KC_NLOCOBJ 50 /* max number of local objects */
#define KC_TICKS2SEC 100 /* clock tick interrupt frequency */
#define KC_TICKS2SLICE 10 /* time slice quantum, in ticks */
#define KC_SYSSTK 0x1000 /* pSOS+ system stack size (bytes) */
#define KC_ROOTSSTK 0x2000 /* ROOT supervisor stack size */
#define KC_ROOTUSTK 0 /* ROOT user stack size */
#define KC_ROOTMODE (T_SUPV | T_ISR) /* ROOT initial mode */
#define KC_ROOTPRI 230 /* ROOT task priority */
#define KC_NMUTEX 0 /* Max number of Mutex's */
#define KC_NCVAR 0 /* Max number of condition variables */
#define KC_NTVAR 0 /* Max number of task variable */
#define KC_NCOCB 1 /* Max number of callouts */
#define KC_IDLESTK 0x1000 /* IDLE stack size */
#define KC_MAXDNTENT 0 /* max number of device names in DNT */
#define KC_DNLEN 10 /* max length of a device name in DNT */
#define KC_NTSD 0 /* Max # of TSD entries */
#define KC_MAXIO (SC_DEVMAX+1) /* Max # of devices in the system */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a pSOSystem routine as a fatal error handler */
/* #define KC_FATAL ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a fatal error handler */
/* extern void MyHandler (void); */
/* #define KC_FATAL ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define KC_STARTCO 0 /* callout at task activation */
#define KC_DELETECO 0 /* callout at task deletion */
#define KC_SWITCHCO 0 /* callout at task switch */
#define KC_FATAL 0 /* fatal error handler address */
#define KC_IDLECO 0 /* Idle Task Callout */
#define KC_RTCINITCO 0 /* RTC INIT Callout */
/*---------------------------------------------------------------------*/
/* pSOS+m configuration parameters */
/*---------------------------------------------------------------------*/
#define MC_NGLBOBJ 8 /* size of gbl obj table */
#define MC_NAGENT 10 /* number of RPC agents in this node */
#define MC_FLAGS SEQWRAP_ON /* operating mode flags */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following definition */
/* */
/* Using a pSOSystem routine as a roster change handler */
/* #define MC_ROSTER ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a roster change handler */
/* extern void MyHandler (void); */
/* #define MC_ROSTER ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define MC_ROSTER 0 /* addr of user roster change callout */
#define MC_KIMAXBUF 100 /* maximum KI packet buffer length */
#define MC_ASYNCERR 0 /* asynchronous calls error callout */
/*---------------------------------------------------------------------*/
/* pROBE configuration parameters - note that the SMODE flag bits are */
/* irrelevant if SC_SD_DEBUG_MODE = DBG_AP. */
/*---------------------------------------------------------------------*/
#define TD_BRKOPC 0 /* Instruction break opcode */
#define TD_ILEV (MAX_ILEV << 12) /* pROBE+ interrupt mask */
#define TD_FLAGS (NODOTS_MASK | TD_ILEV | NOTUPD_MASK)/* flags */
#define TD_DBGPRI 244 /* Debugger task priority */
/*---------------------------------------------------------------------*/
/* The variable defined down should be set to the Starting address for */
/* for pROBE+ DATA AREA. This is required by all the smaller boards. */
/* NOTE: */
/* Setting of this value should have atleast 0x4400 bytes Free */
/* Space from that location. */
/*---------------------------------------------------------------------*/
#define TD_DATASTART 0x0
/*---------------------------------------------------------------------*/
/* pHILE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define FC_LOGBSIZE 9 /* Block size (base-2 exponent) */
#define FC_NBUF 6 /* Number of cache buffers */
#define FC_NMOUNT 3 /* Max # of mounted volumes */
#define FC_NFCB 10 /* Max # of opened files per system */
#define FC_NCFILE 2 /* Max # of opened files per task */
#define FC_NDNLC 0 /* Max # of cached directory entries */
/*---------------------------------------------------------------------*/
/* Set the value for FC_ERRCO. It will be called if there is an error */
/* during IO operation on the Volume */
/* */
/* Sample call-out is defined below (fc_errco). */
/*---------------------------------------------------------------------*/
#if SC_PHILE
#include <phile.h> /* pHILE+ types definitions for FC_ERRCO */
extern ULONG
fc_errco(int direction, ULONG err_code, const struct buffer_header *buffer);
#define FC_ERRCO 0 /* I/O error call-out */
#endif /* SC_PHILE */
/*---------------------------------------------------------------------*/
/* pLM+ configuration parameters */
/*---------------------------------------------------------------------*/
#if SC_PLM
#include <plm.h> /* pLM+ type definitions */
#define LM_MAXREG 8 /* Max # of registered libraries */
#define LM_DATA 0 /* pLM+ data area */
#define LM_DATASIZE 0 /* pLM+ data area size */
/***********************************************************************/
/* Setting the LM_DEFAULT_COUTS to YES will use the default Callout */
/* mechanism provided by pSOSystem. Else */
/* It needs to be defined by the User. */
/* If User is not defining the call outs then pLM+ will jump to ZERO */
/* Address for execution. */
/***********************************************************************/
#define LM_DEFAULT_COUTS YES
#if LM_DEFAULT_COUTS
extern ULONG lm_loadco(const char *libname, ULONG scope, ULONG version,
const void *libinfo, /* Out */ sl_attrib *attr);
extern ULONG lm_unloadco(const sl_attrib *attr);
#define LM_LOADCO lm_loadco /* sl_acquire() Load call-out */
#define LM_UNLOADCO lm_unloadco /* sl_release() Unload call-out */
#else /* LM_DEFAULT_COUTS == NO */
#define LM_LOADCO 0
#define LM_UNLOADCO 0
#endif
#endif
/*---------------------------------------------------------------------*/
/* pREPC+ configuration parameters */
/*---------------------------------------------------------------------*/
#define LC_BUFSIZ (1 << FC_LOGBSIZE) /* I/O buffer size */
#define LC_NUMFILES 5 /* Max number of open files per task */
#define LC_WAITOPT 0 /* Wait option for memory allocation */
#define LC_TIMEOPT 0 /* Timeout option for mem allocation */
#define LC_SSIZE 512 /* Size of print buffer */
/*---------------------------------------------------------------------*/
/* pREPC+ stdin, stdout and stderr device mapping. */
/*---------------------------------------------------------------------*/
#if (SC_DEV_PSCONSOLE)
#define LC_STDIN "///dev/stdin" /* The default STDIN device */
#define LC_STDOUT "///dev/stdout" /* The default STDOUT device */
#define LC_STDERR "///dev/stderr" /* The default STDERR device */
#elif (BSP_CPUFAMILY == FAMILY_X86) && (SC_APP_CONSOLE == PCCON)
#define LC_STDIN "///dev/pcconsole" /* Make PCCON as STDIN device */
#define LC_STDOUT "///dev/pcconsole" /* Make PCCON as STDOUT device */
#define LC_STDERR "///dev/pcconsole" /* Make PCCON as STDERR device */
#elif (SC_DEV_SERIAL)
#define LC_STDIN "///dev/tty" /* Make TTY the STDIN device */
#define LC_STDOUT "///dev/tty" /* Make TTY the STDOUT device */
#define LC_STDERR "///dev/tty" /* Make TTY the STDERR device */
#elif (SC_DEV_SIMCONSOLE)
#define LC_STDIN "///dev/simconsole" /* Make simconsole STDIN */
#define LC_STDOUT "///dev/simconsole" /* Make simconsole STDOUT */
#define LC_STDERR "///dev/simconsole" /* Make simconsole STDERR */
#else
#define LC_STDIN "///dev/null" /* Make NULL the STDIN device */
#define LC_STDOUT "///dev/null" /* Make NULL the STDOUT device */
#define LC_STDERR "///dev/null" /* Make NULL the STDERR device */
#endif
#if (SC_DEV_RAMDISK)
#define LC_TEMPDIR DEV_RAMDISK /* The default TEMPDIR device */
#elif (SC_DEV_SCSI)
#define LC_TEMPDIR DEV_SCSI /* The default TEMPDIR device */
#elif (SC_DEV_IDE)
#define LC_TEMPDIR DEV_IDE /* The default TEMPDIR device */
#elif (SC_DEV_FLOPPY)
#define LC_TEMPDIR DEV_FLOPPY /* The default TEMPDIR device */
#else
#define LC_TEMPDIR 0 /* The default TEMPDIR device */
#endif
/*---------------------------------------------------------------------*/
/* pNA+ configuration parameters */
/* */
/* NOTE: If you get pNA+ errno 5F01 FAT_INSUFFMEM you may need to */
/* decrease the number of buffers allocated here for pNA+. */
/* In general this error means pNA+ could not allocate enough */
/* memory from Region 0 for the number of buffers requested. */
/*---------------------------------------------------------------------*/
#define NC_NNI 5 /* size of pNA NI Table */
#define NC_NROUTE 10 /* size of pNA Routing Table */
#define NC_NARP 20 /* size of pNA ARP table */
#define NC_DEFUID 0 /* Default User ID of a task */
#define NC_DEFGID 0 /* Default Group ID of a task */
#define NC_HOSTNAME "scg" /* Hostname of the node */
#define NC_NHENTRY 8 /* Number of Host table entries */
#define NC_NMCSOCS 0 /* Number of IP multicast sockets */
#define NC_NMCMEMB 0 /* Number of distict IP multicast */
/* group memberships per interface */
#define NC_NNODEID 0 /* Network NODE ID for unnumbered link */
#define NC_NSOCKETS 4 /* Number of sockets in the system */
#define NC_NDESCS 4 /* # of socket descriptors/task */
#define NC_MBLKS 300 /* # of message blocks in the system */
#define NC_BUFS_0 64 /* number of 0 length buffers */
#define NC_BUFS_32 0 /* number of 32 length buffers */
#define NC_BUFS_64 0 /* number of 64 length buffers */
#define NC_BUFS_128 256 /* number of 128 byte buffers */
#define NC_BUFS_256 0 /* number of 256 byte buffers */
#define NC_BUFS_512 0 /* number of 512 byte buffers */
#define NC_BUFS_1024 16 /* number of 1k byte buffers */
#define NC_BUFS_2048 48 /* number of 2k byte buffers */
#define NC_BUFS_4096 0 /* number of 4k byte buffers */
#define NC_MAX_BUFS 9 /* max number of NC_BUFS types */
#define NC_PNAMEM_NEWSCHEME YES /* apply new pNA MEM management scheme*/
#define NC_BUFS_XX_INTERNAL 20 /* # of buffers for internal pNA usage */
#define NC_MBLKS_INT_PERCENT 15 /* % of mblks reserved for pNA internal */
#define NC_MBLKS_TX_PERCENT 40 /* % of mblks reserved for Tx Mem Pool */
#define NC_BUFS_0_TX_PERCENT 50 /* % of 0 length buffers used for Tx */
#define NC_BUFS_32_TX_PERCENT 50 /* % of 32 length buffers used for Tx */
#define NC_BUFS_64_TX_PERCENT 50 /* % of 64 length buffers used for Tx */
#define NC_BUFS_128_TX_PERCENT 50 /* % of 128 byte buffers used for Tx */
#define NC_BUFS_256_TX_PERCENT 50 /* % of 256 byte buffers used for Tx */
#define NC_BUFS_512_TX_PERCENT 50 /* % of 512 byte buffers used for Tx */
#define NC_BUFS_1024_TX_PERCENT 50 /* % of 1k byte buffers used for Tx */
#define NC_BUFS_2048_TX_PERCENT 50 /* % of 2k byte buffers used for Tx */
#define NC_BUFS_4096_TX_PERCENT 50 /* % of 4k byte buffers used for Tx */
/*---------------------------------------------------------------------*/
/* pNA+ daemon task configuration parameters */
/*---------------------------------------------------------------------*/
#define NC_DTASK_STKSZ 0x800 /* pNAD daemon task stack size */
#define NC_DTASK_PRIO 255 /* pNAD daemon task priority */
#define NC_REENTRANT YES /* pNA+ reentrant */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a user written routine as a pNA+ Signal Handler */
/* extern void MySigHandler (void); */
/* #define NC_SIGNAL ((void (*)()) MySigHandler) */
/* */
/*---------------------------------------------------------------------*/
#define NC_SIGNAL 0 /* pNA+ Signal Hdlr */
/*---------------------------------------------------------------------*/
/* pRPC+ configuration parameters */
/*---------------------------------------------------------------------*/
#define NR_PMAP_PRIO 254 /* task priority */
#define NR_PMAP_SSTACK 0x2000 /* supervisor stack size */
#define NR_PMAP_USTACK 0x100 /* user stack size */
#define NR_PMAP_FLAGS T_LOCAL /* t_create flags */
#define NR_PMAP_MODE T_SUPV /* t_start mode */
#define NR_OPEN_SOCKET SC_PSE_PRPC /* open socket, if open rpc */
/*---------------------------------------------------------------------*/
/* User can change these TWO defines to have their own handlers. */
/*---------------------------------------------------------------------*/
#define NR_GETHOSTNAME nr_gethostname /* Function to get local */
/* host name */
#define NR_GET_HENTBYNAME nr_get_hentbyname /* Function to map host */
/* name to it's IP Addr */
/*---------------------------------------------------------------------*/
/* pSE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define SE_NBUFS_0 64 /* number of 0 length buffers */
#define SE_NBUFS_32 128 /* number of 32 byte buffers */
#define SE_NBUFS_64 128 /* number of 64 byte buffers */
#define SE_NBUFS_128 256 /* number of 128 byte buffers */
#define SE_NBUFS_256 32 /* number of 256 byte buffers */
#define SE_NBUFS_512 32 /* number of 512 byte buffers */
#define SE_NBUFS_1024 16 /* number of 1k byte buffers */
#define SE_NBUFS_2048 16 /* number of 2k byte buffers */
#define SE_NBUFS_4096 8 /* number of 4k byte buffers */
#define SE_MAX_BUFS 9 /* max number of stream buffer types */
#define SE_MAX_MODULES 4 /* max number of streams modules */
#define SE_SHARE_NI NO /* LAN-NI with streams? */
#define SE_DATA_SIZE 0x1000 /* size of pSE data area */
/* (must be at least 3K) */
#define SE_TASK_PRIO 250 /* priority for pSE task */
#define SE_STACK_SIZE 0x2000 /* stack size for pSE task */
#define SE_DEF_UID 0 /* default user id */
#define SE_DEF_GID 0 /* default group id */
#define SE_N_FDS 32 /* max # of system-wide */
/* stream descriptors */
#define SE_N_TASKFDS 8 /* max # of per-task stream */
/* descriptors */
#define SE_N_LINKS 32 /* max # of multiplexing links */
#define SE_N_TIMEOUTS 32 /* max # of timeout requests */
#define SE_N_BUFCALLS 32 /* max # of bufcall requests */
#define SE_N_QUEUES 256 /* # of queues */
#define SE_N_QBANDS (SE_N_QUEUES * 2) /* # of qbands */
#define SE_N_MBLKS 512 /* # of message blocks */
#define SE_PRI_BANDS NO /* Whether priority bands are desired */
#define SE_STRLOG YES /* Whether the log facility is cnfgrd */
#define SE_TMO_RES 2 /* pSE Timer resolution in ticks */
#define SE_MAX_AUTOPUSH 10 /* Max # of autopush entries */
#define SE_SIGHANDLER NULL /* pSE global signal handler */
#define SE_PRINTF printf /* pSE printf function */
#define SE_LOG_BUFSIZE 100 /* Maximum size of the log message */
#define SE_NUM_LOG_BUFFERS 25 /* Number of log buffs to be allocated*/
#define SE_BUF_BORROW_LEVEL 0 /* The buffer borrowing level desired */
#define SE_NO_GLOBAL_LOCKING NO /* Whether global locking is desired */
#define SE_PCRASH_BUF_SIZE 8192 /* default pcrash buffer size */
#define SE_HI_BUF_RESVN_PERCENT 12 /* Hi buffer reservation % */
#define SE_MED_BUF_RESVN_PERCENT 13 /* Med buffer reservation % */
/*---------------------------------------------------------------------*/
/* Loader configuration parameters */
/* */
/* YES indicates for each module to be linked in. NO means do not link */
/* object module loader into this application. */
/* */
/*---------------------------------------------------------------------*/
#define LD_MAX_LOAD 8 /* Max. # of active loads */
#define LD_ELF_MODULE NO /* ELF object-load-module */
#define LD_SREC_MODULE NO /* SREC object-load-module */
#define LD_COFF_MODULE NO /* COFF object-load-module */
#define LD_IEEE_MODULE NO /* IEEE object-load-module */
#define LD_IHEX_MODULE NO /* IHEX object-load-module */
/*---------------------------------------------------------------------*/
/* pMONT+ configuration parameters - note that PM_DEV and PM_BAUD are */
/* only relevant to serial communication (PM_CMODE = 2) */
/*---------------------------------------------------------------------*/
#define PM_CMODE 1 /* 1 = networking, 2 = serial */
/*---------------------------------------------------------------------*/
/* PM_DEV down uses a macro to calculate the channel number, which is */
/* SERIAL_DRVRNUM(0). This means Low-Level Driver 0 (1) is used for */
/* default PM_DEV. If you need to change this to another Low-Level */
/* Serial Driver, change "0" in the macro SERIAL_DRVRNUM(0) to the */
/* number of the driver you want. */
/* */
/* Consult the "README" file in BSP directory for number of different */
/* drivers supported and for the SERIAL_DRVRNUM mapping for those */
/* drivers. */
/*---------------------------------------------------------------------*/
#define PM_DEV (2 + SERIAL_DRVRNUM(0))
/* Minor Device number for serial */
/* channel if used */
#define PM_BAUD 9600 /* Baud rate for serial chnl */
#define PM_TRACE_BUFF 0 /* Address of trace buffer -- */
/* Allocated by pSOSystem if 0 */
#define PM_TRACE_SIZE 0x6000 /* Size of trace buffer */
#define PM_TIMER YES /* 2nd timer for finer time */
/* within data collection */
/*---------------------------------------------------------------------*/
/* General Serial Block Configuration Parameters */
/*---------------------------------------------------------------------*/
#define GS_BUFS_0 64 /* number of 0 length buffers */
#define GS_BUFS_32 128 /* number of 32 byte buffers */
#define GS_BUFS_64 128 /* number of 64 byte buffers */
#define GS_BUFS_128 256 /* number of 128 byte buffers */
#define GS_BUFS_256 32 /* number of 256 byte buffers */
#define GS_BUFS_512 32 /* number of 512 byte buffers */
#define GS_BUFS_1024 16 /* number of 1k byte buffers */
#define GS_BUFS_2048 16 /* number of 2k byte buffers */
#define GS_BUFS_4096 8 /* number of 4k byte buffers */
#define GS_MBLKS 680
#define GS_MAX_BUFS 9 /* max number of serial buffer types */
/*---------------------------------------------------------------------*/
/* TCP/IP for OpEN configuration parameters */
/*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/* Configurable parameters for the Network layer (IP) */
/*---------------------------------------------------------------------*/
#define OTCP_IPMAX 8 /* Max # of open IP device */
#define OTCP_IPNINTERFACES 4 /* Max # of network interfaces */
#define OTCP_IPNROUTES 64 /* Max #of routing tbl entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for ARP */
/*---------------------------------------------------------------------*/
#define OTCP_ARPMAX 8 /* Max # of open ARP device */
#define OTCP_ARPNINTERFACES 4 /* Max # of ARP interfaces */
#define OTCP_ARPNENTRIES 32 /* Max # of ARP table entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for TCP */
/*---------------------------------------------------------------------*/
#define OTCP_TCPMAX 64 /* Max # of open TCP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for UDP */
/*---------------------------------------------------------------------*/
#define OTCP_UDPMAX 32 /* Max # of open UDP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for RAW */
/*---------------------------------------------------------------------*/
#define OTCP_RAWMAX 32 /* Max # of open RAW device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for LOOP */
/*---------------------------------------------------------------------*/
#define OTCP_LOOPMAX 2 /* Max # of open LOOP device */
#endif /* _SYS_CONF_H */
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,53 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: oemtypes.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.6 2001/01/19 22:22:58 paul
* Update copyright.
*
* Revision 1.5 2000/03/17 00:10:01 meister
* Update copyright message
*
* Revision 1.4 2000/02/17 16:38:08 josh
* removing obsolete definitions
*
* Revision 1.3 1998/08/13 20:11:31 josh
* updates for pSOS
*
* Revision 1.2 1998/06/28 21:18:28 josh
* updating/bugfixing for SNMp
*
* Revision 1.1 1998/06/19 16:09:06 josh
* port files for building SNMp
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stddef.h>
@@ -0,0 +1,376 @@
#* @(#) pSOSystem PowerPC/V2.2.2: configs/ppc/config.mk 1.59 97/09/12 10:00:37 *
#***********************************************************************
#* *
#* MODULE: config.mk *
#* DATE: 97/09/12 *
#* PURPOSE: Macro definitions, linker commands, etc, for "make" *
#* *
#*---------------------------------------------------------------------*
#* *
#* Copyright 2000-2001 Wind River Systems, Inc.
#* Copyright 1991 - 1997, Integrated Systems, Inc. *
#* ALL RIGHTS RESERVED *
#* *
#* Permission is hereby granted to licensees of Integrated Systems, *
#* Inc. products to use or abstract this computer program for the *
#* sole purpose of implementing a product based on Integrated *
#* Systems, Inc. products. No other rights to reproduce, use, *
#* or disseminate this computer program, whether in part or in *
#* whole, are granted. *
#* *
#* Integrated Systems, Inc. makes no representation or warranties *
#* with respect to the performance of this computer program, and *
#* specifically disclaims any responsibility for any damages, *
#* special or consequential, connected with the use of this program. *
#* *
#*---------------------------------------------------------------------*
#***********************************************************************
#
#------------------------------------------------------------------------
# Compiler commands and command-line options
#------------------------------------------------------------------------
# Add following option to COPTS_FILE2 to generate listing files
# -W:as:,-l -Xpass-source
#------------------------------------------------------------------------
CC = dcc
COMP_OPTS1 = -O -t$(DTARGET)E$(DFP):psos -Xsmall-data=8
COMP_OPTS2 = -Xstruct-best-align=0 -Xansi -D__DIAB -DPPC
COPTS_FILE1 = -I. -I$(PSS_BSP) -I$(PSS_ROOT)/include
COPTS_FILE2 = $(PSS_APPINCS) -c
COPTS = -@c.opt
#------------------------------------------------------------------------
# Assembler command-line options
#------------------------------------------------------------------------
AS = das
#------------------------------------------------------------------------
# Added target switch for the assembler
# The target definition is located in bsp.mk of the bsp you are using
#------------------------------------------------------------------------
# Add following option to AOPTS_FILE1 to generate listing files -l
#------------------------------------------------------------------------
AOPTS_FILE1 = -I. -I$(PSS_BSP) -I$(PSS_ROOT)/include
AOPTS_FILE2 = $(PSS_APPINCS) -t$(DTARGET)E$(DFP)
AOPTS = -@a.opt
#------------------------------------------------------------------------
# Linker command name
#------------------------------------------------------------------------
LD = dcc
LOPTS = -Ws -t$(DTARGET)E$(DFP) -Wl,-Xsupress-dot -Xreloc-bug -m2
#------------------------------------------------------------------------
# Librarian command name and options
#------------------------------------------------------------------------
LIB = dar
LIBOPTS = -qf
LIBOPTS_SORT = -sR
#========================================================================
# Link everything together
#========================================================================
CFG1_OBJS= sysinit.o philecfg.o pnacfg.o prepccfg.o dialog.o
CFG2_OBJS= probecfg.o prpccfg.o psecfg.o psoscfg.o pmontcfg.o
CFG3_OBJS= pollio.o bspcfg.o gsblkcfg.o rdi_ser.o
ram.elf: c.opt a.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
prepcv.o \
$(PSS_DRVOBJS) \
$(DRV_LIB1) $(DRV_LIB2) $(DRV_LIB3) $(DRV_LIB4) $(DRV_LIB5) \
$(PSS_APPOBJS) \
$(APP_LIB1) $(APP_LIB2) $(APP_LIB3) $(APP_LIB4) $(APP_LIB5) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_BSP)/ram_di.lnk
@cat $(PSS_BSP)/ram_di.lnk >cmd.lnk
@echo $(LOPTS) -o ram.elf -Wm cmd.lnk begin.o > l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo prepcv.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo $(PSS_BSP)/libbsp.a >> l.opt
@echo $(PSS_ROOT)/sys/os/libsys.a >> l.opt
@echo -L $(PSS_ROOT)/sys/libc -lprepc >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > ram.map
ddump -tv ram.elf >> ram.map
ram.hex: ram.elf
ddump -Rv ram.elf -o ram.hex
rom.elf: c.opt a.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
prepcv.o \
$(PSS_DRVOBJS) \
$(DRV_LIB1) $(DRV_LIB2) $(DRV_LIB3) $(DRV_LIB4) $(DRV_LIB5) \
$(APP_LIB1) $(APP_LIB2) $(APP_LIB3) $(APP_LIB4) $(APP_LIB5) \
$(PSS_BSP)/libbsp.a \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_BSP)/rom_di.lnk
@cat $(PSS_BSP)/rom_di.lnk >cmd.lnk
@echo $(LOPTS) -o rom.elf -Wm cmd.lnk begin.o > l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo prepcv.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo $(PSS_BSP)/libbsp.a >> l.opt
@echo $(PSS_ROOT)/sys/os/libsys.a >> l.opt
@echo -L $(PSS_ROOT)/sys/libc -lprepc >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > rom.map
ddump -tv rom.elf >> rom.map
rom.hex: rom.elf
ddump -Rv rom.elf -o rom.hex
os.elf: c.opt a.opt begin.o \
makefile \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
prepcv.o \
$(PSS_DRVOBJS) \
$(DRV_LIB1) $(DRV_LIB2) $(DRV_LIB3) $(DRV_LIB4) $(DRV_LIB5) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_BSP)/os.lnk
@cat $(PSS_BSP)/os.lnk >cmd.lnk
@echo $(LOPTS) -o os.elf -Wm cmd.lnk begin.o > l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo prepcv.o >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo $(PSS_BSP)/libbsp.a >> l.opt
@echo $(PSS_ROOT)/sys/os/libsys.a >> l.opt
@echo -L $(PSS_ROOT)/sys/libc -lprepc >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > os.map
ddump -tv os.elf >> os.map
os.hex: os.elf
ddump -Rv os.elf -o os.hex
app.elf: c.opt a.opt begina.o \
makefile \
$(PSS_APPOBJS) \
$(APP_LIB1) $(APP_LIB2) $(APP_LIB3) $(APP_LIB4) $(APP_LIB5) \
prepcv.o \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_BSP)/app.lnk
@cat $(PSS_BSP)/app.lnk >cmd.lnk
@echo $(LOPTS) -o app.elf -Wm cmd.lnk begina.o > l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo prepcv.o >> l.opt
@echo $(PSS_ROOT)/sys/os/libsys.a >> l.opt
@echo -L $(PSS_ROOT)/sys/libc -lprepc >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app.map
ddump -tv app.elf >> app.map
app.hex: app.elf
ddump -Rv app.elf -o app.hex
#------------------------------------------------------------------------
# Compile or assemble modules which are always used.
#------------------------------------------------------------------------
begin.o: $(PSS_CONFIG)/begin.s makefile \
$(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o begin.o $(PSS_CONFIG)/begin.s
begina.o: $(PSS_CONFIG)/begina.s makefile \
$(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o begina.o $(PSS_CONFIG)/begina.s
gsblkcfg.o: $(PSS_CONFIG)/gsblkcfg.c \
makefile \
$(PSS_ROOT)/include/gsblk.h \
$(PSS_CONFIG)/config.mk \
sys_conf.h
$(CC) $(COPTS) $(PSS_CONFIG)/gsblkcfg.c
sysinit.o: $(PSS_CONFIG)/sysinit.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/apdialog.h \
$(PSS_ROOT)/include/pna.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/sysinit.c
philecfg.o: $(PSS_CONFIG)/philecfg.c \
makefile \
sys_conf.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/philecfg.c
pnacfg.o: $(PSS_CONFIG)/pnacfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/pna.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/pnacfg.c
prepccfg.o: $(PSS_CONFIG)/prepccfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/prepccfg.c
probecfg.o: $(PSS_CONFIG)/probecfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/probecfg.c
prpccfg.o: $(PSS_CONFIG)/prpccfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/prpccfg.c
psecfg.o: $(PSS_CONFIG)/psecfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/psecfg.c
psoscfg.o: $(PSS_CONFIG)/psoscfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/psoscfg.c
pmontcfg.o: $(PSS_CONFIG)/pmontcfg.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/pmontcfg.c
dialog.o: $(PSS_CONFIG)/dialog.c \
makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/apdialog.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_ROOT)/include/version.h \
$(PSS_ROOT)/include/stdarg.h \
$(PSS_ROOT)/include/pna.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/dialog.c
pollio.o: $(PSS_CONFIG)/pollio.c makefile \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/stdarg.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/pollio.c
prepcv.o: $(PSS_ROOT)/sys/os/prepcv.c makefile \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_ROOT)/sys/os/prepcv.c
bspcfg.o: $(PSS_BSP)/bspcfg.c makefile \
$(PSS_CONFIG)/config.mk \
sys_conf.h \
$(PSS_BSP)/bsp.h
@echo -I$(PSS_ROOT)/bsps/devices > bsp.opt
$(CC) $(COPTS) -@bsp.opt $(PSS_BSP)/bspcfg.c
@rm bsp.opt
rdi_ser.o: $(PSS_CONFIG)/rdi_ser.c makefile \
sys_conf.h \
$(PSS_BSP)/bsp.h \
$(PSS_ROOT)/include/bspfuncs.h \
$(PSS_ROOT)/include/configs.h \
$(PSS_ROOT)/include/sysvars.h \
$(PSS_CONFIG)/config.mk
$(CC) $(COPTS) $(PSS_CONFIG)/rdi_ser.c
c.opt: makefile
@echo $(COMP_OPTS1) > c.opt
@echo $(COMP_OPTS2) >> c.opt
@echo $(COPTS_FILE1) >> c.opt
@echo $(COPTS_FILE2) >> c.opt
a.opt: makefile
@echo $(AOPTS_FILE1) > a.opt
@echo $(AOPTS_FILE2) >> a.opt
@@ -0,0 +1,536 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/ppc222/drv_conf.h,v 1.1.1.1 2001/11/05 17:47:10 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: drv_conf.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:10 tneale
* Tornado shuffle
*
* Revision 1.5 2001/01/19 22:22:58 paul
* Update copyright.
*
* Revision 1.4 2000/03/17 00:10:04 meister
* Update copyright message
*
* Revision 1.3 1998/08/20 18:01:19 josh
* sys_conf.h cleanup
*
* Revision 1.2 1998/08/19 21:38:31 josh
* adding copyright stuff.
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* @(#) pSOSystem x86/V2.2.6: apps.v22/xxxx/drv_conf.c 3.3 (snmpv2) 98/01/09 12:28:00 */
/***********************************************************************/
/* */
/* MODULE: drv_conf.c */
/* DATE: 98/01/09 */
/* PURPOSE: pSOSystem driver configuration and initialization */
/* */
/* There are two functions in this file: */
/* */
/* SetUpDrivers to setup drivers except for Network drivers */
/* SetUpNI to setup Network drivers */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1993 - 1997, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* */
/* */
/***********************************************************************/
#include <sys_conf.h>
#include "bsp.h"
#include <bspfuncs.h>
#include <configs.h>
#include <sysvars.h>
#include <pna.h>
#if SC_DEV_SPI
#include "spi.h"
#endif
#if (SC_PSE)
#include <psecfg.h>
#include <sys/stream.h>
#endif
#if (SC_DEV_DLPI)
extern long DlpiEnet();
#endif
#define NULLF (ULONG) ((void (*)()) 0)
void InstallNi(int (*entry)(), int, int, int, int, int, int);
static const char RarpErrTimeout[] =
"RARP request failed: Check for a RARP server";
static const char RarpErrNet[] =
"RARP request failed: Network Error";
#if SC_PSOS || SC_PSOSM
/***********************************************************************/
/* SetUpDrivers: installs drivers in PsosIO table via a call to */
/* InstallDriver and then calls driver setup function if */
/* needed. NOTE: If the driver is to be part of the */
/* Network Interface then it should be placed in the */
/* SetUpNI function. */
/* */
/* INPUT: FreeMemPtr = A pointer to unused memory that can be */
/* used to allocate space for a driver. */
/* NOTE: Be sure to advance FreeMemPtr if */
/* memory is allocates! */
/* */
/* RETURNS: The new address of free memory after the drivers have */
/* allocated space. */
/* */
/* NOTE: This function does many precompile checks so errors */
/* can be found during compile-time rather then at run- */
/* time. */
/* */
/* To add a non-Network driver to pSOSystem, call InstallDriver(). */
/* This adds a device driver to the PsosIO table. InstallDriver() */
/* takes the following arguments: */
/* */
/* unsigned short major_number device major number */
/* void (*dev_init)(), device init procedure */
/* void (*dev_open)(), device open procedure */
/* void (*dev_close)(), device close procedure */
/* void (*dev_read)(), device read procedure */
/* void (*dev_write)(), device write procedure */
/* void (*dev_ioctl)(), device control procedure */
/* unsigned long rsvd1, reserved */
/* unsigned short rsvd2) reserved */
/* unsigned short flags; If set to IO_AUTOINIT pSOS will */
/* automatically call the */
/* drivers initialization */
/* function. The SC_AUTOINIT */
/* #define which is set in */
/* sys_conf.h can be used to set */
/* this element. */
/* */
/* InstallDriver() does not return a value. InstallDriver() assumes */
/* SC_DEVMAX is defined in sys_conf.h and is useful only before pSOS+ */
/* has been initialized. */
/* */
/* If you are adding a driver that needs to be initialized before */
/* either pSOS+ is initialized or the driver's init function is */
/* called, then you can call a setup function (that you create) for */
/* the driver (for example, see the CnslSetup call for the serial */
/* device driver). If your initialization function needs to allocate */
/* memory, you may pass it the FreeMemPtr. The function should return */
/* a new FreeMemPtr which points to the end of the memory it has */
/* allocated. */
/* */
/* When adding code to install a new driver, it is a good idea to add */
/* precompile checks so errors can be found during compile-time rather */
/* then at run-time. Precompile checks are used, for example, in the */
/* code that installs the pSOSystem serial device driver below. */
/* */
/***********************************************************************/
UCHAR *SetUpDrivers(UCHAR *FreeMemPtr)
{
/*---------------------------------------------------------------------*/
/* Install the pSOSystem serial device driver. */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SERIAL && BSP_SERIAL)
#if(SC_DEV_SERIAL > SC_DEVMAX)
#error "SC_DEV_SERIAL cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SERIAL, CnslInit, NULLF, NULLF,CnslRead,
CnslWrite, CnslCntrl, 0, 0, SC_AUTOINIT);
FreeMemPtr = CnslSetup(FreeMemPtr, SysVars.DefBaud,
SC_APP_CONSOLE);
#endif
/*---------------------------------------------------------------------*/
/* Install Pseudo driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_PSEUDO)
InstallDriver(SC_DEV_PSEUDO, PseudoIOInit, NULLF, NULLF,
PseudoIORead, PseudoIOWrite, PseudoIOCntrl, 0, 0, 0);
#endif
/*--------------------------------------------------------------------*/
/* Setup pSOSystem PC console device driver */
/*--------------------------------------------------------------------*/
#if (SC_DEV_CONSOLE && BSP_CONSOLE)
#if (SC_DEV_CONSOLE >SC_DEVMAX)
#error "SC_DEV_CONSOLE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_CONSOLE, PcCnslInit, NULLF, NULLF,
PcCnslRead, PcCnslWrite, PcCnslCntrl, 0, 0,
SC_AUTOINIT);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem tick timer. */
/*---------------------------------------------------------------------*/
#if SC_DEV_TIMER
#if(SC_DEV_TIMER > SC_DEVMAX)
#error "SC_DEV_TIMER cannot be > SC_DEVMAX"
#endif
#if (!SC_PSOS && !SC_PSOSM)
#error "Must have pSOS+ or pSOS+m in system to use tick timer!"
#endif
InstallDriver(SC_DEV_TIMER, RtcInit, NULLF, NULLF, NULLF, NULLF,
NULLF, 0, 0, SC_AUTOINIT);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem ramdisk driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if SC_DEV_RAMDISK
#if(SC_DEV_RAMDISK > SC_DEVMAX)
#error "SC_DEV_RAMDISK cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_RAMDISK, RdskInit, NULLF, NULLF, RdskRead,
RdskWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem SCSI driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SCSI && BSP_SCSI)
#if(SC_DEV_SCSI > SC_DEVMAX)
#error "SC_DEV_SCSI cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SCSI, SdrvInit, NULLF, NULLF, SdskRead,
SdskWrite, SdrvCntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem SCSI Tape driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SCSI_TAPE && BSP_SCSI_TAPE)
#if(SC_DEV_SCSI_TAPE > SC_DEVMAX)
#error "SC_DEV_SCSI_TAPE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SCSI_TAPE, SdrvInit, StapeOpen, StapeClose,
StapeRead, StapeWrite, SdrvCntrl, 0, 0, 0);
/*-----------------------------------------------------------------*/
/* Don't need to call SdrvSetup this time since it was done before */
/*-----------------------------------------------------------------*/
/* SdrvSetup(); */
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem CMOS clock driver */
/*---------------------------------------------------------------------*/
#if (SC_DEV_CMOS && BSP_CLOCK)
#if (SC_DEV_CMOS >SC_DEVMAX)
#error "SC_DEV_CMOS cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_CMOS, NULLF, NULLF, NULLF, CmcRead,
CmcWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem printer driver */
/*---------------------------------------------------------------------*/
#if (SC_DEV_PARALLEL && BSP_PARALLEL)
#if (SC_DEV_PARALLEL >SC_DEVMAX)
#error "SC_DEV_PARALLEL cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_PARALLEL, ParInit, ParOpen, ParClose, NULLF,
ParWrite, ParCntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem floppy diskette driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_FLOPPY && BSP_FLOPPY)
#if (SC_DEV_FLOPPY >SC_DEVMAX)
#error "SC_DEV_FLOPPY cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_FLOPPY, FlpInit, NULLF, NULLF, FlpRead,
FlpWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem IDE disk driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_IDE && BSP_IDE)
#if (SC_DEV_IDE >SC_DEVMAX)
#error "SC_DEV_IDE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_IDE, IDEInit, NULLF, NULLF, IDERead,
IDEWrite, IDECntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem TFTP driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_TFTP)
#if(SC_DEV_TFTP > SC_DEVMAX)
#error "SC_DEV_TFTP cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_TFTP, TftpInit, TftpOpen, TftpClose, TftpRead,
NULLF, TftpCntl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the SPI driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SPI)
#if(SC_DEV_SPI > SC_DEVMAX)
#error "SC_DEV_SPI cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SPI, SPI_init, SPI_open, SPI_close, NULLF,
NULLF, SPI_io, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install pSE DLPI driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_DLPI)
{
#if(SC_DEV_DLPI > SC_DEVMAX)
#error "SC_DEV_DLPI cannot be > SC_DEVMAX"
#endif
extern long DlpiNullNI();
extern UCHAR *DlpiInit(UCHAR *, long, long);
extern int DlpiAddNI(long, long(*)(), long, long, char *, long);
extern void enetinit();
extern struct streamtab enetinfo;
char *DlpiErrMsg = "DlpiAddNI failed: NI Error";
static const psedrvparam_t eth0param = {"eth0", DT_CLONE,
&enetinfo, 0, 0};
InstallDriver(SC_DEV_DLPI, enetinit, NULLF, NULLF, NULLF,
NULLF, NULLF, (long)&eth0param, 0, 0);
/*-------------------------------------------------------------*/
/* Call DlpiInit to initialize the Streams DLPI driver */
/* Arguments passed to DlpiInit are: */
/* 1. Free memory address */
/* 2. Maximum NI interface number */
/* 3. Maximum number of streams per interface */
/*-------------------------------------------------------------*/
FreeMemPtr = DlpiInit(FreeMemPtr, 1, 6);
/*-------------------------------------------------------------*/
/* Call DlpiAddNI to add an NI interface to the Streams DLPI */
/* driver. DlpiAddNI must be called for each NI driver */
/* interface used with the Streams DLPI driver. */
/* Arguments passed to DlpiAddNI are: */
/* 1. NI interface number (should correspond to the pNA+ */
/* interface number if driver is shared with pNA+) */
/* 2. NI entry point */
/* 3. NI flags */
/* IFF_SELFLOOP 0x0001 loopback for self-address */
/* IFF_POLL_NI 0x0002 driver must be polled */
/* IFF_RAWMEM 0x2000 driver accepts mblk link list */
/* 4. NI major device number */
/* 5. NI multicast address */
/* 6. NI poll frequency (every # of elapsed ticks) */
/*-------------------------------------------------------------*/
#if (BSP_LAN1 && SE_SHARE_NI)
if (DlpiAddNI(1, (long(*)())BSP_LAN1_ENTRY, 0x2000,
SC_DEV_DLPI, 0, 0))
SysInitFail(DlpiErrMsg);
#else
if (DlpiAddNI(0, (long(*)())DlpiNullNI, 0, SC_DEV_DLPI, 0, 0))
SysInitFail(DlpiErrMsg);
#endif
}
#endif
/*-------------------------------------------------------------------*/
/* Install pSOSystem Watchdog driver */
/*-------------------------------------------------------------------*/
#if (SC_DEV_WATCHDOG)
#if(SC_DEV_WATCHDOG > SC_DEVMAX)
#error "SC_DEV_WATCHDOG cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_WATCHDOG, WdtInit, NULLF, NULLF, NULLF,
NULLF, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Additional drivers may be installed here. */
/*---------------------------------------------------------------------*/
return FreeMemPtr;
}
#endif /* SC_PSOS || SC_PSOSM */
#if SC_PNA
/***********************************************************************/
/* SetUpNI: Set up Network Interfaces for pNA+ */
/* */
/* INPUT: FreeMemPtr = A pointer to unused memory that can be */
/* used to allocate space for a driver. */
/* NOTE: Be sure to advance FreeMemPtr if */
/* memory is allocates! */
/* */
/* RETURNS: The new address of free memory after the drivers have */
/* allocated space. */
/* */
/* NOTES: This function does many precompile checks so errors */
/* can be found during compile-time rather then at run- */
/* time. */
/* */
/* Also, the Network Interface Table must be allocated */
/* before this function can be called. There cannot be */
/* more then NC_NNI entries in this table. NC_NNI is set */
/* in sys_conf.h. Before adding another interface, be */
/* sure to check sys_conf.h to see if NC_NNI is set to */
/* accommodate another one! */
/* */
/* See the pSOSystem Programmers Reference Manual */
/* for more information. */
/* */
/* To add a Network driver to pSOSystem, call InstallNi(). This adds */
/* the Network Interface to the pNA+ Network Interface Table. */
/* InstallNi() takes the following arguments: */
/* */
/* int (*entry)(); address of NI entry point */
/* int ipadd; IP address */
/* int mtu; maximum transmission length */
/* int hwalen; length of hardware address */
/* int flags; intErface flags */
/* int subnetaddr; subnet mask */
/* int dstipaddr; destination ip address */
/* */
/* See pSOSystem Programmer`s Reference Manual, Configuration Tables */
/* Section, for more information about the Network Interface Table. */
/* InstallNi() does not return a value. */
/* */
/* If you are adding a driver that needs to be initialized before */
/* either pSOS+ is initialized or the driver's init function is */
/* called, then you can call a setup function (that you create) for */
/* the driver (for example, see the CnslSetup call for the serial */
/* device driver). If your initialization function needs to allocate */
/* memory, you may pass it the FreeMemPtr. The function should return */
/* a new FreeMemPtr which points to the end of the memory it has */
/* allocated. */
/* */
/* When adding code to install a new driver, it is a good idea to add */
/* precompile checks so errors can be found during compile-time rather */
/* then at run-time. Precompile checks are used, for example, in the */
/* code that installs the pSOSystem serial device driver below. */
/* */
/***********************************************************************/
UCHAR *SetUpNI(UCHAR *FreeMemPtr)
{
int IPaddr;
/*---------------------------------------------------------------------*/
/* Install the pSOSystem NI. */
/*---------------------------------------------------------------------*/
#if BSP_LAN1
if (SysVars.Lan1)
{
/*-------------------------------------------------------------*/
/* If RARP is specified for the IP address, use it now to */
/* obtain the IP address for this interface. */
/*-------------------------------------------------------------*/
if (SysVars.Lan1IP == USE_RARP)
{
#if (SC_DEV_DLPI && SE_SHARE_NI)
IPaddr = RarpEth((long (*)())DlpiEnet);
#else
IPaddr = RarpEth((long (*)())BSP_LAN1_ENTRY);
#endif
if (IPaddr == 0)
SysInitFail(RarpErrTimeout);
if (IPaddr == -1)
SysInitFail(RarpErrNet);
}
else
IPaddr = SysVars.Lan1IP;
#if (SC_DEV_DLPI && SE_SHARE_NI)
InstallNi((int (*)())DlpiEnet, IPaddr,
#else
InstallNi((int (*)())BSP_LAN1_ENTRY, IPaddr,
#endif
BSP_LAN1_MTU, BSP_LAN1_HWALEN, BSP_LAN1_FLAGS,
SysVars.Lan1SubnetMask, 0);
}
#endif
/*---------------------------------------------------------------------*/
/* Install the shared memory NI. */
/*---------------------------------------------------------------------*/
#if BSP_SMEM
#if ((SC_NISM_LEVEL != 1) && (SC_NISM_LEVEL != 2))
#error "Illegal value for SC_NISM_LEVEL"
#endif
if (SysVars.Nism)
{
InstallNi((int (*)())NiSmem, SysVars.NismIP, NISM_MTU, 4, 0x8002,
SysVars.NismSubnetMask, 0);
/*-------------------------------------------------------------*/
/* Set up the NI Shared Memory driver by calling its function */
/* "NiSmemSetup". */
/*-------------------------------------------------------------*/
FreeMemPtr = NiSmemSetup(SC_NISM_BUFFS, FreeMemPtr,
SC_NISM_LEVEL);
}
#endif
/*---------------------------------------------------------------------*/
/* Additional Network drivers may be installed here. */
/*---------------------------------------------------------------------*/
return FreeMemPtr;
}
#endif
@@ -0,0 +1,734 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/ppc222/sys_conf.h,v 1.1.1.1 2001/11/05 17:47:10 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: sys_conf.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:10 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:22:59 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:10:05 meister
* Update copyright message
*
* Revision 1.2 1998/08/19 21:38:32 josh
* adding copyright stuff.
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* @(#) pSOSystem x86/V2.2.6: apps.v22/xxxx/sys_conf.h (snmpv2 386) 3.21 98/01/12 10:03:13 */
/***********************************************************************/
/* */
/* MODULE: sys_conf.h */
/* DATE: 98/01/12 */
/* PURPOSE: pSOSystem configuration definitions */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1991 - 1997, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* This is a header file which defines all of the system-level */
/* parameters that are likely to need changing. */
/* */
/* It has been set up to be as close as possible to the settings */
/* which are appropriate for this application. However, you may */
/* need to make some changes to parameters to reflect your */
/* environment, such as IP addresses, etc. */
/* */
/* Chapter 7 of the pSOSystem Getting Started manual contains a */
/* complete description of the symbols that are defined in this */
/* file. */
/* */
/***********************************************************************/
#if __cplusplus
extern "C" {
#endif
#ifndef _SYS_CONF_H
#define _SYS_CONF_H
/***********************************************************************/
/* */
/* SC_APP_PARMS Must be defined before you include sysvars.h file. */
/* Since "sysvars.h" file depends on SC_APP_PARMS and BSP_PARMS */
/* to define the Storage Parms Structure. */
/* */
/* Defining this variable to a Non-Zero Value will create a space in */
/* the Storage Parms. structure for your application use. */
/* */
/***********************************************************************/
#define SC_APP_PARMS 0
#define SC_APP_NAME "snmpv2 Application"
/*---------------------------------------------------------------------*/
/* types.h contains common definitions for example YES and NO */
/*---------------------------------------------------------------------*/
#include <types.h>
/***********************************************************************/
/* sysvars.h contains the structures and definitions for the system */
/* variables that are stored in NVRAM. These structures and */
/* definitions are also used when creating the boot rom for the */
/* target system. By using the same sysvars.h file it will insure the */
/* consistency of the values stored by the boot rom and later read by */
/* the downloaded application. */
/***********************************************************************/
#include <sysvars.h>
/*---------------------------------------------------------------------*/
/* include psos.h for defines IO_AUTOINIT and IO_NOAUTOINIT */
/*---------------------------------------------------------------------*/
#include <psos.h>
/***********************************************************************/
/* */
/* These symbols are used to define other symbols in this file. */
/* They should never be changed. */
/* */
/***********************************************************************/
#define USE_RARP 0
/***********************************************************************/
/* */
/* B A S I C P A R A M E T E R S */
/* */
/* The parameters in this section determine the fashion in which */
/* many of the other parameters in this file will be used. */
/* */
/* Many of the parameters in this file have names beginning with */
/* either "SC_" or "SD_". Those beginning with "SC_" are ALWAYS */
/* controlled by the values you set in this file. The values of */
/* the "SD_" parameters can be determined either by the definitions */
/* given in this file, or by the data found in the target board's */
/* parameter storage area. SC_SD_PARAMETERS determines this. If */
/* SC_SD_PARAMETERS is "SYS_CONF", then the values given in this */
/* file will be used for the SD_ parameters. If SC_SD_PARAMETERS */
/* is "STORAGE", then pSOSystem will attempt to use the values found */
/* in the board's parameter storage area for the SD_ variables. If */
/* the parameter storage area has not been initialized or has been */
/* corrupted, then the values given in this file will be used. They */
/* will also be written to the storage area. */
/* */
/* If SC_SD_PARAMETERS is STORAGE, you may enable a "startup dialog" */
/* which will allow you to view, and optionally change, the */
/* parameter values found in the storage area. The dialog is enabled */
/* by setting SC_STARTUP_DIALOG to YES. In this case, */
/* SD_STARTUP_DELAY specifies the number of seconds that the dialog */
/* will wait for input before proceeding to boot the system. */
/* */
/* SC_SD_DEBUG_MODE determines how the system will operate, as follows:*/
/* */
/* DBG_SA: Boot pROBE+ in standalone mode. */
/* */
/* DBG_XS: Boot into pROBE+ and wait for the host debugger */
/* via a serial connection */
/* */
/* DBG_XN: Boot into pROBE+ and wait for the host debugger */
/* via a network connection */
/* */
/* DBG_AP: Same as DBG_SA, but also does a pROBE+ "silent startup",*/
/* meaning that pROBE+ initializes itself without */
/* printing a startup banner. pROBE+ then initializes */
/* pSOS+ and starts the application running. This mode */
/* was created to simplify implementation of the pSOSystem */
/* Boot ROMs. Note that when this mode is used, the value */
/* you specify for RC_SMODE (see "pROBE+ Configuration */
/* Parameters", below) is overridden. */
/* */
/* STORAGE: Use the mode (DBG_SA, DBG_XS, or DBG_XN) found in the */
/* parameter storage area. If a valid mode is not found, */
/* then use DBG_SA. */
/* */
/* An important consequence of using SC_SD_DEBUG_MODE=STORAGE should */
/* be noted. If you use the TFTP bootloader in the pSOSystem ROMs */
/* to download and start your system, you will be setting */
/* SC_SD_DEBUG_MODE = DBG_AP in your target board's parameter storage */
/* area. Thus, if you have left SC_SD_DEBUG_MODE set to STORAGE in */
/* this file, your downloaded system will also use DBG_AP, meaning */
/* that the application will begin running immediately after the */
/* TFTP bootloader has loaded and started your system. */
/* */
/***********************************************************************/
#define SC_SD_PARAMETERS STORAGE
#define SC_STARTUP_DIALOG NO
#define SC_BOOT_ROM NO
#define SD_STARTUP_DELAY 60
#define SC_SD_DEBUG_MODE STORAGE
/***********************************************************************/
/* */
/* O P E R A T I N G S Y S T E M C O M P O N E N T S */
/* */
/* Setting the definition line to YES will cause that component to */
/* be built into the system. NO means the component will NOT be */
/* put into the system. It is an error to specify both SC_PSOS */
/* and SC_PSOSM as present! */
/* */
/***********************************************************************/
#define SC_PSOS YES /* pSOS+ real-time kernel */
#define SC_PSOSM NO /* pSOS+ real-time multiproc kernel */
#define SC_PROBE YES /* pROBE+ (processor svcs) */
#define SC_PROBE_DISASM YES /* pROBE+ (disassembler) */
#define SC_PROBE_DASM_INTEL NO /* pROBE+ (Intel format disassembler) */
/* for x86 Targets Only */
#define SC_PROBE_CIE YES /* pROBE+ (console executive) */
#define SC_PROBE_QUERY YES /* pROBE+ (query services) */
#define SC_PROBE_DEBUG YES /* pROBE+ (debug interface executive) */
#define SC_PHILE YES /* pHILE+ file system manager */
#define SC_PREPC YES /* pREPC+ C run-time library */
#define SC_PNA YES /* pNA+ TCP/IP networking manager */
#define SC_PRPC YES /* pRPC+ RPC component */
#define SC_PSE NO /* pSE+ streams component */
#define SC_PSKT NO /* pSKT+ SKT library component */
#define SC_PTLI NO /* pTLI+ TLI library component */
#define SC_PMONT NO /* pMONT+ */
#define SC_PROFILER NO /* Profiler is enabled/Disabled */
/*---------------------------------------------------------------------*/
/* If set to IO_AUTOINIT device drivers that are installed be the */
/* InstallDriver function will have their autoinit field set. This */
/* will cause pSOS+ call the drivers initialization function when */
/* pSOS+ starts up. The de_init call will not have to be called for */
/* each driver if this is done. */
/* */
/* NOTE: This Auto Initialization will not work on all drivers. */
/* Setting IO_AUTOINIT only effects drivers that can use the Auto */
/* Initialization feature. */
/* */
/* If set to IO_NOAUTOINIT no automatic driver initialization will */
/* happen. */
/*---------------------------------------------------------------------*/
#define SC_AUTOINIT IO_AUTOINIT
/*---------------------------------------------------------------------*/
/* If SC_PMONT SC_AUTOINIT will always be set to 1 because pMONT needs */
/* drivers to be automatically initialized. */
/*---------------------------------------------------------------------*/
#if SC_PMONT
#undef SC_AUTOINIT
#define SC_AUTOINIT IO_AUTOINIT
#endif
/***********************************************************************/
/* */
/* S E R I A L C H A N N E L C O N F I G U R A T I O N */
/* */
/* * SD_DEF_BAUD specifies the default baud rate to be used for the */
/* serial channels */
/* * SC_APP_CONSOLE specifies the serial channel number (starting */
/* from 1) which should be used for the application's "console". */
/* * SC_PROBE_CONSOLE specifies the serial channel number (starting */
/* from 1) which pROBE+ should use to display output and receive */
/* commands, or to communicate with the host debugger. */
/* * SC_PROBE_HOST specifies the serial channel number (starting */
/* from 1) which should be used for the pROBE+ "host" channel. */
/* This is not normally required, so it can be disabled by */
/* using a value of 0. The host channel is explained in the */
/* pROBE+ User's Manual. */
/* */
/***********************************************************************/
#define SD_DEF_BAUD 9600
#define SC_APP_CONSOLE 1
#define SC_PROBE_CONSOLE 1
#define SC_RBUG_PORT 0
/***********************************************************************/
/* SC_NumNon_pSOSChan is the number of non pSOS users of serial */
/* channels. These are users that will be initiated before pSOS */
/* such as pROBE. */
/* NOTE: These channels will not be closed on a soft reset. */
/***********************************************************************/
#if (SC_RBUG_PORT && SC_PROBE_CONSOLE && (SC_PROBE_CONSOLE != PCCON))
#define SC_NumNon_pSOSChan 2
#else
#define SC_NumNon_pSOSChan 1
#endif
/***********************************************************************/
/* */
/* L A N C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_LAN1 YES
#define SD_LAN1_IP 0x80e001b7
#define SD_LAN1_SUBNET_MASK 0xffffff00
/*---------------------------------------------------------------------*/
/* Maximum number of multicast addresses to be used by the lan */
/* interface. Must not exceed maximum supported by the lan driver. */
/*---------------------------------------------------------------------*/
#define SC_LAN1_NMCAST 0
/***********************************************************************/
/* */
/* S H A R E D M E M O R Y C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
/***********************************************************************/
/* */
/* B U S C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_VME_BASE_ADDR 0x01000000
/*---------------------------------------------------------------------*/
/* If you want to build a Shared Memory Interface for the network or */
/* multi-processing pSOS+m, set SD_SM_NODE (a non-zero value) to the */
/* node number of THIS node. */
/*---------------------------------------------------------------------*/
#define SD_SM_NODE 0
/*---------------------------------------------------------------------*/
/* Shared memory network interface - SC_NISM_LEVEL should be 1 if this */
/* will be the FIRST system to use the SMNI on this board. It should */
/* be 2 if this will not be the first system to use the SMNI on this */
/* board. Usually this means that SC_NISM_LEVEL should be 1 if you */
/* are building Boot ROMs, and 2 for a system that will be downloaded */
/* and started using the Boot ROMs. See the comments at the beginning */
/* of drivers/ni_smem.c for more explanation. */
/*---------------------------------------------------------------------*/
#define SD_NISM NO
#define SD_NISM_IP 0x00000000
#define SD_NISM_DIRADDR 0x00000400
#define SC_NISM_BUFFS 30
#define SC_NISM_LEVEL 2
#define SD_NISM_SUBNET_MASK 0
/*---------------------------------------------------------------------*/
/* If you want to build a multi-node pSOS+m system, set SD_KISM */
/* to the number of nodes in the system. */
/*---------------------------------------------------------------------*/
#define SD_KISM 0
#define SD_KISM_DIRADDR 0x00000580
/***********************************************************************/
/* */
/* M I S C E L L A N E O U S N E T W O R K I N G */
/* P A R A M E T E R S */
/* */
/***********************************************************************/
#define SD_DEF_GTWY_IP 0
/***********************************************************************/
/* SC_RAM_SIZE */
/* */
/* Normally, pSOSystem uses ALL of the memory remaining on a board for */
/* dynamic allocation ("region 0"). You may override this by setting */
/* SC_RAM_SIZE to a non-zero value. If you do, pSOSystem will not */
/* touch any memory after address (BSP_RAM_BASE + SC_RAM_SIZE - 1). */
/* */
/* NOTE: This is useful when making a BOOT ROM and you want to ensure */
/* that the ROM's RAM area does not overflow the space alloted for it. */
/***********************************************************************/
#define SC_RAM_SIZE 0
/***********************************************************************/
/* */
/* I / O D E V I C E S */
/* */
/* Each device may be included in the system by specifying a major */
/* number for it, which determines its slot in the pSOS+ I/O switch */
/* table. To leave a device driver out of the system, use NO for */
/* the major number. */
/* */
/* Note the following: */
/* * Major device 0 is reserved and cannot be used for any of these */
/* devices. Setting a device number to 0 here is the same as NO. */
/* * No device number may be higher than SC_DEVMAX (SC_DEVMAX may */
/* be increased, if desired) */
/* * The lines defining the symbols DEV_SERIAL, DEV_TIMER, etc, */
/* should not be changed. These are for use by application */
/* programs as the "device number" parameter on de_* calls. */
/* */
/***********************************************************************/
#define SC_DEV_SERIAL 1 /* Serial driver */
#define SC_DEV_TIMER 2 /* Periodic tick timer */
#define SC_DEV_RAMDISK NO /* RAM disk */
#define SC_DEV_CONSOLE 4 /* PC-Console driver */
#define SC_DEV_SCSI NO /* SCSI bus */
#define SC_DEV_SCSI_TAPE NO /* SCSI bus, tape device */
#define SC_DEV_IDE NO /* IDE Driver */
#define SC_DEV_FLOPPY NO /* Floppy Driver */
#define SC_DEV_TFTP NO /* TFTP pseudo driver */
#define SC_DEV_SPI NO /* SPI driver */
#define SC_DEV_DLPI NO /* DLPI pseudo driver */
#define SC_DEV_OTCP NO /* 12 TCP/IP for OpEN */
#define SC_IP SC_DEV_OTCP /* 12 IP */
#define SC_ARP NO /* 13 ARP */
#define SC_TCP NO /* 14 TCP */
#define SC_UDP NO /* 15 UDP */
#define SC_RAW NO /* 16 RAW */
#define SC_LOOP NO /* 17 LOOP = (SC_DEV_OTCP + 5) */
#define SC_DEV_SOSI NO /* 18 OSI for OpEN */
#define SC_DEV_PSEUDO NO /* PSEUDO driver */
#define SC_DEV_PARALLEL NO /* Parallel Port Driver */
#define SC_DEV_CMOS NO /* CMOS Driver */
#define SC_DEV_WATCHDOG NO /* Watchdog Driver */
#define SC_DEV_OLAP NO /* LAP Driver */
#define SC_PHPI (SC_DEV_OLAP) /* Phpi driver */
#define SC_LAPB (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 1 */
#define SC_CLAPB (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 2 */
#define SC_DEV_OX25 (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 3 */
#define SC_X25 (SC_DEV_OX25) /* X25 driver */
#define SC_CX25 (SC_DEV_OX25 + 0)/* X25 driver Change 0 to 1 */
#define SC_SNDCF NO /* sndcf driver */
#define SC_CSNDCF NO /* csndcf driver */
#define SC_IPCONV NO
#define SC_CIPCONV NO
#define SC_DEVMAX 32 /* Maximum device number */
#define DEV_SERIAL (SC_DEV_SERIAL << 16)
#define DEV_PARALLEL (SC_DEV_PARALLEL << 16)
#define DEV_TIMER (SC_DEV_TIMER << 16)
#define DEV_RAMDISK (SC_DEV_RAMDISK << 16)
#define DEV_SCSI (SC_DEV_SCSI << 16)
#define DEV_SCSI_TAPE (SC_DEV_SCSI_TAPE << 16)
#define DEV_PSEUDO (SC_DEV_PSEUDO << 16)
#define DEV_DLPI (SC_DEV_DLPI << 16)
#define DEV_TFTP (SC_DEV_TFTP << 16)
#define DEV_SPI (SC_DEV_SPI << 16)
#define DEV_WATCHDOG (SC_DEV_WATCHDOG << 16)
#define DEV_FLOPPY (SC_DEV_FLOPPY << 16)
#define DEV_IDE (SC_DEV_IDE << 16)
#define DEV_CMOS (SC_DEV_CMOS << 16)
#define DEV_CONSOLE (SC_DEV_CONSOLE << 16)
#if (BSP_CPUFAMILY == FAMILY_X86) && (SC_APP_CONSOLE == PCCON)
#define CONSOLE DEV_CONSOLE
#else
#define CONSOLE DEV_SERIAL
#endif
/***********************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T L I B R A R Y P A R A M S */
/* */
/***********************************************************************/
#define SC_MMULIB NO
/***********************************************************************/
/* */
/* C O M P O N E N T C O N F I G U R A T I O N P A R A M E T E R S */
/* */
/* These parameters should work as is for this application. You */
/* may want to change some of them if you start customizing this */
/* application. */
/* */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/* pSOS+ configuration parameters */
/*---------------------------------------------------------------------*/
#define KC_RN0USIZE 0x100 /* region 0 unit size */
#define KC_NTASK 25 /* max number of tasks */
#define KC_NQUEUE 10 /* max number of message queues */
#define KC_NSEMA4 30 /* max number of semaphores */
#define KC_NMSGBUF 256 /* max number of message buffers */
#define KC_NTIMER 10 /* max number of timers */
#define KC_NLOCOBJ 50 /* max number of local objects */
#define KC_TICKS2SEC 100 /* clock tick interrupt frequency */
#define KC_TICKS2SLICE 10 /* time slice quantum, in ticks */
#define KC_INTSTK 0x2000 /* interrupt stack size */
#define KC_SYSSTK 0x2000 /* pSOS+ system stack size (bytes) */
#define KC_ROOTSSTK 0x4000 /* ROOT supervisor stack size */
#define KC_ROOTUSTK 0 /* ROOT user stack size */
#define KC_ROOTMODE (T_SUPV | T_ISR) /* ROOT initial mode */
#define KC_ROOTPRI 230 /* ROOT task priority */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a pSOSystem routine as a fatal error handler */
/* #define KC_FATAL ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a fatal error handler */
/* extern void MyHandler (void); */
/* #define KC_FATAL ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define KC_STARTCO 0 /* callout at task activation */
#define KC_DELETECO 0 /* callout at task deletion */
#define KC_SWITCHCO 0 /* callout at task switch */
#define KC_FATAL 0 /* fatal error handler address */
#define KC_IDLECO 0 /* Idle Task Callout */
#define KC_RTCINITCO 0 /* RTC INIT Callout */
/*---------------------------------------------------------------------*/
/* pSOS+m configuration parameters */
/*---------------------------------------------------------------------*/
#define MC_NGLBOBJ 8 /* size of gbl obj table */
#define MC_NAGENT 10 /* number of RPC agents in this node */
#define MC_FLAGS SEQWRAP_ON /* operating mode flags */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following definition */
/* */
/* Using a pSOSystem routine as a roster change handler */
/* #define MC_ROSTER ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a roster change handler */
/* extern void MyHandler (void); */
/* #define MC_ROSTER ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define MC_ROSTER 0 /* addr of user roster change callout */
#define MC_KIMAXBUF 100 /* maximum KI packet buffer length */
#define MC_ASYNCERR 0 /* asynchronous calls error callout */
/*---------------------------------------------------------------------*/
/* pROBE configuration parameters - note that the SMODE flag bits are */
/* irrelevant if SC_SD_DEBUG_MODE = DBG_AP. */
/*---------------------------------------------------------------------*/
#define TD_BRKOPC 0xCC /* Instruction break opcode */
#define TD_ILEV (1 << 12)/* pROBE+ interrupt mask */
#define TD_FLAGS (NODOTS_MASK | TD_ILEV | NOTUPD_MASK)/* flags */
#define TD_DBGPRI 244 /* Debugger task priority */
/*---------------------------------------------------------------------*/
/* The variable defined down should be set to the Starting address for */
/* for pROBE+ DATA AREA. This is required by all the smaller boards. */
/* NOTE: */
/* Setting of this value should have atleast 0x4400 bytes Free */
/* Space from that location. */
/*---------------------------------------------------------------------*/
#define TD_DATASTART 0x0
/*---------------------------------------------------------------------*/
/* pHILE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define FC_LOGBSIZE 9 /* Block size (base-2 exponent) */
#define FC_NBUF 6 /* Number of cache buffers */
#define FC_NMOUNT 3 /* Max # of mounted volumes */
#define FC_NFCB 10 /* Max # of opened files per system */
#define FC_NCFILE 2 /* Max # of opened files per task */
#define FC_NDNLC 0 /* Max # of cached directory entries */
#define FC_MSDOS 1 /* MS-DOS volume mount flag */
#define FC_CDROM 0 /* CD-ROM volume mount flag */
/*---------------------------------------------------------------------*/
/* pREPC+ configuration parameters */
/*---------------------------------------------------------------------*/
#define LC_BUFSIZ 128 /* I/O buffer size */
#define LC_NUMFILES 5 /* Max number of open files per task */
#define LC_WAITOPT 0 /* Wait option for memory allocation */
#define LC_TIMEOPT 0 /* Timeout option for mem allocation */
#define LC_SSIZE 512 /* Size of print buffer */
/*---------------------------------------------------------------------*/
/* pNA+ configuration parameters */
/* */
/* NOTE: If you get pNA+ errno 5F01 FAT_INSUFFMEM you may need to */
/* decrease the number of buffers allocated here for pNA+. */
/* In general this error means pNA+ could not allocate enough */
/* memory from Region 0 for the number of buffers requested. */
/*---------------------------------------------------------------------*/
#define NC_NNI 5 /* size of pNA NI Table */
#define NC_NROUTE 10 /* size of pNA Routing Table */
#define NC_NARP 20 /* size of pNA ARP table */
#define NC_DEFUID 0 /* Default User ID of a task */
#define NC_DEFGID 0 /* Default Group ID of a task */
#define NC_HOSTNAME "scg" /* Hostname of the node */
#define NC_NHENTRY 8 /* Number of Host table entries */
#define NC_NMCSOCS 0 /* Number of IP multicast sockets */
#define NC_NMCMEMB 0 /* Number of distict IP multicast */
/* group memberships per interface */
#define NC_NNODEID 0 /* Network NODE ID for unnumbered link */
#define NC_NSOCKETS 128 /* Number of sockets in the system */
#define NC_NDESCS 128 /* # of socket descriptors/task */
#define NC_MBLKS 300 /* # of message blocks in the system */
#define NC_BUFS_0 64 /* number of 0 length buffers */
#define NC_BUFS_32 0 /* number of 32 length buffers */
#define NC_BUFS_64 0 /* number of 64 length buffers */
#define NC_BUFS_128 256 /* number of 128 byte buffers */
#define NC_BUFS_256 0 /* number of 256 byte buffers */
#define NC_BUFS_512 0 /* number of 512 byte buffers */
#define NC_BUFS_1024 16 /* number of 1k byte buffers */
#define NC_BUFS_2048 48 /* number of 2k byte buffers */
#define NC_BUFS_4096 0 /* number of 4k byte buffers */
#define NC_MAX_BUFS 9 /* max number of NC_BUFS types */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a user written routine as a pNA+ Signal Handler */
/* extern void MySigHandler (void); */
/* #define NC_SIGNAL ((void (*)()) MySigHandler) */
/* */
/*---------------------------------------------------------------------*/
#define NC_SIGNAL 0 /* pNA+ Signal Hdlr */
/*---------------------------------------------------------------------*/
/* pSE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define SE_NBUFS_0 64 /* number of 0 length buffers */
#define SE_NBUFS_32 128 /* number of 32 byte buffers */
#define SE_NBUFS_64 128 /* number of 64 byte buffers */
#define SE_NBUFS_128 256 /* number of 128 byte buffers */
#define SE_NBUFS_256 32 /* number of 256 byte buffers */
#define SE_NBUFS_512 32 /* number of 512 byte buffers */
#define SE_NBUFS_1024 16 /* number of 1k byte buffers */
#define SE_NBUFS_2048 16 /* number of 2k byte buffers */
#define SE_NBUFS_4096 8 /* number of 4k byte buffers */
#define SE_MAX_BUFS 9 /* max number of stream buffer types */
#define SE_MAX_MODULES 3 /* max number of streams modules */
#define SE_SHARE_NI NO /* LAN-NI with streams? */
#define SE_DATA_SIZE 0x0C00 /* size of pSE data area */
/* (must be at least 3K) */
#define SE_TASK_PRIO 250 /* priority for pSE task */
#define SE_STACK_SIZE 0x2000 /* stack size for pSE task */
#define SE_DEF_UID 0 /* default user id */
#define SE_DEF_GID 0 /* default group id */
#define SE_N_FDS 32 /* max # of system-wide */
/* stream descriptors */
#define SE_N_TASKFDS 8 /* max # of per-task stream */
/* descriptors */
#define SE_N_LINKS 32 /* max # of multiplexing links */
#define SE_N_TIMEOUTS 32 /* max # of timeout requests */
#define SE_N_BUFCALLS 32 /* max # of bufcall requests */
#define SE_N_QUEUES 256 /* # of queues */
#define SE_N_MBLKS 512 /* reserved for future use, must be 0 */
/*---------------------------------------------------------------------*/
/* Loader configuration parameters */
/* */
/* YES indicates for each module to be linked in. NO means do not link */
/* object module loader into this application. */
/* */
/*---------------------------------------------------------------------*/
#define LD_MAX_LOAD 8 /* Max. # of active loads */
#define LD_ELF_MODULE NO /* ELF object-load-module */
#define LD_SREC_MODULE NO /* SREC object-load-module */
#define LD_COFF_MODULE NO /* COFF object-load-module */
#define LD_IEEE_MODULE NO /* IEEE object-load-module */
#define LD_IHEX_MODULE NO /* IHEX object-load-module */
/*---------------------------------------------------------------------*/
/* pMONT+ configuration parameters - note that PM_DEV and PM_BAUD are */
/* only relevant to serial communication (PM_CMODE = 2) */
/*---------------------------------------------------------------------*/
#define PM_CMODE 1 /* 1 = networking, 2 = serial */
#define PM_DEV 2 /* Minor Device number for */
/* serial channel if used */
#define PM_BAUD 9600 /* Baud rate for serial chnl */
#define PM_TRACE_BUFF 0 /* Address of trace buffer -- */
/* Allocated by pSOSystem if 0 */
#define PM_TRACE_SIZE 0x6000 /* Size of trace buffer */
#define PM_TIMER NO /* 2nd timer for finer time */
/* within data collection */
/*---------------------------------------------------------------------*/
/* General Serial Block Configuration Parameters */
/*---------------------------------------------------------------------*/
#define GS_BUFS_0 64 /* number of 0 length buffers */
#define GS_BUFS_32 128 /* number of 32 byte buffers */
#define GS_BUFS_64 128 /* number of 64 byte buffers */
#define GS_BUFS_128 256 /* number of 128 byte buffers */
#define GS_BUFS_256 32 /* number of 256 byte buffers */
#define GS_BUFS_512 32 /* number of 512 byte buffers */
#define GS_BUFS_1024 16 /* number of 1k byte buffers */
#define GS_BUFS_2048 16 /* number of 2k byte buffers */
#define GS_BUFS_4096 8 /* number of 4k byte buffers */
#define GS_MBLKS 680
#define GS_MAX_BUFS 9 /* max number of serial buffer types */
/*---------------------------------------------------------------------*/
/* TCP/IP for OpEN configuration parameters */
/*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/* Configurable parameters for the Network layer (IP) */
/*---------------------------------------------------------------------*/
#define OTCP_IPMAX 8 /* Max # of open IP device */
#define OTCP_IPNINTERFACES 4 /* Max # of network interfaces */
#define OTCP_IPNROUTES 64 /* Max #of routing tbl entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for ARP */
/*---------------------------------------------------------------------*/
#define OTCP_ARPMAX 8 /* Max # of open ARP device */
#define OTCP_ARPNINTERFACES 4 /* Max # of ARP interfaces */
#define OTCP_ARPNENTRIES 32 /* Max # of ARP table entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for TCP */
/*---------------------------------------------------------------------*/
#define OTCP_TCPMAX 64 /* Max # of open TCP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for UDP */
/*---------------------------------------------------------------------*/
#define OTCP_UDPMAX 32 /* Max # of open UDP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for RAW */
/*---------------------------------------------------------------------*/
#define OTCP_RAWMAX 32 /* Max # of open RAW device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for LOOP */
/*---------------------------------------------------------------------*/
#define OTCP_LOOPMAX 2 /* Max # of open LOOP device */
#endif /* _SYS_CONF_H */
#if __cplusplus
}
#endif
@@ -0,0 +1,499 @@
#* @(#) pSOSystem PowerPC/V2.5.0: configs/ppc/config.mk 4.23 98/11/11 06:51:23 *
#***********************************************************************
#* *
#* MODULE: configs/std/config.mk *
#* DATE: 98/11/11 *
#* PURPOSE: Macro definitions, linker commands, etc, for "make" *
#* *
#*---------------------------------------------------------------------*
#* *
#* Copyright 2000-2001 Wind River Systems, Inc.
#* Copyright 1991 - 1998, Integrated Systems, Inc. *
#* ALL RIGHTS RESERVED *
#* *
#* Permission is hereby granted to licensees of Integrated Systems, *
#* Inc. products to use or abstract this computer program for the *
#* sole purpose of implementing a product based on Integrated *
#* Systems, Inc. products. No other rights to reproduce, use, *
#* or disseminate this computer program, whether in part or in *
#* whole, are granted. *
#* *
#* Integrated Systems, Inc. makes no representation or warranties *
#* with respect to the performance of this computer program, and *
#* specifically disclaims any responsibility for any damages, *
#* special or consequential, connected with the use of this program. *
#* *
#*---------------------------------------------------------------------*
#***********************************************************************
#
#------------------------------------------------------------------------
# Compiler commands and command-line options
#------------------------------------------------------------------------
# Add following option to COPTS_FILE2 to generate listing files
# -W:as:,-l -Xpass-source
#------------------------------------------------------------------------
CC = @echo "Making $@ \tfrom $<";dcc
CXX = @echo "Making $@ \tfrom $<";dplus
COMP_OPTS1 = -O -t$(DTARGET)E$(DFP):psos -Xstruct-best-align=0
COMP_OPTS2 = -Xstrict-ansi $(PSS_APPCOPTS) -D__DIAB -DPPC
COPTS_FILE1 = -I. -I$(PSS_ROOT)/include -I$(PSS_BSP) $(PSS_APPINCS)
COPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@ -c
CXX_OPTS = -Xexception
#------------------------------------------------------------------------
# COPT_PER_FILE is used to provide a convenient way to add per
# file compile options. If a .cop file for a source file exist then
# content of this file is passed as the compile options.
#------------------------------------------------------------------------
COPT_PER_FILE=`if [ -f ./$(*F).cop ]; then cat ./$(*F).cop; fi`
COPTS = -@c.opt $(COPT_PER_FILE)
CXXOPTS = -@cxx.opt $(COPT_PER_FILE)
#------------------------------------------------------------------------
# TARGET_CPU is used in application makefiles to pass on to incremental
# linking and other tools.
#------------------------------------------------------------------------
TARGET_CPU = -t$(DTARGET)E$(DFP):psos
#------------------------------------------------------------------------
# Assembler command-line options
#------------------------------------------------------------------------
AS = @echo "Making $@ \tfrom $<";das
#------------------------------------------------------------------------
# Added target switch for the assembler
# The target definition is located in bsp.mk of the bsp you are using
#------------------------------------------------------------------------
# Add following option to AOPTS_FILE1 to generate listing files -l
#------------------------------------------------------------------------
AOPTS_FILE1 = -I. $(PSS_APPINCS) -I$(PSS_ROOT)/include -I$(PSS_BSP)
AOPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@
AOPTS_FILE3 = -t$(DTARGET)E$(DFP)
AOPTS = -@a.opt $(COPT_PER_FILE)
#------------------------------------------------------------------------
# Linker command name
#------------------------------------------------------------------------
LD = dld
LOPTS = -t$(DTARGET)E$(DFP) -Xsuppress-dot -Xreloc-bug -m2 $(PSS_APPLOPTS)
#------------------------------------------------------------------------
# Librarian command name and options
#------------------------------------------------------------------------
LIB = dar
LIBOPTS = -qf
LIBOPTS_SORT = -sR
#========================================================================
# Link everything together
#========================================================================
CFG1_OBJS= sysinit.o bspcfg.o pnacfg.o prepccfg.o dialog.o
CFG2_OBJS= probecfg.o prpccfg.o psecfg.o psoscfg.o pmontcfg.o
CFG3_OBJS= pollio.o philecfg.o gsblkcfg.o plmcfg.o pnetcfg.o
CFG4_OBJS= ldcfg.o posixcfg.o rtacfg.o
ram.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
ram.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_APPOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o ram.elf -Wm ram.dld begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > ram.map
ddump -tv ram.elf >> ram.map
ram.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/ram.dld
@cat $(PSS_BSP)/ram.dld > ram.dld
@cat $(PSS_BSP)/anchor.dld >> ram.dld
ram.hex: ram.elf
ddump -Rv ram.elf -o ram.hex
rom.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
rom.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o rom.elf -Wm rom.dld begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > rom.map
ddump -tv rom.elf >> rom.map
rom.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/rom.dld
@cat $(PSS_BSP)/rom.dld > rom.dld
@cat $(PSS_BSP)/anchor.dld >> rom.dld
rom.hex: rom.elf
ddump -Rv rom.elf -o rom.hex
os.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
os.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o os.elf -Wm os.dld begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo -m3 $(DRV_LIB1) >> l.opt
@echo -m3 $(DRV_LIB2) >> l.opt
@echo -m3 $(DRV_LIB3) >> l.opt
@echo -m3 $(DRV_LIB4) >> l.opt
@echo -m3 $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > os.map
ddump -tv os.elf >> os.map
os.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/os.dld
@cat $(PSS_BSP)/os.dld > os.dld
@cat $(PSS_BSP)/anchor.dld >> os.dld
os.hex: os.elf
ddump -Rv os.elf -o os.hex
app.elf: cxx.opt c.opt a.opt ill.opt beginapp.o bspcalls.o \
makefile \
app.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o app.elf -Wm app.dld beginapp.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app.map
ddump -tv app.elf >> app.map
app.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > app.dld
@cat $(PSS_BSP)/anchor.dld >> app.dld
app_ld.elf: app.elf
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.elf app.elf
@rm -f ld_prep.def
app.hex: app.elf
ddump -Rv app.elf -o app.hex
app_ld.hex: app.hex
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.hex app.hex
@rm -f ld_prep.def
driver.elf: cxx.opt c.opt a.opt ill.opt lddriver.o bspcalls.o \
ldblcfg.o \
makefile \
driver.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o driver.elf driver.dld lddriver.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > driver.map
@ddump -tv driver.elf >> driver.map
driver.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > driver.dld
@cat $(PSS_BSP)/anchor.dld >> driver.dld
lddriver.elf: driver.elf
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o lddriver.elf driver.elf
@rm -f ld_prep.def
lib.elf: cxx.opt c.opt a.opt ill.opt bspcalls.o \
makefile \
lib.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o lib.elf lib.dld > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo -m3 $(APP_LIB1) >> l.opt
@echo -m3 $(APP_LIB2) >> l.opt
@echo -m3 $(APP_LIB3) >> l.opt
@echo -m3 $(APP_LIB4) >> l.opt
@echo -m3 $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo -m3 $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > lib.map
@ddump -tv lib.elf >> lib.map
lib.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > lib.dld
@cat $(PSS_BSP)/anchor.dld >> lib.dld
lib_ld.elf: lib.elf
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.elf lib.elf
@rm -f ld_prep.def
lib.hex: lib.elf
ddump -Rv lib.elf -o lib.hex
lib_ld.hex: lib.hex
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.hex lib.hex
@rm -f ld_prep.def
#------------------------------------------------------------------------
# Compile or assemble modules which are always used.
#------------------------------------------------------------------------
begin.o: $(PSS_CONFIG)/begin.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
beginapp.o: $(PSS_CONFIG)/beginapp.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
lddriver.o: $(PSS_CONFIG)/lddriver.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
bspcalls.o: $(PSS_BSP)/bspcalls.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
gsblkcfg.o: $(PSS_CONFIG)/gsblkcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h
$(CC) $(COPTS) -o $@ $<
sysinit.o: $(PSS_CONFIG)/sysinit.c \
qpsos.tmp \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o sysinit.tmp $<
@$(LD) $(LOPTS) -r -Xsuppress-dot -Xreloc-bug -o sysinit.o sysinit.tmp qpsos.tmp > qpsos.map
@rm -f qpsos.o qmpsos.o qpsos.map sysinit.tmp
qpsos.tmp: $(PSS_ROOT)/sys/os/qpsos.s
@echo "UNIPROC=1" > qpsos_tmp.s
@cat $< >> qpsos_tmp.s
@$(AS) $(AOPTS) -o qpsos.o qpsos_tmp.s
@echo "UNIPROC=0" > qpsos_tmp.s
@cat $< >> qpsos_tmp.s
@das $(AOPTS) -I$(PSS_ROOT)/sys/os -o qmpsos.o qpsos_tmp.s
@rm -f qpsos.tmp qpsos_tmp.s
@$(LIB) cr qpsos.tmp qpsos.o qmpsos.o
philecfg.o: $(PSS_CONFIG)/philecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pnacfg.o: $(PSS_CONFIG)/pnacfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pnetcfg.o: $(PSS_CONFIG)/pnetcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
prepccfg.o: $(PSS_CONFIG)/prepccfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
probecfg.o: $(PSS_CONFIG)/probecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
prpccfg.o: $(PSS_CONFIG)/prpccfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
psecfg.o: $(PSS_CONFIG)/psecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
psoscfg.o: $(PSS_CONFIG)/psoscfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pmontcfg.o: $(PSS_CONFIG)/pmontcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
dialog.o: $(PSS_CONFIG)/dialog.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pollio.o: $(PSS_CONFIG)/pollio.c \
makefile $(PSS_CONFIG)/config.mk \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
bspcfg.o: $(PSS_BSP)/bspcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
plmcfg.o: $(PSS_CONFIG)/plmcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
ldcfg.o: $(PSS_CONFIG)/ldcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h
$(CC) $(COPTS) -o $@ $<
posixcfg.o: $(PSS_CONFIG)/posixcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
rtacfg.o: $(PSS_CONFIG)/rtacfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
c.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > c.opt
@echo $(COMP_OPTS2) >> c.opt
@echo $(COPTS_FILE1) >> c.opt
@echo $(COPTS_FILE2) >> c.opt
cxx.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > cxx.opt
@echo $(COMP_OPTS2) >> cxx.opt
@echo $(COPTS_FILE1) >> cxx.opt
@echo $(COPTS_FILE2) >> cxx.opt
@echo $(CXX_OPTS) >> cxx.opt
a.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(AOPTS_FILE1) > a.opt
@echo $(AOPTS_FILE2) >> a.opt
@echo $(AOPTS_FILE3) >> a.opt
ill.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(LOPTS) > ill.opt
#------------------------------------------------------------------------
# Following target is used in psosmake to ensure that .opt files exist
# when target for a single file is made.
#------------------------------------------------------------------------
create_opt_files: c.opt cxx.opt a.opt $(PSS_APP_OPTFILES)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,51 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/snmptalk.h,v 1.1.1.1 2001/11/05 17:47:09 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: snmptalk.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:09 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:22:58 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:01 meister
* Update copyright message
*
* Revision 1.1 1998/08/17 21:47:13 josh
* adding a new file to the port directory
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* defines for nvutils for file manipulation */
#define SNMP_READONLY "r"
#define SNMP_READPLUS "r+"
#define SNMP_WRITEPLUS "w+"
#define SNMP_REMOVE_FILE(fname) remove_f(fname)
#define NEEDS_STRDUP
#define NEEDS_STRICMP
@@ -0,0 +1,611 @@
#* @(#) pSOSystem SPL/V2.5.0-F8: configs/spl/config.mk 4.7 00/02/03 14:36:27 *
#***********************************************************************
#* *
#* MODULE: configs/std/config.mk *
#* DATE: 00/02/03 *
#* PURPOSE: Macro definitions, linker commands, etc, for "make" *
#* *
#*---------------------------------------------------------------------*
#* *
#* Copyright 1991 - 2000, Integrated Systems, Inc. *
#* ALL RIGHTS RESERVED *
#* *
#* Permission is hereby granted to licensees of Integrated Systems, *
#* Inc. products to use or abstract this computer program for the *
#* sole purpose of implementing a product based on Integrated *
#* Systems, Inc. products. No other rights to reproduce, use, *
#* or disseminate this computer program, whether in part or in *
#* whole, are granted. *
#* *
#* Integrated Systems, Inc. makes no representation or warranties *
#* with respect to the performance of this computer program, and *
#* specifically disclaims any responsibility for any damages, *
#* special or consequential, connected with the use of this program. *
#* *
#*---------------------------------------------------------------------*
#***********************************************************************
#
#------------------------------------------------------------------------
# Compiler commands and command-line options
#------------------------------------------------------------------------
#------------------------------------------------------------------------
# Note the CC and CXX commands are continued on several lines.
#
# Only echo the "Making..." string if the silent flags was not given.
#
# The command `echo ${MAKEFLAGS} | sed 's/[^s]//g'` echoes the make flags
# to the standard input of the sed command. The sed command replaces
# every character that is not an s with nothing. So if the silent flag
# was given the left side of the equals results in "Xs". If the silent
# flag was not given it would result in "X".
#------------------------------------------------------------------------
CC = @if [ "X`echo ${MAKEFLAGS} | sed 's/[^s]//g'`" = "X" ]; \
then \
echo "Making $@ \tfrom $<"; \
fi; \
dcc
CXX = @if [ "X`echo ${MAKEFLAGS} | sed 's/[^s]//g'`" = "X" ]; \
then \
echo "Making $@ \tfrom $<"; \
fi; \
dplus
#------------------------------------------------------------------------
# Add following option to COPTS_FILE2 to generate listing files
# -W:as:,-l -Xpass-source
#------------------------------------------------------------------------
COMP_OPTS1 = -O -g -t$(DTARGET)E$(DFP):psos -Xstruct-best-align=0
COMP_OPTS2 = -Xforce-prototypes -Xstrict-ansi $(PSS_APPCOPTS) -D__DIAB -DSPL
COPTS_FILE1 = -I. -I$(PSS_ROOT)/include -I$(PSS_BSP) $(PSS_APPINCS)
COPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@ -c
CXX_OPTS = -Xexception
#------------------------------------------------------------------------
# COPT_PER_FILE is used to provide a convenient way to add per
# file compile options. If a .cop file for a source file exist then
# content of this file is passed as the compile options.
#------------------------------------------------------------------------
COPT_PER_FILE=`if [ -f ./$(*F).cop ]; then cat ./$(*F).cop; fi`
COPTS = -@c.opt $(COPT_PER_FILE)
CXXOPTS = -@cxx.opt $(COPT_PER_FILE)
#------------------------------------------------------------------------
# TARGET_CPU is used in application makefiles to pass on to incremental
# linking and other tools.
#------------------------------------------------------------------------
TARGET_CPU = -t$(DTARGET)E$(DFP):psos
#------------------------------------------------------------------------
# DEVICES_CPU_DIR is used by application makefiles to make them generic
# across platforms.
#------------------------------------------------------------------------
DEVICES_CPU_DIR = $(PSS_ROOT)/bsps/devices/powerpc
#------------------------------------------------------------------------
# Assembler command-line options
#
# Note the AS command is continued on several lines.
#
# Only echo the "Making..." string if the silent flags was not given.
#
# The command `echo ${MAKEFLAGS} | sed 's/[^s]//g'` echoes the make flags
# to the standard input of the sed command. The sed command replaces
# every character that is not an s with nothing. So if the silent flag
# was given the left side of the equals results in "Xs". If the silent
# flag was not given it would result in "X".
#------------------------------------------------------------------------
AS = @if [ "X`echo ${MAKEFLAGS} | sed 's/[^s]//g'`" = "X" ]; \
then \
echo "Making $@ \tfrom $<"; \
fi; \
das
#------------------------------------------------------------------------
# Added target switch for the assembler
# The target definition is located in bsp.mk of the bsp you are using
#------------------------------------------------------------------------
# Add following option to AOPTS_FILE1 to generate listing files -l
#------------------------------------------------------------------------
AOPTS_FILE1 = -I. $(PSS_APPINCS) -I$(PSS_ROOT)/include -I$(PSS_BSP)
AOPTS_FILE2 = -I$(PSS_ROOT)/bsps/devices $(PSS_VINCLUDE) -I@
AOPTS_FILE3 = -t$(DTARGET)E$(DFP):psos
AOPTS = -@a.opt $(COPT_PER_FILE)
#------------------------------------------------------------------------
# Linker command name
#------------------------------------------------------------------------
LD = dld
LOPTS = -t$(DTARGET)E$(DFP):psos -Xsuppress-dot -Xreloc-bug -m2 $(PSS_APPLOPTS)
#------------------------------------------------------------------------
# Librarian command name and options
#------------------------------------------------------------------------
LIB = dar
LIBOPTS = -qf
LIBOPTS_SORT = -sR
#========================================================================
# Link everything together
#========================================================================
CFG1_OBJS= sysinit.o bspcfg.o pnacfg.o prepccfg.o dialog.o
CFG2_OBJS= probecfg.o prpccfg.o psecfg.o psoscfg.o pmontcfg.o
CFG3_OBJS= pollio.o philecfg.o gsblkcfg.o plmcfg.o pnetcfg.o
CFG4_OBJS= ldcfg.o posixcfg.o rtacfg.o
ram.elf: cxx.opt c.opt a.opt ill.opt begin.o compiler.o \
makefile \
ram.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_APPOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o ram.elf -Wm ram.dld begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo $(DRV_LIB1) >> l.opt
@echo $(DRV_LIB2) >> l.opt
@echo $(DRV_LIB3) >> l.opt
@echo $(DRV_LIB4) >> l.opt
@echo $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > ram.map
ddump -tv ram.elf >> ram.map
ram.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/ram.dld
@cat $(PSS_BSP)/ram.dld > ram.dld
@cat $(PSS_BSP)/anchor.dld >> ram.dld
ram.hex: ram.elf
ddump -Rv ram.elf -o ram.hex
rom.elf: cxx.opt c.opt a.opt ill.opt rombegin.o compiler.o \
makefile \
rom.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o rom.elf -Wm rom.dld rombegin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo $(DRV_LIB1) >> l.opt
@echo $(DRV_LIB2) >> l.opt
@echo $(DRV_LIB3) >> l.opt
@echo $(DRV_LIB4) >> l.opt
@echo $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > rom.map
ddump -tv rom.elf >> rom.map
rom.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/rom.dld
@cat $(PSS_BSP)/rom.dld > rom.dld
@cat $(PSS_BSP)/anchor.dld >> rom.dld
rom.hex: rom.elf
ddump -Rv rom.elf -o rom.hex
os.elf: cxx.opt c.opt a.opt ill.opt begin.o \
makefile \
os.dld \
$(CFG1_OBJS) \
$(CFG2_OBJS) \
$(CFG3_OBJS) \
$(CFG4_OBJS) \
$(PSS_DRVOBJS) \
$(PSS_BSP)/libbsp.a \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a \
$(PSS_ROOT)/sys/libc/libpnet.a
@echo $(LOPTS) -o os.elf -Wm os.dld begin.o > l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo $(CFG1_OBJS) >> l.opt
@echo $(CFG2_OBJS) >> l.opt
@echo $(CFG3_OBJS) >> l.opt
@echo $(CFG4_OBJS) >> l.opt
@echo $(PSS_DRVOBJS) >> l.opt
@echo $(DRV_LIB1) >> l.opt
@echo $(DRV_LIB2) >> l.opt
@echo $(DRV_LIB3) >> l.opt
@echo $(DRV_LIB4) >> l.opt
@echo $(DRV_LIB5) >> l.opt
@echo -lbsp -ldrv >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lpnet -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > os.map
ddump -tv os.elf >> os.map
os.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/os.dld
@cat $(PSS_BSP)/os.dld > os.dld
@cat $(PSS_BSP)/anchor.dld >> os.dld
os.hex: os.elf
ddump -Rv os.elf -o os.hex
app.elf: cxx.opt c.opt a.opt ill.opt beginapp.o bspcalls.o compiler.o \
makefile \
app.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o app.elf -Wm app.dld beginapp.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app.map
ddump -tv app.elf >> app.map
app.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > app.dld
@cat $(PSS_BSP)/anchor.dld >> app.dld
app.hex: app.elf
ddump -R app.elf -o app.hex
app_ld.elf: cxx.opt c.opt a.opt ill.opt ldbegin.o bspcalls.o compiler.o \
ldblcfg.o makefile \
app_ld.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o app_tmp.elf -Wm app_ld.dld > l.opt
@echo ldbegin.o bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app_ld.map
ddump -tv app_tmp.elf >> app_ld.map
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 8192 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.elf app_tmp.elf
@rm -f ld_prep.def
app_ld.hex: cxx.opt c.opt a.opt ill.opt ldbegin.o bspcalls.o compiler.o \
ldblcfg.o makefile \
app_ld.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o app_tmp.elf -Wm app_ld.dld > l.opt
@echo ldbegin.o bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > app_ld.map
ddump -tv app_tmp.elf >> app_ld.map
ddump -R app_tmp.elf -o app_tmp.hex
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 8192 > ld_prep.def
@ld_prep -v -d ld_prep.def -o app_ld.hex app_tmp.hex
@rm -f ld_prep.def
app_ld.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > app_ld.dld
@cat $(PSS_BSP)/anchor.dld >> app_ld.dld
driver.elf: cxx.opt c.opt a.opt ill.opt lddriver.o bspcalls.o compiler.o \
ldblcfg.o \
makefile \
driver.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o driver.elf driver.dld lddriver.o > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > driver.map
@ddump -tv driver.elf >> driver.map
driver.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > driver.dld
@cat $(PSS_BSP)/anchor.dld >> driver.dld
lddriver.elf: driver.elf
@echo $(PSS_LDBOPTS) -p 180 -n LDBL -mAT -u 1024 -s 4096 > ld_prep.def
@ld_prep -v -d ld_prep.def -o lddriver.elf driver.elf
@rm -f ld_prep.def
lib.elf: cxx.opt c.opt a.opt ill.opt bspcalls.o compiler.o \
makefile \
lib.dld \
$(PSS_APPOBJS) \
$(PSS_ROOT)/sys/os/libsys.a \
$(PSS_ROOT)/sys/libc/libprepc$(DFP).a
@echo $(LOPTS) -o lib.elf lib.dld > l.opt
@echo bspcalls.o >> l.opt
@echo -L $(PSS_BSP) -L $(PSS_ROOT)/sys/os >> l.opt
@echo -L $(PSS_ROOT)/sys/libc $(PSS_APPLINKS) >> l.opt
@echo $(PSS_VLINK) >> l.opt
@echo compiler.o >> l.opt
@echo $(PSS_APPOBJS) >> l.opt
@echo $(APP_LIB1) >> l.opt
@echo $(APP_LIB2) >> l.opt
@echo $(APP_LIB3) >> l.opt
@echo $(APP_LIB4) >> l.opt
@echo $(APP_LIB5) >> l.opt
@echo -lsys >> l.opt
@echo -lprepc$(DFP) -lquery >> l.opt
@echo $(FIX_LIB) >> l.opt
@echo $(PSS_COMPLIB) >> l.opt
$(LD) -@l.opt > lib.map
@ddump -tv lib.elf >> lib.map
lib.dld: $(PSS_BSP)/anchor.dld \
$(PSS_BSP)/app.dld
@cat $(PSS_BSP)/app.dld > lib.dld
@cat $(PSS_BSP)/anchor.dld >> lib.dld
lib_ld.elf: lib.elf
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.elf lib.elf
@rm -f ld_prep.def
lib.hex: lib.elf
ddump -R lib.elf -o lib.hex
lib_ld.hex: lib.hex
@echo $(PSS_LDBOPTS) > ld_prep.def
@ld_prep -v -d ld_prep.def -o lib_ld.hex lib.hex
@rm -f ld_prep.def
#------------------------------------------------------------------------
# Compile or assemble modules which are always used.
#------------------------------------------------------------------------
begin.o: $(PSS_CONFIG)/begin.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
rombegin.o: $(PSS_CONFIG)/rombegin.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
beginapp.o: $(PSS_CONFIG)/beginapp.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
ldbegin.o: $(PSS_CONFIG)/ldbegin.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
lddriver.o: $(PSS_CONFIG)/lddriver.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
bspcalls.o: $(PSS_BSP)/bspcalls.s \
makefile $(PSS_CONFIG)/config.mk
$(AS) $(AOPTS) -o $@ $<
gsblkcfg.o: $(PSS_CONFIG)/gsblkcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h
$(CC) $(COPTS) -o $@ $<
sysinit.o: $(PSS_CONFIG)/sysinit.c \
qpsos.tmp \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o sysinit.tmp $<
@$(LD) $(LOPTS) -r -Xsuppress-dot -Xreloc-bug -o sysinit.o sysinit.tmp qpsos.tmp > qpsos.map
@rm -f qpsos.o qmpsos.o qpsos.map sysinit.tmp
qpsos.tmp: $(PSS_ROOT)/sys/os/qpsos.s
@echo "UNIPROC=1" > qpsos_tmp.s
@cat $< >> qpsos_tmp.s
@$(AS) $(AOPTS) -o qpsos.o qpsos_tmp.s
@echo "UNIPROC=0" > qpsos_tmp.s
@cat $< >> qpsos_tmp.s
@das $(AOPTS) -I$(PSS_ROOT)/sys/os -o qmpsos.o qpsos_tmp.s
@rm -f qpsos.tmp qpsos_tmp.s
@$(LIB) cr qpsos.tmp qpsos.o qmpsos.o
philecfg.o: $(PSS_CONFIG)/philecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pnacfg.o: $(PSS_CONFIG)/pnacfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pnetcfg.o: $(PSS_CONFIG)/pnetcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
prepccfg.o: $(PSS_CONFIG)/prepccfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
probecfg.o: $(PSS_CONFIG)/probecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
prpccfg.o: $(PSS_CONFIG)/prpccfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
psecfg.o: $(PSS_CONFIG)/psecfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
psoscfg.o: $(PSS_CONFIG)/psoscfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pmontcfg.o: $(PSS_CONFIG)/pmontcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
dialog.o: $(PSS_CONFIG)/dialog.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
pollio.o: $(PSS_CONFIG)/pollio.c \
makefile $(PSS_CONFIG)/config.mk \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
bspcfg.o: $(PSS_BSP)/bspcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
plmcfg.o: $(PSS_CONFIG)/plmcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
ldcfg.o: $(PSS_CONFIG)/ldcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h
$(CC) $(COPTS) -o $@ $<
compiler.o: $(PSS_CONFIG)/compiler.c \
makefile $(PSS_CONFIG)/config.mk
$(CC) $(COPTS) -o $@ $<
posixcfg.o: $(PSS_CONFIG)/posixcfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
rtacfg.o: $(PSS_CONFIG)/rtacfg.c \
makefile $(PSS_CONFIG)/config.mk sys_conf.h \
$(PSS_BSP)/bsp.h
$(CC) $(COPTS) -o $@ $<
c.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > c.opt
@echo $(COMP_OPTS2) >> c.opt
@echo $(COPTS_FILE1) >> c.opt
@echo $(COPTS_FILE2) >> c.opt
cxx.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(COMP_OPTS1) > cxx.opt
@echo $(COMP_OPTS2) >> cxx.opt
@echo $(COPTS_FILE1) >> cxx.opt
@echo $(COPTS_FILE2) >> cxx.opt
@echo $(CXX_OPTS) >> cxx.opt
a.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(AOPTS_FILE1) > a.opt
@echo $(AOPTS_FILE2) >> a.opt
@echo $(AOPTS_FILE3) >> a.opt
ill.opt: makefile $(PSS_CONFIG)/config.mk
@echo $(LOPTS) > ill.opt
#------------------------------------------------------------------------
# Following target is used in psosmake to ensure that .opt files exist
# when target for a single file is made.
#------------------------------------------------------------------------
create_opt_files: c.opt cxx.opt a.opt $(PSS_APP_OPTFILES)
@@ -0,0 +1,535 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/x86226/drv_conf.h,v 1.1.1.1 2001/11/05 17:47:11 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: drv_conf.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:11 tneale
* Tornado shuffle
*
* Revision 1.5 2001/01/19 22:23:00 paul
* Update copyright.
*
* Revision 1.4 2000/03/17 00:10:13 meister
* Update copyright message
*
* Revision 1.3 1998/08/20 18:01:21 josh
* sys_conf.h cleanup
*
* Revision 1.2 1998/08/19 21:38:34 josh
* adding copyright stuff.
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* @(#) pSOSystem x86/V2.2.6: apps.v22/xxxx/drv_conf.c 3.3 (snmpv2) 98/01/09 12:28:00 */
/***********************************************************************/
/* */
/* MODULE: drv_conf.c */
/* DATE: 98/01/09 */
/* PURPOSE: pSOSystem driver configuration and initialization */
/* */
/* There are two functions in this file: */
/* */
/* SetUpDrivers to setup drivers except for Network drivers */
/* SetUpNI to setup Network drivers */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1993 - 1997, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* */
/* */
/***********************************************************************/
#include <sys_conf.h>
#include "bsp.h"
#include <bspfuncs.h>
#include <configs.h>
#include <sysvars.h>
#include <pna.h>
#if SC_DEV_SPI
#include "spi.h"
#endif
#if (SC_PSE)
#include <psecfg.h>
#include <sys/stream.h>
#endif
#if (SC_DEV_DLPI)
extern long DlpiEnet();
#endif
#define NULLF (ULONG) ((void (*)()) 0)
void InstallNi(int (*entry)(), int, int, int, int, int, int);
static const char RarpErrTimeout[] =
"RARP request failed: Check for a RARP server";
static const char RarpErrNet[] =
"RARP request failed: Network Error";
#if SC_PSOS || SC_PSOSM
/***********************************************************************/
/* SetUpDrivers: installs drivers in PsosIO table via a call to */
/* InstallDriver and then calls driver setup function if */
/* needed. NOTE: If the driver is to be part of the */
/* Network Interface then it should be placed in the */
/* SetUpNI function. */
/* */
/* INPUT: FreeMemPtr = A pointer to unused memory that can be */
/* used to allocate space for a driver. */
/* NOTE: Be sure to advance FreeMemPtr if */
/* memory is allocates! */
/* */
/* RETURNS: The new address of free memory after the drivers have */
/* allocated space. */
/* */
/* NOTE: This function does many precompile checks so errors */
/* can be found during compile-time rather then at run- */
/* time. */
/* */
/* To add a non-Network driver to pSOSystem, call InstallDriver(). */
/* This adds a device driver to the PsosIO table. InstallDriver() */
/* takes the following arguments: */
/* */
/* unsigned short major_number device major number */
/* void (*dev_init)(), device init procedure */
/* void (*dev_open)(), device open procedure */
/* void (*dev_close)(), device close procedure */
/* void (*dev_read)(), device read procedure */
/* void (*dev_write)(), device write procedure */
/* void (*dev_ioctl)(), device control procedure */
/* unsigned long rsvd1, reserved */
/* unsigned short rsvd2) reserved */
/* unsigned short flags; If set to IO_AUTOINIT pSOS will */
/* automatically call the */
/* drivers initialization */
/* function. The SC_AUTOINIT */
/* #define which is set in */
/* sys_conf.h can be used to set */
/* this element. */
/* */
/* InstallDriver() does not return a value. InstallDriver() assumes */
/* SC_DEVMAX is defined in sys_conf.h and is useful only before pSOS+ */
/* has been initialized. */
/* */
/* If you are adding a driver that needs to be initialized before */
/* either pSOS+ is initialized or the driver's init function is */
/* called, then you can call a setup function (that you create) for */
/* the driver (for example, see the CnslSetup call for the serial */
/* device driver). If your initialization function needs to allocate */
/* memory, you may pass it the FreeMemPtr. The function should return */
/* a new FreeMemPtr which points to the end of the memory it has */
/* allocated. */
/* */
/* When adding code to install a new driver, it is a good idea to add */
/* precompile checks so errors can be found during compile-time rather */
/* then at run-time. Precompile checks are used, for example, in the */
/* code that installs the pSOSystem serial device driver below. */
/* */
/***********************************************************************/
UCHAR *SetUpDrivers(UCHAR *FreeMemPtr)
{
/*---------------------------------------------------------------------*/
/* Install the pSOSystem serial device driver. */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SERIAL && BSP_SERIAL)
#if(SC_DEV_SERIAL > SC_DEVMAX)
#error "SC_DEV_SERIAL cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SERIAL, CnslInit, NULLF, NULLF,CnslRead,
CnslWrite, CnslCntrl, 0, 0, SC_AUTOINIT);
FreeMemPtr = CnslSetup(FreeMemPtr, SysVars.DefBaud,
SC_APP_CONSOLE);
#endif
/*---------------------------------------------------------------------*/
/* Install Pseudo driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_PSEUDO)
InstallDriver(SC_DEV_PSEUDO, PseudoIOInit, NULLF, NULLF,
PseudoIORead, PseudoIOWrite, PseudoIOCntrl, 0, 0, 0);
#endif
/*--------------------------------------------------------------------*/
/* Setup pSOSystem PC console device driver */
/*--------------------------------------------------------------------*/
#if (SC_DEV_CONSOLE && BSP_CONSOLE)
#if (SC_DEV_CONSOLE >SC_DEVMAX)
#error "SC_DEV_CONSOLE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_CONSOLE, PcCnslInit, NULLF, NULLF,
PcCnslRead, PcCnslWrite, PcCnslCntrl, 0, 0,
SC_AUTOINIT);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem tick timer. */
/*---------------------------------------------------------------------*/
#if SC_DEV_TIMER
#if(SC_DEV_TIMER > SC_DEVMAX)
#error "SC_DEV_TIMER cannot be > SC_DEVMAX"
#endif
#if (!SC_PSOS && !SC_PSOSM)
#error "Must have pSOS+ or pSOS+m in system to use tick timer!"
#endif
InstallDriver(SC_DEV_TIMER, RtcInit, NULLF, NULLF, NULLF, NULLF,
NULLF, 0, 0, SC_AUTOINIT);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem ramdisk driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if SC_DEV_RAMDISK
#if(SC_DEV_RAMDISK > SC_DEVMAX)
#error "SC_DEV_RAMDISK cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_RAMDISK, RdskInit, NULLF, NULLF, RdskRead,
RdskWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem SCSI driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SCSI && BSP_SCSI)
#if(SC_DEV_SCSI > SC_DEVMAX)
#error "SC_DEV_SCSI cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SCSI, SdrvInit, NULLF, NULLF, SdskRead,
SdskWrite, SdrvCntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem SCSI Tape driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SCSI_TAPE && BSP_SCSI_TAPE)
#if(SC_DEV_SCSI_TAPE > SC_DEVMAX)
#error "SC_DEV_SCSI_TAPE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SCSI_TAPE, SdrvInit, StapeOpen, StapeClose,
StapeRead, StapeWrite, SdrvCntrl, 0, 0, 0);
/*-----------------------------------------------------------------*/
/* Don't need to call SdrvSetup this time since it was done before */
/*-----------------------------------------------------------------*/
/* SdrvSetup(); */
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem CMOS clock driver */
/*---------------------------------------------------------------------*/
#if (SC_DEV_CMOS && BSP_CLOCK)
#if (SC_DEV_CMOS >SC_DEVMAX)
#error "SC_DEV_CMOS cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_CMOS, NULLF, NULLF, NULLF, CmcRead,
CmcWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem printer driver */
/*---------------------------------------------------------------------*/
#if (SC_DEV_PARALLEL && BSP_PARALLEL)
#if (SC_DEV_PARALLEL >SC_DEVMAX)
#error "SC_DEV_PARALLEL cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_PARALLEL, ParInit, ParOpen, ParClose, NULLF,
ParWrite, ParCntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem floppy diskette driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_FLOPPY && BSP_FLOPPY)
#if (SC_DEV_FLOPPY >SC_DEVMAX)
#error "SC_DEV_FLOPPY cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_FLOPPY, FlpInit, NULLF, NULLF, FlpRead,
FlpWrite, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Setup pSOSystem IDE disk driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_IDE && BSP_IDE)
#if (SC_DEV_IDE >SC_DEVMAX)
#error "SC_DEV_IDE cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_IDE, IDEInit, NULLF, NULLF, IDERead,
IDEWrite, IDECntrl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the pSOSystem TFTP driver. */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_TFTP)
#if(SC_DEV_TFTP > SC_DEVMAX)
#error "SC_DEV_TFTP cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_TFTP, TftpInit, TftpOpen, TftpClose, TftpRead,
NULLF, TftpCntl, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install the SPI driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_SPI)
#if(SC_DEV_SPI > SC_DEVMAX)
#error "SC_DEV_SPI cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_SPI, SPI_init, SPI_open, SPI_close, NULLF,
NULLF, SPI_io, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Install pSE DLPI driver */
/* NOTE: This driver must be called from a task it cannot use the */
/* auto initialization freature of pSOS+ */
/*---------------------------------------------------------------------*/
#if (SC_DEV_DLPI)
{
#if(SC_DEV_DLPI > SC_DEVMAX)
#error "SC_DEV_DLPI cannot be > SC_DEVMAX"
#endif
extern long DlpiNullNI();
extern UCHAR *DlpiInit(UCHAR *, long, long);
extern int DlpiAddNI(long, long(*)(), long, long, char *, long);
extern void enetinit();
extern struct streamtab enetinfo;
char *DlpiErrMsg = "DlpiAddNI failed: NI Error";
static const psedrvparam_t eth0param = {"eth0", DT_CLONE,
&enetinfo, 0, 0};
InstallDriver(SC_DEV_DLPI, enetinit, NULLF, NULLF, NULLF,
NULLF, NULLF, (long)&eth0param, 0, 0);
/*-------------------------------------------------------------*/
/* Call DlpiInit to initialize the Streams DLPI driver */
/* Arguments passed to DlpiInit are: */
/* 1. Free memory address */
/* 2. Maximum NI interface number */
/* 3. Maximum number of streams per interface */
/*-------------------------------------------------------------*/
FreeMemPtr = DlpiInit(FreeMemPtr, 1, 6);
/*-------------------------------------------------------------*/
/* Call DlpiAddNI to add an NI interface to the Streams DLPI */
/* driver. DlpiAddNI must be called for each NI driver */
/* interface used with the Streams DLPI driver. */
/* Arguments passed to DlpiAddNI are: */
/* 1. NI interface number (should correspond to the pNA+ */
/* interface number if driver is shared with pNA+) */
/* 2. NI entry point */
/* 3. NI flags */
/* IFF_SELFLOOP 0x0001 loopback for self-address */
/* IFF_POLL_NI 0x0002 driver must be polled */
/* IFF_RAWMEM 0x2000 driver accepts mblk link list */
/* 4. NI major device number */
/* 5. NI multicast address */
/* 6. NI poll frequency (every # of elapsed ticks) */
/*-------------------------------------------------------------*/
#if (BSP_LAN1 && SE_SHARE_NI)
if (DlpiAddNI(1, (long(*)())BSP_LAN1_ENTRY, 0x2000,
SC_DEV_DLPI, 0, 0))
SysInitFail(DlpiErrMsg);
#else
if (DlpiAddNI(0, (long(*)())DlpiNullNI, 0, SC_DEV_DLPI, 0, 0))
SysInitFail(DlpiErrMsg);
#endif
}
#endif
/*-------------------------------------------------------------------*/
/* Install pSOSystem Watchdog driver */
/*-------------------------------------------------------------------*/
#if (SC_DEV_WATCHDOG)
#if(SC_DEV_WATCHDOG > SC_DEVMAX)
#error "SC_DEV_WATCHDOG cannot be > SC_DEVMAX"
#endif
InstallDriver(SC_DEV_WATCHDOG, WdtInit, NULLF, NULLF, NULLF,
NULLF, NULLF, 0, 0, 0);
#endif
/*---------------------------------------------------------------------*/
/* Additional drivers may be installed here. */
/*---------------------------------------------------------------------*/
return FreeMemPtr;
}
#endif /* SC_PSOS || SC_PSOSM */
#if SC_PNA
/***********************************************************************/
/* SetUpNI: Set up Network Interfaces for pNA+ */
/* */
/* INPUT: FreeMemPtr = A pointer to unused memory that can be */
/* used to allocate space for a driver. */
/* NOTE: Be sure to advance FreeMemPtr if */
/* memory is allocates! */
/* */
/* RETURNS: The new address of free memory after the drivers have */
/* allocated space. */
/* */
/* NOTES: This function does many precompile checks so errors */
/* can be found during compile-time rather then at run- */
/* time. */
/* */
/* Also, the Network Interface Table must be allocated */
/* before this function can be called. There cannot be */
/* more then NC_NNI entries in this table. NC_NNI is set */
/* in sys_conf.h. Before adding another interface, be */
/* sure to check sys_conf.h to see if NC_NNI is set to */
/* accommodate another one! */
/* */
/* See the pSOSystem Programmers Reference Manual */
/* for more information. */
/* */
/* To add a Network driver to pSOSystem, call InstallNi(). This adds */
/* the Network Interface to the pNA+ Network Interface Table. */
/* InstallNi() takes the following arguments: */
/* */
/* int (*entry)(); address of NI entry point */
/* int ipadd; IP address */
/* int mtu; maximum transmission length */
/* int hwalen; length of hardware address */
/* int flags; intErface flags */
/* int subnetaddr; subnet mask */
/* int dstipaddr; destination ip address */
/* */
/* See pSOSystem Programmer`s Reference Manual, Configuration Tables */
/* Section, for more information about the Network Interface Table. */
/* InstallNi() does not return a value. */
/* */
/* If you are adding a driver that needs to be initialized before */
/* either pSOS+ is initialized or the driver's init function is */
/* called, then you can call a setup function (that you create) for */
/* the driver (for example, see the CnslSetup call for the serial */
/* device driver). If your initialization function needs to allocate */
/* memory, you may pass it the FreeMemPtr. The function should return */
/* a new FreeMemPtr which points to the end of the memory it has */
/* allocated. */
/* */
/* When adding code to install a new driver, it is a good idea to add */
/* precompile checks so errors can be found during compile-time rather */
/* then at run-time. Precompile checks are used, for example, in the */
/* code that installs the pSOSystem serial device driver below. */
/* */
/***********************************************************************/
UCHAR *SetUpNI(UCHAR *FreeMemPtr)
{
int IPaddr;
/*---------------------------------------------------------------------*/
/* Install the pSOSystem NI. */
/*---------------------------------------------------------------------*/
#if BSP_LAN1
if (SysVars.Lan1)
{
/*-------------------------------------------------------------*/
/* If RARP is specified for the IP address, use it now to */
/* obtain the IP address for this interface. */
/*-------------------------------------------------------------*/
if (SysVars.Lan1IP == USE_RARP)
{
#if (SC_DEV_DLPI && SE_SHARE_NI)
IPaddr = RarpEth((long (*)())DlpiEnet);
#else
IPaddr = RarpEth((long (*)())BSP_LAN1_ENTRY);
#endif
if (IPaddr == 0)
SysInitFail(RarpErrTimeout);
if (IPaddr == -1)
SysInitFail(RarpErrNet);
}
else
IPaddr = SysVars.Lan1IP;
#if (SC_DEV_DLPI && SE_SHARE_NI)
InstallNi((int (*)())DlpiEnet, IPaddr,
#else
InstallNi((int (*)())BSP_LAN1_ENTRY, IPaddr,
#endif
BSP_LAN1_MTU, BSP_LAN1_HWALEN, BSP_LAN1_FLAGS,
SysVars.Lan1SubnetMask, 0);
}
#endif
/*---------------------------------------------------------------------*/
/* Install the shared memory NI. */
/*---------------------------------------------------------------------*/
#if BSP_SMEM
#if ((SC_NISM_LEVEL != 1) && (SC_NISM_LEVEL != 2))
#error "Illegal value for SC_NISM_LEVEL"
#endif
if (SysVars.Nism)
{
InstallNi((int (*)())NiSmem, SysVars.NismIP, NISM_MTU, 4, 0x8002,
SysVars.NismSubnetMask, 0);
/*-------------------------------------------------------------*/
/* Set up the NI Shared Memory driver by calling its function */
/* "NiSmemSetup". */
/*-------------------------------------------------------------*/
FreeMemPtr = NiSmemSetup(SC_NISM_BUFFS, FreeMemPtr,
SC_NISM_LEVEL);
}
#endif
/*---------------------------------------------------------------------*/
/* Additional Network drivers may be installed here. */
/*---------------------------------------------------------------------*/
return FreeMemPtr;
}
#endif
@@ -0,0 +1,734 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/isisnmp/x86226/sys_conf.h,v 1.1.1.1 2001/11/05 17:47:11 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: sys_conf.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:11 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:23:00 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:10:13 meister
* Update copyright message
*
* Revision 1.2 1998/08/19 21:38:35 josh
* adding copyright stuff.
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/* @(#) pSOSystem x86/V2.2.6: apps.v22/xxxx/sys_conf.h (snmpv2 386) 3.21 98/01/12 10:03:13 */
/***********************************************************************/
/* */
/* MODULE: sys_conf.h */
/* DATE: 98/01/12 */
/* PURPOSE: pSOSystem configuration definitions */
/* */
/*---------------------------------------------------------------------*/
/* */
/* Copyright 1991 - 1997, Integrated Systems, Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of Integrated Systems, */
/* Inc. products to use or abstract this computer program for the */
/* sole purpose of implementing a product based on Integrated */
/* Systems, Inc. products. No other rights to reproduce, use, */
/* or disseminate this computer program, whether in part or in */
/* whole, are granted. */
/* */
/* Integrated Systems, Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*---------------------------------------------------------------------*/
/* */
/* This is a header file which defines all of the system-level */
/* parameters that are likely to need changing. */
/* */
/* It has been set up to be as close as possible to the settings */
/* which are appropriate for this application. However, you may */
/* need to make some changes to parameters to reflect your */
/* environment, such as IP addresses, etc. */
/* */
/* Chapter 7 of the pSOSystem Getting Started manual contains a */
/* complete description of the symbols that are defined in this */
/* file. */
/* */
/***********************************************************************/
#if __cplusplus
extern "C" {
#endif
#ifndef _SYS_CONF_H
#define _SYS_CONF_H
/***********************************************************************/
/* */
/* SC_APP_PARMS Must be defined before you include sysvars.h file. */
/* Since "sysvars.h" file depends on SC_APP_PARMS and BSP_PARMS */
/* to define the Storage Parms Structure. */
/* */
/* Defining this variable to a Non-Zero Value will create a space in */
/* the Storage Parms. structure for your application use. */
/* */
/***********************************************************************/
#define SC_APP_PARMS 0
#define SC_APP_NAME "snmpv2 Application"
/*---------------------------------------------------------------------*/
/* types.h contains common definitions for example YES and NO */
/*---------------------------------------------------------------------*/
#include <types.h>
/***********************************************************************/
/* sysvars.h contains the structures and definitions for the system */
/* variables that are stored in NVRAM. These structures and */
/* definitions are also used when creating the boot rom for the */
/* target system. By using the same sysvars.h file it will insure the */
/* consistency of the values stored by the boot rom and later read by */
/* the downloaded application. */
/***********************************************************************/
#include <sysvars.h>
/*---------------------------------------------------------------------*/
/* include psos.h for defines IO_AUTOINIT and IO_NOAUTOINIT */
/*---------------------------------------------------------------------*/
#include <psos.h>
/***********************************************************************/
/* */
/* These symbols are used to define other symbols in this file. */
/* They should never be changed. */
/* */
/***********************************************************************/
#define USE_RARP 0
/***********************************************************************/
/* */
/* B A S I C P A R A M E T E R S */
/* */
/* The parameters in this section determine the fashion in which */
/* many of the other parameters in this file will be used. */
/* */
/* Many of the parameters in this file have names beginning with */
/* either "SC_" or "SD_". Those beginning with "SC_" are ALWAYS */
/* controlled by the values you set in this file. The values of */
/* the "SD_" parameters can be determined either by the definitions */
/* given in this file, or by the data found in the target board's */
/* parameter storage area. SC_SD_PARAMETERS determines this. If */
/* SC_SD_PARAMETERS is "SYS_CONF", then the values given in this */
/* file will be used for the SD_ parameters. If SC_SD_PARAMETERS */
/* is "STORAGE", then pSOSystem will attempt to use the values found */
/* in the board's parameter storage area for the SD_ variables. If */
/* the parameter storage area has not been initialized or has been */
/* corrupted, then the values given in this file will be used. They */
/* will also be written to the storage area. */
/* */
/* If SC_SD_PARAMETERS is STORAGE, you may enable a "startup dialog" */
/* which will allow you to view, and optionally change, the */
/* parameter values found in the storage area. The dialog is enabled */
/* by setting SC_STARTUP_DIALOG to YES. In this case, */
/* SD_STARTUP_DELAY specifies the number of seconds that the dialog */
/* will wait for input before proceeding to boot the system. */
/* */
/* SC_SD_DEBUG_MODE determines how the system will operate, as follows:*/
/* */
/* DBG_SA: Boot pROBE+ in standalone mode. */
/* */
/* DBG_XS: Boot into pROBE+ and wait for the host debugger */
/* via a serial connection */
/* */
/* DBG_XN: Boot into pROBE+ and wait for the host debugger */
/* via a network connection */
/* */
/* DBG_AP: Same as DBG_SA, but also does a pROBE+ "silent startup",*/
/* meaning that pROBE+ initializes itself without */
/* printing a startup banner. pROBE+ then initializes */
/* pSOS+ and starts the application running. This mode */
/* was created to simplify implementation of the pSOSystem */
/* Boot ROMs. Note that when this mode is used, the value */
/* you specify for RC_SMODE (see "pROBE+ Configuration */
/* Parameters", below) is overridden. */
/* */
/* STORAGE: Use the mode (DBG_SA, DBG_XS, or DBG_XN) found in the */
/* parameter storage area. If a valid mode is not found, */
/* then use DBG_SA. */
/* */
/* An important consequence of using SC_SD_DEBUG_MODE=STORAGE should */
/* be noted. If you use the TFTP bootloader in the pSOSystem ROMs */
/* to download and start your system, you will be setting */
/* SC_SD_DEBUG_MODE = DBG_AP in your target board's parameter storage */
/* area. Thus, if you have left SC_SD_DEBUG_MODE set to STORAGE in */
/* this file, your downloaded system will also use DBG_AP, meaning */
/* that the application will begin running immediately after the */
/* TFTP bootloader has loaded and started your system. */
/* */
/***********************************************************************/
#define SC_SD_PARAMETERS STORAGE
#define SC_STARTUP_DIALOG NO
#define SC_BOOT_ROM NO
#define SD_STARTUP_DELAY 60
#define SC_SD_DEBUG_MODE STORAGE
/***********************************************************************/
/* */
/* O P E R A T I N G S Y S T E M C O M P O N E N T S */
/* */
/* Setting the definition line to YES will cause that component to */
/* be built into the system. NO means the component will NOT be */
/* put into the system. It is an error to specify both SC_PSOS */
/* and SC_PSOSM as present! */
/* */
/***********************************************************************/
#define SC_PSOS YES /* pSOS+ real-time kernel */
#define SC_PSOSM NO /* pSOS+ real-time multiproc kernel */
#define SC_PROBE YES /* pROBE+ (processor svcs) */
#define SC_PROBE_DISASM YES /* pROBE+ (disassembler) */
#define SC_PROBE_DASM_INTEL NO /* pROBE+ (Intel format disassembler) */
/* for x86 Targets Only */
#define SC_PROBE_CIE YES /* pROBE+ (console executive) */
#define SC_PROBE_QUERY YES /* pROBE+ (query services) */
#define SC_PROBE_DEBUG YES /* pROBE+ (debug interface executive) */
#define SC_PHILE YES /* pHILE+ file system manager */
#define SC_PREPC YES /* pREPC+ C run-time library */
#define SC_PNA YES /* pNA+ TCP/IP networking manager */
#define SC_PRPC YES /* pRPC+ RPC component */
#define SC_PSE NO /* pSE+ streams component */
#define SC_PSKT NO /* pSKT+ SKT library component */
#define SC_PTLI NO /* pTLI+ TLI library component */
#define SC_PMONT NO /* pMONT+ */
#define SC_PROFILER NO /* Profiler is enabled/Disabled */
/*---------------------------------------------------------------------*/
/* If set to IO_AUTOINIT device drivers that are installed be the */
/* InstallDriver function will have their autoinit field set. This */
/* will cause pSOS+ call the drivers initialization function when */
/* pSOS+ starts up. The de_init call will not have to be called for */
/* each driver if this is done. */
/* */
/* NOTE: This Auto Initialization will not work on all drivers. */
/* Setting IO_AUTOINIT only effects drivers that can use the Auto */
/* Initialization feature. */
/* */
/* If set to IO_NOAUTOINIT no automatic driver initialization will */
/* happen. */
/*---------------------------------------------------------------------*/
#define SC_AUTOINIT IO_AUTOINIT
/*---------------------------------------------------------------------*/
/* If SC_PMONT SC_AUTOINIT will always be set to 1 because pMONT needs */
/* drivers to be automatically initialized. */
/*---------------------------------------------------------------------*/
#if SC_PMONT
#undef SC_AUTOINIT
#define SC_AUTOINIT IO_AUTOINIT
#endif
/***********************************************************************/
/* */
/* S E R I A L C H A N N E L C O N F I G U R A T I O N */
/* */
/* * SD_DEF_BAUD specifies the default baud rate to be used for the */
/* serial channels */
/* * SC_APP_CONSOLE specifies the serial channel number (starting */
/* from 1) which should be used for the application's "console". */
/* * SC_PROBE_CONSOLE specifies the serial channel number (starting */
/* from 1) which pROBE+ should use to display output and receive */
/* commands, or to communicate with the host debugger. */
/* * SC_PROBE_HOST specifies the serial channel number (starting */
/* from 1) which should be used for the pROBE+ "host" channel. */
/* This is not normally required, so it can be disabled by */
/* using a value of 0. The host channel is explained in the */
/* pROBE+ User's Manual. */
/* */
/***********************************************************************/
#define SD_DEF_BAUD 9600
#define SC_APP_CONSOLE PCCON
#define SC_PROBE_CONSOLE PCCON
#define SC_RBUG_PORT 0
/***********************************************************************/
/* SC_NumNon_pSOSChan is the number of non pSOS users of serial */
/* channels. These are users that will be initiated before pSOS */
/* such as pROBE. */
/* NOTE: These channels will not be closed on a soft reset. */
/***********************************************************************/
#if (SC_RBUG_PORT && SC_PROBE_CONSOLE && (SC_PROBE_CONSOLE != PCCON))
#define SC_NumNon_pSOSChan 2
#else
#define SC_NumNon_pSOSChan 1
#endif
/***********************************************************************/
/* */
/* L A N C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_LAN1 YES
#define SD_LAN1_IP 0x80e001b7
#define SD_LAN1_SUBNET_MASK 0xffffff00
/*---------------------------------------------------------------------*/
/* Maximum number of multicast addresses to be used by the lan */
/* interface. Must not exceed maximum supported by the lan driver. */
/*---------------------------------------------------------------------*/
#define SC_LAN1_NMCAST 0
/***********************************************************************/
/* */
/* S H A R E D M E M O R Y C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
/***********************************************************************/
/* */
/* B U S C O N F I G U R A T I O N */
/* */
/* */
/***********************************************************************/
#define SD_VME_BASE_ADDR 0x01000000
/*---------------------------------------------------------------------*/
/* If you want to build a Shared Memory Interface for the network or */
/* multi-processing pSOS+m, set SD_SM_NODE (a non-zero value) to the */
/* node number of THIS node. */
/*---------------------------------------------------------------------*/
#define SD_SM_NODE 0
/*---------------------------------------------------------------------*/
/* Shared memory network interface - SC_NISM_LEVEL should be 1 if this */
/* will be the FIRST system to use the SMNI on this board. It should */
/* be 2 if this will not be the first system to use the SMNI on this */
/* board. Usually this means that SC_NISM_LEVEL should be 1 if you */
/* are building Boot ROMs, and 2 for a system that will be downloaded */
/* and started using the Boot ROMs. See the comments at the beginning */
/* of drivers/ni_smem.c for more explanation. */
/*---------------------------------------------------------------------*/
#define SD_NISM NO
#define SD_NISM_IP 0x00000000
#define SD_NISM_DIRADDR 0x00000400
#define SC_NISM_BUFFS 30
#define SC_NISM_LEVEL 2
#define SD_NISM_SUBNET_MASK 0
/*---------------------------------------------------------------------*/
/* If you want to build a multi-node pSOS+m system, set SD_KISM */
/* to the number of nodes in the system. */
/*---------------------------------------------------------------------*/
#define SD_KISM 0
#define SD_KISM_DIRADDR 0x00000580
/***********************************************************************/
/* */
/* M I S C E L L A N E O U S N E T W O R K I N G */
/* P A R A M E T E R S */
/* */
/***********************************************************************/
#define SD_DEF_GTWY_IP 0
/***********************************************************************/
/* SC_RAM_SIZE */
/* */
/* Normally, pSOSystem uses ALL of the memory remaining on a board for */
/* dynamic allocation ("region 0"). You may override this by setting */
/* SC_RAM_SIZE to a non-zero value. If you do, pSOSystem will not */
/* touch any memory after address (BSP_RAM_BASE + SC_RAM_SIZE - 1). */
/* */
/* NOTE: This is useful when making a BOOT ROM and you want to ensure */
/* that the ROM's RAM area does not overflow the space alloted for it. */
/***********************************************************************/
#define SC_RAM_SIZE 0
/***********************************************************************/
/* */
/* I / O D E V I C E S */
/* */
/* Each device may be included in the system by specifying a major */
/* number for it, which determines its slot in the pSOS+ I/O switch */
/* table. To leave a device driver out of the system, use NO for */
/* the major number. */
/* */
/* Note the following: */
/* * Major device 0 is reserved and cannot be used for any of these */
/* devices. Setting a device number to 0 here is the same as NO. */
/* * No device number may be higher than SC_DEVMAX (SC_DEVMAX may */
/* be increased, if desired) */
/* * The lines defining the symbols DEV_SERIAL, DEV_TIMER, etc, */
/* should not be changed. These are for use by application */
/* programs as the "device number" parameter on de_* calls. */
/* */
/***********************************************************************/
#define SC_DEV_SERIAL 1 /* Serial driver */
#define SC_DEV_TIMER 2 /* Periodic tick timer */
#define SC_DEV_RAMDISK NO /* RAM disk */
#define SC_DEV_CONSOLE 4 /* PC-Console driver */
#define SC_DEV_SCSI NO /* SCSI bus */
#define SC_DEV_SCSI_TAPE NO /* SCSI bus, tape device */
#define SC_DEV_IDE NO /* IDE Driver */
#define SC_DEV_FLOPPY NO /* Floppy Driver */
#define SC_DEV_TFTP NO /* TFTP pseudo driver */
#define SC_DEV_SPI NO /* SPI driver */
#define SC_DEV_DLPI NO /* DLPI pseudo driver */
#define SC_DEV_OTCP NO /* 12 TCP/IP for OpEN */
#define SC_IP SC_DEV_OTCP /* 12 IP */
#define SC_ARP NO /* 13 ARP */
#define SC_TCP NO /* 14 TCP */
#define SC_UDP NO /* 15 UDP */
#define SC_RAW NO /* 16 RAW */
#define SC_LOOP NO /* 17 LOOP = (SC_DEV_OTCP + 5) */
#define SC_DEV_SOSI NO /* 18 OSI for OpEN */
#define SC_DEV_PSEUDO NO /* PSEUDO driver */
#define SC_DEV_PARALLEL NO /* Parallel Port Driver */
#define SC_DEV_CMOS NO /* CMOS Driver */
#define SC_DEV_WATCHDOG NO /* Watchdog Driver */
#define SC_DEV_OLAP NO /* LAP Driver */
#define SC_PHPI (SC_DEV_OLAP) /* Phpi driver */
#define SC_LAPB (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 1 */
#define SC_CLAPB (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 2 */
#define SC_DEV_OX25 (SC_DEV_OLAP + 0)/* LAPB driver Change 0 to 3 */
#define SC_X25 (SC_DEV_OX25) /* X25 driver */
#define SC_CX25 (SC_DEV_OX25 + 0)/* X25 driver Change 0 to 1 */
#define SC_SNDCF NO /* sndcf driver */
#define SC_CSNDCF NO /* csndcf driver */
#define SC_IPCONV NO
#define SC_CIPCONV NO
#define SC_DEVMAX 32 /* Maximum device number */
#define DEV_SERIAL (SC_DEV_SERIAL << 16)
#define DEV_PARALLEL (SC_DEV_PARALLEL << 16)
#define DEV_TIMER (SC_DEV_TIMER << 16)
#define DEV_RAMDISK (SC_DEV_RAMDISK << 16)
#define DEV_SCSI (SC_DEV_SCSI << 16)
#define DEV_SCSI_TAPE (SC_DEV_SCSI_TAPE << 16)
#define DEV_PSEUDO (SC_DEV_PSEUDO << 16)
#define DEV_DLPI (SC_DEV_DLPI << 16)
#define DEV_TFTP (SC_DEV_TFTP << 16)
#define DEV_SPI (SC_DEV_SPI << 16)
#define DEV_WATCHDOG (SC_DEV_WATCHDOG << 16)
#define DEV_FLOPPY (SC_DEV_FLOPPY << 16)
#define DEV_IDE (SC_DEV_IDE << 16)
#define DEV_CMOS (SC_DEV_CMOS << 16)
#define DEV_CONSOLE (SC_DEV_CONSOLE << 16)
#if (BSP_CPUFAMILY == FAMILY_X86) && (SC_APP_CONSOLE == PCCON)
#define CONSOLE DEV_CONSOLE
#else
#define CONSOLE DEV_SERIAL
#endif
/***********************************************************************/
/* */
/* M E M O R Y M A N A G E M E N T L I B R A R Y P A R A M S */
/* */
/***********************************************************************/
#define SC_MMULIB NO
/***********************************************************************/
/* */
/* C O M P O N E N T C O N F I G U R A T I O N P A R A M E T E R S */
/* */
/* These parameters should work as is for this application. You */
/* may want to change some of them if you start customizing this */
/* application. */
/* */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/* pSOS+ configuration parameters */
/*---------------------------------------------------------------------*/
#define KC_RN0USIZE 0x100 /* region 0 unit size */
#define KC_NTASK 25 /* max number of tasks */
#define KC_NQUEUE 10 /* max number of message queues */
#define KC_NSEMA4 30 /* max number of semaphores */
#define KC_NMSGBUF 256 /* max number of message buffers */
#define KC_NTIMER 10 /* max number of timers */
#define KC_NLOCOBJ 50 /* max number of local objects */
#define KC_TICKS2SEC 100 /* clock tick interrupt frequency */
#define KC_TICKS2SLICE 10 /* time slice quantum, in ticks */
#define KC_INTSTK 0x2000 /* interrupt stack size */
#define KC_SYSSTK 0x2000 /* pSOS+ system stack size (bytes) */
#define KC_ROOTSSTK 0x4000 /* ROOT supervisor stack size */
#define KC_ROOTUSTK 0 /* ROOT user stack size */
#define KC_ROOTMODE (T_SUPV | T_ISR) /* ROOT initial mode */
#define KC_ROOTPRI 230 /* ROOT task priority */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a pSOSystem routine as a fatal error handler */
/* #define KC_FATAL ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a fatal error handler */
/* extern void MyHandler (void); */
/* #define KC_FATAL ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define KC_STARTCO 0 /* callout at task activation */
#define KC_DELETECO 0 /* callout at task deletion */
#define KC_SWITCHCO 0 /* callout at task switch */
#define KC_FATAL 0 /* fatal error handler address */
#define KC_IDLECO 0 /* Idle Task Callout */
#define KC_RTCINITCO 0 /* RTC INIT Callout */
/*---------------------------------------------------------------------*/
/* pSOS+m configuration parameters */
/*---------------------------------------------------------------------*/
#define MC_NGLBOBJ 8 /* size of gbl obj table */
#define MC_NAGENT 10 /* number of RPC agents in this node */
#define MC_FLAGS SEQWRAP_ON /* operating mode flags */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following definition */
/* */
/* Using a pSOSystem routine as a roster change handler */
/* #define MC_ROSTER ((void (*)()) SysInitFail) */
/* */
/* Using a user written routine as a roster change handler */
/* extern void MyHandler (void); */
/* #define MC_ROSTER ((void (*)()) MyHandler) */
/* */
/*---------------------------------------------------------------------*/
#define MC_ROSTER 0 /* addr of user roster change callout */
#define MC_KIMAXBUF 100 /* maximum KI packet buffer length */
#define MC_ASYNCERR 0 /* asynchronous calls error callout */
/*---------------------------------------------------------------------*/
/* pROBE configuration parameters - note that the SMODE flag bits are */
/* irrelevant if SC_SD_DEBUG_MODE = DBG_AP. */
/*---------------------------------------------------------------------*/
#define TD_BRKOPC 0xCC /* Instruction break opcode */
#define TD_ILEV (1 << 12)/* pROBE+ interrupt mask */
#define TD_FLAGS (NODOTS_MASK | TD_ILEV | NOTUPD_MASK)/* flags */
#define TD_DBGPRI 244 /* Debugger task priority */
/*---------------------------------------------------------------------*/
/* The variable defined down should be set to the Starting address for */
/* for pROBE+ DATA AREA. This is required by all the smaller boards. */
/* NOTE: */
/* Setting of this value should have atleast 0x4400 bytes Free */
/* Space from that location. */
/*---------------------------------------------------------------------*/
#define TD_DATASTART 0x0
/*---------------------------------------------------------------------*/
/* pHILE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define FC_LOGBSIZE 9 /* Block size (base-2 exponent) */
#define FC_NBUF 6 /* Number of cache buffers */
#define FC_NMOUNT 3 /* Max # of mounted volumes */
#define FC_NFCB 10 /* Max # of opened files per system */
#define FC_NCFILE 2 /* Max # of opened files per task */
#define FC_NDNLC 0 /* Max # of cached directory entries */
#define FC_MSDOS 1 /* MS-DOS volume mount flag */
#define FC_CDROM 0 /* CD-ROM volume mount flag */
/*---------------------------------------------------------------------*/
/* pREPC+ configuration parameters */
/*---------------------------------------------------------------------*/
#define LC_BUFSIZ 128 /* I/O buffer size */
#define LC_NUMFILES 5 /* Max number of open files per task */
#define LC_WAITOPT 0 /* Wait option for memory allocation */
#define LC_TIMEOPT 0 /* Timeout option for mem allocation */
#define LC_SSIZE 512 /* Size of print buffer */
/*---------------------------------------------------------------------*/
/* pNA+ configuration parameters */
/* */
/* NOTE: If you get pNA+ errno 5F01 FAT_INSUFFMEM you may need to */
/* decrease the number of buffers allocated here for pNA+. */
/* In general this error means pNA+ could not allocate enough */
/* memory from Region 0 for the number of buffers requested. */
/*---------------------------------------------------------------------*/
#define NC_NNI 5 /* size of pNA NI Table */
#define NC_NROUTE 10 /* size of pNA Routing Table */
#define NC_NARP 20 /* size of pNA ARP table */
#define NC_DEFUID 0 /* Default User ID of a task */
#define NC_DEFGID 0 /* Default Group ID of a task */
#define NC_HOSTNAME "scg" /* Hostname of the node */
#define NC_NHENTRY 8 /* Number of Host table entries */
#define NC_NMCSOCS 0 /* Number of IP multicast sockets */
#define NC_NMCMEMB 0 /* Number of distict IP multicast */
/* group memberships per interface */
#define NC_NNODEID 0 /* Network NODE ID for unnumbered link */
#define NC_NSOCKETS 128 /* Number of sockets in the system */
#define NC_NDESCS 128 /* # of socket descriptors/task */
#define NC_MBLKS 300 /* # of message blocks in the system */
#define NC_BUFS_0 64 /* number of 0 length buffers */
#define NC_BUFS_32 0 /* number of 32 length buffers */
#define NC_BUFS_64 0 /* number of 64 length buffers */
#define NC_BUFS_128 256 /* number of 128 byte buffers */
#define NC_BUFS_256 0 /* number of 256 byte buffers */
#define NC_BUFS_512 0 /* number of 512 byte buffers */
#define NC_BUFS_1024 16 /* number of 1k byte buffers */
#define NC_BUFS_2048 48 /* number of 2k byte buffers */
#define NC_BUFS_4096 0 /* number of 4k byte buffers */
#define NC_MAX_BUFS 9 /* max number of NC_BUFS types */
/*---------------------------------------------------------------------*/
/* The following are examples for modifying the following defines */
/* */
/* Using a user written routine as a pNA+ Signal Handler */
/* extern void MySigHandler (void); */
/* #define NC_SIGNAL ((void (*)()) MySigHandler) */
/* */
/*---------------------------------------------------------------------*/
#define NC_SIGNAL 0 /* pNA+ Signal Hdlr */
/*---------------------------------------------------------------------*/
/* pSE+ configuration parameters */
/*---------------------------------------------------------------------*/
#define SE_NBUFS_0 64 /* number of 0 length buffers */
#define SE_NBUFS_32 128 /* number of 32 byte buffers */
#define SE_NBUFS_64 128 /* number of 64 byte buffers */
#define SE_NBUFS_128 256 /* number of 128 byte buffers */
#define SE_NBUFS_256 32 /* number of 256 byte buffers */
#define SE_NBUFS_512 32 /* number of 512 byte buffers */
#define SE_NBUFS_1024 16 /* number of 1k byte buffers */
#define SE_NBUFS_2048 16 /* number of 2k byte buffers */
#define SE_NBUFS_4096 8 /* number of 4k byte buffers */
#define SE_MAX_BUFS 9 /* max number of stream buffer types */
#define SE_MAX_MODULES 3 /* max number of streams modules */
#define SE_SHARE_NI NO /* LAN-NI with streams? */
#define SE_DATA_SIZE 0x0C00 /* size of pSE data area */
/* (must be at least 3K) */
#define SE_TASK_PRIO 250 /* priority for pSE task */
#define SE_STACK_SIZE 0x2000 /* stack size for pSE task */
#define SE_DEF_UID 0 /* default user id */
#define SE_DEF_GID 0 /* default group id */
#define SE_N_FDS 32 /* max # of system-wide */
/* stream descriptors */
#define SE_N_TASKFDS 8 /* max # of per-task stream */
/* descriptors */
#define SE_N_LINKS 32 /* max # of multiplexing links */
#define SE_N_TIMEOUTS 32 /* max # of timeout requests */
#define SE_N_BUFCALLS 32 /* max # of bufcall requests */
#define SE_N_QUEUES 256 /* # of queues */
#define SE_N_MBLKS 512 /* reserved for future use, must be 0 */
/*---------------------------------------------------------------------*/
/* Loader configuration parameters */
/* */
/* YES indicates for each module to be linked in. NO means do not link */
/* object module loader into this application. */
/* */
/*---------------------------------------------------------------------*/
#define LD_MAX_LOAD 8 /* Max. # of active loads */
#define LD_ELF_MODULE NO /* ELF object-load-module */
#define LD_SREC_MODULE NO /* SREC object-load-module */
#define LD_COFF_MODULE NO /* COFF object-load-module */
#define LD_IEEE_MODULE NO /* IEEE object-load-module */
#define LD_IHEX_MODULE NO /* IHEX object-load-module */
/*---------------------------------------------------------------------*/
/* pMONT+ configuration parameters - note that PM_DEV and PM_BAUD are */
/* only relevant to serial communication (PM_CMODE = 2) */
/*---------------------------------------------------------------------*/
#define PM_CMODE 1 /* 1 = networking, 2 = serial */
#define PM_DEV 2 /* Minor Device number for */
/* serial channel if used */
#define PM_BAUD 9600 /* Baud rate for serial chnl */
#define PM_TRACE_BUFF 0 /* Address of trace buffer -- */
/* Allocated by pSOSystem if 0 */
#define PM_TRACE_SIZE 0x6000 /* Size of trace buffer */
#define PM_TIMER NO /* 2nd timer for finer time */
/* within data collection */
/*---------------------------------------------------------------------*/
/* General Serial Block Configuration Parameters */
/*---------------------------------------------------------------------*/
#define GS_BUFS_0 64 /* number of 0 length buffers */
#define GS_BUFS_32 128 /* number of 32 byte buffers */
#define GS_BUFS_64 128 /* number of 64 byte buffers */
#define GS_BUFS_128 256 /* number of 128 byte buffers */
#define GS_BUFS_256 32 /* number of 256 byte buffers */
#define GS_BUFS_512 32 /* number of 512 byte buffers */
#define GS_BUFS_1024 16 /* number of 1k byte buffers */
#define GS_BUFS_2048 16 /* number of 2k byte buffers */
#define GS_BUFS_4096 8 /* number of 4k byte buffers */
#define GS_MBLKS 680
#define GS_MAX_BUFS 9 /* max number of serial buffer types */
/*---------------------------------------------------------------------*/
/* TCP/IP for OpEN configuration parameters */
/*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/* Configurable parameters for the Network layer (IP) */
/*---------------------------------------------------------------------*/
#define OTCP_IPMAX 8 /* Max # of open IP device */
#define OTCP_IPNINTERFACES 4 /* Max # of network interfaces */
#define OTCP_IPNROUTES 64 /* Max #of routing tbl entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for ARP */
/*---------------------------------------------------------------------*/
#define OTCP_ARPMAX 8 /* Max # of open ARP device */
#define OTCP_ARPNINTERFACES 4 /* Max # of ARP interfaces */
#define OTCP_ARPNENTRIES 32 /* Max # of ARP table entries */
/*---------------------------------------------------------------------*/
/* Configurable parameters for TCP */
/*---------------------------------------------------------------------*/
#define OTCP_TCPMAX 64 /* Max # of open TCP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for UDP */
/*---------------------------------------------------------------------*/
#define OTCP_UDPMAX 32 /* Max # of open UDP device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for RAW */
/*---------------------------------------------------------------------*/
#define OTCP_RAWMAX 32 /* Max # of open RAW device */
/*---------------------------------------------------------------------*/
/* Configurable parameters for LOOP */
/*---------------------------------------------------------------------*/
#define OTCP_LOOPMAX 2 /* Max # of open LOOP device */
#endif /* _SYS_CONF_H */
#if __cplusplus
}
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mac/emissary.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: emissary.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:23:01 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:15 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:52 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:16 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:57:56 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 20:35:56 sar
* Initial version
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <console.h>
#include <assert.h>
#include <limits.h>
/*
* Pathname separator character.
*/
#define EMISSARY_PATH_SEPARATOR ':'
#if __option(profile)
#include <profile.h>
#endif
/*
* I don't understand how the Macintosh works well enough to know
* if these are the right values in all cases. Change them if not.
*
* If you don't want the file type and file creator stuff at all,
* define these macros to expand to nothing.
*/
#if 1
#define EMISSARY_MACINTOSH_SET_FILE_TYPE \
{ extern long _ftype; _ftype = 'TEXT'; }
#define EMISSARY_MACINTOSH_SET_FILE_CREATOR \
{ extern long _fcreator; _fcreator = 'MPS '; }
#else
#define EMISSARY_MACINTOSH_SET_FILE_TYPE
#define EMISSARY_MACINTOSH_SET_FILE_CREATOR
#endif
/*
* OS-specific initialization code for the Macintosh with Think C.
* This is ugly, if you can think of a better way to do it that
* doesn't embed Mac-specific code in the guts of the MIB compiler,
* tell us.
*/
#if __option(profile)
#define EMISSARY_MACINTOSH_INITPROFILE InitProfile(512, 200)
#else
#define EMISSARY_MACINTOSH_INITPROFILE
#endif
#define EMISSARY_OS_DEPENDENT_INIT(argc,argv) \
do { \
extern struct __copt console_options; \
console_options.nrows = 25; \
argc = ccommand(&argv); \
EMISSARY_MACINTOSH_INITPROFILE; \
EMISSARY_MACINTOSH_SET_FILE_TYPE; \
EMISSARY_MACINTOSH_SET_FILE_CREATOR; \
} while (0)
@@ -0,0 +1,297 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/attache.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: attache.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.7 2001/01/19 22:23:01 paul
* Update copyright.
*
* Revision 1.6 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.5 1998/03/12 18:23:43 meister
* GLUE_IPSEC_RCV_SA_NOTUNNEL()
*
* Revision 1.4 1998/03/11 21:11:12 meister
* Added some parameters to some IPSEC glue functions
*
* Revision 1.3 1998/02/27 22:30:09 meister
* Added IPSEC glue function defs
*
* Revision 1.2 1998/02/25 04:56:52 sra
* Update copyrights.
*
* Revision 1.1 1998/02/18 22:34:58 sra
* Add ip_loopback(), eradicate glue_pkt_handle().
*
* Revision 1.0 1997/08/08 22:11:16 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:06 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 20:30:07 sar
* Initial version
*
*/
/* [clearcase]
modification history
-------------------
*/
/* Previous revision history from mach386/attache.h
* with release update messages removed
*
* Revision 2.4 1994/12/20 21:19:11 lowell
* worked around problems between Mach's memory.h and
* the builtin versions provided by GCC...
*
* Revision 2.3 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 2.2 1994/09/04 06:13:38 sra
* Clean up antique type names and install macros.
*
* Revision 1.6 1993/08/03 23:40:54 dab
* CONFIG_PREAMBLE is either defined or not, so use #ifdef
*
* Revision 1.5 1993/08/02 21:58:54 dab
* moved MEM* and STR* to the first section
*
* Revision 1.4 1993/04/21 15:30:10 dab
* Default configuration moved to <attache/h/config.h>
*
* Revision 1.2 1993/02/28 17:25:09 dab
* If set SGRP to 1 instead of just on then matches what happens in
* envoy/h/asn1conf.h.
*
*/
#ifdef CONFIG_PREAMBLE
/* Things which MAY be defined in here:
*
* MAX_PACKETS
* STATIC_PACKETS
* MAX_ARP_ENTRIES
* ARP_EXPIRATION
* ARP_TIMER_FREQUENCY
* ARP_TIMEOUT
* PRINTF
* DEFAULT_IP_TTL
* MAX_REASM
* IP_REASM_TIMEOUT
* TFTP_TIMEOUT
*/
/* Define MAX_PACKETS in order to preallocate packets using glue_alloc().
* MAX_PACKETS value is the number of packets to preallocate.
*
* Define STATIC_PACKETS to have MAX_PACKETS packet buffers allocated
* from a static array. STATIC_PACKETS should be the packet size
* to allocate.
*/
#define MAX_PACKETS 20
/*#define STATIC_PACKETS 1536 */
/* Define IP_MAX_PKTSIZE to be the maximum reassembly buffer size.
* This isn't the largest packet that can be reassembled because some of the
* buffer space is taken up with other things.
* Also, ptcp_init() will preallocate packets of this size at startup
*/
#ifdef STATIC_PACKETS
#define IP_MAX_PKTSIZE STATIC_PACKETS
#else
#define IP_MAX_PKTSIZE 1536
#endif
/* Declarations for various standard C functions needed by Attache.
* These later may be declared by just including system include files
* or the functions may be explcitly declared here. The standard C
* functions needed by Attache are:
*
* memcpy memcmp memset strcmp strcpy strlen
*
*/
/* The standard C functions provided by Mach 386 are declared with
* char* instead of void*. Rather than using Mach's declarations,
* we'll use gcc's builtin functions where they're available:
* memset() isn't a builtin, so we'll just define it here, gcc-style. */
void * memset(void *, int, size_t);
#include <strings.h>
/* If you're using Attache along with Envoy, these macros will be
* needed in envoy.h as well. Make sure they are identical so the
* C-preprocessor doesn't complain about them being redefined. */
#define MEMCPY(dst, src, n) memcpy((char *)(dst), (char *)(src), n)
#define MEMCMP(s1, s2, n) memcmp((char *)(s1), (char *)(s2), n)
#define MEMSET(dst, val, n) memset((char *)(dst), val, n)
#else /* CONFIG_PREAMBLE */
/* glue routines to interface to the outside world.
*/
int glue_intlock (int); /* lock interrupts, return old state */
/* generic memory allocation routines
*/
#define GLUE_ALLOC(len) malloc(len)
#define GLUE_FREE(mem) free(mem)
/* Define this one if you want your own packet allocation routine. Both
* GLUE_PKTALLOC() and GLUE_PKTFREE() must be defined or undefined.
*/
/* #define GLUE_PKTALLOC(len) gettapkt(len) */
/* #define GLUE_PKTFREE(p) givepkt(p) */
/* Define GLUE_PKTPRIVATE_FREE(x) to be a routine to free the pkt_private
* value, if you need to do that.
*/
/* #define GLUE_PKTPRIVATE_FREE(x) priv_free(x) */
/* Define GLUE_CKSUM to be a function that computes the IP checksum
* We provide a C routine in mach386/glue.c
*/
#define GLUE_CKSUM(buf, word_count) cksum((bits16_t *)(buf), (word_count))
/* Define GLUE_SWAP16 and GLUE_SWAP32 iff your machine is little endian and
* thus SWAP16 and SWAP32 are defined. These functions are provided in
* mach386/glue.c
*/
#ifdef SWAP16
#define GLUE_SWAP16(x) swap16(x)
#endif /* SWAP16 */
#ifdef SWAP32
#define GLUE_SWAP32(x) swap32(x)
#endif /* SWAP32 */
/* GLUE time functions
*
* GLUE_NOW() returns a 32 bit number in milliseconds. It's used as a
* relative, not absolute, number. Just keep it to whatever resolution is
* convenient, but make sure it is a monotonically increasing number.
*/
#define GLUE_NOW() glue_now()
/* GLUE_CALLIN() schedules a function to be called in ms milliseconds.
* It only has to remember one function; when it is called while a call is
* already scheduled, the previous settings can be forgotten.
* It should guarantee that when the function is called, GLUE_NOW() will
* be at least ms greater than it was when GLUE_CALLIN() was called (ie:
* make sure you call later rather than earlier)
* Also, be sure that from whatever context handler is called, it's
* safe to make calls into the protocol stack, for instance, into udp_sendto()
* or similar functions.
*/
#define GLUE_CALLIN(ms, handler) callin(ms, handler)
/* Declare all the previously used glue functions */
bits16_t cksum (bits16_t *, unsigned);
bits16_t swap16 (bits16_t);
bits32_t swap32 (bits32_t);
bits32_t glue_now (void);
void callin (bits32_t, void (*)(void));
void *malloc (unsigned);
void free (void *);
#ifdef ATTACHE_IPSEC_H
#define GLUE_IPSEC_SA_EXPIRED(W,X,Y,Z) \
glue_ipsec_sa_expired(W,X,Y,Z)
extern void glue_ipsec_sa_expired (ipsec_sa_dir_t, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_SND_PKT_DENIED(W,X,Y,Z) \
glue_ipsec_snd_pkt_denied((W),(X),(Y),(Z))
extern void glue_ipsec_snd_pkt_denied(packet *, ipaddr_t *, ipaddr_t *, int);
#define GLUE_IPSEC_RCV_PKT_BADSPI(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_badspi((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_badspi(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_NOTPARTY(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_notparty((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTIP(U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notip((U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notip(packet *, packet *, ipaddr_t *,
ipaddr_t *, bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTPARTY(S,T,U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notparty((S),(T),(U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_SA_NOTUNNEL(V,W,X,Y,Z) \
glue_ipsec_rcv_sa_notunnel((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_sa_notunnel(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_BADAH(V,W,X,Y) \
glue_ipsec_rcv_pkt_badah((V),(W),(X),(Y))
extern void glue_ipsec_rcv_pkt_badah(packet *, ipaddr_t *, ipaddr_t *,
bits32_t);
#define GLUE_IPSEC_RCV_PKT_DENIED(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_denied((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_denied(packet *, ipaddr_t *, ipaddr_t *,
ipsec_policy_flags_t, bits16_t);
#endif /* ATTACHE_IPSEC */
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,54 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/common.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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:12 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:23:01 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.2 1998/02/25 04:56:53 sra
* Update copyrights.
*
* Revision 1.1 1997/08/21 17:23:45 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
-------------------
*/
/*
* NIY....
*/
#ifdef CONFIG_PREAMBLE
#else /* CONFIG_PREAMBLE */
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,129 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/emissary.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: emissary.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:23:02 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:53 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:17 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:06 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 20:30:07 sar
* Initial version
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* The headers for this system are really screwed up, particularly
* when dealing with two different versions of gcc in ANSI mode.
* This will never be pretty, just grit your teeth.
*/
#define __GCC2__ (defined(__GNUC__) && __GNUC__ >= 2)
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
#if !__GCC2__
#include <libc.h>
#endif
#include <ctype.h>
#if !__GCC2__
#include <memory.h>
#endif
#include <string.h>
#include <time.h>
#include <errno.h>
#include <limits.h>
#include <assert.h>
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
/*
* This is a pain, but the Mach386 header files don't declare this stuff
* if you're compiling with -traditional, and we want to avoid getting
* compiler warnings. It seems to be kind of arbitrary as to which functions
* are actually declared in the header files in this case.
*/
#if !__STDC__
extern int fflush(FILE*);
extern void exit(int);
extern int ungetc(int, FILE*);
extern int atoi(char *);
extern void perror(char *);
extern int fclose(FILE*);
extern int printf(char*,...);
extern int access(char *, int);
extern int _filbuf(FILE*);
extern void free(void *);
#endif /* !__STDC__ */
/*
* Definitions to suppress warnings from dumb system header files.
*/
#define MEMCPY(x,y,z) memcpy((char *) (x), (const char *) (y), (int) (z))
#define MEMSET(x,y,z) memset((char *) (x), (int) (y), (int) (z))
#define MEMCMP(x,y,z) memcmp((const char *) (x), (const char *) (y), (int) (z))
#define MEMCHR(x,y,z) memchr((const char *) (x), (int) (y), (int) (z))
/*
* These should be in the files <stddef.h>, <stdlib.h>, and <unistd.h>,
* but the versions of those that gcc-2.5.5 generated on Mach386 have
* everything conditionalized for C++ only, so they're useless. Sigh.
*/
#if __GCC2__
extern void *memchr(const void *, int, long unsigned int);
extern int memcmp(const void *, const void *, long unsigned int);
extern void *memcpy(void *, const void *, long unsigned int);
extern void *memset(void *, int, long unsigned int);
extern char *getenv (const char *);
extern int atoi(const char *);
extern void *malloc(long unsigned int);
extern void free(void *);
extern void *realloc(void *, long unsigned int);
#endif
@@ -0,0 +1,206 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/envoy.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: envoy.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.7 2001/01/19 22:23:02 paul
* Update copyright.
*
* Revision 1.6 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.5 1998/06/21 21:53:05 sar
* Moved the porting stuff that is common to all of our demos to generic/envoy.h
* and included that file here.
*
* Revision 1.4 1998/06/20 18:29:20 sar
* Update for use with v3, also made it similar to other envoy.h files
*
* Revision 1.3 1998/02/25 04:56:54 sra
* Update copyrights.
*
* Revision 1.2 1997/11/04 00:29:36 sar
* Changed the agentx sub agent timeout period from 10000 (10 seconds)
* which was used for testing to 1000 (1 second).
*
* Revision 1.1 1997/10/29 01:31:29 sar
* Updated the master agent installation option.
*
* Revision 1.0 1997/08/08 22:11:17 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:07 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.2 1997/01/15 22:13:32 sar
* moved the location of nvutils.h to snark/snmptalk
*
* Revision 0.1 1996/10/28 20:30:07 sar
* Initial version
*
* Revision 3.2 1996/03/22 10:05:39 sra
* Update copyrights prior to Attache 3.2 release.
*
* Revision 3.1 1995/09/27 21:21:17 lowell
* Ifdeffed the example locking code so it won't conflict with the defaults
* if we don't have locking turned on.
* (per sar's changes to the msdos example code)
*
* Revision 3.0 1995/05/10 22:37:24 sra
* Release 3.0.
*
* Revision 2.9 1995/05/01 20:59:29 sra
* Have to test CONFIG_PREAMBLE with #ifdef, not #if.
*
* Revision 2.8 1995/01/06 00:52:48 sra
* Update copyright notice for 2.1 release.
*
* Revision 2.7 1994/12/20 21:19:11 lowell
* worked around problems between Mach's memory.h and
* the builtin versions provided by GCC...
*
* Revision 2.6 1994/11/01 18:02:55 sar
* Updated *_add_mod to include a flags argument.
*
* Revision 2.5 1994/10/18 15:52:03 sar
* Modfied the calls for the new nvutils routines.
*
* Revision 2.4 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 2.3 1994/05/12 17:28:21 sar
* moved the include for nvutils.h so it is available to all who need it.
*
* Revision 2.2 1994/05/10 20:43:24 sar
* Moved some view stuff around so it is available in other than v2 settings.
*
* Revision 2.1 1993/08/06 22:03:40 sra
* Release 2.0.
*
* Revision 1.8 1993/08/02 22:05:36 dab
* don't use #ifdef for INSTALL_ options
*
* Revision 1.7 1993/06/02 23:24:44 dab
* make MEMCMP identical to attache.h so the compiler doesn't complain.
*
* Revision 1.6 1993/05/13 22:27:54 sar
* added MEMCMP
*
* Revision 1.5 1993/05/13 18:47:44 sar
* Added macros for managing file impelementation of non volatile memory.
*
* Revision 1.4 1993/04/22 22:58:03 sar
* Got rid of pread and pwrite and some other macros, modified TIME
* to be SNMP_PARTYTIME
*
* Revision 1.3 1993/03/01 18:38:08 dab
* Added MEMSET and MEMCPY macros.
*
* Revision 1.2 1993/03/01 17:20:43 dab
* Added include of <string.h> to get strlen() declaration.
*
* Revision 1.1 1993/02/26 22:06:21 dab
* Initial revision
*
* Revision 1.1 1993/02/26 17:26:21 dab
* Initial revision
*
*
*/
/* [clearcase]
modification history
-------------------
*/
/*****************************************************************
This is the platform specific part of envoy.h for use with the
example code. It contains only the platform specific pieces of
the port code. The common porting code is in generic/envoy.h.
In general customers will have one envoy.h file per platform
that combines this file and the platform specific information,
we use two files as there is a lot of shared code between our
demos.
*****************************************************************/
#ifdef CONFIG_PREAMBLE
/*****************************************************************
System Includes:
Envoy uses memcpy(), memset(), and strlen(). The appropriate
include file should be put here to see that these routines are
properly declared. If no such include file exists on the system
then declare memcpy() and memset() here directly. Envoy also
uses min() and max(). Include the system's definition or use the
macros supplied below.
*****************************************************************/
void * memset(void *, int, size_t);
#include <string.h>
/*****************************************************************
Memory allocation routines. Envoy needs to allocate memory to
decode the packet into and also to store the response data
Make sure that the routines used by the SNMP_memory_alloc() and
SNMP_memory_free() macros are declared. If system memory routines
are used (e.g. malloc() and free()) then include the appropriate
system header file here.
On MACH 386 the system include files don't pass gcc's -pedentic
switch. This is just too painful to watch so I just declare malloc
and free myself.
*****************************************************************/
extern void *malloc (unsigned);
extern void free (void *);
#define SNMP_memory_alloc(need) malloc(need)
#define SNMP_memory_free(buf) free(buf)
/*****************************************************************
These macros fix up Mach 386's improper declaration of the mem*
routines. If you're using Envoy with Attache then these same macros
need to be defined in attache.h as well. Make sure they are identical
otherwise the C-preprocessor will complain about redefining them.
*****************************************************************/
#define MEMCPY(dst, src, n) memcpy((char *)(dst), (char *)(src), n)
#define MEMSET(dst, val, n) memset((char *)(dst), val, n)
#define MEMCMP(dst, src, n) memcmp((char *)(dst), (char *)(src), n)
#include <port/generic/envoy.h>
#else /* config preamble */
#include <port/generic/envoy.h>
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,69 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/oemtypes.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: oemtypes.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:23:02 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:54 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:18 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:07 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.1 1996/10/28 20:30:07 sar
* Initial version
*
*/
/* [clearcase]
modification history
-------------------
*/
/*
* We need to supply size_t. Everything else in <types.h> will
* work fine on Mach386.
*/
#include <sys/types.h>
/*
* For use with Emissary.
*/
#define __GCC2__ (defined(__GNUC__) && __GNUC__ >= 2)
#if __GCC2__
#include <stddef.h>
#endif
@@ -0,0 +1,71 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/snmptalk.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: snmptalk.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:23:02 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:19 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:55 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:18 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:58:08 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.2 1996/10/30 22:08:57 sar
* removed bsd_release
*
* Revision 0.1 1996/10/28 20:30:07 sar
* Initial version
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <strings.h>
/* defines for nvutils for file manipulation */
#define SNMP_READONLY "r"
#define SNMP_READPLUS "r+"
#define SNMP_WRITEPLUS "w+"
#define SNMP_REMOVE_FILE(fname) unlink(fname)
/* Mach doesn't have these routines so we provide them. */
#define NEEDS_STRDUP
#define NEEDS_STRTOL
#define NEEDS_STRTOUL
#define strnicmp strncasecmp
#define stricmp strcasecmp
@@ -0,0 +1,64 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/mach386/telnet.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: telnet.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.3 2001/01/19 22:23:02 paul
* Update copyright.
*
* Revision 1.2 2000/03/17 00:10:20 meister
* Update copyright message
*
* Revision 1.1 1998/02/25 04:56:55 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:18 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.3 1997/03/20 06:58:02 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.2 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
*/
/* [clearcase]
modification history
-------------------
*/
/* Things which MAY be defined in here:
*
* TN_LOCAL_NEWLINE
* TN_RECV_LOCAL_NEWLINE
* TN_SEND_LOCAL_NEWLINE
* TN_INITIAL_ACTIVE_WINDOW_SIZE
* TN_INITIAL_PASSIVE_WINDOW_SIZE
* GLUE_TN_WINDOW_SIZE
*/
/*
* All of the defaults are in attache/h/tnconfig.h.
*/
@@ -0,0 +1,356 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/msdos/attache.h,v 1.2 2002/02/26 18:22:53 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: attache.h,v $
* Revision 1.2 2002/02/26 18:22:53 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.12 2001/01/19 22:23:03 paul
* Update copyright.
*
* Revision 1.11 2000/03/17 00:10:25 meister
* Update copyright message
*
* Revision 1.10 1999/04/28 23:53:25 sra
* Clean up various minor installation option glitches.
*
* Revision 1.9 1998/09/06 08:11:06 sra
* Packet filtering hooks in Attache, rudimentary firewall
* implementation in Snark.
*
* Revision 1.8 1998/03/12 18:23:42 meister
* GLUE_IPSEC_RCV_SA_NOTUNNEL()
*
* Revision 1.7 1998/03/11 21:08:28 meister
* Added extra parameters to a couple of IPSEC glue macros
*
* Revision 1.6 1998/03/03 15:26:16 mrf
* Comment out PRINTF declarations.
*
* Revision 1.5 1998/02/28 01:40:00 meister
* Added stdio and a PRINTF
*
* Revision 1.4 1998/02/27 22:31:01 meister
* Added ipsec glue functions
*
* Revision 1.3 1998/02/25 04:56:56 sra
* Update copyrights.
*
* Revision 1.2 1998/02/18 22:34:59 sra
* Add ip_loopback(), eradicate glue_pkt_handle().
*
* Revision 1.1 1997/09/15 15:48:27 sra
* GLUE_NOW() migration version skew.
*
* Revision 1.0 1997/08/08 22:11:19 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.5 1997/03/20 06:57:47 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.4 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.3 1997/01/08 01:08:19 sar
* as part of changing snmptalk to use the snark suite we can remove
* the ifdefs for snark in this file.
*
* Revision 0.2 1996/10/26 00:43:57 sar
* put the #else for config_preamble in the right place
*
* Revision 0.1 1996/10/23 00:12:55 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
/* previous history from attache/port/msdos/attache.h
*
* Revision 3.1 1996/03/22 10:05:39 sra
* Update copyrights prior to Attache 3.2 release.
*
* Revision 3.0 1995/05/10 22:37:24 sra
* Release 3.0.
*
* Revision 2.4 1995/01/06 00:52:48 sra
* Update copyright notice for 2.1 release.
*
* Revision 2.3 1994/09/04 23:55:50 sra
* Get rid of most of the ancient NO_PP cruft.
*
* Revision 2.2 1994/09/04 06:13:38 sra
* Clean up antique type names and install macros.
*
* Revision 2.1 1993/08/06 22:03:43 sra
* Release 2.0.
*
* Revision 1.8 1993/08/03 23:19:38 dab
* CONFIG_PREAMBLE is either defined or not, so use ifdef
*
* Revision 1.7 1993/08/02 21:59:13 dab
* moved MEM* and STR* to the first section
*
* Revision 1.6 1993/05/20 20:22:21 sar
* Removed memory.h if the compiler is watcom or intel 960
*
* Revision 1.5 1993/05/17 20:11:55 sar
* Added an ifdef for zortech to remove the include of memory.h and
* to add the define of NEEDS_STR{DUP ICMP NICMP} as they weren't
* available.
*
* Revision 1.4 1993/04/21 15:30:59 dab
* Default configuration moved to <attache/h/config.h>
*
* Revision 1.3 1993/02/28 18:28:38 dab
* Changed "#define SGRP" to "#define SGRP 1" so it matches envoy/h/asn1conf.h
* so we don't get warnings.
* Added include of <memory.h> and <string.h>.
*
* Revision 1.2 1993/02/27 17:31:59 dab
* Merged in stuff from glue.h
*
* Revision 1.1 1993/02/18 21:50:33 dab
* Initial revision
*/
#ifdef CONFIG_PREAMBLE
/* Things which MAY be defined in here:
*
* MAX_PACKETS
* STATIC_PACKETS
* MAX_ARP_ENTRIES
* ARP_EXPIRATION
* ARP_TIMER_FREQUENCY
* ARP_TIMEOUT
* PRINTF
* DEFAULT_IP_TTL
* MAX_REASM
* IP_REASM_TIMEOUT
* TFTP_TIMEOUT
*/
/* Define MAX_PACKETS in order to preallocate packets using glue_alloc().
* MAX_PACKETS value is the number of packets to preallocate.
*
* Define STATIC_PACKETS to have MAX_PACKETS packet buffers allocated
* from a static array. STATIC_PACKETS should be the packet size
* to allocate.
*/
#define MAX_PACKETS 20
/*#define STATIC_PACKETS 1536 */
/* Define IP_MAX_PKTSIZE to be the maximum reassembly buffer size.
* This isn't the largest packet that can be reassembled because some of the
* buffer space is taken up with other things.
* Also, ptcp_init() will preallocate packets of this size at startup
*/
#ifdef STATIC_PACKETS
#define IP_MAX_PKTSIZE STATIC_PACKETS
#else
#define IP_MAX_PKTSIZE 1536
#endif
#define TCP_DEFAULT_MAX_RETRANSMISSIONS 0
#else /* CONFIG_PREAMBLE */
/* Declarations for various standard C functions needed by Attache.
* These later may be declared by just including system include files
* or the functions may be explcitly declared here. The standard C
* functions needed by Attache are:
*
* memcpy memcmp memset strcmp strcpy strlen
*
*/
/* microsoft and borland have a memory.h so include it */
#if defined(INSTALL_on_microsoft) || defined(INSTALL_on_bcc)
#include <memory.h>
#endif
#include <string.h>
#include <stdio.h>
/* glue routines to interface to the outside world. */
/* lock interrupts, return old state */
extern int glue_intlock (int);
/* generic memory allocation routines */
#define GLUE_ALLOC(len) ((void *) malloc(len))
#define GLUE_FREE(mem) free((char *)(mem))
/* Define this one if you want your own packet allocation routine. Both
* GLUE_PKTALLOC() and GLUE_PKTFREE() must be defined or undefined.
*/
/* #define GLUE_PKTALLOC(len) gettapkt(len) */
/* #define GLUE_PKTFREE(p) givepkt(p) */
/* Define GLUE_PKTPRIVATE_FREE(x) to be a routine to free the pkt_private
* value, if you need to do that.
*/
/* #define GLUE_PKTPRIVATE_FREE(x) priv_free(x) */
/* Define GLUE_CKSUM to be a function that computes the IP checksum
*/
#define GLUE_CKSUM(x, y) glue_cksum((bits16_t *)(x), (y))
/* Define GLUE_SWAP16 and GLUE_SWAP32 iff your machine is little endian and
* thus SWAP16 and SWAP32 are defined. Supplied are definitions for PC-DOS.
*/
#define GLUE_SWAP16(x) glue_swap16(x)
#define GLUE_SWAP32(x) glue_swap32(x)
/* GLUE time functions
*
* GLUE_NOW() returns a 32 bit number in milliseconds. It's used as a
* relative, not absolute, number. Just keep it to whatever resolution is
* convenient, but make sure it is a monotonically increasing number.
*/
#ifndef GLUE_NOW
#define GLUE_NOW() glue_now()
#endif
/* GLUE_CALLIN() schedules a function to be called in ms milliseconds.
* It only has to remember one function; when it is called while a call is
* already scheduled, the previous settings can be forgotten.
* It should guarantee that when the function is called, GLUE_NOW() will
* be at least ms greater than it was when GLUE_CALLIN() was called (ie:
* make sure you call later rather than earlier)
* Also, be sure that from whatever context handler is called, it's
* safe to make calls into the protocol stack, for instance, into udp_sendto()
* or similar functions.
*/
#define GLUE_CALLIN(x, y) glue_callin(x, y)
/* here we include files that define functions (like malloc(), for instance)
* that may be glue routines or declare the functions directly
*/
#include <stdlib.h>
extern bits32_t glue_now (void);
extern bits16_t glue_cksum (bits16_t *, unsigned);
extern void glue_callin (bits32_t, void (*)(void));
extern bits16_t glue_swap16 (bits16_t);
extern bits32_t glue_swap32 (bits32_t);
#ifndef MEMCPY
#define MEMCPY(x, y, z) memcpy(x, y, z)
#endif
#ifndef MEMCMP
#define MEMCMP(x, y, z) memcmp(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
/* Define PRINTF to build debugging/printing code
#ifndef PRINTF
#define PRINTF printf
#endif
*/
#ifdef ATTACHE_IPSEC_H
#define GLUE_IPSEC_SA_EXPIRED(W,X,Y,Z) \
glue_ipsec_sa_expired(W,X,Y,Z)
extern void glue_ipsec_sa_expired (ipsec_sa_dir_t, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_SND_PKT_DENIED(W,X,Y,Z) \
glue_ipsec_snd_pkt_denied((W),(X),(Y),(Z))
extern void glue_ipsec_snd_pkt_denied(packet *, ipaddr_t *, ipaddr_t *, int);
#define GLUE_IPSEC_RCV_PKT_BADSPI(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_badspi((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_badspi(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_NOTPARTY(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_notparty((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_SA_NOTUNNEL(V,W,X,Y,Z) \
glue_ipsec_rcv_sa_notunnel((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_sa_notunnel(packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTIP(U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notip((U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notip(packet *, packet *, ipaddr_t *,
ipaddr_t *, bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_TUNPKT_NOTPARTY(S,T,U,V,W,X,Y,Z) \
glue_ipsec_rcv_tunpkt_notparty((S),(T),(U),(V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_tunpkt_notparty(packet *, ipaddr_t *, ipaddr_t *,
packet *, ipaddr_t *, ipaddr_t *,
bits32_t, bits8_t);
#define GLUE_IPSEC_RCV_PKT_BADAH(V,W,X,Y) \
glue_ipsec_rcv_pkt_badah((V),(W),(X),(Y))
extern void glue_ipsec_rcv_pkt_badah(packet *, ipaddr_t *, ipaddr_t *,
bits32_t);
#define GLUE_IPSEC_RCV_PKT_DENIED(V,W,X,Y,Z) \
glue_ipsec_rcv_pkt_denied((V),(W),(X),(Y),(Z))
extern void glue_ipsec_rcv_pkt_denied(packet *, ipaddr_t *, ipaddr_t *,
ipsec_policy_flags_t, bits16_t);
#endif /* ATTACHE_IPSEC */
#if defined(INSTALL_SNARK_FIREWALL) && INSTALL_SNARK_FIREWALL
#include <wrn/wm/demo/firewall.h>
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,90 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/msdos/common.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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:12 tneale
* Tornado shuffle
*
* Revision 1.7 2001/01/19 22:23:03 paul
* Update copyright.
*
* Revision 1.6 2000/03/17 00:10:27 meister
* Update copyright message
*
* Revision 1.5 1998/06/21 21:43:51 sar
* Dos compilers seem to use stricmp and strnicmp instead of casecmp
*
* Revision 1.4 1998/02/25 04:56:57 sra
* Update copyrights.
*
* Revision 1.3 1997/12/02 16:15:15 mrf
* add GLUE_NOW definition to make prng.c build on DOS
*
* Revision 1.2 1997/10/29 20:32:33 sar
* Added memory.h for some compilers to get prototypes for mem functions.
*
* Revision 1.1 1997/08/21 17:23:46 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
-------------------
*/
/*
* NIY....
*/
#ifdef CONFIG_PREAMBLE
/* zortech, watcom and intel 960 don't have a memory.h so away it goes */
#if (!defined(INSTALL_on_ztc) && !defined(INSTALL_on_watcom) && !defined(INSTALL_on_i960))
#include <memory.h>
#endif /* INSTALL_on_ztc */
#ifndef STRICMP
#define STRICMP(x, y) stricmp(x, y)
#endif
#ifndef STRNICMP
#define STRNICMP(x, y, z) strnicmp(x, y, z)
#endif
#else /* CONFIG_PREAMBLE */
#ifndef GLUE_NOW
#define GLUE_NOW() glue_now()
extern bits32_t glue_now (void);
#endif
#endif /* CONFIG_PREAMBLE */
@@ -0,0 +1,197 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/msdos/decorum.h,v 1.3 2003/01/15 14:00:26 josh Exp $ */
/*
* Copyright (C) 1999-2004 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: decorum.h,v $
* Revision 1.3 2003/01/15 14:00:26 josh
* directory structure shifting
*
* Revision 1.2 2002/02/26 18:22:53 josh
* updating paths in port files
*
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 2.7 2001/01/19 22:23:03 paul
* Update copyright.
*
* Revision 2.6 2000/03/17 00:10:27 meister
* Update copyright message
*
* Revision 2.5 1998/03/12 20:59:46 josh
* added string.h to prevent some compiler warnings
*
* Revision 2.4 1998/02/25 04:56:57 sra
* Update copyrights.
*
* Revision 2.3 1998/02/16 21:33:43 josh
* decorum port file now uses epilogue_char_t where appropriate
*
* Revision 2.2 1997/11/04 00:23:34 sar
* added memory.h for some compilers to get rid of some warnings.
*
* Revision 2.1 1997/09/15 22:32:59 josh
* include stdlib.h so we know how malloc() and free() are defined
*
* Revision 2.0 1997/09/11 15:08:17 josh
* updating version numbers for release
*
* Revision 1.0 1997/08/08 22:11:19 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.8 1997/08/05 19:23:36 josh
* updated for Decorum 2.0 -- new stuff added
*
* Revision 0.7 1997/03/20 06:57:48 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.6 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.5 1997/02/12 19:17:12 lowell
* refer to DECORUM_GET_RAWTIME
*
* Revision 0.4 1996/10/28 17:49:00 sar
* Added use of decorum_size_t
*
* Revision 0.3 1996/10/27 16:54:09 lowell
* ETC_STDIO_SIZE
*
* Revision 0.2 1996/10/26 23:03:18 lowell
* DECORUM_SENDBUF_LEN and ETC_STDIO_READ
*
* Revision 0.1 1996/10/23 00:12:55 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#if (!defined(decorum_inc))
#define decorum_inc
/* zortech, watcom and intel 960 don't have a memory.h so away it goes */
#if (!defined(INSTALL_on_ztc) && !defined(INSTALL_on_watcom) && !defined(INSTALL_on_i960))
#include <memory.h>
#endif /* INSTALL_on_ztc */
#include <wrn/wm/common/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef DECORUM_ALLOC
#define DECORUM_ALLOC(x) ((void *) malloc(x))
#endif
#ifndef DECORUM_FREE
#define DECORUM_FREE(x) (free((char *) (x)))
#endif
/* This first should be the same as SNMP_MAX_PACKET_SIZE in envoy.h */
#define DECORUM_MAX_PACKET_SIZE (1400)
#define DECORUM_DEFAULT_RECEIVE_BUFLEN (512)
/* needed for OIDC_T definition */
#if INSTALL_DECORUM_PROXY && (!defined(asn1conf_inc))
#include <wrn/wm/snmp/engine/asn1conf.h>
#endif
/* Some input routines, these are provided but may be replaced with
more efficient implentations if desired */
extern sbits16_t decorum_parse_sbits32 (epilogue_char_t *,
epilogue_char_t **,
sbits32_t *);
extern sbits16_t decorum_parse_bits32 (epilogue_char_t *,
epilogue_char_t **,
bits32_t *);
extern sbits16_t decorum_parse_hexstring (epilogue_char_t *,
epilogue_char_t *,
decorum_size_t);
#define ETC_STRING_GET_SBITS32 decorum_parse_sbits32
#define ETC_STRING_GET_BITS32 decorum_parse_bits32
#define ETC_STRING_GET_HEXSTRING decorum_parse_hexstring
/* a routine to output a number to a byte string, used to create
file/stream names */
#define ETC_STDIO_SPRINTF(buf, num, str) sprintf(buf, "%lu%s", num, str)
/* Define the structure that will be used for holding output
until we are done */
typedef FILE etc_stdio_t;
/* Macros for opening, closing and removing a stream */
#define ETC_STDIO_MODE_READ "r"
#define ETC_STDIO_MODE_WRITE "w+"
#define ETC_STDIO_OPEN(fname, how) fopen(fname, how)
#define ETC_STDIO_CLOSE(outstream) fclose(outstream)
#define ETC_STDIO_REMOVE(fname) remove(fname)
#define ETC_STDIO_READ(instream, size, buf) \
fread((buf), 1, (size), (instream))
#define ETC_STDIO_WRITE(outstream, size, buf) \
fwrite((buf), 1, (size), (outstream))
extern bits32_t file_size_32(char * fname);
#define ETC_STDIO_SIZE(fname) (file_size_32(fname))
#if 0
extern void file_last_modified_time(char *, struct decorum_rawtime *);
#define ETC_STDIO_LAST_MODIFIED_TIME(fname, tvp) \
(file_last_modified_time((fname), (tvp)))
#endif
/* Define the base output routines */
extern sbits16_t decorum_put_string (etc_stdio_t *, epilogue_char_t *,
decorum_size_t);
extern sbits16_t decorum_put_sbits32 (etc_stdio_t *, sbits32_t);
extern sbits16_t decorum_put_bits32 (etc_stdio_t *, bits32_t);
extern sbits16_t decorum_put_hex_string (etc_stdio_t *, bits8_t *,
decorum_size_t);
#define ETC_STDIO_PUT_STRING decorum_put_string
#define ETC_STDIO_PUT_SBITS32 decorum_put_sbits32
#define ETC_STDIO_PUT_BITS32 decorum_put_bits32
#define ETC_STDIO_PUT_HEX_STRING decorum_put_hex_string
#if INSTALL_DECORUM_PROXY
/* Define a more complex output routine, this may use the
base routines (as the example code does) or may be more direct */
extern sbits16_t decorum_put_oid (etc_stdio_t *, OIDC_T *, decorum_size_t);
#define ETC_STDIO_PUT_OID decorum_put_oid
#endif /* INSTALL_DECORUM_PROXY */
/* Define a string comparison routine */
#define ETC_STRING_STRCASECMP stricmp
/* Define a string length routine */
#define ETC_STRING_STRLEN strlen
/* Define a routine that gets the current time. */
/* This is compiler dependent on MS-DOS. */
#if 0
#define DECORUM_GET_RAWTIME(timeval_p) msdos_glue_getime ((timeval_p));
#endif
/* Define a routine that figgers out how big a buffer to use for a chunk
* of outgoing data. */
#define DECORUM_SENDBUF_LEN(http_sb) (256)
#endif /* #if (!defined(decorum_inc)) */
@@ -0,0 +1,113 @@
/* $Header: /usr/cvsroot/target/h/wrn/wm/util/port/msdos/emissary.h,v 1.1.1.1 2001/11/05 17:47:12 tneale Exp $ */
/*
* Copyright (C) 1999-2004 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: emissary.h,v $
* Revision 1.1.1.1 2001/11/05 17:47:12 tneale
* Tornado shuffle
*
* Revision 1.4 2001/01/19 22:23:03 paul
* Update copyright.
*
* Revision 1.3 2000/03/17 00:10:27 meister
* Update copyright message
*
* Revision 1.2 1998/10/08 19:31:45 paul
* small syntax cleanup
*
* Revision 1.1 1998/02/25 04:56:57 sra
* Update copyrights.
*
* Revision 1.0 1997/08/08 22:11:20 meister
* Bumped revision number to 1.0 to hopfully get rid of the spurious
* added files weirdness
*
* Revision 0.4 1997/03/20 06:57:48 sra
* DFARS-safe copyright text. Zap!
*
* Revision 0.3 1997/02/25 10:58:16 sra
* Update copyright notice, dust under the bed.
*
* Revision 0.2 1996/10/28 17:42:54 mrf
* undefine MEM_AVAIL if we are on msvc4.0 (which has no _memavl())
*
* Revision 0.1 1996/10/23 00:12:55 sar
* *** empty log message ***
*
*/
/* [clearcase]
modification history
-------------------
*/
#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <io.h>
#include <assert.h>
#include <limits.h>
#include <errno.h>
/*
* WATCOM C/C++ 9.5 warns about constructs like "defined(foo) && foo",
* so explicitly zero all the compiler install tests we know it will find.
*/
#ifndef INSTALL_on_bcc
#define INSTALL_on_bcc 0
#endif
#ifndef INSTALL_on_microsoft
#define INSTALL_on_microsoft 0
#endif
#ifndef INSTALL_on_microsoft
#define INSTALL_on_microsoft 0
#endif
#ifndef INSTALL_on_msvc40
#define INSTALL_on_msvc40 0
#endif
#ifndef INSTALL_on_ztc
#define INSTALL_on_ztc 0
#endif
#if INSTALL_on_bcc
#include <memory.h>
#include <alloc.h>
#define MEM_AVAIL() ((unsigned long) coreleft())
#endif
#if INSTALL_on_microsoft
#include <memory.h>
#include <malloc.h>
#define MEM_AVAIL() ((unsigned long) _memavl())
#endif
/* No _memavl() on msvc40 */
#if INSTALL_on_msvc40
#undef MEM_AVAIL
#endif

Some files were not shown because too many files have changed in this diff Show More