1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.waarp.gateway.ftp.snmp;
21
22 import org.snmp4j.agent.DuplicateRegistrationException;
23 import org.snmp4j.agent.MOScope;
24 import org.snmp4j.agent.MOServer;
25 import org.snmp4j.agent.mo.MOAccessImpl;
26 import org.snmp4j.agent.mo.snmp.SNMPv2MIB;
27 import org.snmp4j.agent.mo.snmp.SysUpTime;
28 import org.snmp4j.mp.SnmpConstants;
29 import org.snmp4j.smi.Integer32;
30 import org.snmp4j.smi.OID;
31 import org.snmp4j.smi.OctetString;
32 import org.snmp4j.smi.SMIConstants;
33 import org.snmp4j.smi.TimeTicks;
34 import org.snmp4j.smi.VariableBinding;
35 import org.waarp.common.command.ReplyCode;
36 import org.waarp.common.logging.WaarpLogger;
37 import org.waarp.common.logging.WaarpLoggerFactory;
38 import org.waarp.common.utility.Version;
39 import org.waarp.gateway.ftp.config.FileBasedConfiguration;
40 import org.waarp.gateway.ftp.database.data.DbTransferLog;
41 import org.waarp.snmp.WaarpSnmpAgent;
42 import org.waarp.snmp.interf.WaarpInterfaceMib;
43 import org.waarp.snmp.r66.WaarpPrivateMib;
44 import org.waarp.snmp.utils.MemoryGauge32;
45 import org.waarp.snmp.utils.MemoryGauge32.MemoryType;
46 import org.waarp.snmp.utils.WaarpEntry;
47 import org.waarp.snmp.utils.WaarpMORow;
48 import org.waarp.snmp.utils.WaarpMOScalar;
49 import org.waarp.snmp.utils.WaarpUptime;
50
51
52
53
54 public class FtpPrivateMib implements WaarpInterfaceMib {
55
56
57
58 private static final WaarpLogger logger =
59 WaarpLoggerFactory.getLogger(FtpPrivateMib.class);
60
61 public static final String SnmpName = "Waarp GW FTP SNMP";
62
63 public static final int SnmpPrivateId = 66666;
64
65 public static final int SnmpFtpId = 21;
66
67 public static final String SnmpDefaultAuthor = "Frederic Bregier";
68
69 public static final String SnmpVersion =
70 "Waarp GW FTP " + Version.fullIdentifier();
71
72 public static final String SnmpDefaultLocalization = "Paris, France";
73
74 public static final int SnmpService = 72;
75
76
77
78
79 public final OID ggObjectId;
80
81
82
83
84 public SysUpTime upTime;
85
86
87
88
89
90
91 public final String applicationProtocolBase;
92
93
94
95
96 public final OID applicationProtocol;
97
98
99
100
101 public final String srootOIDWaarp;
102
103
104
105
106 public final OID rootOIDWaarp;
107
108
109
110
111 public final OID rootOIDWaarpNotif;
112
113
114
115
116 public final OID rootOIDWaarpNotifStartOrShutdown;
117
118
119
120
121 public final OID rootOIDWaarpInfo;
122
123
124
125
126 public WaarpMORow rowInfo;
127
128
129
130
131 public final OID rootOIDWaarpGlobal;
132
133
134
135
136 public WaarpMORow rowGlobal;
137
138
139
140
141 public final OID rootOIDWaarpGlobalUptime;
142
143
144
145
146 public WaarpMOScalar scalarUptime;
147
148
149
150
151 public final OID rootOIDWaarpDetailed;
152
153
154
155
156 public WaarpMORow rowDetailed;
157
158
159
160
161 public final OID rootOIDWaarpError;
162
163
164
165
166 public WaarpMORow rowError;
167
168
169
170
171 public SNMPv2MIB snmpv2;
172
173
174
175
176 public WaarpSnmpAgent agent;
177
178
179
180
181 public FtpPrivateMib(final int port) {
182 srootOIDWaarp = rootEnterpriseMib + "." + SnmpPrivateId + '.' + SnmpFtpId;
183 applicationProtocolBase = srootOIDWaarp + ".1.1.4.";
184 ggObjectId = new OID(srootOIDWaarp);
185 applicationProtocol = new OID(applicationProtocolBase + port);
186 rootOIDWaarp = new OID(srootOIDWaarp);
187 rootOIDWaarpInfo = new OID(srootOIDWaarp + ".1");
188 rootOIDWaarpGlobal = new OID(srootOIDWaarp + ".2");
189 rootOIDWaarpGlobalUptime = new OID(
190 rootOIDWaarpGlobal + "." + WaarpGlobalValuesIndex.applUptime.getOID() +
191 ".0");
192 rootOIDWaarpDetailed = new OID(srootOIDWaarp + ".3");
193 rootOIDWaarpError = new OID(srootOIDWaarp + ".4");
194 rootOIDWaarpNotif = new OID(srootOIDWaarp + ".5.1");
195 rootOIDWaarpNotifStartOrShutdown = new OID(srootOIDWaarp + ".5.1.1.1");
196 }
197
198
199
200
201
202
203
204 protected final void agentRegisterSystem()
205 throws DuplicateRegistrationException {
206
207
208
209
210 agent.unregisterManagedObject(agent.getSnmpv2MIB());
211
212
213
214 snmpv2 = new SNMPv2MIB(new OctetString(SnmpName), ggObjectId,
215 new Integer32(SnmpService));
216 snmpv2.setContact(new OctetString(SnmpDefaultAuthor));
217 snmpv2.setLocation(new OctetString(SnmpDefaultLocalization));
218 snmpv2.setName(new OctetString(SnmpVersion));
219 snmpv2.registerMOs(agent.getServer(), null);
220 if (logger.isDebugEnabled()) {
221 logger.debug(
222 "SNMPV2: " + snmpv2.getContact() + ':' + snmpv2.getDescr() + ':' +
223 snmpv2.getLocation() + ':' + snmpv2.getName() + ':' +
224 snmpv2.getObjectID() + ':' + snmpv2.getServices() + ':' +
225 snmpv2.getUpTime());
226 }
227
228 upTime = snmpv2.getSysUpTime();
229 }
230
231
232
233
234
235
236 protected final void agentRegisterWaarpMib()
237 throws DuplicateRegistrationException {
238 logger.debug("registerGGMib");
239
240 rowInfo = new WaarpMORow(this, rootOIDWaarpInfo, WaarpDefinition,
241 MibLevel.staticInfo.ordinal());
242 rowInfo.setValue(WaarpDefinitionIndex.applName.ordinal(),
243 "Waarp " + "GatewayFtp");
244 rowInfo.setValue(WaarpDefinitionIndex.applServerName.ordinal(),
245 FileBasedConfiguration.fileBasedConfiguration.getHostId());
246 rowInfo.setValue(WaarpDefinitionIndex.applVersion.ordinal(),
247 Version.fullIdentifier());
248 rowInfo.setValue(WaarpDefinitionIndex.applDescription.ordinal(),
249 "Waarp Gateway Ftp: FTP Gateway");
250 rowInfo.setValue(WaarpDefinitionIndex.applURL.ordinal(),
251 "http://waarp.github.com/Waarp");
252 rowInfo.setValue(WaarpDefinitionIndex.applApplicationProtocol.ordinal(),
253 applicationProtocol);
254
255 rowInfo.registerMOs(agent.getServer(), null);
256
257 rowGlobal = new WaarpMORow(this, rootOIDWaarpGlobal, WaarpGlobalValues,
258 MibLevel.globalInfo.ordinal());
259 WaarpMOScalar memoryScalar =
260 rowGlobal.getRow()[WaarpGlobalValuesIndex.memoryTotal.ordinal()];
261 memoryScalar.setValue(new MemoryGauge32(MemoryType.TotalMemory));
262 memoryScalar =
263 rowGlobal.getRow()[WaarpGlobalValuesIndex.memoryFree.ordinal()];
264 memoryScalar.setValue(new MemoryGauge32(MemoryType.FreeMemory));
265 memoryScalar =
266 rowGlobal.getRow()[WaarpGlobalValuesIndex.memoryUsed.ordinal()];
267 memoryScalar.setValue(new MemoryGauge32(MemoryType.UsedMemory));
268 rowGlobal.registerMOs(agent.getServer(), null);
269
270 scalarUptime =
271 rowGlobal.getRow()[WaarpGlobalValuesIndex.applUptime.ordinal()];
272 scalarUptime.setValue(new WaarpUptime(upTime));
273 changeStatus(OperStatus.restarting);
274 changeStatus(OperStatus.up);
275
276 rowDetailed =
277 new WaarpMORow(this, rootOIDWaarpDetailed, WaarpDetailedValues,
278 MibLevel.detailedInfo.ordinal());
279 rowDetailed.registerMOs(agent.getServer(), null);
280
281 rowError = new WaarpMORow(this, rootOIDWaarpError, WaarpErrorValues,
282 MibLevel.errorInfo.ordinal());
283 rowError.registerMOs(agent.getServer(), null);
284 }
285
286
287
288
289 protected final void agentUnregisterMibs() {
290 logger.debug("UnRegisterWaarp");
291 rowInfo.unregisterMOs(agent.getServer(), agent.getDefaultContext());
292 rowGlobal.unregisterMOs(agent.getServer(), agent.getDefaultContext());
293 rowDetailed.unregisterMOs(agent.getServer(), agent.getDefaultContext());
294 rowError.unregisterMOs(agent.getServer(), agent.getDefaultContext());
295 }
296
297 @Override
298 public final void registerMOs(final MOServer moServer,
299 final OctetString octetString)
300 throws DuplicateRegistrationException {
301 agentRegisterSystem();
302 agentRegisterWaarpMib();
303 }
304
305 @Override
306 public final void unregisterMOs(final MOServer moServer,
307 final OctetString octetString) {
308 agentUnregisterMibs();
309 }
310
311 @Override
312 public final void setAgent(final WaarpSnmpAgent agent) {
313 this.agent = agent;
314 }
315
316 @Override
317 public final OID getBaseOidStartOrShutdown() {
318 return rootOIDWaarpNotifStartOrShutdown;
319 }
320
321 @Override
322 public final SNMPv2MIB getSNMPv2MIB() {
323 return snmpv2;
324 }
325
326 @Override
327 public final void updateServices(final WaarpMOScalar scalar) {
328
329 }
330
331 @Override
332 public final void updateServices(final MOScope range) {
333
334 }
335
336
337
338
339
340
341 public final void changeStatus(final OperStatus status) {
342 final WaarpMOScalar statusScalar =
343 rowGlobal.getRow()[WaarpGlobalValuesIndex.applOperStatus.ordinal()];
344 final Integer32 var = (Integer32) statusScalar.getValue();
345 if (var.getValue() != status.status) {
346 var.setValue(status.status);
347 final WaarpMOScalar lastTimeScalar =
348 rowGlobal.getRow()[WaarpGlobalValuesIndex.applLastChange.ordinal()];
349 final TimeTicks time = (TimeTicks) lastTimeScalar.getValue();
350 time.setValue(upTime.get().getValue());
351 }
352 }
353
354
355
356
357
358
359
360 public final void notifyStartStop(final String message,
361 final String message2) {
362 if (!TrapLevel.StartStop.isLevelValid(agent.getTrapLevel())) {
363 return;
364 }
365 notify(NotificationElements.TrapShutdown, message, message2);
366 }
367
368
369
370
371
372
373
374 public final void notifyError(final String message, final String message2) {
375 if (!TrapLevel.Alert.isLevelValid(agent.getTrapLevel())) {
376 return;
377 }
378 notify(NotificationElements.TrapError, message, message2);
379 }
380
381
382
383
384
385
386
387 public final void notifyOverloaded(final String message,
388 final String message2) {
389 if (!TrapLevel.Warning.isLevelValid(agent.getTrapLevel())) {
390 return;
391 }
392 notify(NotificationElements.TrapOverloaded, message, message2);
393 }
394
395
396
397
398
399
400
401 public final void notifyWarning(final String message, final String message2) {
402 if (!TrapLevel.Warning.isLevelValid(agent.getTrapLevel())) {
403 return;
404 }
405 notify(NotificationElements.TrapWarning, message, message2);
406 }
407
408
409
410
411
412
413
414
415 public final void notifyInfoTask(final String message,
416 final DbTransferLog runner) {
417 if (!TrapLevel.All.isLevelValid(agent.getTrapLevel())) {
418 return;
419 }
420 if (logger.isDebugEnabled()) {
421 logger.debug(
422 "Notify: " + NotificationElements.InfoTask + ':' + message + ':' +
423 runner);
424 }
425 long delay =
426 (runner.getStart().getTime() - agent.getUptimeSystemTime()) / 10;
427 if (delay < 0) {
428 delay = 0;
429 }
430 agent.getNotificationOriginator().notify(new OctetString("public"),
431 NotificationElements.InfoTask.getOID(
432 rootOIDWaarpNotif),
433 new VariableBinding[] {
434 new VariableBinding(
435 NotificationElements.InfoTask.getOID(
436 rootOIDWaarpNotif, 1),
437 new OctetString(
438 NotificationElements.InfoTask.name())),
439 new VariableBinding(
440 NotificationElements.InfoTask.getOID(
441 rootOIDWaarpNotif, 1),
442 new OctetString(message)),
443
444 new VariableBinding(
445 NotificationElements.InfoTask.getOID(
446 rootOIDWaarpNotif,
447 NotificationTasks.filenameInfo.getOID()),
448 new OctetString(
449 runner.getFilename())),
450 new VariableBinding(
451 NotificationElements.InfoTask.getOID(
452 rootOIDWaarpNotif,
453 NotificationTasks.modeTransInfo.getOID()),
454 new OctetString(
455 runner.getMode())),
456 new VariableBinding(
457 NotificationElements.InfoTask.getOID(
458 rootOIDWaarpNotif,
459 NotificationTasks.startTransInfo.getOID()),
460 new TimeTicks(delay)),
461 new VariableBinding(
462 NotificationElements.InfoTask.getOID(
463 rootOIDWaarpNotif,
464 NotificationTasks.infoStatusInfo.getOID()),
465 new OctetString(
466 runner.getErrorInfo()
467 .getMesg())),
468 new VariableBinding(
469 NotificationElements.InfoTask.getOID(
470 rootOIDWaarpNotif,
471 NotificationTasks.userIdInfo.getOID()),
472 new OctetString(
473 runner.getUser())),
474 new VariableBinding(
475 NotificationElements.InfoTask.getOID(
476 rootOIDWaarpNotif,
477 NotificationTasks.accountId.getOID()),
478 new OctetString(
479 runner.getAccount())),
480 new VariableBinding(
481 NotificationElements.InfoTask.getOID(
482 rootOIDWaarpNotif,
483 NotificationTasks.specialIdInfo.getOID()),
484 new OctetString(
485 String.valueOf(
486 runner.getSpecialId()))),
487
488 new VariableBinding(
489 SnmpConstants.sysDescr,
490 snmpv2.getDescr()),
491 new VariableBinding(
492 SnmpConstants.sysObjectID,
493 snmpv2.getObjectID()),
494 new VariableBinding(
495 SnmpConstants.sysContact,
496 snmpv2.getContact()),
497 new VariableBinding(
498 SnmpConstants.sysName,
499 snmpv2.getName()),
500 new VariableBinding(
501 SnmpConstants.sysLocation,
502 snmpv2.getLocation())
503 });
504 }
505
506
507
508
509
510
511
512
513 private void notify(final NotificationElements element, final String message,
514 final String message2) {
515 if (logger.isDebugEnabled()) {
516 logger.debug("Notify: " + element + ':' + message + ':' + message2);
517 }
518 agent.getNotificationOriginator()
519 .notify(new OctetString("public"), element.getOID(rootOIDWaarpNotif),
520 new VariableBinding[] {
521 new VariableBinding(element.getOID(rootOIDWaarpNotif, 1),
522 new OctetString(element.name())),
523 new VariableBinding(element.getOID(rootOIDWaarpNotif, 1),
524 new OctetString(message)),
525 new VariableBinding(element.getOID(rootOIDWaarpNotif, 1),
526 new OctetString(message2)),
527 new VariableBinding(SnmpConstants.sysDescr,
528 snmpv2.getDescr()),
529 new VariableBinding(SnmpConstants.sysObjectID,
530 snmpv2.getObjectID()),
531 new VariableBinding(SnmpConstants.sysContact,
532 snmpv2.getContact()),
533 new VariableBinding(SnmpConstants.sysName,
534 snmpv2.getName()),
535 new VariableBinding(SnmpConstants.sysLocation,
536 snmpv2.getLocation())
537 });
538 }
539
540
541
542
543 public enum MibLevel {
544 staticInfo, globalInfo, detailedInfo, errorInfo, trapInfo
545 }
546
547
548
549
550
551
552 public enum NotificationElements {
553 TrapShutdown(1), TrapError(2), TrapWarning(3), TrapOverloaded(4),
554 InfoTask(5);
555
556 public final int[] oid;
557
558 NotificationElements(final int oid) {
559 this.oid = new int[] { oid };
560 }
561
562 public final OID getOID(final OID oidBase) {
563 return new OID(oidBase.getValue(), oid);
564 }
565
566 public final OID getOID(final OID oidBase, final int rank) {
567 final int[] ids = { oid[0], rank };
568 return new OID(oidBase.getValue(), ids);
569 }
570 }
571
572
573
574
575 public enum NotificationTasks {
576 filenameInfo, modeTransInfo, startTransInfo, infoStatusInfo, userIdInfo,
577 accountId, specialIdInfo;
578
579 public final int getOID() {
580 return ordinal() + 1;
581 }
582 }
583
584
585
586
587 public enum WaarpDefinitionIndex {
588 applName, applServerName, applVersion, applDescription, applURL,
589 applApplicationProtocol;
590
591 public final int getOID() {
592 return ordinal() + 1;
593 }
594 }
595
596
597
598
599 public static final WaarpEntry[] WaarpDefinition =
600 WaarpPrivateMib.WaarpDefinition;
601
602
603
604
605 public enum WaarpGlobalValuesIndex {
606 applUptime, applOperStatus, applLastChange, applInboundAssociations,
607 applOutboundAssociations, applAccumInboundAssociations,
608 applAccumOutboundAssociations, applLastInboundActivity,
609 applLastOutboundActivity, applRejectedInboundAssociations,
610 applFailedOutboundAssociations, applInboundBandwidthKBS,
611 applOutboundBandwidthKBS, nbInfoUnknown, nbInfoNotUpdated,
612 nbInfoInterrupted, nbInfoToSubmit, nbInfoError, nbInfoRunning, nbInfoDone,
613 nbAllTransfer, memoryTotal, memoryFree, memoryUsed, nbThreads,
614 nbNetworkConnection;
615
616 public final int getOID() {
617 return ordinal() + 1;
618 }
619 }
620
621
622
623
624 public static final WaarpEntry[] WaarpGlobalValues =
625 WaarpPrivateMib.WaarpGlobalValues;
626
627
628
629
630 public enum WaarpDetailedValuesIndex {
631 reply_000(ReplyCode.REPLY_000_SPECIAL_NOSTATUS),
632 reply_110(ReplyCode.REPLY_110_RESTART_MARKER_REPLY),
633 reply_120(ReplyCode.REPLY_120_SERVICE_READY_IN_NNN_MINUTES),
634 reply_125(ReplyCode.REPLY_125_DATA_CONNECTION_ALREADY_OPEN),
635 reply_150(ReplyCode.REPLY_150_FILE_STATUS_OKAY),
636 reply_200(ReplyCode.REPLY_200_COMMAND_OKAY),
637 reply_202(ReplyCode.REPLY_202_COMMAND_NOT_IMPLEMENTED),
638 reply_211(ReplyCode.REPLY_211_SYSTEM_STATUS_REPLY),
639 reply_212(ReplyCode.REPLY_212_DIRECTORY_STATUS),
640 reply_213(ReplyCode.REPLY_213_FILE_STATUS),
641 reply_214(ReplyCode.REPLY_214_HELP_MESSAGE),
642 reply_215(ReplyCode.REPLY_215_NAME_SYSTEM_TYPE),
643 reply_220(ReplyCode.REPLY_220_SERVICE_READY),
644 reply_221(ReplyCode.REPLY_221_CLOSING_CONTROL_CONNECTION),
645 reply_225(ReplyCode.REPLY_225_DATA_CONNECTION_OPEN_NO_TRANSFER_IN_PROGRESS),
646 reply_226(ReplyCode.REPLY_226_CLOSING_DATA_CONNECTION),
647 reply_227(ReplyCode.REPLY_227_ENTERING_PASSIVE_MODE),
648 reply_229(ReplyCode.REPLY_229_ENTERING_PASSIVE_MODE),
649 reply_230(ReplyCode.REPLY_230_USER_LOGGED_IN),
650 reply_232(ReplyCode.REPLY_232_USER_LOGGED_IN),
651 reply_234(ReplyCode.REPLY_234_SECURITY_DATA_EXCHANGE_COMPLETE),
652 reply_250(ReplyCode.REPLY_250_REQUESTED_FILE_ACTION_OKAY),
653 reply_257(ReplyCode.REPLY_257_PATHNAME_CREATED),
654 reply_331(ReplyCode.REPLY_331_USER_NAME_OKAY_NEED_PASSWORD),
655 reply_332(ReplyCode.REPLY_332_NEED_ACCOUNT_FOR_LOGIN), reply_350(
656 ReplyCode.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION);
657
658 public final ReplyCode code;
659
660 WaarpDetailedValuesIndex(final ReplyCode code) {
661 this.code = code;
662 }
663
664 public final int getOID() {
665 return ordinal() + 1;
666 }
667 }
668
669
670
671
672 public static final WaarpEntry[] WaarpDetailedValues = {
673
674 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
675 MOAccessImpl.ACCESS_READ_ONLY),
676
677 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
678 MOAccessImpl.ACCESS_READ_ONLY),
679
680 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
681 MOAccessImpl.ACCESS_READ_ONLY),
682
683 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
684 MOAccessImpl.ACCESS_READ_ONLY),
685
686 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
687 MOAccessImpl.ACCESS_READ_ONLY),
688
689 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
690 MOAccessImpl.ACCESS_READ_ONLY),
691
692 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
693 MOAccessImpl.ACCESS_READ_ONLY),
694
695 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
696 MOAccessImpl.ACCESS_READ_ONLY),
697
698 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
699 MOAccessImpl.ACCESS_READ_ONLY),
700
701 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
702 MOAccessImpl.ACCESS_READ_ONLY),
703
704 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
705 MOAccessImpl.ACCESS_READ_ONLY),
706
707 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
708 MOAccessImpl.ACCESS_READ_ONLY),
709
710 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
711 MOAccessImpl.ACCESS_READ_ONLY),
712
713 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
714 MOAccessImpl.ACCESS_READ_ONLY),
715
716 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
717 MOAccessImpl.ACCESS_READ_ONLY),
718
719 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
720 MOAccessImpl.ACCESS_READ_ONLY),
721
722 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
723 MOAccessImpl.ACCESS_READ_ONLY),
724
725 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
726 MOAccessImpl.ACCESS_READ_ONLY),
727
728 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
729 MOAccessImpl.ACCESS_READ_ONLY),
730
731 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
732 MOAccessImpl.ACCESS_READ_ONLY),
733
734 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
735 MOAccessImpl.ACCESS_READ_ONLY),
736
737 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
738 MOAccessImpl.ACCESS_READ_ONLY),
739
740 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
741 MOAccessImpl.ACCESS_READ_ONLY),
742
743 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
744 MOAccessImpl.ACCESS_READ_ONLY),
745
746 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
747 MOAccessImpl.ACCESS_READ_ONLY),
748
749 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32, MOAccessImpl.ACCESS_READ_ONLY)
750 };
751
752
753
754
755 public enum WaarpErrorValuesIndex {
756 reply_421(
757 ReplyCode.REPLY_421_SERVICE_NOT_AVAILABLE_CLOSING_CONTROL_CONNECTION),
758 reply_425(ReplyCode.REPLY_425_CANT_OPEN_DATA_CONNECTION),
759 reply_426(ReplyCode.REPLY_426_CONNECTION_CLOSED_TRANSFER_ABORTED),
760 reply_431(
761 ReplyCode.REPLY_431_NEED_UNAVAILABLE_RESOURCE_TO_PROCESS_SECURITY),
762 reply_450(ReplyCode.REPLY_450_REQUESTED_FILE_ACTION_NOT_TAKEN),
763 reply_451(ReplyCode.REPLY_451_REQUESTED_ACTION_ABORTED),
764 reply_452(ReplyCode.REPLY_452_REQUESTED_ACTION_NOT_TAKEN),
765 reply_500(ReplyCode.REPLY_500_SYNTAX_ERROR_COMMAND_UNRECOGNIZED),
766 reply_501(ReplyCode.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS),
767 reply_502(ReplyCode.REPLY_502_COMMAND_NOT_IMPLEMENTED),
768 reply_503(ReplyCode.REPLY_503_BAD_SEQUENCE_OF_COMMANDS),
769 reply_504(ReplyCode.REPLY_504_COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER),
770 reply_522(
771 ReplyCode.REPLY_522_EXTENDED_PORT_FAILURE_UNKNOWN_NETWORK_PROTOCOL),
772 reply_530(ReplyCode.REPLY_530_NOT_LOGGED_IN),
773 reply_532(ReplyCode.REPLY_532_NEED_ACCOUNT_FOR_STORING_FILES), reply_533(
774 ReplyCode.REPLY_533_COMMAND_PROTECTION_LEVEL_DENIED_FOR_POLICY_REASONS),
775 reply_534(ReplyCode.REPLY_534_REQUEST_DENIED_FOR_POLICY_REASONS),
776 reply_535(ReplyCode.REPLY_535_FAILED_SECURITY_CHECK),
777 reply_536(ReplyCode.REPLY_536_REQUESTED_PROT_LEVEL_NOT_SUPPORTED),
778 reply_550(ReplyCode.REPLY_550_REQUESTED_ACTION_NOT_TAKEN),
779 reply_551(ReplyCode.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN),
780 reply_552(
781 ReplyCode.REPLY_552_REQUESTED_FILE_ACTION_ABORTED_EXCEEDED_STORAGE),
782 reply_553(
783 ReplyCode.REPLY_553_REQUESTED_ACTION_NOT_TAKEN_FILE_NAME_NOT_ALLOWED);
784
785 public final ReplyCode code;
786
787 WaarpErrorValuesIndex(final ReplyCode code) {
788 this.code = code;
789 }
790
791 public final int getOID() {
792 return ordinal() + 1;
793 }
794 }
795
796
797
798
799 public static final WaarpEntry[] WaarpErrorValues = {
800
801 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
802 MOAccessImpl.ACCESS_READ_ONLY),
803
804 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
805 MOAccessImpl.ACCESS_READ_ONLY),
806
807 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
808 MOAccessImpl.ACCESS_READ_ONLY),
809
810 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
811 MOAccessImpl.ACCESS_READ_ONLY),
812
813 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
814 MOAccessImpl.ACCESS_READ_ONLY),
815
816 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
817 MOAccessImpl.ACCESS_READ_ONLY),
818
819 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
820 MOAccessImpl.ACCESS_READ_ONLY),
821
822 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
823 MOAccessImpl.ACCESS_READ_ONLY),
824
825 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
826 MOAccessImpl.ACCESS_READ_ONLY),
827
828 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
829 MOAccessImpl.ACCESS_READ_ONLY),
830
831 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
832 MOAccessImpl.ACCESS_READ_ONLY),
833
834 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
835 MOAccessImpl.ACCESS_READ_ONLY),
836
837 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
838 MOAccessImpl.ACCESS_READ_ONLY),
839
840 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
841 MOAccessImpl.ACCESS_READ_ONLY),
842
843 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
844 MOAccessImpl.ACCESS_READ_ONLY),
845
846 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
847 MOAccessImpl.ACCESS_READ_ONLY),
848
849 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
850 MOAccessImpl.ACCESS_READ_ONLY),
851
852 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
853 MOAccessImpl.ACCESS_READ_ONLY),
854
855 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
856 MOAccessImpl.ACCESS_READ_ONLY),
857
858 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
859 MOAccessImpl.ACCESS_READ_ONLY),
860
861 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
862 MOAccessImpl.ACCESS_READ_ONLY),
863
864 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32,
865 MOAccessImpl.ACCESS_READ_ONLY),
866
867 new WaarpEntry(SMIConstants.SYNTAX_GAUGE32, MOAccessImpl.ACCESS_READ_ONLY)
868 };
869
870
871
872
873 public enum OperStatus {
874 up(1), down(2), halted(3), congested(4), restarting(5), quiescing(6);
875
876 public final int status;
877
878 OperStatus(final int status) {
879 this.status = status;
880 }
881 }
882
883 }