xref: /onnv-gate/usr/src/cmd/agents/snmp/snmplib/madman_api.h (revision 0:68f95e015346)
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 (c) 1998 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #ifndef _MADMAN_API_H_
30 #define _MADMAN_API_H_
31 
32 #include <sys/types.h>
33 #include "snmp_api.h"
34 
35 
36 /***** GLOBAL CONSTANTS *****/
37 
38 
39 /* predefined request values */
40 
41 #define SYSUPTIME_REQ			1
42 
43 #define APPL_ENTRY_REQ			11
44 #define ASSOC_ENTRY_REQ			12
45 
46 #define MTA_ENTRY_REQ			21
47 #define MTA_GROUP_ENTRY_REQ		22
48 #define MTA_GROUP_ASSOCIATION_ENTRY_REQ	23
49 
50 #define DSA_OPS_ENTRY_REQ		31
51 #define DSA_ENTRIES_ENTRY_REQ		32
52 #define DSA_INT_ENTRY_REQ		33
53 
54 #define X4MS_MTA_ENTRY_REQ		101
55 #define X4MS_USER_ENTRY_PART1_REQ	102
56 #define X4MS_USER_ENTRY_PART2_REQ	103
57 #define X4MS_USER_ASSOCIATION_ENTRY_REQ	104
58 
59 #define X4GRP_ENTRY_REQ			201
60 #define X4GRP_MAPPING_ENTRY_REQ		202
61 
62 #define X5DSA_REFERENCE_ENTRY_REQ	401
63 
64 
65 /* applStatus values */
66 
67 #define APPL_UP			1
68 #define APPL_DOWN		2
69 #define APPL_HALTED		3
70 #define APPL_CONGESTED		4
71 #define APPL_RESTARTING		5
72 
73 
74 /* assocApplicationType values */
75 
76 #define ASSOC_UA_INITIATOR	1
77 #define ASSOC_UA_RESPONDER	2
78 #define ASSOC_PEER_INITIATOR	3
79 #define ASSOC_PEER_RESPONDER	4
80 
81 
82 /* x5dsaReferenceType values */
83 
84 #define REFERENCE_SUPERIOR			1
85 #define REFERENCE_CROSS				2
86 #define REFERENCE_SUBORDINATE			3
87 #define REFERENCE_NON_SPECIFIC_SUBORDINATE	4
88 
89 
90 /***** GLOBAL TYPES *****/
91 
92 /**********/
93 /* MIB II */
94 /**********/
95 
96 typedef int32_t SysUpTime;
97 
98 
99 /************/
100 /* RFC 1565 */
101 /************/
102 
103 typedef struct _ApplEntry {
104 	int32_t	applIndex;
105 	char	*applName;
106 	char	*applDirectoryName;
107 	char	*applVersion;
108 	int32_t	applUptime;
109 	int32_t	applOperStatus;
110 	int32_t	applLastChange;
111 	int32_t	applInboundAssociations;
112 	int32_t	applOutboundAssociations;
113 	int32_t	applAccumulatedInboundAssociations;
114 	int32_t	applAccumulatedOutboundAssociations;
115 	int32_t	applLastInboundActivity;
116 	int32_t	applLastOutboundActivity;
117 	int32_t	applRejectedInboundAssociations;
118 	int32_t	applFailedOutboundAssociations;
119 } ApplEntry;
120 
121 typedef struct _AssocEntry {
122 	int32_t	applIndex;
123 	int32_t	assocIndex;
124 	char	*assocRemoteApplication;
125 	Oid	*assocApplicationProtocol;
126 	int32_t	assocApplicationType;
127 	int32_t	assocDuration;
128 } AssocEntry;
129 
130 
131 /************/
132 /* RFC 1566 */
133 /************/
134 
135 typedef struct _MtaEntry {
136 	int32_t	applIndex;
137 	int32_t	mtaReceivedMessages;
138 	int32_t	mtaStoredMessages;
139 	int32_t	mtaTransmittedMessages;
140 	int32_t	mtaReceivedVolume;
141 	int32_t	mtaStoredVolume;
142 	int32_t	mtaTransmittedVolume;
143 	int32_t	mtaReceivedRecipients;
144 	int32_t	mtaStoredRecipients;
145 	int32_t	mtaTransmittedRecipients;
146 } MtaEntry;
147 
148 typedef struct _MtaGroupEntry {
149 	int32_t	applIndex;
150 	int32_t	mtaGroupIndex;
151 	int32_t	mtaGroupReceivedMessages;
152 	int32_t	mtaGroupRejectedMessages;
153 	int32_t	mtaGroupStoredMessages;
154 	int32_t	mtaGroupTransmittedMessages;
155 	int32_t	mtaGroupReceivedVolume;
156 	int32_t	mtaGroupStoredVolume;
157 	int32_t	mtaGroupTransmittedVolume;
158 	int32_t	mtaGroupReceivedRecipients;
159 	int32_t	mtaGroupStoredRecipients;
160 	int32_t	mtaGroupTransmittedRecipients;
161 	int32_t	mtaGroupOldestMessageStored;
162 	int32_t	mtaGroupInboundAssociations;
163 	int32_t	mtaGroupOutboundAssociations;
164 	int32_t	mtaGroupAccumulatedInboundAssociations;
165 	int32_t	mtaGroupAccumulatedOutboundAssociations;
166 	int32_t	mtaGroupLastInboundActivity;
167 	int32_t	mtaGroupLastOutboundActivity;
168 	int32_t	mtaGroupRejectedInboundAssociations;
169 	int32_t	mtaGroupFailedOutboundAssociations;
170 	char	*mtaGroupInboundRejectionReason;
171 	char	*mtaGroupOutboundConnectFailureReason;
172 	int32_t	mtaGroupScheduledRetry;
173 	Oid	*mtaGroupMailProtocol;
174 	char	*mtaGroupName;
175 } MtaGroupEntry;
176 
177 typedef struct _MtaGroupAssociationEntry {
178 	int32_t	applIndex;
179 	int32_t	mtaGroupIndex;
180 	int32_t	mtaGroupAssociationIndex;
181 } MtaGroupAssociationEntry;
182 
183 
184 /************/
185 /* RFC 1567 */
186 /************/
187 
188 typedef struct _DsaOpsEntry {
189 	int32_t	applIndex;
190 	int32_t	dsaAnonymousBinds;
191 	int32_t	dsaUnauthBinds;
192 	int32_t	dsaSimpleAuthBinds;
193 	int32_t	dsaStrongAuthBinds;
194 	int32_t	dsaBindSecurityErrors;
195 	int32_t	dsaInOps;
196 	int32_t	dsaReadOps;
197 	int32_t	dsaCompareOps;
198 	int32_t	dsaAddEntryOps;
199 	int32_t	dsaRemoveEntryOps;
200 	int32_t	dsaModifyEntryOps;
201 	int32_t	dsaModifyRDNOps;
202 	int32_t	dsaListOps;
203 	int32_t	dsaSearchOps;
204 	int32_t	dsaOneLevelSearchOps;
205 	int32_t	dsaWholeTreeSearchOps;
206 	int32_t	dsaReferrals;
207 	int32_t	dsaChainings;
208 	int32_t	dsaSecurityErrors;
209 	int32_t	dsaErrors;
210 } DsaOpsEntry;
211 
212 typedef struct _DsaEntriesEntry {
213 	int32_t	applIndex;
214 	int32_t	dsaMasterEntries;
215 	int32_t	dsaCopyEntries;
216 	int32_t	dsaCacheEntries;
217 	int32_t	dsaCacheHits;
218 	int32_t	dsaSlaveHits;
219 } DsaEntriesEntry;
220 
221 typedef struct _DsaIntEntry {
222 	int32_t	applIndex;
223 	int32_t	dsaIntIndex;
224 	char	*dsaName;
225 	int32_t	dsaTimeOfCreation;
226 	int32_t	dsaTimeOfLastAttempt;
227 	int32_t	dsaTimeOfLastSuccess;
228 	int32_t	dsaFailuresSinceLastSuccess;
229 	int32_t	dsaFailures;
230 	int32_t	dsaSuccesses;
231 } DsaIntEntry;
232 
233 
234 /************/
235 /* X4MS MIB */
236 /************/
237 
238 typedef struct _X4msMtaEntry {
239 	int32_t	x4msMtaIndex;
240 	char	*x4msMtaName;
241 } X4msMtaEntry;
242 
243 
244 typedef struct _X4msUserTablePart1 {
245 	int32_t	x4msUserIndex;
246 	int32_t	x4msUserTotalMessages;
247 	int32_t	x4msUserTotalVolume;
248 	int32_t	x4msUserP3Associations;
249 	int32_t	x4msUserP7Associations;
250 	int32_t	x4msUserLastP7Association;
251 	int32_t	x4msUserAuthentificationFailures;
252 	char	*x4msUserAuthentificationFailureReason;
253 	char	*x4msUserName;
254 } X4msUserEntryPart1;
255 
256 typedef struct _X4msUserEntryPart2 {
257 	int32_t	x4msUserIndex;
258 	int32_t	x4msUserNewMessages;
259 	int32_t	x4msUserNewVolume;
260 	int32_t	x4msUserListedMessages;
261 	int32_t	x4msUserListedVolume;
262 	int32_t	x4msUserProcessedMessages;
263 	int32_t	x4msUserProcessedVolume;
264 	int32_t	x4msUserMessagesOlderThanWeek;
265 	int32_t	x4msUserVolumeOlderThanWeek;
266 	int32_t	x4msUserMessagesOlderThanMonth;
267 	int32_t	x4msUserVolumeOlderThanMonth;
268 	int32_t	x4msUserMessagesOlderThanYear;
269 	int32_t	x4msUserVolumeOlderThanYear;
270 	int32_t	x4msUserP3InboundAssociations;
271 	int32_t	x4msUserP7InboundAssociations;
272 	int32_t	x4msUserP3OutboundAssociations;
273 	int32_t	x4msUserAccumulatedP3InboundAssociations;
274 	int32_t	x4msUserAccumulatedP7InboundAssociations;
275 	int32_t	x4msUserAccumulatedP3OutboundAssociations;
276 	int32_t	x4msUserLastP3InboundActivity;
277 	int32_t	x4msUserLastP7InboundActivity;
278 	int32_t	x4msUserLastP3OutboundActivity;
279 	int32_t	x4msUserRejectedP3InboundAssociations;
280 	int32_t	x4msUserRejectedP7InboundAssociations;
281 	int32_t	x4msUserFailedP3OutboundAssociations;
282 	char	*x4msUserP3InboundRejectionReason;
283 	char	*x4msUserP7InboundRejectionReason;
284 	char	*x4msUserP3OutboundConnectFailureReason;
285 	int32_t	x4msUserMtaIndex;
286 	char	*x4msUserORName;
287 } X4msUserEntryPart2;
288 
289 typedef struct _X4msUserAssociationEntry {
290 	int32_t	x4msUserIndex;
291 	int32_t	x4msUserAssociationIndex;
292 } X4msUserAssociationEntry;
293 
294 
295 /*************/
296 /* X4GRP MIB */
297 /*************/
298 
299 typedef struct _X4grpEntry {
300 	int32_t	x4grpIndex;
301 	char	*x4grpName;
302 } X4grpEntry;
303 
304 
305 typedef struct _X4grpMappingEntry {
306 	int32_t	x4grpIndex;
307 	int32_t	x4grpMappingMSIndex;
308 	int32_t	x4grpMappingMTAIndex;
309 } X4grpMappingEntry;
310 
311 
312 /*************/
313 /* X5DSA MIB */
314 /*************/
315 
316 typedef struct _X5dsaReferenceEntry {
317 	int32_t	x5dsaReferenceIndex;
318 	int32_t	x5dsaReferenceType;
319 	char	*x5dsaReferenceNamingContext;
320 	char	*x5dsaReferenceSubordinate;
321 	char	*x5dsaReferenceName;
322 } X5dsaReferenceEntry;
323 
324 
325 /***** GLOBAL VARIABLES *****/
326 
327 /* SMTP */
328 extern Oid smtp_name;
329 extern char smtp_string[];
330 
331 /* P1 */
332 extern Oid id_ac_mts_transfer_name;
333 extern char id_ac_mts_transfer_string[];
334 
335 /* P3 */
336 extern Oid id_ac_mts_access_name;
337 extern Oid id_ac_mts_forced_access_name;
338 extern Oid id_ac_mts_reliable_access_name;
339 extern Oid id_ac_mts_forced_reliable_access_name;
340 
341 /* P7 */
342 extern Oid id_ac_ms_access_name;
343 extern Oid id_ac_ms_reliable_access_name;
344 
345 
346 /***** GLOBAL FUNCTIONS *****/
347 
348 /**********/
349 /* MIB II */
350 /**********/
351 
352 /* SysUpTime */
353 
354 int sysUpTime_send_request(SNMP_session *session, char *error_label);
355 SysUpTime *sysUpTime_process_response(SNMP_session *session,
356 	SNMP_pdu *response, char *error_label);
357 void sysUpTime_free(SysUpTime *sysUpTime);
358 void sysUpTime_print(SysUpTime *sysUpTime);
359 
360 
361 /************/
362 /* RFC 1565 */
363 /************/
364 
365 /* ApplEntry */
366 
367 int applEntry_send_request(SNMP_session *session,
368 	u_char request_type, int32_t applIndex, char *error_label);
369 ApplEntry *applEntry_process_response(SNMP_session *session,
370 	SNMP_pdu *response, char *error_label);
371 void applEntry_free(ApplEntry *applEntry);
372 void applEntry_print(ApplEntry *applEntry);
373 
374 /* AssocEntry */
375 
376 int assocEntry_send_request(SNMP_session *session,
377 	u_char request_type, int32_t applIndex, int32_t assocIndex, char *error_label);
378 AssocEntry *assocEntry_process_response(SNMP_session *session,
379 	SNMP_pdu *response, char *error_label);
380 void assocEntry_free(AssocEntry *assocEntry);
381 void assocEntry_print(AssocEntry *assocEntry);
382 
383 /* miscellaneous */
384 
385 char *applOperStatus_string(int32_t applStatus);
386 char *assocApplicationType_string(int32_t applStatus);
387 
388 
389 /************/
390 /* RFC 1566 */
391 /************/
392 
393 /* MtaEntry */
394 
395 int mtaEntry_send_request(SNMP_session *session,
396 	u_char request_type, int32_t applIndex, char *error_label);
397 MtaEntry *mtaEntry_process_response(SNMP_session *session,
398 	SNMP_pdu *response, char *error_label);
399 void mtaEntry_free(MtaEntry *mtaEntry);
400 void mtaEntry_print(MtaEntry *mtaEntry);
401 
402 /* MtaGroupEntry */
403 
404 int mtaGroupEntry_send_request(SNMP_session *session,
405 	u_char request_type, int32_t applIndex, int32_t mtaGroupIndex, char *error_label);
406 MtaGroupEntry *mtaGroupEntry_process_response(SNMP_session *session,
407 	SNMP_pdu *response, char *error_label);
408 void mtaGroupEntry_free(MtaGroupEntry *mtaGroupEntry);
409 void mtaGroupEntry_print(MtaGroupEntry *mtaGroupEntry);
410 
411 /* MtaGroupAssociationEntry */
412 
413 int mtaGroupAssociationEntry_send_request(SNMP_session *session,
414 	u_char request_type, int32_t applIndex, int32_t mtaGroupIndex,
415 	int32_t mtaGroupAssociationIndex, char *error_label);
416 MtaGroupAssociationEntry *mtaGroupAssociationEntry_process_response(SNMP_session *session,
417 	SNMP_pdu *response, char *error_label);
418 void mtaGroupAssociationEntry_free(MtaGroupAssociationEntry *mtaGroupAssociationEntry);
419 void mtaGroupAssociationEntry_print(MtaGroupAssociationEntry *mtaGroupAssociationEntry);
420 
421 
422 /************/
423 /* RFC 1567 */
424 /************/
425 
426 /* DsaOpsEntry */
427 
428 int dsaOpsEntry_send_request(SNMP_session *session,
429 	u_char request_type, int32_t applIndex, char *error_label);
430 DsaOpsEntry *dsaOpsEntry_process_response(SNMP_session *session,
431 	SNMP_pdu *response, char *error_label);
432 void dsaOpsEntry_free(DsaOpsEntry *dsaOpsEntry);
433 void dsaOpsEntry_print(DsaOpsEntry *dsaOpsEntry);
434 
435 /* DsaEntriesEntry */
436 
437 int dsaEntriesEntry_send_request(SNMP_session *session,
438 	u_char request_type, int32_t applIndex, char *error_label);
439 DsaEntriesEntry *dsaEntriesEntry_process_response(SNMP_session *session,
440 	SNMP_pdu *response, char *error_label);
441 void dsaEntriesEntry_free(DsaEntriesEntry *dsaEntriesEntry);
442 void dsaEntriesEntry_print(DsaEntriesEntry *dsaEntriesEntry);
443 
444 /* DsaIntEntry */
445 
446 int dsaIntEntry_send_request(SNMP_session *session,
447 	u_char request_type, int32_t applIndex, int32_t dsaIntIndex, char *error_label);
448 DsaIntEntry *dsaIntEntry_process_response(SNMP_session *session,
449 	SNMP_pdu *response, char *error_label);
450 void dsaIntEntry_free(DsaIntEntry *dsaIntEntry);
451 void dsaIntEntry_print(DsaIntEntry *dsaIntEntry);
452 
453 
454 /************/
455 /* X4MS MIB */
456 /************/
457 
458 /* X4msMtaEntry */
459 
460 int x4msMtaEntry_send_request(SNMP_session *session,
461 	u_char request_type, int32_t x4msMtaIndex, char *error_label);
462 X4msMtaEntry *x4msMtaEntry_process_response(SNMP_session *session,
463 	SNMP_pdu *response, char *error_label);
464 void x4msMtaEntry_free(X4msMtaEntry *x4msMtaEntry);
465 void x4msMtaEntry_print(X4msMtaEntry *x4msMtaEntry);
466 
467 /* X4msUserEntryPart1 */
468 
469 int x4msUserEntryPart1_send_request(SNMP_session *session,
470 	u_char request_type, int32_t x4msUserIndex, char *error_label);
471 X4msUserEntryPart1 *x4msUserEntryPart1_process_response(SNMP_session *session,
472 	SNMP_pdu *response, char *error_label);
473 void x4msUserEntryPart1_free(X4msUserEntryPart1 *x4msUserEntryPart1);
474 void x4msUserEntryPart1_print(X4msUserEntryPart1 *x4msUserEntryPart1);
475 
476 
477 /* X4msUserEntryPart2 */
478 
479 int x4msUserEntryPart2_send_request(SNMP_session *session,
480 	u_char request_type, int32_t x4msUserIndex, char *error_label);
481 X4msUserEntryPart2 *x4msUserEntryPart2_process_response(SNMP_session *session,
482 	SNMP_pdu *response, char *error_label);
483 void x4msUserEntryPart2_free(X4msUserEntryPart2 *x4msUserEntryPart2);
484 void x4msUserEntryPart2_print(X4msUserEntryPart2 *x4msUserEntryPart2);
485 
486 
487 /* X4msUserAssociationEntry */
488 
489 int x4msUserAssociationEntry_send_request(SNMP_session *session,
490 	u_char request_type, int32_t x4msUserIndex, int32_t x4msUserAssociationIndex, char *error_label);
491 X4msUserAssociationEntry *x4msUserAssociationEntry_process_response(SNMP_session *session,
492 	SNMP_pdu *response, char *error_label);
493 void x4msUserAssociationEntry_free(X4msUserAssociationEntry *x4msUserAssociationEntry);
494 void x4msUserAssociationEntry_print(X4msUserAssociationEntry *x4msUserAssociationEntry);
495 
496 
497 /*************/
498 /* X4GRP MIB */
499 /*************/
500 
501 /* X4grpEntry */
502 
503 int x4grpEntry_send_request(SNMP_session *session,
504 	u_char request_type, int32_t x4grpIndex, char *error_label);
505 X4grpEntry *x4grpEntry_process_response(SNMP_session *session,
506 	SNMP_pdu *response, char *error_label);
507 void x4grpEntry_free(X4grpEntry *x4grpEntry);
508 void x4grpEntry_print(X4grpEntry *x4grpEntry);
509 
510 /* X4grpMappingEntry */
511 
512 int x4grpMappingEntry_send_request(SNMP_session *session,
513 	u_char request_type, int32_t x4grpIndex, int32_t x4grpMappingMSIndex,
514 	int32_t x4grpMappingMTAIndex, char *error_label);
515 X4grpMappingEntry *x4grpMappingEntry_process_response(SNMP_session *session,
516 	SNMP_pdu *response, char *error_label);
517 void x4grpMappingEntry_free(X4grpMappingEntry *x4grpMappingEntry);
518 void x4grpMappingEntry_print(X4grpMappingEntry *x4grpMappingEntry);
519 
520 
521 /*************/
522 /* X5DSA MIB */
523 /*************/
524 
525 /* X5dsaReferenceEntry */
526 
527 int x5dsaReferenceEntry_send_request(SNMP_session *session,
528 	u_char request_type, int32_t x5dsaReferenceIndex, char *error_label);
529 X5dsaReferenceEntry *x5dsaReferenceEntry_process_response(SNMP_session *session,
530 	SNMP_pdu *response, char *error_label);
531 void x5dsaReferenceEntry_free(X5dsaReferenceEntry *x5dsaReferenceEntry);
532 void x5dsaReferenceEntry_print(X5dsaReferenceEntry *x5dsaReferenceEntry);
533 
534 /* miscellaneous */
535 
536 char *x5dsaReferenceType_string(int32_t x5dsaReferenceType);
537 
538 
539 /*****************/
540 /* miscellaneous */
541 /*****************/
542 
543 char *predefined_request_string(int predefined_id);
544 
545 
546 #endif
547 
548