1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 1999 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 #pragma ident "%Z%%M% %I% %E% SMI" 27 28 #include <sys/types.h> 29 30 #include "impl.h" 31 #include "asn1.h" 32 #include "node.h" 33 34 #include "snmpdx_stub.h" 35 36 37 Subid subid_table[] = { 38 /* 0 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 1, 39 /* 10 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 2, 40 /* 20 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 3, 41 /* 30 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 4, 42 /* 40 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 5, 43 /* 50 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 6, 44 /* 60 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 7, 45 /* 70 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 1, 46 /* 82 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 2, 47 /* 94 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 3, 48 /* 106 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 4, 49 /* 118 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 5, 50 /* 130 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 6, 51 /* 142 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 7, 52 /* 154 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 8, 53 /* 166 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 9, 54 /* 178 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 10, 55 /* 190 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 11, 56 /* 202 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 8, 1, 12, 57 /* 214 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 9, 58 /* 224 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 1, 59 /* 236 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 2, 60 /* 248 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 3, 61 /* 260 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 4, 62 /* 272 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 5, 63 /* 284 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 6, 64 /* 296 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 7, 65 /* 308 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 10, 1, 8, 66 /* 320 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 11, 67 /* 330 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 12, 1, 1, 68 /* 342 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 12, 1, 2, 69 /* 354 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 12, 1, 3, 70 /* 366 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 12, 1, 4, 71 /* 378 */ 1, 3, 6, 1, 4, 1, 42, 2, 15, 13, 72 0 73 }; 74 int subid_table_size = 388; 75 76 Enum enum_table[] = { 77 /* 0 */ { &enum_table[ 1], "active", 1 }, 78 /* 1 */ { &enum_table[ 2], "inactive", 2 }, 79 /* 2 */ { &enum_table[ 3], "init", 3 }, 80 /* 3 */ { &enum_table[ 4], "load", 4 }, 81 /* 4 */ { NULL, "destroy", 5 }, 82 /* 5 */ { &enum_table[ 6], "active", 1 }, 83 /* 6 */ { NULL, "inactive", 2 }, 84 /* 7 */ { &enum_table[ 8], "active", 1 }, 85 /* 8 */ { NULL, "inactive", 2 }, 86 { NULL, NULL, 0 } 87 }; 88 int enum_table_size = 9; 89 90 Object object_table[] = { 91 /* 0 */ { { &subid_table[0], 10 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 1, get_relayProcessIDFile, set_relayProcessIDFile,free_relayProcessIDFile }, 92 /* 1 */ { { &subid_table[10], 10 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 1, get_relayResourceFile, set_relayResourceFile,free_relayResourceFile }, 93 /* 2 */ { { &subid_table[20], 10 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 1, get_relayPersonalFileDir, set_relayPersonalFileDir,free_relayPersonalFileDir }, 94 /* 3 */ { { &subid_table[30], 10 }, INTEGER, NULL, READ_FLAG, 1, get_relayTrapPort, NULL,NULL }, 95 /* 4 */ { { &subid_table[40], 10 }, STRING, NULL, READ_FLAG | WRITE_FLAG,1, get_relayCheckPoint, set_relayCheckPoint,free_relayCheckPoint }, 96 /* 5 */ { { &subid_table[50], 10 }, INTEGER, NULL, READ_FLAG, 1, get_relayPollInterval, NULL,NULL }, 97 /* 6 */ { { &subid_table[60], 10 }, INTEGER, NULL, READ_FLAG, 1, get_relayMaxAgentTimeOut, NULL,NULL }, 98 /* 7 */ { { &subid_table[214], 10 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 1, get_agentTableIndex, set_agentTableIndex,NULL }, 99 /* 8 */ { { &subid_table[320], 10 }, INTEGER, NULL, READ_FLAG, 1, get_regTblTableIndex, NULL,NULL }, 100 /* 9 */ { { &subid_table[378], 10 }, INTEGER, NULL, READ_FLAG, 1, get_regTreeTableIndex, NULL,NULL }, 101 { { NULL, 0}, 0, NULL, 0, NULL, NULL } 102 }; 103 int object_table_size = 10; 104 105 Index index_table[] = { 106 /* 0 */ { NULL, "agentID",3,0, &node_table[28] }, 107 /* 1 */ { &index_table[ 2], "regTblAgentID",3,0, &node_table[44] }, 108 /* 2 */ { NULL, "regTblIndex",3,0, &node_table[43] }, 109 /* 3 */ { &index_table[ 4], "regTreeAgentID",3,0, &node_table[55] }, 110 /* 4 */ { NULL, "regTreeIndex",3,0, &node_table[54] }, 111 { NULL, NULL, NULL } 112 }; 113 int index_table_size = 5; 114 115 Entry entry_table[] = { 116 /* 0 */ { &index_table[0], 1, get_agentEntry, free_agentEntry }, 117 /* 1 */ { &index_table[1], 2, get_regTblEntry, free_regTblEntry }, 118 /* 2 */ { &index_table[3], 2, get_regTreeEntry, free_regTreeEntry }, 119 { NULL, 0, NULL } 120 }; 121 int entry_table_size = 3; 122 123 Column column_table[] = { 124 /* 0 */ { { &subid_table[70], 12 }, INTEGER, NULL, READ_FLAG, 2, NULL, NULL, &entry_table[0], 0 }, 125 /* 1 */ { { &subid_table[82], 12 }, INTEGER, &enum_table[0], READ_FLAG | WRITE_FLAG, 2, NULL, set_agentStatus, &entry_table[0], 4 }, 126 /* 2 */ { { &subid_table[94], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentTimeOut, &entry_table[0], 8 }, 127 /* 3 */ { { &subid_table[106], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentPortNumber, &entry_table[0], 12 }, 128 /* 4 */ { { &subid_table[118], 12 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentPersonalFile, &entry_table[0], 16 }, 129 /* 5 */ { { &subid_table[130], 12 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentConfigFile, &entry_table[0], 24 }, 130 /* 6 */ { { &subid_table[142], 12 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentExecutable, &entry_table[0], 32 }, 131 /* 7 */ { { &subid_table[154], 12 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentVersionNum, &entry_table[0], 40 }, 132 /* 8 */ { { &subid_table[166], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL,set_agentProcessID, &entry_table[0], 48 }, 133 /* 9 */ { { &subid_table[178], 12 }, STRING, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentName, &entry_table[0], 52 }, 134 /* 10 */ { { &subid_table[190], 12 }, TIMETICKS, NULL, READ_FLAG | WRITE_FLAG, 2, NULL,set_agentSystemUpTime, &entry_table[0], 60 }, 135 /* 11 */ { { &subid_table[202], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_agentWatchDogTime, &entry_table[0], 64 }, 136 /* 12 */ { { &subid_table[224], 12 }, INTEGER, NULL, READ_FLAG, 2, NULL, NULL, &entry_table[1], 0 }, 137 /* 13 */ { { &subid_table[236], 12 }, INTEGER, NULL, READ_FLAG, 2, NULL, NULL, &entry_table[1], 4 }, 138 /* 14 */ { { &subid_table[248], 12 }, OBJID, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblOID, &entry_table[1], 8 }, 139 /* 15 */ { { &subid_table[260], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblStartColumn, &entry_table[1], 16 }, 140 /* 16 */ { { &subid_table[272], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblEndColumn, &entry_table[1], 20 }, 141 /* 17 */ { { &subid_table[284], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblStartRow, &entry_table[1], 24 }, 142 /* 18 */ { { &subid_table[296], 12 }, INTEGER, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblEndRow, &entry_table[1], 28 }, 143 /* 19 */ { { &subid_table[308], 12 }, INTEGER, &enum_table[5], READ_FLAG | WRITE_FLAG, 2, NULL, set_regTblStatus, &entry_table[1], 32 }, 144 /* 20 */ { { &subid_table[330], 12 }, INTEGER, NULL, READ_FLAG, 2, NULL, NULL, &entry_table[2], 0 }, 145 /* 21 */ { { &subid_table[342], 12 }, INTEGER, NULL, READ_FLAG, 2, NULL, NULL, &entry_table[2], 4 }, 146 /* 22 */ { { &subid_table[354], 12 }, OBJID, NULL, READ_FLAG | WRITE_FLAG, 2, NULL, set_regTreeOID, &entry_table[2], 8 }, 147 /* 23 */ { { &subid_table[366], 12 }, INTEGER, &enum_table[7], READ_FLAG | WRITE_FLAG, 2, NULL, set_regTreeStatus, &entry_table[2], 16 }, 148 { { NULL, 0}, 0, NULL, 0, NULL, NULL, NULL , 0 } 149 }; 150 int column_table_size = 24; 151 152 Node node_table[] = { 153 /* 0 */ { NULL, &node_table[ 1], NULL, &node_table[ 19], "iso", 1, NODE, NULL }, 154 /* 1 */ { &node_table[ 0], &node_table[ 2], NULL, &node_table[ 19], "org", 3, NODE, NULL }, 155 /* 2 */ { &node_table[ 1], &node_table[ 3], NULL, &node_table[ 19], "dod", 6, NODE, NULL }, 156 /* 3 */ { &node_table[ 2], &node_table[ 4], NULL, &node_table[ 19], "internet", 1, NODE, NULL }, 157 /* 4 */ { &node_table[ 3], NULL, &node_table[ 5], &node_table[ 19], "directory", 1, NODE, NULL }, 158 /* 5 */ { &node_table[ 3], &node_table[ 6], &node_table[ 7], &node_table[ 19], "mgmt", 2, NODE, NULL }, 159 /* 6 */ { &node_table[ 5], NULL, NULL, &node_table[ 19], "mib-2", 1, NODE, NULL }, 160 /* 7 */ { &node_table[ 3], NULL, &node_table[ 8], &node_table[ 19], "experimental", 3, NODE, NULL }, 161 /* 8 */ { &node_table[ 3], &node_table[ 9], &node_table[ 61], &node_table[ 19], "private", 4, NODE, NULL }, 162 /* 9 */ { &node_table[ 8], &node_table[ 10], NULL, &node_table[ 19], "enterprises", 1, NODE, NULL }, 163 /* 10 */ { &node_table[ 9], &node_table[ 11], &node_table[ 60], &node_table[ 19], "sun", 42, NODE, NULL }, 164 /* 11 */ { &node_table[ 10], &node_table[ 12], &node_table[ 59], &node_table[ 19], "products", 2, NODE, NULL }, 165 /* 12 */ { &node_table[ 11], &node_table[ 13], &node_table[ 18], &node_table[ 19], "messaging", 8, NODE, NULL }, 166 /* 13 */ { &node_table[ 12], &node_table[ 14], &node_table[ 17], &node_table[ 19], "agents", 1, NODE, NULL }, 167 /* 14 */ { &node_table[ 13], NULL, &node_table[ 15], &node_table[ 19], "snmpx400d", 1, NODE, NULL }, 168 /* 15 */ { &node_table[ 13], NULL, &node_table[ 16], &node_table[ 19], "snmpxapiad", 2, NODE, NULL }, 169 /* 16 */ { &node_table[ 13], NULL, NULL, &node_table[ 19], "snmpx500d", 3, NODE, NULL }, 170 /* 17 */ { &node_table[ 12], NULL, NULL, &node_table[ 19], "private-mibs", 2, NODE, NULL }, 171 /* 18 */ { &node_table[ 11], &node_table[ 19], NULL, &node_table[ 19], "relay-agent", 15, NODE, NULL }, 172 /* 19 */ { &node_table[ 18], NULL, &node_table[ 20], &node_table[ 20], "relayProcessIDFile", 1, OBJECT, (void *) &object_table[0] }, 173 /* 20 */ { &node_table[ 18], NULL, &node_table[ 21], &node_table[ 21], "relayResourceFile", 2, OBJECT, (void *) &object_table[1] }, 174 /* 21 */ { &node_table[ 18], NULL, &node_table[ 22], &node_table[ 22], "relayPersonalFileDir", 3, OBJECT, (void *) &object_table[2] }, 175 /* 22 */ { &node_table[ 18], NULL, &node_table[ 23], &node_table[ 23], "relayTrapPort", 4, OBJECT, (void *) &object_table[3] }, 176 /* 23 */ { &node_table[ 18], NULL, &node_table[ 24], &node_table[ 24], "relayCheckPoint", 5, OBJECT, (void *) &object_table[4] }, 177 /* 24 */ { &node_table[ 18], NULL, &node_table[ 25], &node_table[ 25], "relayPollInterval", 6, OBJECT, (void *) &object_table[5] }, 178 /* 25 */ { &node_table[ 18], NULL, &node_table[ 26], &node_table[ 28], "relayMaxAgentTimeOut", 7, OBJECT, (void *) &object_table[6] }, 179 /* 26 */ { &node_table[ 18], &node_table[ 27], &node_table[ 40], &node_table[ 28], "agentTable", 8, NODE, NULL }, 180 /* 27 */ { &node_table[ 26], &node_table[ 28], NULL, &node_table[ 28], "agentEntry", 1, NODE, NULL }, 181 /* 28 */ { &node_table[ 27], NULL, &node_table[ 29], &node_table[ 29], "agentID", 1, COLUMN, (void *) &column_table[0] }, 182 /* 29 */ { &node_table[ 27], NULL, &node_table[ 30], &node_table[ 30], "agentStatus", 2, COLUMN, (void *) &column_table[1] }, 183 /* 30 */ { &node_table[ 27], NULL, &node_table[ 31], &node_table[ 31], "agentTimeOut", 3, COLUMN, (void *) &column_table[2] }, 184 /* 31 */ { &node_table[ 27], NULL, &node_table[ 32], &node_table[ 32], "agentPortNumber", 4, COLUMN, (void *) &column_table[3] }, 185 /* 32 */ { &node_table[ 27], NULL, &node_table[ 33], &node_table[ 33], "agentPersonalFile", 5, COLUMN, (void *) &column_table[4] }, 186 /* 33 */ { &node_table[ 27], NULL, &node_table[ 34], &node_table[ 34], "agentConfigFile", 6, COLUMN, (void *) &column_table[5] }, 187 /* 34 */ { &node_table[ 27], NULL, &node_table[ 35], &node_table[ 35], "agentExecutable", 7, COLUMN, (void *) &column_table[6] }, 188 /* 35 */ { &node_table[ 27], NULL, &node_table[ 36], &node_table[ 36], "agentVersionNum", 8, COLUMN, (void *) &column_table[7] }, 189 /* 36 */ { &node_table[ 27], NULL, &node_table[ 37], &node_table[ 37], "agentProcessID", 9, COLUMN, (void *) &column_table[8] }, 190 /* 37 */ { &node_table[ 27], NULL, &node_table[ 38], &node_table[ 38], "agentName", 10, COLUMN, (void *) &column_table[9] }, 191 /* 38 */ { &node_table[ 27], NULL, &node_table[ 39], &node_table[ 39], "agentSystemUpTime", 11, COLUMN, (void *) &column_table[10] }, 192 /* 39 */ { &node_table[ 27], NULL, NULL, &node_table[ 40], "agentWatchDogTime", 12, COLUMN, (void *) &column_table[11] }, 193 /* 40 */ { &node_table[ 18], NULL, &node_table[ 41], &node_table[ 43], "agentTableIndex", 9, OBJECT, (void *) &object_table[7] }, 194 /* 41 */ { &node_table[ 18], &node_table[ 42], &node_table[ 51], &node_table[ 43], "regTblTable", 10, NODE, NULL }, 195 /* 42 */ { &node_table[ 41], &node_table[ 43], NULL, &node_table[ 43], "regTblEntry", 1, NODE, NULL }, 196 /* 43 */ { &node_table[ 42], NULL, &node_table[ 44], &node_table[ 44], "regTblIndex", 1, COLUMN, (void *) &column_table[12] }, 197 /* 44 */ { &node_table[ 42], NULL, &node_table[ 45], &node_table[ 45], "regTblAgentID", 2, COLUMN, (void *) &column_table[13] }, 198 /* 45 */ { &node_table[ 42], NULL, &node_table[ 46], &node_table[ 46], "regTblOID", 3, COLUMN, (void *) &column_table[14] }, 199 /* 46 */ { &node_table[ 42], NULL, &node_table[ 47], &node_table[ 47], "regTblStartColumn", 4, COLUMN, (void *) &column_table[15] }, 200 /* 47 */ { &node_table[ 42], NULL, &node_table[ 48], &node_table[ 48], "regTblEndColumn", 5, COLUMN, (void *) &column_table[16] }, 201 /* 48 */ { &node_table[ 42], NULL, &node_table[ 49], &node_table[ 49], "regTblStartRow", 6, COLUMN, (void *) &column_table[17] }, 202 /* 49 */ { &node_table[ 42], NULL, &node_table[ 50], &node_table[ 50], "regTblEndRow", 7, COLUMN, (void *) &column_table[18] }, 203 /* 50 */ { &node_table[ 42], NULL, NULL, &node_table[ 51], "regTblStatus", 8, COLUMN, (void *) &column_table[19] }, 204 /* 51 */ { &node_table[ 18], NULL, &node_table[ 52], &node_table[ 54], "regTblTableIndex", 11, OBJECT, (void *) &object_table[8] }, 205 /* 52 */ { &node_table[ 18], &node_table[ 53], &node_table[ 58], &node_table[ 54], "regTreeTable", 12, NODE, NULL }, 206 /* 53 */ { &node_table[ 52], &node_table[ 54], NULL, &node_table[ 54], "regTreeEntry", 1, NODE, NULL }, 207 /* 54 */ { &node_table[ 53], NULL, &node_table[ 55], &node_table[ 55], "regTreeIndex", 1, COLUMN, (void *) &column_table[20] }, 208 /* 55 */ { &node_table[ 53], NULL, &node_table[ 56], &node_table[ 56], "regTreeAgentID", 2, COLUMN, (void *) &column_table[21] }, 209 /* 56 */ { &node_table[ 53], NULL, &node_table[ 57], &node_table[ 57], "regTreeOID", 3, COLUMN, (void *) &column_table[22] }, 210 /* 57 */ { &node_table[ 53], NULL, NULL, &node_table[ 58], "regTreeStatus", 4, COLUMN, (void *) &column_table[23] }, 211 /* 58 */ { &node_table[ 18], NULL, NULL, NULL, "regTreeTableIndex", 13, OBJECT, (void *) &object_table[9] }, 212 /* 59 */ { &node_table[ 10], NULL, NULL, NULL, "products", 2, NODE, NULL }, 213 /* 60 */ { &node_table[ 9], NULL, NULL, NULL, "sun", 42, NODE, NULL }, 214 /* 61 */ { &node_table[ 3], NULL, &node_table[ 62], NULL, "security", 5, NODE, NULL }, 215 /* 62 */ { &node_table[ 3], &node_table[ 63], NULL, NULL, "snmpV2", 6, NODE, NULL }, 216 /* 63 */ { &node_table[ 62], NULL, &node_table[ 64], NULL, "snmpDomains", 1, NODE, NULL }, 217 /* 64 */ { &node_table[ 62], NULL, &node_table[ 65], NULL, "snmpProxys", 2, NODE, NULL }, 218 /* 65 */ { &node_table[ 62], NULL, NULL, NULL, "snmpModules", 3, NODE, NULL }, 219 { NULL, NULL, NULL, NULL, NULL, 0, 0, NULL } 220 }; 221 int node_table_size = 66; 222 223