/* chess_tbl.c - object table for subtree 'chess'. * * @DEC_COPYRIGHT@ * * NOTE: This file is created by the ucxaxp$dka0:[sys0.syscommon.][sysexe]ucx$snmpi.exe;1 program from definitions in 'alldefs_624981101.defs'. * Editing this file is not recommended. */ #include #include #include "chess_tbl.h" static unsigned int elems[] = { 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, /* chess */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 1, 0, /* chessProductID */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 2, 0, /* chessMaxGames */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 3, 0, /* chessNumGames */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 4, 1, 1, 0, /* gameIndex */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 4, 1, 2, 0, /* gameDescr */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 4, 1, 3, 0, /* gameNumMoves */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 4, 1, 4, 0, /* gameStatus */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 5, 1, 1, 0, /* moveIndex */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 5, 1, 2, 0, /* moveByWhite */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 5, 1, 3, 0, /* moveByBlack */ 1, 3, 6, 1, 4, 1, 36, 2, 15, 2, 99, 5, 1, 4, 0, /* moveStatus */ }; static OBJECT objects[] = { {I_chessProductID ,{12, &elems[ 11]}, ESNMP_TYPE_ObjectId ,chess_get, NULL}, {I_chessMaxGames ,{12, &elems[ 24]}, ESNMP_TYPE_Integer32 ,chess_get, NULL}, {I_chessNumGames ,{12, &elems[ 37]}, ESNMP_TYPE_Integer32 ,chess_get, NULL}, {I_gameIndex ,{14, &elems[ 50]}, ESNMP_TYPE_Integer32 ,gameEntry_get, gameEntry_set}, {I_gameDescr ,{14, &elems[ 65]}, ESNMP_TYPE_DisplayString,gameEntry_get, gameEntry_set}, {I_gameNumMoves ,{14, &elems[ 80]}, ESNMP_TYPE_Integer32 ,gameEntry_get, gameEntry_set}, {I_gameStatus ,{14, &elems[ 95]}, ESNMP_TYPE_Integer32 ,gameEntry_get, gameEntry_set}, {I_moveIndex ,{14, &elems[110]}, ESNMP_TYPE_Integer32 ,moveEntry_get, moveEntry_set}, {I_moveByWhite ,{14, &elems[125]}, ESNMP_TYPE_DisplayString,moveEntry_get, moveEntry_set}, {I_moveByBlack ,{14, &elems[140]}, ESNMP_TYPE_DisplayString,moveEntry_get, moveEntry_set}, {I_moveStatus ,{14, &elems[155]}, ESNMP_TYPE_Integer32 ,moveEntry_get, moveEntry_set}, }; SUBTREE chess_subtree = { "chess", "1.3.6.1.4.1.36.2.15.2.99", { 11, &elems[0] }, objects, I_moveStatus}; /******************************************************** * FUNCTION: gameEntry_new * * Allocate gameEntry_type data object for SET. ********************************************************/ gameEntry_type *gameEntry_new( void ) { gameEntry_type *data; data = (gameEntry_type *)calloc(1,sizeof(gameEntry_type)); return (data); } /******************************************************** * FUNCTION: gameEntry_free * * Free gameEntry_type data object for SET. ********************************************************/ void gameEntry_free( gameEntry_type *data) { if (data != NULL) { if (data->gameDescr.ptr) free(data->gameDescr.ptr); free(data); } } /******************************************************** * FUNCTION: moveEntry_new * * Allocate moveEntry_type data object for SET. ********************************************************/ moveEntry_type *moveEntry_new( void ) { moveEntry_type *data; data = (moveEntry_type *)calloc(1,sizeof(moveEntry_type)); return (data); } /******************************************************** * FUNCTION: moveEntry_free * * Free moveEntry_type data object for SET. ********************************************************/ void moveEntry_free( moveEntry_type *data) { if (data != NULL) { if (data->moveByWhite.ptr) free(data->moveByWhite.ptr); if (data->moveByBlack.ptr) free(data->moveByBlack.ptr); free(data); } }