New method "enableDiscoveryPolling" in NXSL class "Node"
[public/netxms.git] / src / server / core / nxsl_classes.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003-2016 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** File: nxsl_classes.cpp
20 **
21 **/
22
23 #include "nxcore.h"
24
25 /**
26 * clearGeoLocation()
27 */
28 NXSL_METHOD_DEFINITION(NetObj, clearGeoLocation)
29 {
30 ((NetObj *)object->getData())->setGeoLocation(GeoLocation());
31 *result = new NXSL_Value;
32 return 0;
33 }
34
35 /**
36 * setGeoLocation(loc)
37 */
38 NXSL_METHOD_DEFINITION(NetObj, setGeoLocation)
39 {
40 if (!argv[0]->isObject())
41 return NXSL_ERR_NOT_OBJECT;
42
43 NXSL_Object *o = argv[0]->getValueAsObject();
44 if (_tcscmp(o->getClass()->getName(), g_nxslGeoLocationClass.getName()))
45 return NXSL_ERR_BAD_CLASS;
46
47 GeoLocation *gl = (GeoLocation *)o->getData();
48 ((NetObj *)object->getData())->setGeoLocation(*gl);
49 *result = new NXSL_Value;
50 return 0;
51 }
52
53 /**
54 * setStatusCalculation(type, ...)
55 */
56 NXSL_METHOD_DEFINITION(NetObj, setStatusCalculation)
57 {
58 if (argc < 1)
59 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
60
61 if (!argv[0]->isInteger())
62 return NXSL_ERR_NOT_INTEGER;
63
64 INT32 success = 1;
65 int method = argv[0]->getValueAsInt32();
66 NetObj *netobj = (NetObj *)object->getData();
67 switch(method)
68 {
69 case SA_CALCULATE_DEFAULT:
70 case SA_CALCULATE_MOST_CRITICAL:
71 netobj->setStatusCalculation(method);
72 break;
73 case SA_CALCULATE_SINGLE_THRESHOLD:
74 if (argc < 2)
75 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
76 if (!argv[1]->isInteger())
77 return NXSL_ERR_NOT_INTEGER;
78 netobj->setStatusCalculation(method, argv[1]->getValueAsInt32());
79 break;
80 case SA_CALCULATE_MULTIPLE_THRESHOLDS:
81 if (argc < 5)
82 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
83 for(int i = 1; i <= 4; i++)
84 {
85 if (!argv[i]->isInteger())
86 return NXSL_ERR_NOT_INTEGER;
87 }
88 netobj->setStatusCalculation(method, argv[1]->getValueAsInt32(), argv[2]->getValueAsInt32(), argv[3]->getValueAsInt32(), argv[4]->getValueAsInt32());
89 break;
90 default:
91 success = 0; // invalid method
92 break;
93 }
94 *result = new NXSL_Value(success);
95 return 0;
96 }
97
98 /**
99 * setStatusPropagation(type, ...)
100 */
101 NXSL_METHOD_DEFINITION(NetObj, setStatusPropagation)
102 {
103 if (argc < 1)
104 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
105
106 if (!argv[0]->isInteger())
107 return NXSL_ERR_NOT_INTEGER;
108
109 INT32 success = 1;
110 int method = argv[0]->getValueAsInt32();
111 NetObj *netobj = (NetObj *)object->getData();
112 switch(method)
113 {
114 case SA_PROPAGATE_DEFAULT:
115 case SA_PROPAGATE_UNCHANGED:
116 netobj->setStatusPropagation(method);
117 break;
118 case SA_PROPAGATE_FIXED:
119 case SA_PROPAGATE_RELATIVE:
120 if (argc < 2)
121 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
122 if (!argv[1]->isInteger())
123 return NXSL_ERR_NOT_INTEGER;
124 netobj->setStatusPropagation(method, argv[1]->getValueAsInt32());
125 break;
126 case SA_PROPAGATE_TRANSLATED:
127 if (argc < 5)
128 return NXSL_ERR_INVALID_ARGUMENT_COUNT;
129 for(int i = 1; i <= 4; i++)
130 {
131 if (!argv[i]->isInteger())
132 return NXSL_ERR_NOT_INTEGER;
133 }
134 netobj->setStatusPropagation(method, argv[1]->getValueAsInt32(), argv[2]->getValueAsInt32(), argv[3]->getValueAsInt32(), argv[4]->getValueAsInt32());
135 break;
136 default:
137 success = 0; // invalid method
138 break;
139 }
140 *result = new NXSL_Value(success);
141 return 0;
142 }
143
144 /**
145 * NXSL class NetObj: constructor
146 */
147 NXSL_NetObjClass::NXSL_NetObjClass() : NXSL_Class()
148 {
149 _tcscpy(m_name, _T("NetObj"));
150
151 NXSL_REGISTER_METHOD(NetObj, clearGeoLocation, 0);
152 NXSL_REGISTER_METHOD(NetObj, setGeoLocation, 1);
153 NXSL_REGISTER_METHOD(NetObj, setStatusCalculation, -1);
154 NXSL_REGISTER_METHOD(NetObj, setStatusPropagation, -1);
155 }
156
157 /**
158 * NXSL class NetObj: get attribute
159 */
160 NXSL_Value *NXSL_NetObjClass::getAttr(NXSL_Object *_object, const TCHAR *attr)
161 {
162 NXSL_Value *value = NULL;
163 NetObj *object = (NetObj *)_object->getData();
164 if (!_tcscmp(attr, _T("name")))
165 {
166 value = new NXSL_Value(object->getName());
167 }
168 else if (!_tcscmp(attr, _T("id")))
169 {
170 value = new NXSL_Value(object->getId());
171 }
172 else if (!_tcscmp(attr, _T("guid")))
173 {
174 TCHAR buffer[64];
175 value = new NXSL_Value(object->getGuid().toString(buffer));
176 }
177 else if (!_tcscmp(attr, _T("status")))
178 {
179 value = new NXSL_Value((LONG)object->getStatus());
180 }
181 else if (!_tcscmp(attr, _T("ipAddr")))
182 {
183 TCHAR buffer[64];
184 GetObjectIpAddress(object).toString(buffer);
185 value = new NXSL_Value(buffer);
186 }
187 else if (!_tcscmp(attr, _T("type")))
188 {
189 value = new NXSL_Value((LONG)object->getObjectClass());
190 }
191 else if (!_tcscmp(attr, _T("comments")))
192 {
193 value = new NXSL_Value(object->getComments());
194 }
195 else if (!_tcscmp(attr, _T("customAttributes")))
196 {
197 value = object->getCustomAttributesForNXSL();
198 }
199 else if (!_tcscmp(attr, _T("country")))
200 {
201 value = new NXSL_Value(object->getPostalAddress()->getCountry());
202 }
203 else if (!_tcscmp(attr, _T("city")))
204 {
205 value = new NXSL_Value(object->getPostalAddress()->getCity());
206 }
207 else if (!_tcscmp(attr, _T("geolocation")))
208 {
209 value = new NXSL_Value(new NXSL_Object(&g_nxslGeoLocationClass, new GeoLocation(object->getGeoLocation())));
210 }
211 else if (!_tcscmp(attr, _T("streetAddress")))
212 {
213 value = new NXSL_Value(object->getPostalAddress()->getStreetAddress());
214 }
215 else if (!_tcscmp(attr, _T("postcode")))
216 {
217 value = new NXSL_Value(object->getPostalAddress()->getPostCode());
218 }
219 else
220 {
221 const TCHAR *attrValue = object->getCustomAttribute(attr);
222 if (attrValue != NULL)
223 {
224 value = new NXSL_Value(attrValue);
225 }
226 }
227 return value;
228 }
229
230 /**
231 * NXSL class Zone: constructor
232 */
233 NXSL_ZoneClass::NXSL_ZoneClass() : NXSL_NetObjClass()
234 {
235 _tcscpy(m_name, _T("Zone"));
236 }
237
238 /**
239 * NXSL class Zone: get attribute
240 */
241 NXSL_Value *NXSL_ZoneClass::getAttr(NXSL_Object *object, const TCHAR *attr)
242 {
243 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
244 if (value != NULL)
245 return value;
246
247 Zone *zone = (Zone *)object->getData();
248 if (!_tcscmp(attr, _T("proxyNode")))
249 {
250 Node *node = (Node *)FindObjectById(zone->getProxyNodeId(), OBJECT_NODE);
251 value = (node != NULL) ? new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, node)) : new NXSL_Value();
252 }
253 else if (!_tcscmp(attr, _T("proxyNodeId")))
254 {
255 value = new NXSL_Value(zone->getProxyNodeId());
256 }
257 else if (!_tcscmp(attr, _T("zoneId")))
258 {
259 value = new NXSL_Value(zone->getZoneId());
260 }
261 return value;
262 }
263
264 /**
265 * Generic implementation for flag changing methods
266 */
267 static int ChangeFlagMethod(NXSL_Object *object, NXSL_Value *arg, NXSL_Value **result, UINT32 flag)
268 {
269 if (!arg->isInteger())
270 return NXSL_ERR_NOT_INTEGER;
271
272 Node *node = (Node *)object->getData();
273 if (arg->getValueAsInt32())
274 node->clearFlag(flag);
275 else
276 node->setFlag(flag);
277
278 *result = new NXSL_Value;
279 return 0;
280 }
281
282 /**
283 * enableAgent(enabled) method
284 */
285 NXSL_METHOD_DEFINITION(Node, enableAgent)
286 {
287 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_NXCP);
288 }
289
290 /**
291 * enableConfigurationPolling(enabled) method
292 */
293 NXSL_METHOD_DEFINITION(Node, enableConfigurationPolling)
294 {
295 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_CONF_POLL);
296 }
297
298 /**
299 * enableDiscoveryPolling(enabled) method
300 */
301 NXSL_METHOD_DEFINITION(Node, enableDiscoveryPolling)
302 {
303 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_DISCOVERY_POLL);
304 }
305
306 /**
307 * enableIcmp(enabled) method
308 */
309 NXSL_METHOD_DEFINITION(Node, enableIcmp)
310 {
311 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_ICMP);
312 }
313
314 /**
315 * enableSnmp(enabled) method
316 */
317 NXSL_METHOD_DEFINITION(Node, enableSnmp)
318 {
319 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_SNMP);
320 }
321
322 /**
323 * enableStatusPolling(enabled) method
324 */
325 NXSL_METHOD_DEFINITION(Node, enableStatusPolling)
326 {
327 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_STATUS_POLL);
328 }
329
330 /**
331 * enableTopologyPolling(enabled) method
332 */
333 NXSL_METHOD_DEFINITION(Node, enableTopologyPolling)
334 {
335 return ChangeFlagMethod(object, argv[0], result, NF_DISABLE_TOPOLOGY_POLL);
336 }
337
338 /**
339 * NXSL class Node: constructor
340 */
341 NXSL_NodeClass::NXSL_NodeClass() : NXSL_NetObjClass()
342 {
343 _tcscpy(m_name, _T("Node"));
344
345 NXSL_REGISTER_METHOD(Node, enableAgent, 1);
346 NXSL_REGISTER_METHOD(Node, enableConfigurationPolling, 1);
347 NXSL_REGISTER_METHOD(Node, enableDiscoveryPolling, 1);
348 NXSL_REGISTER_METHOD(Node, enableIcmp, 1);
349 NXSL_REGISTER_METHOD(Node, enableSnmp, 1);
350 NXSL_REGISTER_METHOD(Node, enableStatusPolling, 1);
351 NXSL_REGISTER_METHOD(Node, enableTopologyPolling, 1);
352 }
353
354 /**
355 * NXSL class Node: get attribute
356 */
357 NXSL_Value *NXSL_NodeClass::getAttr(NXSL_Object *object, const TCHAR *attr)
358 {
359 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
360 if (value != NULL)
361 return value;
362
363 Node *node = (Node *)object->getData();
364 if (!_tcscmp(attr, _T("agentVersion")))
365 {
366 value = new NXSL_Value(node->getAgentVersion());
367 }
368 else if (!_tcscmp(attr, _T("bootTime")))
369 {
370 value = new NXSL_Value((INT64)node->getBootTime());
371 }
372 else if (!_tcscmp(attr, _T("bridgeBaseAddress")))
373 {
374 TCHAR buffer[64];
375 value = new NXSL_Value(BinToStr(node->getBridgeId(), MAC_ADDR_LENGTH, buffer));
376 }
377 else if (!_tcscmp(attr, _T("driver")))
378 {
379 value = new NXSL_Value(node->getDriverName());
380 }
381 else if (!_tcscmp(attr, _T("flags")))
382 {
383 value = new NXSL_Value(node->getFlags());
384 }
385 else if (!_tcscmp(attr, _T("isAgent")))
386 {
387 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_NATIVE_AGENT) ? 1 : 0));
388 }
389 else if (!_tcscmp(attr, _T("isBridge")))
390 {
391 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_BRIDGE) ? 1 : 0));
392 }
393 else if (!_tcscmp(attr, _T("isCDP")))
394 {
395 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_CDP) ? 1 : 0));
396 }
397 else if (!_tcscmp(attr, _T("isLLDP")))
398 {
399 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_LLDP) ? 1 : 0));
400 }
401 else if (!_tcscmp(attr, _T("isLocalMgmt")) || !_tcscmp(attr, _T("isLocalManagement")))
402 {
403 value = new NXSL_Value((LONG)((node->isLocalManagement()) ? 1 : 0));
404 }
405 else if (!_tcscmp(attr, _T("isPAE")) || !_tcscmp(attr, _T("is802_1x")))
406 {
407 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_8021X) ? 1 : 0));
408 }
409 else if (!_tcscmp(attr, _T("isPrinter")))
410 {
411 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_PRINTER) ? 1 : 0));
412 }
413 else if (!_tcscmp(attr, _T("isRouter")))
414 {
415 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_ROUTER) ? 1 : 0));
416 }
417 else if (!_tcscmp(attr, _T("isSMCLP")))
418 {
419 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_SMCLP) ? 1 : 0));
420 }
421 else if (!_tcscmp(attr, _T("isSNMP")))
422 {
423 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_SNMP) ? 1 : 0));
424 }
425 else if (!_tcscmp(attr, _T("isSONMP")))
426 {
427 value = new NXSL_Value((LONG)((node->getFlags() & NF_IS_SONMP) ? 1 : 0));
428 }
429 else if (!_tcscmp(attr, _T("platformName")))
430 {
431 value = new NXSL_Value(node->getPlatformName());
432 }
433 else if (!_tcscmp(attr, _T("rack")))
434 {
435 Rack *rack = (Rack *)FindObjectById(node->getRackId(), OBJECT_RACK);
436 if (rack != NULL)
437 {
438 value = rack->createNXSLObject();
439 }
440 else
441 {
442 value = new NXSL_Value;
443 }
444 }
445 else if (!_tcscmp(attr, _T("rackId")))
446 {
447 value = new NXSL_Value(node->getRackId());
448 }
449 else if (!_tcscmp(attr, _T("rackHeight")))
450 {
451 value = new NXSL_Value(node->getRackHeight());
452 }
453 else if (!_tcscmp(attr, _T("rackPosition")))
454 {
455 value = new NXSL_Value(node->getRackPosition());
456 }
457 else if (!_tcscmp(attr, _T("runtimeFlags")))
458 {
459 value = new NXSL_Value(node->getRuntimeFlags());
460 }
461 else if (!_tcscmp(attr, _T("snmpOID")))
462 {
463 value = new NXSL_Value(node->getSNMPObjectId());
464 }
465 else if (!_tcscmp(attr, _T("snmpSysContact")))
466 {
467 value = new NXSL_Value(node->getSysContact());
468 }
469 else if (!_tcscmp(attr, _T("snmpSysLocation")))
470 {
471 value = new NXSL_Value(node->getSysLocation());
472 }
473 else if (!_tcscmp(attr, _T("snmpSysName")))
474 {
475 value = new NXSL_Value(node->getSysName());
476 }
477 else if (!_tcscmp(attr, _T("snmpVersion")))
478 {
479 value = new NXSL_Value((LONG)node->getSNMPVersion());
480 }
481 else if (!_tcscmp(attr, _T("subType")))
482 {
483 value = new NXSL_Value(node->getSubType());
484 }
485 else if (!_tcscmp(attr, _T("sysDescription")))
486 {
487 value = new NXSL_Value(node->getSysDescription());
488 }
489 else if (!_tcscmp(attr, _T("type")))
490 {
491 value = new NXSL_Value((INT32)node->getType());
492 }
493 else if (!_tcscmp(attr, _T("zone")))
494 {
495 if (g_flags & AF_ENABLE_ZONING)
496 {
497 Zone *zone = FindZoneByGUID(node->getZoneId());
498 if (zone != NULL)
499 {
500 value = new NXSL_Value(new NXSL_Object(&g_nxslZoneClass, zone));
501 }
502 else
503 {
504 value = new NXSL_Value;
505 }
506 }
507 else
508 {
509 value = new NXSL_Value;
510 }
511 }
512 else if (!_tcscmp(attr, _T("zoneId")))
513 {
514 value = new NXSL_Value(node->getZoneId());
515 }
516 return value;
517 }
518
519 /**
520 * Interface::setExcludeFromTopology(enabled) method
521 */
522 NXSL_METHOD_DEFINITION(Interface, setExcludeFromTopology)
523 {
524 if (!argv[0]->isInteger())
525 return NXSL_ERR_NOT_INTEGER;
526
527 Interface *iface = (Interface *)object->getData();
528 iface->setExcludeFromTopology(argv[0]->getValueAsInt32() != 0);
529 *result = new NXSL_Value;
530 return 0;
531 }
532
533 /**
534 * Interface::setExpectedState(state) method
535 */
536 NXSL_METHOD_DEFINITION(Interface, setExpectedState)
537 {
538 int state;
539 if (argv[0]->isInteger())
540 {
541 state = argv[0]->getValueAsInt32();
542 }
543 else if (argv[0]->isString())
544 {
545 static const TCHAR *stateNames[] = { _T("UP"), _T("DOWN"), _T("IGNORE"), NULL };
546 const TCHAR *name = argv[0]->getValueAsCString();
547 for(state = 0; stateNames[state] != NULL; state++)
548 if (!_tcsicmp(stateNames[state], name))
549 break;
550 }
551 else
552 {
553 return NXSL_ERR_NOT_STRING;
554 }
555
556 if ((state >= 0) && (state <= 2))
557 ((Interface *)object->getData())->setExpectedState(state);
558
559 *result = new NXSL_Value;
560 return 0;
561 }
562
563 /**
564 * NXSL class Interface: constructor
565 */
566 NXSL_InterfaceClass::NXSL_InterfaceClass() : NXSL_NetObjClass()
567 {
568 _tcscpy(m_name, _T("Interface"));
569
570 NXSL_REGISTER_METHOD(Interface, setExcludeFromTopology, 1);
571 NXSL_REGISTER_METHOD(Interface, setExpectedState, 1);
572 }
573
574 /**
575 * NXSL class Interface: get attribute
576 */
577 NXSL_Value *NXSL_InterfaceClass::getAttr(NXSL_Object *object, const TCHAR *attr)
578 {
579 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
580 if (value != NULL)
581 return value;
582
583 Interface *iface = (Interface *)object->getData();
584 if (!_tcscmp(attr, _T("adminState")))
585 {
586 value = new NXSL_Value((LONG)iface->getAdminState());
587 }
588 else if (!_tcscmp(attr, _T("alias")))
589 {
590 value = new NXSL_Value(iface->getAlias());
591 }
592 else if (!_tcscmp(attr, _T("bridgePortNumber")))
593 {
594 value = new NXSL_Value(iface->getBridgePortNumber());
595 }
596 else if (!_tcscmp(attr, _T("description")))
597 {
598 value = new NXSL_Value(iface->getDescription());
599 }
600 else if (!_tcscmp(attr, _T("dot1xBackendAuthState")))
601 {
602 value = new NXSL_Value((LONG)iface->getDot1xBackendAuthState());
603 }
604 else if (!_tcscmp(attr, _T("dot1xPaeAuthState")))
605 {
606 value = new NXSL_Value((LONG)iface->getDot1xPaeAuthState());
607 }
608 else if (!_tcscmp(attr, _T("expectedState")))
609 {
610 value = new NXSL_Value((iface->getFlags() & IF_EXPECTED_STATE_MASK) >> 28);
611 }
612 else if (!_tcscmp(attr, _T("flags")))
613 {
614 value = new NXSL_Value(iface->getFlags());
615 }
616 else if (!_tcscmp(attr, _T("ifIndex")))
617 {
618 value = new NXSL_Value(iface->getIfIndex());
619 }
620 else if (!_tcscmp(attr, _T("ifType")))
621 {
622 value = new NXSL_Value(iface->getIfType());
623 }
624 else if (!_tcscmp(attr, _T("ipNetMask")))
625 {
626 value = new NXSL_Value(iface->getIpAddressList()->getFirstUnicastAddress().getMaskBits());
627 }
628 else if (!_tcscmp(attr, _T("isExcludedFromTopology")))
629 {
630 value = new NXSL_Value((LONG)(iface->isExcludedFromTopology() ? 1 : 0));
631 }
632 else if (!_tcscmp(attr, _T("isLoopback")))
633 {
634 value = new NXSL_Value((LONG)(iface->isLoopback() ? 1 : 0));
635 }
636 else if (!_tcscmp(attr, _T("isManuallyCreated")))
637 {
638 value = new NXSL_Value((LONG)(iface->isManuallyCreated() ? 1 : 0));
639 }
640 else if (!_tcscmp(attr, _T("isPhysicalPort")))
641 {
642 value = new NXSL_Value((LONG)(iface->isPhysicalPort() ? 1 : 0));
643 }
644 else if (!_tcscmp(attr, _T("macAddr")))
645 {
646 TCHAR buffer[256];
647 value = new NXSL_Value(BinToStr(iface->getMacAddr(), MAC_ADDR_LENGTH, buffer));
648 }
649 else if (!_tcscmp(attr, _T("mtu")))
650 {
651 value = new NXSL_Value(iface->getMTU());
652 }
653 else if (!_tcscmp(attr, _T("node")))
654 {
655 Node *parentNode = iface->getParentNode();
656 if (parentNode != NULL)
657 {
658 value = new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, parentNode));
659 }
660 else
661 {
662 value = new NXSL_Value;
663 }
664 }
665 else if (!_tcscmp(attr, _T("operState")))
666 {
667 value = new NXSL_Value((LONG)iface->getOperState());
668 }
669 else if (!_tcscmp(attr, _T("peerInterface")))
670 {
671 Interface *peerIface = (Interface *)FindObjectById(iface->getPeerInterfaceId(), OBJECT_INTERFACE);
672 if (peerIface != NULL)
673 {
674 if (g_flags & AF_CHECK_TRUSTED_NODES)
675 {
676 Node *parentNode = iface->getParentNode();
677 Node *peerNode = peerIface->getParentNode();
678 if ((parentNode != NULL) && (peerNode != NULL))
679 {
680 if (peerNode->isTrustedNode(parentNode->getId()))
681 {
682 value = new NXSL_Value(new NXSL_Object(&g_nxslInterfaceClass, peerIface));
683 }
684 else
685 {
686 // No access, return null
687 value = new NXSL_Value;
688 DbgPrintf(4, _T("NXSL::Interface::peerInterface(%s [%d]): access denied for node %s [%d]"),
689 iface->getName(), iface->getId(), peerNode->getName(), peerNode->getId());
690 }
691 }
692 else
693 {
694 value = new NXSL_Value;
695 DbgPrintf(4, _T("NXSL::Interface::peerInterface(%s [%d]): parentNode=%p peerNode=%p"), iface->getName(), iface->getId(), parentNode, peerNode);
696 }
697 }
698 else
699 {
700 value = new NXSL_Value(new NXSL_Object(&g_nxslInterfaceClass, peerIface));
701 }
702 }
703 else
704 {
705 value = new NXSL_Value;
706 }
707 }
708 else if (!_tcscmp(attr, _T("peerNode")))
709 {
710 Node *peerNode = (Node *)FindObjectById(iface->getPeerNodeId(), OBJECT_NODE);
711 if (peerNode != NULL)
712 {
713 if (g_flags & AF_CHECK_TRUSTED_NODES)
714 {
715 Node *parentNode = iface->getParentNode();
716 if ((parentNode != NULL) && (peerNode->isTrustedNode(parentNode->getId())))
717 {
718 value = new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, peerNode));
719 }
720 else
721 {
722 // No access, return null
723 value = new NXSL_Value;
724 DbgPrintf(4, _T("NXSL::Interface::peerNode(%s [%d]): access denied for node %s [%d]"),
725 iface->getName(), iface->getId(), peerNode->getName(), peerNode->getId());
726 }
727 }
728 else
729 {
730 value = new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, peerNode));
731 }
732 }
733 else
734 {
735 value = new NXSL_Value;
736 }
737 }
738 else if (!_tcscmp(attr, _T("port")))
739 {
740 value = new NXSL_Value(iface->getPortNumber());
741 }
742 else if (!_tcscmp(attr, _T("slot")))
743 {
744 value = new NXSL_Value(iface->getSlotNumber());
745 }
746 else if (!_tcscmp(attr, _T("speed")))
747 {
748 value = new NXSL_Value(iface->getSpeed());
749 }
750 else if (!_tcscmp(attr, _T("zone")))
751 {
752 if (g_flags & AF_ENABLE_ZONING)
753 {
754 Zone *zone = FindZoneByGUID(iface->getZoneId());
755 if (zone != NULL)
756 {
757 value = new NXSL_Value(new NXSL_Object(&g_nxslZoneClass, zone));
758 }
759 else
760 {
761 value = new NXSL_Value;
762 }
763 }
764 else
765 {
766 value = new NXSL_Value;
767 }
768 }
769 else if (!_tcscmp(attr, _T("zoneId")))
770 {
771 value = new NXSL_Value(iface->getZoneId());
772 }
773 return value;
774 }
775
776 /**
777 * NXSL class Mobile Device: constructor
778 */
779 NXSL_MobileDeviceClass::NXSL_MobileDeviceClass() : NXSL_NetObjClass()
780 {
781 _tcscpy(m_name, _T("MobileDevice"));
782 }
783
784 /**
785 * NXSL class Mobile Device: get attribute
786 */
787 NXSL_Value *NXSL_MobileDeviceClass::getAttr(NXSL_Object *object, const TCHAR *attr)
788 {
789 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
790 if (value != NULL)
791 return value;
792
793 MobileDevice *mobDevice = (MobileDevice *)object->getData();
794 if (!_tcscmp(attr, _T("deviceId")))
795 {
796 value = new NXSL_Value(mobDevice->getDeviceId());
797 }
798 else if (!_tcscmp(attr, _T("vendor")))
799 {
800 value = new NXSL_Value(mobDevice->getVendor());
801 }
802 else if (!_tcscmp(attr, _T("model")))
803 {
804 value = new NXSL_Value(mobDevice->getModel());
805 }
806 else if (!_tcscmp(attr, _T("serialNumber")))
807 {
808 value = new NXSL_Value(mobDevice->getSerialNumber());
809 }
810 else if (!_tcscmp(attr, _T("osName")))
811 {
812 value = new NXSL_Value(mobDevice->getOsName());
813 }
814 else if (!_tcscmp(attr, _T("osVersion")))
815 {
816 value = new NXSL_Value(mobDevice->getOsVersion());
817 }
818 else if (!_tcscmp(attr, _T("userId")))
819 {
820 value = new NXSL_Value(mobDevice->getUserId());
821 }
822 else if (!_tcscmp(attr, _T("batteryLevel")))
823 {
824 value = new NXSL_Value(mobDevice->getBatteryLevel());
825 }
826
827 return value;
828 }
829
830 /**
831 * NXSL class "Chassis" constructor
832 */
833 NXSL_ChassisClass::NXSL_ChassisClass() : NXSL_NetObjClass()
834 {
835 _tcscpy(m_name, _T("Chassis"));
836 }
837
838 /**
839 * NXSL class "Cluster" attributes
840 */
841 NXSL_Value *NXSL_ChassisClass::getAttr(NXSL_Object *object, const TCHAR *attr)
842 {
843 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
844 if (value != NULL)
845 return value;
846
847 Chassis *chassis = (Chassis *)object->getData();
848 if (!_tcscmp(attr, _T("controller")))
849 {
850 Node *node = (Node *)FindObjectById(chassis->getControllerId(), OBJECT_NODE);
851 if (node != NULL)
852 {
853 value = node->createNXSLObject();
854 }
855 else
856 {
857 value = new NXSL_Value;
858 }
859 }
860 else if (!_tcscmp(attr, _T("controllerId")))
861 {
862 value = new NXSL_Value(chassis->getControllerId());
863 }
864 else if (!_tcscmp(attr, _T("flags")))
865 {
866 value = new NXSL_Value(chassis->getFlags());
867 }
868 else if (!_tcscmp(attr, _T("rack")))
869 {
870 Rack *rack = (Rack *)FindObjectById(chassis->getRackId(), OBJECT_RACK);
871 if (rack != NULL)
872 {
873 value = rack->createNXSLObject();
874 }
875 else
876 {
877 value = new NXSL_Value;
878 }
879 }
880 else if (!_tcscmp(attr, _T("rackId")))
881 {
882 value = new NXSL_Value(chassis->getRackId());
883 }
884 else if (!_tcscmp(attr, _T("rackHeight")))
885 {
886 value = new NXSL_Value(chassis->getRackHeight());
887 }
888 else if (!_tcscmp(attr, _T("rackPosition")))
889 {
890 value = new NXSL_Value(chassis->getRackPosition());
891 }
892 return value;
893 }
894
895 /**
896 * NXSL class "Cluster" constructor
897 */
898 NXSL_ClusterClass::NXSL_ClusterClass() : NXSL_NetObjClass()
899 {
900 _tcscpy(m_name, _T("Cluster"));
901 }
902
903 /**
904 * NXSL class "Cluster" attributes
905 */
906 NXSL_Value *NXSL_ClusterClass::getAttr(NXSL_Object *object, const TCHAR *attr)
907 {
908 NXSL_Value *value = NXSL_NetObjClass::getAttr(object, attr);
909 if (value != NULL)
910 return value;
911
912 Cluster *cluster = (Cluster *)object->getData();
913 if (!_tcscmp(attr, _T("zone")))
914 {
915 if (g_flags & AF_ENABLE_ZONING)
916 {
917 Zone *zone = FindZoneByGUID(cluster->getZoneId());
918 if (zone != NULL)
919 {
920 value = zone->createNXSLObject();
921 }
922 else
923 {
924 value = new NXSL_Value;
925 }
926 }
927 else
928 {
929 value = new NXSL_Value;
930 }
931 }
932 else if (!_tcscmp(attr, _T("zoneId")))
933 {
934 value = new NXSL_Value(cluster->getZoneId());
935 }
936 return value;
937 }
938
939 /**
940 * Event::setMessage() method
941 */
942 NXSL_METHOD_DEFINITION(Event, setMessage)
943 {
944 if (!argv[0]->isString())
945 return NXSL_ERR_NOT_STRING;
946
947 Event *event = (Event *)object->getData();
948 event->setMessage(argv[0]->getValueAsCString());
949 *result = new NXSL_Value();
950 return 0;
951 }
952
953 /**
954 * Event::setSeverity() method
955 */
956 NXSL_METHOD_DEFINITION(Event, setSeverity)
957 {
958 if (!argv[0]->isInteger())
959 return NXSL_ERR_NOT_STRING;
960
961 int s = argv[0]->getValueAsInt32();
962 if ((s >= SEVERITY_NORMAL) && (s <= SEVERITY_CRITICAL))
963 {
964 Event *event = (Event *)object->getData();
965 event->setSeverity(s);
966 }
967 *result = new NXSL_Value();
968 return 0;
969 }
970
971 /**
972 * Event::setUserTag() method
973 */
974 NXSL_METHOD_DEFINITION(Event, setUserTag)
975 {
976 if (!argv[0]->isString())
977 return NXSL_ERR_NOT_STRING;
978
979 Event *event = (Event *)object->getData();
980 event->setUserTag(argv[0]->getValueAsCString());
981 *result = new NXSL_Value();
982 return 0;
983 }
984
985 /**
986 * Event::toJson() method
987 */
988 NXSL_METHOD_DEFINITION(Event, toJson)
989 {
990 Event *event = (Event *)object->getData();
991 *result = new NXSL_Value(event->createJson());
992 return 0;
993 }
994
995 /**
996 * NXSL class Event: constructor
997 */
998 NXSL_EventClass::NXSL_EventClass() : NXSL_Class()
999 {
1000 _tcscpy(m_name, _T("Event"));
1001
1002 NXSL_REGISTER_METHOD(Event, setMessage, 1);
1003 NXSL_REGISTER_METHOD(Event, setSeverity, 1);
1004 NXSL_REGISTER_METHOD(Event, setUserTag, 1);
1005 NXSL_REGISTER_METHOD(Event, toJson, 0);
1006 }
1007
1008 /**
1009 * NXSL class Event: get attribute
1010 */
1011 NXSL_Value *NXSL_EventClass::getAttr(NXSL_Object *pObject, const TCHAR *attr)
1012 {
1013 NXSL_Value *value = NULL;
1014
1015 Event *event = (Event *)pObject->getData();
1016 if (!_tcscmp(attr, _T("code")))
1017 {
1018 value = new NXSL_Value(event->getCode());
1019 }
1020 else if (!_tcscmp(attr, _T("customMessage")))
1021 {
1022 value = new NXSL_Value(event->getCustomMessage());
1023 }
1024 else if (!_tcscmp(attr, _T("id")))
1025 {
1026 value = new NXSL_Value(event->getId());
1027 }
1028 else if (!_tcscmp(attr, _T("message")))
1029 {
1030 value = new NXSL_Value(event->getMessage());
1031 }
1032 else if (!_tcscmp(attr, _T("name")))
1033 {
1034 value = new NXSL_Value(event->getName());
1035 }
1036 else if (!_tcscmp(attr, _T("parameters")))
1037 {
1038 NXSL_Array *array = new NXSL_Array;
1039 for(int i = 0; i < event->getParametersCount(); i++)
1040 array->set(i + 1, new NXSL_Value(event->getParameter(i)));
1041 value = new NXSL_Value(array);
1042 }
1043 else if (!_tcscmp(attr, _T("severity")))
1044 {
1045 value = new NXSL_Value(event->getSeverity());
1046 }
1047 else if (!_tcscmp(attr, _T("source")))
1048 {
1049 NetObj *object = FindObjectById(event->getSourceId());
1050 value = (object != NULL) ? object->createNXSLObject() : new NXSL_Value();
1051 }
1052 else if (!_tcscmp(attr, _T("sourceId")))
1053 {
1054 value = new NXSL_Value(event->getSourceId());
1055 }
1056 else if (!_tcscmp(attr, _T("timestamp")))
1057 {
1058 value = new NXSL_Value((INT64)event->getTimeStamp());
1059 }
1060 else if (!_tcscmp(attr, _T("userTag")))
1061 {
1062 value = new NXSL_Value(event->getUserTag());
1063 }
1064 else
1065 {
1066 if (attr[0] == _T('$'))
1067 {
1068 // Try to find parameter with given index
1069 TCHAR *eptr;
1070 int index = _tcstol(&attr[1], &eptr, 10);
1071 if ((index > 0) && (*eptr == 0))
1072 {
1073 const TCHAR *s = event->getParameter(index - 1);
1074 if (s != NULL)
1075 {
1076 value = new NXSL_Value(s);
1077 }
1078 }
1079 }
1080
1081 // Try to find named parameter with given name
1082 if (value == NULL)
1083 {
1084 const TCHAR *s = event->getNamedParameter(attr);
1085 if (s != NULL)
1086 {
1087 value = new NXSL_Value(s);
1088 }
1089 }
1090 }
1091 return value;
1092 }
1093
1094 /**
1095 * Alarm::acknowledge() method
1096 */
1097 NXSL_METHOD_DEFINITION(Alarm, acknowledge)
1098 {
1099 Alarm *alarm = (Alarm *)object->getData();
1100 *result = new NXSL_Value(AckAlarmById(alarm->getAlarmId(), NULL, false, 0));
1101 return 0;
1102 }
1103
1104 /**
1105 * Alarm::resolve() method
1106 */
1107 NXSL_METHOD_DEFINITION(Alarm, resolve)
1108 {
1109 Alarm *alarm = (Alarm *)object->getData();
1110 *result = new NXSL_Value(ResolveAlarmById(alarm->getAlarmId(), NULL, false));
1111 return 0;
1112 }
1113
1114 /**
1115 * Alarm::terminate() method
1116 */
1117 NXSL_METHOD_DEFINITION(Alarm, terminate)
1118 {
1119 Alarm *alarm = (Alarm *)object->getData();
1120 *result = new NXSL_Value(ResolveAlarmById(alarm->getAlarmId(), NULL, true));
1121 return 0;
1122 }
1123
1124 /**
1125 * NXSL class Alarm: constructor
1126 */
1127 NXSL_AlarmClass::NXSL_AlarmClass() : NXSL_Class()
1128 {
1129 _tcscpy(m_name, _T("Alarm"));
1130
1131 NXSL_REGISTER_METHOD(Alarm, acknowledge, 0);
1132 NXSL_REGISTER_METHOD(Alarm, resolve, 0);
1133 NXSL_REGISTER_METHOD(Alarm, terminate, 0);
1134 }
1135
1136 /**
1137 * NXSL object destructor
1138 */
1139 void NXSL_AlarmClass::onObjectDelete(NXSL_Object *object)
1140 {
1141 delete (Alarm *)object->getData();
1142 }
1143
1144 /**
1145 * NXSL class Alarm: get attribute
1146 */
1147 NXSL_Value *NXSL_AlarmClass::getAttr(NXSL_Object *pObject, const TCHAR *attr)
1148 {
1149 NXSL_Value *value = NULL;
1150 Alarm *alarm = (Alarm *)pObject->getData();
1151
1152 if (!_tcscmp(attr, _T("ackBy")))
1153 {
1154 value = new NXSL_Value(alarm->getAckByUser());
1155 }
1156 else if (!_tcscmp(attr, _T("creationTime")))
1157 {
1158 value = new NXSL_Value((INT64)alarm->getCreationTime());
1159 }
1160 else if (!_tcscmp(attr, _T("dciId")))
1161 {
1162 value = new NXSL_Value(alarm->getDciId());
1163 }
1164 else if (!_tcscmp(attr, _T("eventCode")))
1165 {
1166 value = new NXSL_Value(alarm->getSourceEventCode());
1167 }
1168 else if (!_tcscmp(attr, _T("eventId")))
1169 {
1170 value = new NXSL_Value(alarm->getSourceEventId());
1171 }
1172 else if (!_tcscmp(attr, _T("helpdeskReference")))
1173 {
1174 value = new NXSL_Value(alarm->getHelpDeskRef());
1175 }
1176 else if (!_tcscmp(attr, _T("helpdeskState")))
1177 {
1178 value = new NXSL_Value(alarm->getHelpDeskState());
1179 }
1180 else if (!_tcscmp(attr, _T("id")))
1181 {
1182 value = new NXSL_Value(alarm->getAlarmId());
1183 }
1184 else if (!_tcscmp(attr, _T("key")))
1185 {
1186 value = new NXSL_Value(alarm->getKey());
1187 }
1188 else if (!_tcscmp(attr, _T("lastChangeTime")))
1189 {
1190 value = new NXSL_Value((INT64)alarm->getLastChangeTime());
1191 }
1192 else if (!_tcscmp(attr, _T("message")))
1193 {
1194 value = new NXSL_Value(alarm->getMessage());
1195 }
1196 else if (!_tcscmp(attr, _T("originalSeverity")))
1197 {
1198 value = new NXSL_Value(alarm->getOriginalSeverity());
1199 }
1200 else if (!_tcscmp(attr, _T("repeatCount")))
1201 {
1202 value = new NXSL_Value(alarm->getRepeatCount());
1203 }
1204 else if (!_tcscmp(attr, _T("resolvedBy")))
1205 {
1206 value = new NXSL_Value(alarm->getResolvedByUser());
1207 }
1208 else if (!_tcscmp(attr, _T("severity")))
1209 {
1210 value = new NXSL_Value(alarm->getCurrentSeverity());
1211 }
1212 else if (!_tcscmp(attr, _T("sourceObject")))
1213 {
1214 value = new NXSL_Value(alarm->getSourceObject());
1215 }
1216 else if (!_tcscmp(attr, _T("state")))
1217 {
1218 value = new NXSL_Value(alarm->getState());
1219 }
1220 return value;
1221 }
1222
1223 /**
1224 * Implementation of "DCI" class: constructor
1225 */
1226 NXSL_DciClass::NXSL_DciClass() : NXSL_Class()
1227 {
1228 _tcscpy(m_name, _T("DCI"));
1229 }
1230
1231 /**
1232 * Object destructor
1233 */
1234 void NXSL_DciClass::onObjectDelete(NXSL_Object *object)
1235 {
1236 delete (DCObjectInfo *)object->getData();
1237 }
1238
1239 /**
1240 * Implementation of "DCI" class: get attribute
1241 */
1242 NXSL_Value *NXSL_DciClass::getAttr(NXSL_Object *object, const TCHAR *attr)
1243 {
1244 DCObjectInfo *dci;
1245 NXSL_Value *value = NULL;
1246
1247 dci = (DCObjectInfo *)object->getData();
1248 if (!_tcscmp(attr, _T("comments")))
1249 {
1250 value = new NXSL_Value(dci->getComments());
1251 }
1252 else if (!_tcscmp(attr, _T("dataType")) && (dci->getType() == DCO_TYPE_ITEM))
1253 {
1254 value = new NXSL_Value(dci->getDataType());
1255 }
1256 else if (!_tcscmp(attr, _T("description")))
1257 {
1258 value = new NXSL_Value(dci->getDescription());
1259 }
1260 else if (!_tcscmp(attr, _T("errorCount")))
1261 {
1262 value = new NXSL_Value(dci->getErrorCount());
1263 }
1264 else if (!_tcscmp(attr, _T("id")))
1265 {
1266 value = new NXSL_Value(dci->getId());
1267 }
1268 else if ((dci->getType() == DCO_TYPE_ITEM) && !_tcscmp(attr, _T("instance")))
1269 {
1270 value = new NXSL_Value(dci->getInstance());
1271 }
1272 else if (!_tcscmp(attr, _T("lastPollTime")))
1273 {
1274 value = new NXSL_Value((INT64)dci->getLastPollTime());
1275 }
1276 else if (!_tcscmp(attr, _T("name")))
1277 {
1278 value = new NXSL_Value(dci->getName());
1279 }
1280 else if (!_tcscmp(attr, _T("origin")))
1281 {
1282 value = new NXSL_Value((LONG)dci->getOrigin());
1283 }
1284 else if (!_tcscmp(attr, _T("status")))
1285 {
1286 value = new NXSL_Value((LONG)dci->getStatus());
1287 }
1288 else if (!_tcscmp(attr, _T("systemTag")))
1289 {
1290 value = new NXSL_Value(dci->getSystemTag());
1291 }
1292 else if (!_tcscmp(attr, _T("type")))
1293 {
1294 value = new NXSL_Value((LONG)dci->getType());
1295 }
1296 return value;
1297 }
1298
1299 /**
1300 * Implementation of "SNMP_Transport" class: constructor
1301 */
1302 NXSL_SNMPTransportClass::NXSL_SNMPTransportClass() : NXSL_Class()
1303 {
1304 _tcscpy(m_name, _T("SNMP_Transport"));
1305 }
1306
1307 /**
1308 * Implementation of "SNMP_Transport" class: get attribute
1309 */
1310 NXSL_Value *NXSL_SNMPTransportClass::getAttr(NXSL_Object *object, const TCHAR *attr)
1311 {
1312 NXSL_Value *value = NULL;
1313 SNMP_Transport *t;
1314
1315 t = (SNMP_Transport*)object->getData();
1316 if (!_tcscmp(attr, _T("snmpVersion")))
1317 {
1318 const TCHAR *versions[] = { _T("1"), _T("2c"), _T("3") };
1319 value = new NXSL_Value((const TCHAR*)versions[t->getSnmpVersion()]);
1320 }
1321
1322 return value;
1323 }
1324
1325 /**
1326 * Implementation of "SNMP_Transport" class: NXSL object destructor
1327 */
1328 void NXSL_SNMPTransportClass::onObjectDelete(NXSL_Object *object)
1329 {
1330 delete (SNMP_Transport *)object->getData();
1331 }
1332
1333 /**
1334 * NXSL class SNMP_VarBind: constructor
1335 */
1336 NXSL_SNMPVarBindClass::NXSL_SNMPVarBindClass() : NXSL_Class()
1337 {
1338 _tcscpy(m_name, _T("SNMP_VarBind"));
1339 }
1340
1341 /**
1342 * NXSL class SNMP_VarBind: get attribute
1343 */
1344 NXSL_Value *NXSL_SNMPVarBindClass::getAttr(NXSL_Object *object, const TCHAR *attr)
1345 {
1346 NXSL_Value *value = NULL;
1347 SNMP_Variable *t = (SNMP_Variable *)object->getData();
1348 if (!_tcscmp(attr, _T("type")))
1349 {
1350 value = new NXSL_Value((UINT32)t->getType());
1351 }
1352 else if (!_tcscmp(attr, _T("name")))
1353 {
1354 value = new NXSL_Value(t->getName().toString());
1355 }
1356 else if (!_tcscmp(attr, _T("value")))
1357 {
1358 TCHAR strValue[1024];
1359 value = new NXSL_Value(t->getValueAsString(strValue, 1024));
1360 }
1361 else if (!_tcscmp(attr, _T("printableValue")))
1362 {
1363 TCHAR strValue[1024];
1364 bool convToHex = true;
1365 t->getValueAsPrintableString(strValue, 1024, &convToHex);
1366 value = new NXSL_Value(strValue);
1367 }
1368 else if (!_tcscmp(attr, _T("valueAsIp")))
1369 {
1370 TCHAR strValue[128];
1371 t->getValueAsIPAddr(strValue);
1372 value = new NXSL_Value(strValue);
1373 }
1374 else if (!_tcscmp(attr, _T("valueAsMac")))
1375 {
1376 TCHAR strValue[128];
1377 t->getValueAsMACAddr(strValue);
1378 value = new NXSL_Value(strValue);
1379 }
1380
1381 return value;
1382 }
1383
1384 /**
1385 * NXSL class SNMP_VarBind: NXSL object desctructor
1386 */
1387 void NXSL_SNMPVarBindClass::onObjectDelete(NXSL_Object *object)
1388 {
1389 delete (SNMP_Variable *)object->getData();
1390 }
1391
1392 /**
1393 * Class objects
1394 */
1395 NXSL_AlarmClass g_nxslAlarmClass;
1396 NXSL_ChassisClass g_nxslChassisClass;
1397 NXSL_ClusterClass g_nxslClusterClass;
1398 NXSL_DciClass g_nxslDciClass;
1399 NXSL_EventClass g_nxslEventClass;
1400 NXSL_InterfaceClass g_nxslInterfaceClass;
1401 NXSL_MobileDeviceClass g_nxslMobileDeviceClass;
1402 NXSL_NetObjClass g_nxslNetObjClass;
1403 NXSL_NodeClass g_nxslNodeClass;
1404 NXSL_SNMPTransportClass g_nxslSnmpTransportClass;
1405 NXSL_SNMPVarBindClass g_nxslSnmpVarBindClass;
1406 NXSL_ZoneClass g_nxslZoneClass;