From 52b4afb2c72468a55fb49aeed3f7dda1277319df Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 25 Jul 2011 18:26:40 +0300 Subject: [PATCH] snma agent -> smux --- .../stargazer/plugins/other/smux/Makefile | 84 +++ .../plugins/other/{snmp => smux}/TODO | 0 .../plugins/other/{snmp => smux}/asn1/ANY.c | 0 .../plugins/other/{snmp => smux}/asn1/ANY.h | 0 .../{snmp => smux}/asn1/ApplicationSyntax.c | 0 .../{snmp => smux}/asn1/ApplicationSyntax.h | 0 .../other/{snmp => smux}/asn1/AtEntry.c | 0 .../other/{snmp => smux}/asn1/AtEntry.h | 0 .../other/{snmp => smux}/asn1/BIT_STRING.c | 0 .../other/{snmp => smux}/asn1/BIT_STRING.h | 0 .../other/{snmp => smux}/asn1/BOOLEAN.c | 0 .../other/{snmp => smux}/asn1/BOOLEAN.h | 0 .../other/{snmp => smux}/asn1/ClosePDU.c | 0 .../other/{snmp => smux}/asn1/ClosePDU.h | 0 .../other/{snmp => smux}/asn1/Counter.c | 0 .../other/{snmp => smux}/asn1/Counter.h | 0 .../other/{snmp => smux}/asn1/DisplayString.c | 0 .../other/{snmp => smux}/asn1/DisplayString.h | 0 .../other/{snmp => smux}/asn1/EgpNeighEntry.c | 0 .../other/{snmp => smux}/asn1/EgpNeighEntry.h | 0 .../plugins/other/{snmp => smux}/asn1/Gauge.c | 0 .../plugins/other/{snmp => smux}/asn1/Gauge.h | 0 .../{snmp => smux}/asn1/GetNextRequest-PDU.c | 0 .../{snmp => smux}/asn1/GetNextRequest-PDU.h | 0 .../{snmp => smux}/asn1/GetRequest-PDU.c | 0 .../{snmp => smux}/asn1/GetRequest-PDU.h | 0 .../{snmp => smux}/asn1/GetResponse-PDU.c | 0 .../{snmp => smux}/asn1/GetResponse-PDU.h | 0 .../other/{snmp => smux}/asn1/INTEGER.c | 0 .../other/{snmp => smux}/asn1/INTEGER.h | 0 .../other/{snmp => smux}/asn1/IfEntry.c | 0 .../other/{snmp => smux}/asn1/IfEntry.h | 0 .../other/{snmp => smux}/asn1/IpAddrEntry.c | 0 .../other/{snmp => smux}/asn1/IpAddrEntry.h | 0 .../other/{snmp => smux}/asn1/IpAddress.c | 0 .../other/{snmp => smux}/asn1/IpAddress.h | 0 .../{snmp => smux}/asn1/IpNetToMediaEntry.c | 0 .../{snmp => smux}/asn1/IpNetToMediaEntry.h | 0 .../other/{snmp => smux}/asn1/IpRouteEntry.c | 0 .../other/{snmp => smux}/asn1/IpRouteEntry.h | 0 .../other/{snmp => smux}/asn1/Makefile | 0 .../other/{snmp => smux}/asn1/Message.c | 0 .../other/{snmp => smux}/asn1/Message.h | 0 .../plugins/other/{snmp => smux}/asn1/NULL.c | 0 .../plugins/other/{snmp => smux}/asn1/NULL.h | 0 .../{snmp => smux}/asn1/NativeEnumerated.c | 0 .../{snmp => smux}/asn1/NativeEnumerated.h | 0 .../other/{snmp => smux}/asn1/NativeInteger.c | 0 .../other/{snmp => smux}/asn1/NativeInteger.h | 0 .../{snmp => smux}/asn1/NetworkAddress.c | 0 .../{snmp => smux}/asn1/NetworkAddress.h | 0 .../{snmp => smux}/asn1/OBJECT_IDENTIFIER.c | 0 .../{snmp => smux}/asn1/OBJECT_IDENTIFIER.h | 0 .../other/{snmp => smux}/asn1/OCTET_STRING.c | 0 .../other/{snmp => smux}/asn1/OCTET_STRING.h | 0 .../other/{snmp => smux}/asn1/ObjectName.c | 0 .../other/{snmp => smux}/asn1/ObjectName.h | 0 .../other/{snmp => smux}/asn1/ObjectSyntax.c | 0 .../other/{snmp => smux}/asn1/ObjectSyntax.h | 0 .../other/{snmp => smux}/asn1/Opaque.c | 0 .../other/{snmp => smux}/asn1/Opaque.h | 0 .../other/{snmp => smux}/asn1/OpenPDU.c | 0 .../other/{snmp => smux}/asn1/OpenPDU.h | 0 .../plugins/other/{snmp => smux}/asn1/PDU.c | 0 .../plugins/other/{snmp => smux}/asn1/PDU.h | 0 .../plugins/other/{snmp => smux}/asn1/PDUs.c | 0 .../plugins/other/{snmp => smux}/asn1/PDUs.h | 0 .../other/{snmp => smux}/asn1/PhysAddress.c | 0 .../other/{snmp => smux}/asn1/PhysAddress.h | 0 .../{snmp => smux}/asn1/RFC1155-SMI.asn1 | 0 .../{snmp => smux}/asn1/RFC1157-SNMP.asn1 | 0 .../{snmp => smux}/asn1/RFC1213-MIB.asn1 | 0 .../other/{snmp => smux}/asn1/RReqPDU.c | 0 .../other/{snmp => smux}/asn1/RReqPDU.h | 0 .../other/{snmp => smux}/asn1/RRspPDU.c | 0 .../other/{snmp => smux}/asn1/RRspPDU.h | 0 .../other/{snmp => smux}/asn1/SMUX-PDUs.c | 0 .../other/{snmp => smux}/asn1/SMUX-PDUs.h | 0 .../other/{snmp => smux}/asn1/SMUX.asn1 | 0 .../other/{snmp => smux}/asn1/SOutPDU.c | 0 .../other/{snmp => smux}/asn1/SOutPDU.h | 0 .../other/{snmp => smux}/asn1/STG-MIB.mib | 0 .../{snmp => smux}/asn1/SetRequest-PDU.c | 0 .../{snmp => smux}/asn1/SetRequest-PDU.h | 0 .../other/{snmp => smux}/asn1/SimpleOpen.c | 0 .../other/{snmp => smux}/asn1/SimpleOpen.h | 0 .../other/{snmp => smux}/asn1/SimpleSyntax.c | 0 .../other/{snmp => smux}/asn1/SimpleSyntax.h | 0 .../other/{snmp => smux}/asn1/TcpConnEntry.c | 0 .../other/{snmp => smux}/asn1/TcpConnEntry.h | 0 .../other/{snmp => smux}/asn1/TimeTicks.c | 0 .../other/{snmp => smux}/asn1/TimeTicks.h | 0 .../other/{snmp => smux}/asn1/Trap-PDU.c | 0 .../other/{snmp => smux}/asn1/Trap-PDU.h | 0 .../other/{snmp => smux}/asn1/UdpEntry.c | 0 .../other/{snmp => smux}/asn1/UdpEntry.h | 0 .../other/{snmp => smux}/asn1/VarBind.c | 0 .../other/{snmp => smux}/asn1/VarBind.h | 0 .../other/{snmp => smux}/asn1/VarBindList.c | 0 .../other/{snmp => smux}/asn1/VarBindList.h | 0 .../{snmp => smux}/asn1/asn_SEQUENCE_OF.c | 0 .../{snmp => smux}/asn1/asn_SEQUENCE_OF.h | 0 .../other/{snmp => smux}/asn1/asn_SET_OF.c | 0 .../other/{snmp => smux}/asn1/asn_SET_OF.h | 0 .../{snmp => smux}/asn1/asn_application.h | 0 .../other/{snmp => smux}/asn1/asn_codecs.h | 0 .../{snmp => smux}/asn1/asn_codecs_prim.c | 0 .../{snmp => smux}/asn1/asn_codecs_prim.h | 0 .../other/{snmp => smux}/asn1/asn_internal.h | 0 .../other/{snmp => smux}/asn1/asn_system.h | 0 .../other/{snmp => smux}/asn1/ber_decoder.c | 0 .../other/{snmp => smux}/asn1/ber_decoder.h | 0 .../{snmp => smux}/asn1/ber_tlv_length.c | 0 .../{snmp => smux}/asn1/ber_tlv_length.h | 0 .../other/{snmp => smux}/asn1/ber_tlv_tag.c | 0 .../other/{snmp => smux}/asn1/ber_tlv_tag.h | 0 .../other/{snmp => smux}/asn1/constr_CHOICE.c | 0 .../other/{snmp => smux}/asn1/constr_CHOICE.h | 0 .../{snmp => smux}/asn1/constr_SEQUENCE.c | 0 .../{snmp => smux}/asn1/constr_SEQUENCE.h | 0 .../{snmp => smux}/asn1/constr_SEQUENCE_OF.c | 0 .../{snmp => smux}/asn1/constr_SEQUENCE_OF.h | 0 .../other/{snmp => smux}/asn1/constr_SET_OF.c | 0 .../other/{snmp => smux}/asn1/constr_SET_OF.h | 0 .../other/{snmp => smux}/asn1/constr_TYPE.c | 0 .../other/{snmp => smux}/asn1/constr_TYPE.h | 0 .../other/{snmp => smux}/asn1/constraints.c | 0 .../other/{snmp => smux}/asn1/constraints.h | 0 .../{snmp => smux}/asn1/converter-sample.c | 0 .../other/{snmp => smux}/asn1/der_encoder.c | 0 .../other/{snmp => smux}/asn1/der_encoder.h | 0 .../other/{snmp => smux}/asn1/per_decoder.c | 0 .../other/{snmp => smux}/asn1/per_decoder.h | 0 .../other/{snmp => smux}/asn1/per_encoder.c | 0 .../other/{snmp => smux}/asn1/per_encoder.h | 0 .../other/{snmp => smux}/asn1/per_support.c | 0 .../other/{snmp => smux}/asn1/per_support.h | 0 .../other/{snmp => smux}/asn1/xer_decoder.c | 0 .../other/{snmp => smux}/asn1/xer_decoder.h | 0 .../other/{snmp => smux}/asn1/xer_encoder.c | 0 .../other/{snmp => smux}/asn1/xer_encoder.h | 0 .../other/{snmp => smux}/asn1/xer_support.c | 0 .../other/{snmp => smux}/asn1/xer_support.h | 0 .../stargazer/plugins/other/smux/handlers.cpp | 154 +++++ .../plugins/other/{snmp => smux}/sensors.cpp | 48 +- .../plugins/other/{snmp => smux}/sensors.h | 95 ++- .../stargazer/plugins/other/smux/smux.cpp | 564 ++++++++++++++++++ projects/stargazer/plugins/other/smux/smux.h | 113 ++++ .../plugins/other/{snmp => smux}/snmp.cpp | 0 .../plugins/other/{snmp => smux}/snmp.h | 0 .../stargazer/plugins/other/smux/value2os.h | 18 + .../stargazer/plugins/other/snmp/Makefile | 88 --- 152 files changed, 995 insertions(+), 169 deletions(-) create mode 100644 projects/stargazer/plugins/other/smux/Makefile rename projects/stargazer/plugins/other/{snmp => smux}/TODO (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ANY.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ANY.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ApplicationSyntax.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ApplicationSyntax.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/AtEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/AtEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/BIT_STRING.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/BIT_STRING.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/BOOLEAN.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/BOOLEAN.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ClosePDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ClosePDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Counter.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Counter.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/DisplayString.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/DisplayString.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/EgpNeighEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/EgpNeighEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Gauge.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Gauge.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetNextRequest-PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetNextRequest-PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetRequest-PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetRequest-PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetResponse-PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/GetResponse-PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/INTEGER.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/INTEGER.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IfEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IfEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpAddrEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpAddrEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpAddress.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpAddress.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpNetToMediaEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpNetToMediaEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpRouteEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/IpRouteEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Makefile (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Message.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Message.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NULL.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NULL.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NativeEnumerated.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NativeEnumerated.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NativeInteger.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NativeInteger.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NetworkAddress.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/NetworkAddress.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OBJECT_IDENTIFIER.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OBJECT_IDENTIFIER.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OCTET_STRING.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OCTET_STRING.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ObjectName.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ObjectName.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ObjectSyntax.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ObjectSyntax.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Opaque.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Opaque.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OpenPDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/OpenPDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PDUs.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PDUs.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PhysAddress.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/PhysAddress.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RFC1155-SMI.asn1 (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RFC1157-SNMP.asn1 (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RFC1213-MIB.asn1 (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RReqPDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RReqPDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RRspPDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/RRspPDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SMUX-PDUs.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SMUX-PDUs.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SMUX.asn1 (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SOutPDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SOutPDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/STG-MIB.mib (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SetRequest-PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SetRequest-PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SimpleOpen.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SimpleOpen.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SimpleSyntax.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/SimpleSyntax.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/TcpConnEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/TcpConnEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/TimeTicks.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/TimeTicks.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Trap-PDU.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/Trap-PDU.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/UdpEntry.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/UdpEntry.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/VarBind.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/VarBind.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/VarBindList.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/VarBindList.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_SEQUENCE_OF.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_SEQUENCE_OF.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_SET_OF.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_SET_OF.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_application.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_codecs.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_codecs_prim.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_codecs_prim.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_internal.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/asn_system.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_decoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_decoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_tlv_length.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_tlv_length.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_tlv_tag.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/ber_tlv_tag.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_CHOICE.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_CHOICE.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SEQUENCE.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SEQUENCE.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SEQUENCE_OF.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SEQUENCE_OF.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SET_OF.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_SET_OF.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_TYPE.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constr_TYPE.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constraints.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/constraints.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/converter-sample.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/der_encoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/der_encoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_decoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_decoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_encoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_encoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_support.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/per_support.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_decoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_decoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_encoder.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_encoder.h (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_support.c (100%) rename projects/stargazer/plugins/other/{snmp => smux}/asn1/xer_support.h (100%) create mode 100644 projects/stargazer/plugins/other/smux/handlers.cpp rename projects/stargazer/plugins/other/{snmp => smux}/sensors.cpp (80%) rename projects/stargazer/plugins/other/{snmp => smux}/sensors.h (52%) create mode 100644 projects/stargazer/plugins/other/smux/smux.cpp create mode 100644 projects/stargazer/plugins/other/smux/smux.h rename projects/stargazer/plugins/other/{snmp => smux}/snmp.cpp (100%) rename projects/stargazer/plugins/other/{snmp => smux}/snmp.h (100%) create mode 100644 projects/stargazer/plugins/other/smux/value2os.h delete mode 100644 projects/stargazer/plugins/other/snmp/Makefile diff --git a/projects/stargazer/plugins/other/smux/Makefile b/projects/stargazer/plugins/other/smux/Makefile new file mode 100644 index 00000000..ca358f9c --- /dev/null +++ b/projects/stargazer/plugins/other/smux/Makefile @@ -0,0 +1,84 @@ +include ../../../../../Makefile.conf + +LIBS += $(LIB_THREAD) + +PROG = mod_smux.so + +SRCS = smux.cpp \ + sensors.cpp \ + asn1/DisplayString.c \ + asn1/PhysAddress.c \ + asn1/IfEntry.c \ + asn1/AtEntry.c \ + asn1/IpAddrEntry.c \ + asn1/IpRouteEntry.c \ + asn1/IpNetToMediaEntry.c \ + asn1/TcpConnEntry.c \ + asn1/UdpEntry.c \ + asn1/EgpNeighEntry.c \ + asn1/ObjectName.c \ + asn1/ObjectSyntax.c \ + asn1/SimpleSyntax.c \ + asn1/ApplicationSyntax.c \ + asn1/NetworkAddress.c \ + asn1/IpAddress.c \ + asn1/Counter.c \ + asn1/Gauge.c \ + asn1/TimeTicks.c \ + asn1/Opaque.c \ + asn1/Message.c \ + asn1/PDUs.c \ + asn1/GetRequest-PDU.c \ + asn1/GetNextRequest-PDU.c \ + asn1/GetResponse-PDU.c \ + asn1/SetRequest-PDU.c \ + asn1/PDU.c \ + asn1/Trap-PDU.c \ + asn1/VarBind.c \ + asn1/VarBindList.c \ + asn1/SMUX-PDUs.c \ + asn1/OpenPDU.c \ + asn1/SimpleOpen.c \ + asn1/ClosePDU.c \ + asn1/RReqPDU.c \ + asn1/RRspPDU.c \ + asn1/SOutPDU.c \ + asn1/ANY.c \ + asn1/BOOLEAN.c \ + asn1/INTEGER.c \ + asn1/NULL.c \ + asn1/NativeEnumerated.c \ + asn1/NativeInteger.c \ + asn1/OBJECT_IDENTIFIER.c \ + asn1/asn_SEQUENCE_OF.c \ + asn1/asn_SET_OF.c \ + asn1/constr_CHOICE.c \ + asn1/constr_SEQUENCE.c \ + asn1/constr_SEQUENCE_OF.c \ + asn1/constr_SET_OF.c \ + asn1/OCTET_STRING.c \ + asn1/BIT_STRING.c \ + asn1/asn_codecs_prim.c \ + asn1/ber_tlv_length.c \ + asn1/ber_tlv_tag.c \ + asn1/ber_decoder.c \ + asn1/der_encoder.c \ + asn1/constr_TYPE.c \ + asn1/constraints.c \ + asn1/xer_support.c \ + asn1/xer_decoder.c \ + asn1/xer_encoder.c \ + asn1/per_support.c \ + asn1/per_decoder.c \ + asn1/per_encoder.c + +STGLIBS = -lstgcommon + +CXXFLAGS += -Iasn1 + +include ../../Makefile.in + +.PHONY: asn1 + +asn1: + $(MAKE) -C asn1 asn1 diff --git a/projects/stargazer/plugins/other/snmp/TODO b/projects/stargazer/plugins/other/smux/TODO similarity index 100% rename from projects/stargazer/plugins/other/snmp/TODO rename to projects/stargazer/plugins/other/smux/TODO diff --git a/projects/stargazer/plugins/other/snmp/asn1/ANY.c b/projects/stargazer/plugins/other/smux/asn1/ANY.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ANY.c rename to projects/stargazer/plugins/other/smux/asn1/ANY.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ANY.h b/projects/stargazer/plugins/other/smux/asn1/ANY.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ANY.h rename to projects/stargazer/plugins/other/smux/asn1/ANY.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ApplicationSyntax.c b/projects/stargazer/plugins/other/smux/asn1/ApplicationSyntax.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ApplicationSyntax.c rename to projects/stargazer/plugins/other/smux/asn1/ApplicationSyntax.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ApplicationSyntax.h b/projects/stargazer/plugins/other/smux/asn1/ApplicationSyntax.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ApplicationSyntax.h rename to projects/stargazer/plugins/other/smux/asn1/ApplicationSyntax.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/AtEntry.c b/projects/stargazer/plugins/other/smux/asn1/AtEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/AtEntry.c rename to projects/stargazer/plugins/other/smux/asn1/AtEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/AtEntry.h b/projects/stargazer/plugins/other/smux/asn1/AtEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/AtEntry.h rename to projects/stargazer/plugins/other/smux/asn1/AtEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/BIT_STRING.c b/projects/stargazer/plugins/other/smux/asn1/BIT_STRING.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/BIT_STRING.c rename to projects/stargazer/plugins/other/smux/asn1/BIT_STRING.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/BIT_STRING.h b/projects/stargazer/plugins/other/smux/asn1/BIT_STRING.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/BIT_STRING.h rename to projects/stargazer/plugins/other/smux/asn1/BIT_STRING.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/BOOLEAN.c b/projects/stargazer/plugins/other/smux/asn1/BOOLEAN.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/BOOLEAN.c rename to projects/stargazer/plugins/other/smux/asn1/BOOLEAN.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/BOOLEAN.h b/projects/stargazer/plugins/other/smux/asn1/BOOLEAN.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/BOOLEAN.h rename to projects/stargazer/plugins/other/smux/asn1/BOOLEAN.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ClosePDU.c b/projects/stargazer/plugins/other/smux/asn1/ClosePDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ClosePDU.c rename to projects/stargazer/plugins/other/smux/asn1/ClosePDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ClosePDU.h b/projects/stargazer/plugins/other/smux/asn1/ClosePDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ClosePDU.h rename to projects/stargazer/plugins/other/smux/asn1/ClosePDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/Counter.c b/projects/stargazer/plugins/other/smux/asn1/Counter.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Counter.c rename to projects/stargazer/plugins/other/smux/asn1/Counter.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/Counter.h b/projects/stargazer/plugins/other/smux/asn1/Counter.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Counter.h rename to projects/stargazer/plugins/other/smux/asn1/Counter.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/DisplayString.c b/projects/stargazer/plugins/other/smux/asn1/DisplayString.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/DisplayString.c rename to projects/stargazer/plugins/other/smux/asn1/DisplayString.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/DisplayString.h b/projects/stargazer/plugins/other/smux/asn1/DisplayString.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/DisplayString.h rename to projects/stargazer/plugins/other/smux/asn1/DisplayString.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/EgpNeighEntry.c b/projects/stargazer/plugins/other/smux/asn1/EgpNeighEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/EgpNeighEntry.c rename to projects/stargazer/plugins/other/smux/asn1/EgpNeighEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/EgpNeighEntry.h b/projects/stargazer/plugins/other/smux/asn1/EgpNeighEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/EgpNeighEntry.h rename to projects/stargazer/plugins/other/smux/asn1/EgpNeighEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/Gauge.c b/projects/stargazer/plugins/other/smux/asn1/Gauge.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Gauge.c rename to projects/stargazer/plugins/other/smux/asn1/Gauge.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/Gauge.h b/projects/stargazer/plugins/other/smux/asn1/Gauge.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Gauge.h rename to projects/stargazer/plugins/other/smux/asn1/Gauge.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetNextRequest-PDU.c b/projects/stargazer/plugins/other/smux/asn1/GetNextRequest-PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetNextRequest-PDU.c rename to projects/stargazer/plugins/other/smux/asn1/GetNextRequest-PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetNextRequest-PDU.h b/projects/stargazer/plugins/other/smux/asn1/GetNextRequest-PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetNextRequest-PDU.h rename to projects/stargazer/plugins/other/smux/asn1/GetNextRequest-PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetRequest-PDU.c b/projects/stargazer/plugins/other/smux/asn1/GetRequest-PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetRequest-PDU.c rename to projects/stargazer/plugins/other/smux/asn1/GetRequest-PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetRequest-PDU.h b/projects/stargazer/plugins/other/smux/asn1/GetRequest-PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetRequest-PDU.h rename to projects/stargazer/plugins/other/smux/asn1/GetRequest-PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetResponse-PDU.c b/projects/stargazer/plugins/other/smux/asn1/GetResponse-PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetResponse-PDU.c rename to projects/stargazer/plugins/other/smux/asn1/GetResponse-PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/GetResponse-PDU.h b/projects/stargazer/plugins/other/smux/asn1/GetResponse-PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/GetResponse-PDU.h rename to projects/stargazer/plugins/other/smux/asn1/GetResponse-PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/INTEGER.c b/projects/stargazer/plugins/other/smux/asn1/INTEGER.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/INTEGER.c rename to projects/stargazer/plugins/other/smux/asn1/INTEGER.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/INTEGER.h b/projects/stargazer/plugins/other/smux/asn1/INTEGER.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/INTEGER.h rename to projects/stargazer/plugins/other/smux/asn1/INTEGER.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/IfEntry.c b/projects/stargazer/plugins/other/smux/asn1/IfEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IfEntry.c rename to projects/stargazer/plugins/other/smux/asn1/IfEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/IfEntry.h b/projects/stargazer/plugins/other/smux/asn1/IfEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IfEntry.h rename to projects/stargazer/plugins/other/smux/asn1/IfEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpAddrEntry.c b/projects/stargazer/plugins/other/smux/asn1/IpAddrEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpAddrEntry.c rename to projects/stargazer/plugins/other/smux/asn1/IpAddrEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpAddrEntry.h b/projects/stargazer/plugins/other/smux/asn1/IpAddrEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpAddrEntry.h rename to projects/stargazer/plugins/other/smux/asn1/IpAddrEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpAddress.c b/projects/stargazer/plugins/other/smux/asn1/IpAddress.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpAddress.c rename to projects/stargazer/plugins/other/smux/asn1/IpAddress.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpAddress.h b/projects/stargazer/plugins/other/smux/asn1/IpAddress.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpAddress.h rename to projects/stargazer/plugins/other/smux/asn1/IpAddress.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpNetToMediaEntry.c b/projects/stargazer/plugins/other/smux/asn1/IpNetToMediaEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpNetToMediaEntry.c rename to projects/stargazer/plugins/other/smux/asn1/IpNetToMediaEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpNetToMediaEntry.h b/projects/stargazer/plugins/other/smux/asn1/IpNetToMediaEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpNetToMediaEntry.h rename to projects/stargazer/plugins/other/smux/asn1/IpNetToMediaEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpRouteEntry.c b/projects/stargazer/plugins/other/smux/asn1/IpRouteEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpRouteEntry.c rename to projects/stargazer/plugins/other/smux/asn1/IpRouteEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/IpRouteEntry.h b/projects/stargazer/plugins/other/smux/asn1/IpRouteEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/IpRouteEntry.h rename to projects/stargazer/plugins/other/smux/asn1/IpRouteEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/Makefile b/projects/stargazer/plugins/other/smux/asn1/Makefile similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Makefile rename to projects/stargazer/plugins/other/smux/asn1/Makefile diff --git a/projects/stargazer/plugins/other/snmp/asn1/Message.c b/projects/stargazer/plugins/other/smux/asn1/Message.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Message.c rename to projects/stargazer/plugins/other/smux/asn1/Message.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/Message.h b/projects/stargazer/plugins/other/smux/asn1/Message.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Message.h rename to projects/stargazer/plugins/other/smux/asn1/Message.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/NULL.c b/projects/stargazer/plugins/other/smux/asn1/NULL.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NULL.c rename to projects/stargazer/plugins/other/smux/asn1/NULL.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/NULL.h b/projects/stargazer/plugins/other/smux/asn1/NULL.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NULL.h rename to projects/stargazer/plugins/other/smux/asn1/NULL.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/NativeEnumerated.c b/projects/stargazer/plugins/other/smux/asn1/NativeEnumerated.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NativeEnumerated.c rename to projects/stargazer/plugins/other/smux/asn1/NativeEnumerated.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/NativeEnumerated.h b/projects/stargazer/plugins/other/smux/asn1/NativeEnumerated.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NativeEnumerated.h rename to projects/stargazer/plugins/other/smux/asn1/NativeEnumerated.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/NativeInteger.c b/projects/stargazer/plugins/other/smux/asn1/NativeInteger.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NativeInteger.c rename to projects/stargazer/plugins/other/smux/asn1/NativeInteger.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/NativeInteger.h b/projects/stargazer/plugins/other/smux/asn1/NativeInteger.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NativeInteger.h rename to projects/stargazer/plugins/other/smux/asn1/NativeInteger.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/NetworkAddress.c b/projects/stargazer/plugins/other/smux/asn1/NetworkAddress.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NetworkAddress.c rename to projects/stargazer/plugins/other/smux/asn1/NetworkAddress.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/NetworkAddress.h b/projects/stargazer/plugins/other/smux/asn1/NetworkAddress.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/NetworkAddress.h rename to projects/stargazer/plugins/other/smux/asn1/NetworkAddress.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/OBJECT_IDENTIFIER.c b/projects/stargazer/plugins/other/smux/asn1/OBJECT_IDENTIFIER.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OBJECT_IDENTIFIER.c rename to projects/stargazer/plugins/other/smux/asn1/OBJECT_IDENTIFIER.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/OBJECT_IDENTIFIER.h b/projects/stargazer/plugins/other/smux/asn1/OBJECT_IDENTIFIER.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OBJECT_IDENTIFIER.h rename to projects/stargazer/plugins/other/smux/asn1/OBJECT_IDENTIFIER.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/OCTET_STRING.c b/projects/stargazer/plugins/other/smux/asn1/OCTET_STRING.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OCTET_STRING.c rename to projects/stargazer/plugins/other/smux/asn1/OCTET_STRING.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/OCTET_STRING.h b/projects/stargazer/plugins/other/smux/asn1/OCTET_STRING.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OCTET_STRING.h rename to projects/stargazer/plugins/other/smux/asn1/OCTET_STRING.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ObjectName.c b/projects/stargazer/plugins/other/smux/asn1/ObjectName.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ObjectName.c rename to projects/stargazer/plugins/other/smux/asn1/ObjectName.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ObjectName.h b/projects/stargazer/plugins/other/smux/asn1/ObjectName.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ObjectName.h rename to projects/stargazer/plugins/other/smux/asn1/ObjectName.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ObjectSyntax.c b/projects/stargazer/plugins/other/smux/asn1/ObjectSyntax.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ObjectSyntax.c rename to projects/stargazer/plugins/other/smux/asn1/ObjectSyntax.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ObjectSyntax.h b/projects/stargazer/plugins/other/smux/asn1/ObjectSyntax.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ObjectSyntax.h rename to projects/stargazer/plugins/other/smux/asn1/ObjectSyntax.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/Opaque.c b/projects/stargazer/plugins/other/smux/asn1/Opaque.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Opaque.c rename to projects/stargazer/plugins/other/smux/asn1/Opaque.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/Opaque.h b/projects/stargazer/plugins/other/smux/asn1/Opaque.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Opaque.h rename to projects/stargazer/plugins/other/smux/asn1/Opaque.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/OpenPDU.c b/projects/stargazer/plugins/other/smux/asn1/OpenPDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OpenPDU.c rename to projects/stargazer/plugins/other/smux/asn1/OpenPDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/OpenPDU.h b/projects/stargazer/plugins/other/smux/asn1/OpenPDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/OpenPDU.h rename to projects/stargazer/plugins/other/smux/asn1/OpenPDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/PDU.c b/projects/stargazer/plugins/other/smux/asn1/PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PDU.c rename to projects/stargazer/plugins/other/smux/asn1/PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/PDU.h b/projects/stargazer/plugins/other/smux/asn1/PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PDU.h rename to projects/stargazer/plugins/other/smux/asn1/PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/PDUs.c b/projects/stargazer/plugins/other/smux/asn1/PDUs.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PDUs.c rename to projects/stargazer/plugins/other/smux/asn1/PDUs.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/PDUs.h b/projects/stargazer/plugins/other/smux/asn1/PDUs.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PDUs.h rename to projects/stargazer/plugins/other/smux/asn1/PDUs.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/PhysAddress.c b/projects/stargazer/plugins/other/smux/asn1/PhysAddress.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PhysAddress.c rename to projects/stargazer/plugins/other/smux/asn1/PhysAddress.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/PhysAddress.h b/projects/stargazer/plugins/other/smux/asn1/PhysAddress.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/PhysAddress.h rename to projects/stargazer/plugins/other/smux/asn1/PhysAddress.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/RFC1155-SMI.asn1 b/projects/stargazer/plugins/other/smux/asn1/RFC1155-SMI.asn1 similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RFC1155-SMI.asn1 rename to projects/stargazer/plugins/other/smux/asn1/RFC1155-SMI.asn1 diff --git a/projects/stargazer/plugins/other/snmp/asn1/RFC1157-SNMP.asn1 b/projects/stargazer/plugins/other/smux/asn1/RFC1157-SNMP.asn1 similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RFC1157-SNMP.asn1 rename to projects/stargazer/plugins/other/smux/asn1/RFC1157-SNMP.asn1 diff --git a/projects/stargazer/plugins/other/snmp/asn1/RFC1213-MIB.asn1 b/projects/stargazer/plugins/other/smux/asn1/RFC1213-MIB.asn1 similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RFC1213-MIB.asn1 rename to projects/stargazer/plugins/other/smux/asn1/RFC1213-MIB.asn1 diff --git a/projects/stargazer/plugins/other/snmp/asn1/RReqPDU.c b/projects/stargazer/plugins/other/smux/asn1/RReqPDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RReqPDU.c rename to projects/stargazer/plugins/other/smux/asn1/RReqPDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/RReqPDU.h b/projects/stargazer/plugins/other/smux/asn1/RReqPDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RReqPDU.h rename to projects/stargazer/plugins/other/smux/asn1/RReqPDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/RRspPDU.c b/projects/stargazer/plugins/other/smux/asn1/RRspPDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RRspPDU.c rename to projects/stargazer/plugins/other/smux/asn1/RRspPDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/RRspPDU.h b/projects/stargazer/plugins/other/smux/asn1/RRspPDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/RRspPDU.h rename to projects/stargazer/plugins/other/smux/asn1/RRspPDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/SMUX-PDUs.c b/projects/stargazer/plugins/other/smux/asn1/SMUX-PDUs.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SMUX-PDUs.c rename to projects/stargazer/plugins/other/smux/asn1/SMUX-PDUs.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/SMUX-PDUs.h b/projects/stargazer/plugins/other/smux/asn1/SMUX-PDUs.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SMUX-PDUs.h rename to projects/stargazer/plugins/other/smux/asn1/SMUX-PDUs.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/SMUX.asn1 b/projects/stargazer/plugins/other/smux/asn1/SMUX.asn1 similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SMUX.asn1 rename to projects/stargazer/plugins/other/smux/asn1/SMUX.asn1 diff --git a/projects/stargazer/plugins/other/snmp/asn1/SOutPDU.c b/projects/stargazer/plugins/other/smux/asn1/SOutPDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SOutPDU.c rename to projects/stargazer/plugins/other/smux/asn1/SOutPDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/SOutPDU.h b/projects/stargazer/plugins/other/smux/asn1/SOutPDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SOutPDU.h rename to projects/stargazer/plugins/other/smux/asn1/SOutPDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/STG-MIB.mib b/projects/stargazer/plugins/other/smux/asn1/STG-MIB.mib similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/STG-MIB.mib rename to projects/stargazer/plugins/other/smux/asn1/STG-MIB.mib diff --git a/projects/stargazer/plugins/other/snmp/asn1/SetRequest-PDU.c b/projects/stargazer/plugins/other/smux/asn1/SetRequest-PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SetRequest-PDU.c rename to projects/stargazer/plugins/other/smux/asn1/SetRequest-PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/SetRequest-PDU.h b/projects/stargazer/plugins/other/smux/asn1/SetRequest-PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SetRequest-PDU.h rename to projects/stargazer/plugins/other/smux/asn1/SetRequest-PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/SimpleOpen.c b/projects/stargazer/plugins/other/smux/asn1/SimpleOpen.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SimpleOpen.c rename to projects/stargazer/plugins/other/smux/asn1/SimpleOpen.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/SimpleOpen.h b/projects/stargazer/plugins/other/smux/asn1/SimpleOpen.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SimpleOpen.h rename to projects/stargazer/plugins/other/smux/asn1/SimpleOpen.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/SimpleSyntax.c b/projects/stargazer/plugins/other/smux/asn1/SimpleSyntax.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SimpleSyntax.c rename to projects/stargazer/plugins/other/smux/asn1/SimpleSyntax.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/SimpleSyntax.h b/projects/stargazer/plugins/other/smux/asn1/SimpleSyntax.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/SimpleSyntax.h rename to projects/stargazer/plugins/other/smux/asn1/SimpleSyntax.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/TcpConnEntry.c b/projects/stargazer/plugins/other/smux/asn1/TcpConnEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/TcpConnEntry.c rename to projects/stargazer/plugins/other/smux/asn1/TcpConnEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/TcpConnEntry.h b/projects/stargazer/plugins/other/smux/asn1/TcpConnEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/TcpConnEntry.h rename to projects/stargazer/plugins/other/smux/asn1/TcpConnEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/TimeTicks.c b/projects/stargazer/plugins/other/smux/asn1/TimeTicks.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/TimeTicks.c rename to projects/stargazer/plugins/other/smux/asn1/TimeTicks.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/TimeTicks.h b/projects/stargazer/plugins/other/smux/asn1/TimeTicks.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/TimeTicks.h rename to projects/stargazer/plugins/other/smux/asn1/TimeTicks.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/Trap-PDU.c b/projects/stargazer/plugins/other/smux/asn1/Trap-PDU.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Trap-PDU.c rename to projects/stargazer/plugins/other/smux/asn1/Trap-PDU.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/Trap-PDU.h b/projects/stargazer/plugins/other/smux/asn1/Trap-PDU.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/Trap-PDU.h rename to projects/stargazer/plugins/other/smux/asn1/Trap-PDU.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/UdpEntry.c b/projects/stargazer/plugins/other/smux/asn1/UdpEntry.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/UdpEntry.c rename to projects/stargazer/plugins/other/smux/asn1/UdpEntry.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/UdpEntry.h b/projects/stargazer/plugins/other/smux/asn1/UdpEntry.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/UdpEntry.h rename to projects/stargazer/plugins/other/smux/asn1/UdpEntry.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/VarBind.c b/projects/stargazer/plugins/other/smux/asn1/VarBind.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/VarBind.c rename to projects/stargazer/plugins/other/smux/asn1/VarBind.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/VarBind.h b/projects/stargazer/plugins/other/smux/asn1/VarBind.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/VarBind.h rename to projects/stargazer/plugins/other/smux/asn1/VarBind.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/VarBindList.c b/projects/stargazer/plugins/other/smux/asn1/VarBindList.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/VarBindList.c rename to projects/stargazer/plugins/other/smux/asn1/VarBindList.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/VarBindList.h b/projects/stargazer/plugins/other/smux/asn1/VarBindList.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/VarBindList.h rename to projects/stargazer/plugins/other/smux/asn1/VarBindList.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_SEQUENCE_OF.c b/projects/stargazer/plugins/other/smux/asn1/asn_SEQUENCE_OF.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_SEQUENCE_OF.c rename to projects/stargazer/plugins/other/smux/asn1/asn_SEQUENCE_OF.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_SEQUENCE_OF.h b/projects/stargazer/plugins/other/smux/asn1/asn_SEQUENCE_OF.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_SEQUENCE_OF.h rename to projects/stargazer/plugins/other/smux/asn1/asn_SEQUENCE_OF.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_SET_OF.c b/projects/stargazer/plugins/other/smux/asn1/asn_SET_OF.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_SET_OF.c rename to projects/stargazer/plugins/other/smux/asn1/asn_SET_OF.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_SET_OF.h b/projects/stargazer/plugins/other/smux/asn1/asn_SET_OF.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_SET_OF.h rename to projects/stargazer/plugins/other/smux/asn1/asn_SET_OF.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_application.h b/projects/stargazer/plugins/other/smux/asn1/asn_application.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_application.h rename to projects/stargazer/plugins/other/smux/asn1/asn_application.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_codecs.h b/projects/stargazer/plugins/other/smux/asn1/asn_codecs.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_codecs.h rename to projects/stargazer/plugins/other/smux/asn1/asn_codecs.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_codecs_prim.c b/projects/stargazer/plugins/other/smux/asn1/asn_codecs_prim.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_codecs_prim.c rename to projects/stargazer/plugins/other/smux/asn1/asn_codecs_prim.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_codecs_prim.h b/projects/stargazer/plugins/other/smux/asn1/asn_codecs_prim.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_codecs_prim.h rename to projects/stargazer/plugins/other/smux/asn1/asn_codecs_prim.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_internal.h b/projects/stargazer/plugins/other/smux/asn1/asn_internal.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_internal.h rename to projects/stargazer/plugins/other/smux/asn1/asn_internal.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/asn_system.h b/projects/stargazer/plugins/other/smux/asn1/asn_system.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/asn_system.h rename to projects/stargazer/plugins/other/smux/asn1/asn_system.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_decoder.c b/projects/stargazer/plugins/other/smux/asn1/ber_decoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_decoder.c rename to projects/stargazer/plugins/other/smux/asn1/ber_decoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_decoder.h b/projects/stargazer/plugins/other/smux/asn1/ber_decoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_decoder.h rename to projects/stargazer/plugins/other/smux/asn1/ber_decoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_tlv_length.c b/projects/stargazer/plugins/other/smux/asn1/ber_tlv_length.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_tlv_length.c rename to projects/stargazer/plugins/other/smux/asn1/ber_tlv_length.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_tlv_length.h b/projects/stargazer/plugins/other/smux/asn1/ber_tlv_length.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_tlv_length.h rename to projects/stargazer/plugins/other/smux/asn1/ber_tlv_length.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_tlv_tag.c b/projects/stargazer/plugins/other/smux/asn1/ber_tlv_tag.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_tlv_tag.c rename to projects/stargazer/plugins/other/smux/asn1/ber_tlv_tag.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/ber_tlv_tag.h b/projects/stargazer/plugins/other/smux/asn1/ber_tlv_tag.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/ber_tlv_tag.h rename to projects/stargazer/plugins/other/smux/asn1/ber_tlv_tag.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_CHOICE.c b/projects/stargazer/plugins/other/smux/asn1/constr_CHOICE.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_CHOICE.c rename to projects/stargazer/plugins/other/smux/asn1/constr_CHOICE.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_CHOICE.h b/projects/stargazer/plugins/other/smux/asn1/constr_CHOICE.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_CHOICE.h rename to projects/stargazer/plugins/other/smux/asn1/constr_CHOICE.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE.c b/projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE.c rename to projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE.h b/projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE.h rename to projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE_OF.c b/projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE_OF.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE_OF.c rename to projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE_OF.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE_OF.h b/projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE_OF.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SEQUENCE_OF.h rename to projects/stargazer/plugins/other/smux/asn1/constr_SEQUENCE_OF.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SET_OF.c b/projects/stargazer/plugins/other/smux/asn1/constr_SET_OF.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SET_OF.c rename to projects/stargazer/plugins/other/smux/asn1/constr_SET_OF.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_SET_OF.h b/projects/stargazer/plugins/other/smux/asn1/constr_SET_OF.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_SET_OF.h rename to projects/stargazer/plugins/other/smux/asn1/constr_SET_OF.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_TYPE.c b/projects/stargazer/plugins/other/smux/asn1/constr_TYPE.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_TYPE.c rename to projects/stargazer/plugins/other/smux/asn1/constr_TYPE.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constr_TYPE.h b/projects/stargazer/plugins/other/smux/asn1/constr_TYPE.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constr_TYPE.h rename to projects/stargazer/plugins/other/smux/asn1/constr_TYPE.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/constraints.c b/projects/stargazer/plugins/other/smux/asn1/constraints.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constraints.c rename to projects/stargazer/plugins/other/smux/asn1/constraints.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/constraints.h b/projects/stargazer/plugins/other/smux/asn1/constraints.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/constraints.h rename to projects/stargazer/plugins/other/smux/asn1/constraints.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/converter-sample.c b/projects/stargazer/plugins/other/smux/asn1/converter-sample.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/converter-sample.c rename to projects/stargazer/plugins/other/smux/asn1/converter-sample.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/der_encoder.c b/projects/stargazer/plugins/other/smux/asn1/der_encoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/der_encoder.c rename to projects/stargazer/plugins/other/smux/asn1/der_encoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/der_encoder.h b/projects/stargazer/plugins/other/smux/asn1/der_encoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/der_encoder.h rename to projects/stargazer/plugins/other/smux/asn1/der_encoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_decoder.c b/projects/stargazer/plugins/other/smux/asn1/per_decoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_decoder.c rename to projects/stargazer/plugins/other/smux/asn1/per_decoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_decoder.h b/projects/stargazer/plugins/other/smux/asn1/per_decoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_decoder.h rename to projects/stargazer/plugins/other/smux/asn1/per_decoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_encoder.c b/projects/stargazer/plugins/other/smux/asn1/per_encoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_encoder.c rename to projects/stargazer/plugins/other/smux/asn1/per_encoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_encoder.h b/projects/stargazer/plugins/other/smux/asn1/per_encoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_encoder.h rename to projects/stargazer/plugins/other/smux/asn1/per_encoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_support.c b/projects/stargazer/plugins/other/smux/asn1/per_support.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_support.c rename to projects/stargazer/plugins/other/smux/asn1/per_support.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/per_support.h b/projects/stargazer/plugins/other/smux/asn1/per_support.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/per_support.h rename to projects/stargazer/plugins/other/smux/asn1/per_support.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_decoder.c b/projects/stargazer/plugins/other/smux/asn1/xer_decoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_decoder.c rename to projects/stargazer/plugins/other/smux/asn1/xer_decoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_decoder.h b/projects/stargazer/plugins/other/smux/asn1/xer_decoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_decoder.h rename to projects/stargazer/plugins/other/smux/asn1/xer_decoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_encoder.c b/projects/stargazer/plugins/other/smux/asn1/xer_encoder.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_encoder.c rename to projects/stargazer/plugins/other/smux/asn1/xer_encoder.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_encoder.h b/projects/stargazer/plugins/other/smux/asn1/xer_encoder.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_encoder.h rename to projects/stargazer/plugins/other/smux/asn1/xer_encoder.h diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_support.c b/projects/stargazer/plugins/other/smux/asn1/xer_support.c similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_support.c rename to projects/stargazer/plugins/other/smux/asn1/xer_support.c diff --git a/projects/stargazer/plugins/other/snmp/asn1/xer_support.h b/projects/stargazer/plugins/other/smux/asn1/xer_support.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/asn1/xer_support.h rename to projects/stargazer/plugins/other/smux/asn1/xer_support.h diff --git a/projects/stargazer/plugins/other/smux/handlers.cpp b/projects/stargazer/plugins/other/smux/handlers.cpp new file mode 100644 index 00000000..f0f3a8c1 --- /dev/null +++ b/projects/stargazer/plugins/other/smux/handlers.cpp @@ -0,0 +1,154 @@ +#include "asn1/OpenPDU.h" +#include "asn1/ClosePDU.h" +#include "asn1/RReqPDU.h" +#include "asn1/GetRequest-PDU.h" +#include "asn1/GetResponse-PDU.h" +#include "asn1/VarBindList.h" +#include "asn1/VarBind.h" +#include "asn1/OBJECT_IDENTIFIER.h" +#include "asn1/ber_decoder.h" +#include "asn1/der_encoder.h" + +#include "stg/common.h" + +#include "smux.h" + +bool SMUX::CloseHandler(const SMUX_PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::CloseHandler()\n"); +asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); +return false; +} + +bool SMUX::RegisterResponseHandler(const SMUX_PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::RegisterResponseHandler()\n"); +asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); +return false; +} + +bool SMUX::PDUsHandler(const SMUX_PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::PDUsHandler()\n"); +asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); +PDUsHandlers::iterator it; +it = pdusHandlers.find(pdus->choice.pdus.present); +if (it != pdusHandlers.end()) + { + return (this->*(it->second))(&pdus->choice.pdus); + } +else + { + switch (pdus->present) + { + case PDUs_PR_NOTHING: + printfd(__FILE__, "SMUX::PDUsHandler() - nothing\n"); + break; + case PDUs_PR_get_response: + printfd(__FILE__, "SMUX::PDUsHandler() - get response\n"); + break; + case PDUs_PR_trap: + printfd(__FILE__, "SMUX::PDUsHandler() - trap\n"); + break; + default: + printfd(__FILE__, "SMUX::PDUsHandler() - undefined\n"); + } + } +return false; +} + +bool SMUX::CommitOrRollbackHandler(const SMUX_PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::CommitOrRollbackHandler()\n"); +asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); +return false; +} + +bool SMUX::GetRequestHandler(const PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::GetRequestHandler()\n"); +asn_fprint(stderr, &asn_DEF_PDUs, pdus); +const GetRequest_PDU_t * getRequest = &pdus->choice.get_request; +GetResponse_PDU_t msg; +VarBindList_t * varBindList = &msg.variable_bindings; +memset(&msg, 0, sizeof(msg)); + +msg.request_id = getRequest->request_id; +asn_long2INTEGER(&msg.error_status, 0); +asn_long2INTEGER(&msg.error_index, 0); + +const VarBindList_t * vbl = &getRequest->variable_bindings; +for (int i = 0; i < vbl->list.count; ++i) + { + VarBind_t * vb = getRequest->variable_bindings.list.array[i]; + Sensors::iterator it; + it = sensors.find(OI2String(&vb->name)); + if (it == sensors.end()) + { + SendGetResponseErrorPDU(sock, getRequest, + PDU__error_status_noSuchName, i); + return true; + } + + VarBind_t newVb; + memset(&newVb, 0, sizeof(newVb)); + + newVb.name = vb->name; + it->second->GetValue(&newVb.value); + + ASN_SEQUENCE_ADD(varBindList, &newVb); + } + +SendGetResponsePDU(sock, &msg); +asn_fprint(stderr, &asn_DEF_PDU, &msg); +return false; +} + +bool SMUX::GetNextRequestHandler(const PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::GetNextRequestHandler()\n"); +asn_fprint(stderr, &asn_DEF_PDUs, pdus); +const GetRequest_PDU_t * getRequest = &pdus->choice.get_request; +GetResponse_PDU_t msg; +VarBindList_t * varBindList = &msg.variable_bindings; +memset(&msg, 0, sizeof(msg)); + +msg.request_id = getRequest->request_id; +asn_long2INTEGER(&msg.error_status, 0); +asn_long2INTEGER(&msg.error_index, 0); + +const VarBindList_t * vbl = &getRequest->variable_bindings; +for (int i = 0; i < vbl->list.count; ++i) + { + VarBind_t * vb = getRequest->variable_bindings.list.array[i]; + Sensors::iterator it; + it = sensors.upper_bound(OI2String(&vb->name)); + if (it == sensors.end()) + { + SendGetResponseErrorPDU(sock, getRequest, + PDU__error_status_noSuchName, i); + return true; + } + + VarBind_t newVb; + memset(&newVb, 0, sizeof(newVb)); + + newVb.name = vb->name; + it->second->GetValue(&newVb.value); + + ASN_SEQUENCE_ADD(varBindList, &newVb); + } + +SendGetResponsePDU(sock, &msg); +asn_fprint(stderr, &asn_DEF_PDU, &msg); +return false; +} + +bool SMUX::SetRequestHandler(const PDUs_t * pdus) +{ +printfd(__FILE__, "SMUX::SetRequestHandler()\n"); +asn_fprint(stderr, &asn_DEF_PDUs, pdus); +SendGetResponseErrorPDU(sock, &pdus->choice.set_request, + PDU__error_status_readOnly, 0); +return false; +} diff --git a/projects/stargazer/plugins/other/snmp/sensors.cpp b/projects/stargazer/plugins/other/smux/sensors.cpp similarity index 80% rename from projects/stargazer/plugins/other/snmp/sensors.cpp rename to projects/stargazer/plugins/other/smux/sensors.cpp index 57fec93d..5a8e967a 100644 --- a/projects/stargazer/plugins/other/snmp/sensors.cpp +++ b/projects/stargazer/plugins/other/smux/sensors.cpp @@ -5,15 +5,7 @@ #include "sensors.h" -void Int2OS(ObjectSyntax_t * dst, long src) -{ -dst->present = ObjectSyntax_PR_simple; -SimpleSyntax_t * simpleSyntax = &dst->choice.simple; -simpleSyntax->present = SimpleSyntax_PR_number; -asn_long2INTEGER(&simpleSyntax->choice.number, src); -} - -bool ConnectedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool ConnectedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -29,11 +21,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool AuthorizedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool AuthorizedUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -49,11 +41,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool AlwaysOnlineUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool AlwaysOnlineUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -69,11 +61,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool NoCashUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool NoCashUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -89,11 +81,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool DisabledDetailStatsUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool DisabledDetailStatsUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -109,11 +101,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool DisabledUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool DisabledUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -129,11 +121,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool PassiveUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool PassiveUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -149,11 +141,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool CreditUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool CreditUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -169,11 +161,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool FreeMbUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool FreeMbUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -189,11 +181,11 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } -bool TariffChangeUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) +bool TariffChangeUsersSensor::GetValue(ObjectSyntax_t * objectSyntax) const { int handle = users.OpenSearch(); if (!handle) @@ -209,6 +201,6 @@ while (!users.SearchNext(handle, &user)) users.CloseSearch(handle); -Int2OS(objectSyntax, count); +ValueToOS(count, objectSyntax); return true; } diff --git a/projects/stargazer/plugins/other/snmp/sensors.h b/projects/stargazer/plugins/other/smux/sensors.h similarity index 52% rename from projects/stargazer/plugins/other/snmp/sensors.h rename to projects/stargazer/plugins/other/smux/sensors.h index 767f1e14..085a2ddd 100644 --- a/projects/stargazer/plugins/other/snmp/sensors.h +++ b/projects/stargazer/plugins/other/smux/sensors.h @@ -9,25 +9,23 @@ #include "asn1/ObjectSyntax.h" +#include "value2os.h" + class Sensor { public: - virtual bool GetValue(ObjectSyntax_t * objectSyntax) = 0; + virtual bool GetValue(ObjectSyntax_t * objectSyntax) const = 0; }; typedef std::map Sensors; -void Int2OS(ObjectSyntax_t * dst, long src); - class TotalUsersSensor : public Sensor { public: - TotalUsersSensor(const USERS & u) - : users(u) - {} + TotalUsersSensor(const USERS & u) : users(u) {} virtual ~TotalUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax) + bool GetValue(ObjectSyntax_t * objectSyntax) const { - Int2OS(objectSyntax, users.GetUserNum()); + ValueToOS(users.GetUserNum(), objectSyntax); return true; } @@ -37,12 +35,10 @@ class TotalUsersSensor : public Sensor { class ConnectedUsersSensor : public Sensor { public: - ConnectedUsersSensor(USERS & u) - : users(u) - {} + ConnectedUsersSensor(USERS & u) : users(u) {} virtual ~ConnectedUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -50,12 +46,10 @@ class ConnectedUsersSensor : public Sensor { class AuthorizedUsersSensor : public Sensor { public: - AuthorizedUsersSensor(USERS & u) - : users(u) - {} + AuthorizedUsersSensor(USERS & u) : users(u) {} virtual ~AuthorizedUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -63,12 +57,10 @@ class AuthorizedUsersSensor : public Sensor { class AlwaysOnlineUsersSensor : public Sensor { public: - AlwaysOnlineUsersSensor(USERS & u) - : users(u) - {} + AlwaysOnlineUsersSensor(USERS & u) : users(u) {} virtual ~AlwaysOnlineUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -76,12 +68,10 @@ class AlwaysOnlineUsersSensor : public Sensor { class NoCashUsersSensor : public Sensor { public: - NoCashUsersSensor(USERS & u) - : users(u) - {} + NoCashUsersSensor(USERS & u) : users(u) {} virtual ~NoCashUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -89,12 +79,10 @@ class NoCashUsersSensor : public Sensor { class DisabledDetailStatsUsersSensor : public Sensor { public: - DisabledDetailStatsUsersSensor(USERS & u) - : users(u) - {} + DisabledDetailStatsUsersSensor(USERS & u) : users(u) {} virtual ~DisabledDetailStatsUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -102,12 +90,10 @@ class DisabledDetailStatsUsersSensor : public Sensor { class DisabledUsersSensor : public Sensor { public: - DisabledUsersSensor(USERS & u) - : users(u) - {} + DisabledUsersSensor(USERS & u) : users(u) {} virtual ~DisabledUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -115,12 +101,10 @@ class DisabledUsersSensor : public Sensor { class PassiveUsersSensor : public Sensor { public: - PassiveUsersSensor(USERS & u) - : users(u) - {} + PassiveUsersSensor(USERS & u) : users(u) {} virtual ~PassiveUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -128,12 +112,10 @@ class PassiveUsersSensor : public Sensor { class CreditUsersSensor : public Sensor { public: - CreditUsersSensor(USERS & u) - : users(u) - {} + CreditUsersSensor(USERS & u) : users(u) {} virtual ~CreditUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -141,12 +123,10 @@ class CreditUsersSensor : public Sensor { class FreeMbUsersSensor : public Sensor { public: - FreeMbUsersSensor(USERS & u) - : users(u) - {} + FreeMbUsersSensor(USERS & u) : users(u) {} virtual ~FreeMbUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -154,12 +134,10 @@ class FreeMbUsersSensor : public Sensor { class TariffChangeUsersSensor : public Sensor { public: - TariffChangeUsersSensor(USERS & u) - : users(u) - {} + TariffChangeUsersSensor(USERS & u) : users(u) {} virtual ~TariffChangeUsersSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax); + bool GetValue(ObjectSyntax_t * objectSyntax) const; private: USERS & users; @@ -167,14 +145,12 @@ class TariffChangeUsersSensor : public Sensor { class TotalTariffsSensor : public Sensor { public: - TotalTariffsSensor(const TARIFFS & t) - : tariffs(t) - {} + TotalTariffsSensor(const TARIFFS & t) : tariffs(t) {} virtual ~TotalTariffsSensor() {} - bool GetValue(ObjectSyntax_t * objectSyntax) + bool GetValue(ObjectSyntax_t * objectSyntax) const { - Int2OS(objectSyntax, tariffs.GetTariffsNum()); + ValueToOS(tariffs.GetTariffsNum(), objectSyntax); return true; } @@ -182,4 +158,17 @@ class TotalTariffsSensor : public Sensor { const TARIFFS & tariffs; }; +template +class ConstSensor : public Sensor { + public: + ConstSensor(const T & v) : value(v) {} + virtual ~ConstSensor() {} + + bool GetValue(ObjectSyntax * objectSyntax) const + { return ValueToOS(value, objectSyntax); } + + private: + T value; +}; + #endif diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp new file mode 100644 index 00000000..11fda6ed --- /dev/null +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -0,0 +1,564 @@ +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "asn1/OpenPDU.h" +#include "asn1/ClosePDU.h" +#include "asn1/RReqPDU.h" +#include "asn1/GetRequest-PDU.h" +#include "asn1/GetResponse-PDU.h" +#include "asn1/VarBindList.h" +#include "asn1/VarBind.h" +#include "asn1/OBJECT_IDENTIFIER.h" +#include "asn1/ber_decoder.h" +#include "asn1/der_encoder.h" + +#include "stg/common.h" + +#include "smux.h" + +bool WaitPackets(int sd); + +std::string OI2String(OBJECT_IDENTIFIER_t * oi) +{ +std::string res; + +int arcs[1024]; +int count = OBJECT_IDENTIFIER_get_arcs(oi, arcs, sizeof(arcs[0]), 1024); + +if (count > 1024) + return ""; + +for (int i = 0; i < count; ++i) + { + res += "."; + std::string arc; + strprintf(&arc, "%d", arcs[i]); + res += arc; + } + +return res; +} + +bool String2OI(const std::string & str, OBJECT_IDENTIFIER_t * oi) +{ +size_t left = 0, pos = 0, arcPos = 0; +int arcs[1024]; +pos = str.find_first_of('.', left); +if (pos == 0) + { + left = 1; + pos = str.find_first_of('.', left); + } +while (pos != std::string::npos) + { + int arc = 0; + if (str2x(str.substr(left, left - pos), arc)) + { + return false; + } + arcs[arcPos++] = arc; + left = pos + 1; + pos = str.find_first_of('.', left); + } +if (left < str.length()) + { + int arc = 0; + if (str2x(str.substr(left, left - pos), arc)) + { + return false; + } + arcs[arcPos++] = arc; + } +printfd(__FILE__, "String2OI() - arcPos: %d\n", arcPos); +OBJECT_IDENTIFIER_set_arcs(oi, arcs, sizeof(arcs[0]), arcPos); +return true; +} + +class SMUX_CREATOR +{ +private: + SMUX * smux; + +public: + SMUX_CREATOR() : smux(new SMUX()) {} + ~SMUX_CREATOR() { delete smux; } + + SMUX * GetPlugin() { return smux; } +}; + +SMUX_CREATOR sac; + +PLUGIN * GetPlugin() +{ +return sac.GetPlugin(); +} + +int SendOpenPDU(int fd) +{ +const char * description = "Stg SMUX Plugin"; +//int oid[] = {1, 3, 6, 1, 4, 1, 38313, 1, 5, 2, 1, 1}; +asn_enc_rval_t error; +OpenPDU_t msg; + +memset(&msg, 0, sizeof(msg)); + +msg.present = OpenPDU_PR_simple; +asn_long2INTEGER(&msg.choice.simple.version, SimpleOpen__version_version_1); +if (!String2OI(".1.3.6.1.4.1.38313", &msg.choice.simple.identity)) + { + printfd(__FILE__, + "SendOpenPDU() - failed to convert string to OBJECT_IDENTIFIER\n"); + return -1; + } +OCTET_STRING_fromString(&msg.choice.simple.description, description); +OCTET_STRING_fromString(&msg.choice.simple.password, ""); + +char buffer[1024]; +error = der_encode_to_buffer(&asn_DEF_OpenPDU, &msg, buffer, sizeof(buffer)); + +if (error.encoded == -1) + { + printfd(__FILE__, "Could not encode OpenPDU (at %s)\n", + error.failed_type ? error.failed_type->name : "unknown"); + return -1; + } +else + { + write(fd, buffer, error.encoded); + printfd(__FILE__, "OpenPDU encoded successfully to %d bytes\n", + error.encoded); + } +return 0; +} + +int SendClosePDU(int fd) +{ +ClosePDU_t msg; + +memset(&msg, 0, sizeof(msg)); + +asn_long2INTEGER(&msg, ClosePDU_goingDown); + +char buffer[1024]; +asn_enc_rval_t error; +error = der_encode_to_buffer(&asn_DEF_ClosePDU, &msg, buffer, sizeof(buffer)); + +if (error.encoded == -1) + { + printfd(__FILE__, "Could not encode ClosePDU (at %s)\n", + error.failed_type ? error.failed_type->name : "unknown"); + return -1; + } +else + { + write(fd, buffer, error.encoded); + printfd(__FILE__, "ClosePDU encoded successfully\n"); + } +return 0; +} + +int SendRReqPDU(int fd) +{ +int oid[] = {1, 3, 6, 1, 4, 1, 38313, 1}; +asn_enc_rval_t error; +RReqPDU_t msg; + +memset(&msg, 0, sizeof(msg)); + +msg.priority = 0; +asn_long2INTEGER(&msg.operation, RReqPDU__operation_readOnly); +OBJECT_IDENTIFIER_set_arcs(&msg.subtree, + oid, + sizeof(oid[0]), + 8); + +char buffer[1024]; +error = der_encode_to_buffer(&asn_DEF_RReqPDU, &msg, buffer, sizeof(buffer)); + +if (error.encoded == -1) + { + printfd(__FILE__, "Could not encode RReqPDU (at %s)\n", + error.failed_type ? error.failed_type->name : "unknown"); + return -1; + } +else + { + write(fd, buffer, error.encoded); + printfd(__FILE__, "RReqPDU encoded successfully to %d bytes\n", + error.encoded); + } +return 0; +} + +int SendGetResponsePDU(int fd, GetResponse_PDU_t * getResponse) +{ +asn_enc_rval_t error; + +char buffer[1024]; +error = der_encode_to_buffer(&asn_DEF_GetResponse_PDU, getResponse, buffer, + sizeof(buffer)); + +if (error.encoded == -1) + { + printfd(__FILE__, "Could not encode GetResponsePDU (at %s)\n", + error.failed_type ? error.failed_type->name : "unknown"); + return -1; + } +else + { + write(fd, buffer, error.encoded); + printfd(__FILE__, "GetResponsePDU encoded successfully to %d bytes\n", + error.encoded); + } +return 0; +} + +int SendGetResponseErrorPDU(int fd, + const PDU_t * getRequest, + int errorStatus, + int errorIndex) +{ +asn_enc_rval_t error; +GetResponse_PDU_t msg; + +memset(&msg, 0, sizeof(msg)); + +msg.request_id = getRequest->request_id; +asn_long2INTEGER(&msg.error_status, errorStatus); +asn_long2INTEGER(&msg.error_index, errorIndex); + +char buffer[1024]; +error = der_encode_to_buffer(&asn_DEF_GetResponse_PDU, &msg, buffer, + sizeof(buffer)); + +if (error.encoded == -1) + { + printfd(__FILE__, "Could not encode GetResponsePDU for error (at %s)\n", + error.failed_type ? error.failed_type->name : "unknown"); + return -1; + } +else + { + write(fd, buffer, error.encoded); + printfd(__FILE__, + "GetResponsePDU for error encoded successfully to %d bytes\n", + error.encoded); + } +return 0; +} + +SMUX_PDUs_t * RecvSMUXPDUs(int fd) +{ +char buffer[1024]; +SMUX_PDUs_t * pdus = NULL; + +memset(buffer, 0, sizeof(buffer)); + +size_t length = read(fd, buffer, sizeof(buffer)); +if (length < 1) + return NULL; +asn_dec_rval_t error; +error = ber_decode(0, &asn_DEF_SMUX_PDUs, (void **)&pdus, buffer, length); +if(error.code != RC_OK) + { + printfd(__FILE__, "Failed to decode PDUs at byte %ld\n", + (long)error.consumed); + return NULL; + } +return pdus; +} + +int ParseIntInRange(const std::string & str, + int min, + int max, + int * val) +{ +if (str2x(str.c_str(), *val)) + { + return -1; + } +if (*val < min || *val > max) + { + return -1; + } +return 0; +} + +SMUX_SETTINGS::SMUX_SETTINGS() + : ip(0), + port(0) +{} + +int SMUX_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) +{ +PARAM_VALUE pv; +std::vector::const_iterator pvi; +int p; +/////////////////////////// +pv.param = "Port"; +pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); +if (pvi == s.moduleParams.end()) + { + errorStr = "Parameter \'Port\' not found."; + printfd(__FILE__, "Parameter 'Port' not found\n"); + return -1; + } +if (ParseIntInRange(pvi->value[0], 2, 65535, &p)) + { + errorStr = "Cannot parse parameter \'Port\': " + errorStr; + printfd(__FILE__, "Cannot parse parameter 'Port'\n"); + return -1; + } +port = p; + +pv.param = "Password"; +pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); +if (pvi == s.moduleParams.end()) + { + errorStr = "Parameter \'Password\' not found."; + printfd(__FILE__, "Parameter 'Password' not found\n"); + password = ""; + } +else + { + password = pvi->value[0]; + } + +pv.param = "Server"; +pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv); +if (pvi == s.moduleParams.end()) + { + errorStr = "Parameter \'Server\' not found."; + printfd(__FILE__, "Parameter 'Server' not found\n"); + return -1; + } +ip = inet_strington(pvi->value[0]); + +return 0; +} + +SMUX::SMUX() + : PLUGIN(), + users(NULL), + tariffs(NULL), + running(false), + stopped(true), + sock(-1) +{ +pthread_mutex_init(&mutex, NULL); + +smuxHandlers[SMUX_PDUs_PR_close] = &SMUX::CloseHandler; +smuxHandlers[SMUX_PDUs_PR_registerResponse] = &SMUX::RegisterResponseHandler; +smuxHandlers[SMUX_PDUs_PR_pdus] = &SMUX::PDUsHandler; +smuxHandlers[SMUX_PDUs_PR_commitOrRollback] = &SMUX::CommitOrRollbackHandler; + +pdusHandlers[PDUs_PR_get_request] = &SMUX::GetRequestHandler; +pdusHandlers[PDUs_PR_get_next_request] = &SMUX::GetNextRequestHandler; +pdusHandlers[PDUs_PR_set_request] = &SMUX::SetRequestHandler; +} + +SMUX::~SMUX() +{ +Sensors::iterator it; +for (it = sensors.begin(); it != sensors.end(); ++it) + delete it->second; +printfd(__FILE__, "SMUX::~SMUX()\n"); +pthread_mutex_destroy(&mutex); +} + +int SMUX::ParseSettings() +{ +return smuxSettings.ParseSettings(settings); +} + +int SMUX::Start() +{ +if (PrepareNet()) + return -1; + +// Users +sensors[".1.3.6.1.4.1.38313.1.1.1"] = new TotalUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.2"] = new ConnectedUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.3"] = new AuthorizedUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.4"] = new AlwaysOnlineUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.5"] = new NoCashUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.7"] = new DisabledDetailStatsUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.8"] = new DisabledUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.9"] = new PassiveUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.10"] = new CreditUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.11"] = new FreeMbUsersSensor(*users); +sensors[".1.3.6.1.4.1.38313.1.1.12"] = new TariffChangeUsersSensor(*users); +// Tariffs +sensors[".1.3.6.1.4.1.38313.1.2.1"] = new TotalTariffsSensor(*tariffs); + +if (!running) + { + if (pthread_create(&thread, NULL, Runner, this)) + { + errorStr = "Cannot create thread."; + printfd(__FILE__, "Cannot create thread\n"); + return -1; + } + } + +return 0; +} + +int SMUX::Stop() +{ +printfd(__FILE__, "SMUX::Stop() - Before\n"); +running = false; + +if (!stopped) + { + //5 seconds to thread stops itself + for (int i = 0; i < 25 && !stopped; i++) + { + struct timespec ts = {0, 200000000}; + nanosleep(&ts, NULL); + } + + //after 5 seconds waiting thread still running. now killing it + if (!stopped) + { + printfd(__FILE__, "SMUX::Stop() - failed to stop thread, killing it\n"); + if (pthread_kill(thread, SIGINT)) + { + errorStr = "Cannot kill thread."; + printfd(__FILE__, "SMUX::Stop() - Cannot kill thread\n"); + return -1; + } + printfd(__FILE__, "SMUX::Stop() - killed Run\n"); + } + } + +pthread_join(thread, NULL); + +close(sock); + +printfd(__FILE__, "SMUX::Stop() - After\n"); +return 0; +} + +void * SMUX::Runner(void * d) +{ +SMUX * smux = static_cast(d); + +smux->Run(); + +return NULL; +} + +void SMUX::Run() +{ +SendOpenPDU(sock); +SendRReqPDU(sock); +running = true; +stopped = false; +while(running) + { + if (WaitPackets(sock)) + { + SMUX_PDUs_t * pdus = RecvSMUXPDUs(sock); + if (pdus) + DispatchPDUs(pdus); + } + if (!running) + break; + } +SendClosePDU(sock); +stopped = true; +} + +bool SMUX::PrepareNet() +{ +sock = socket(AF_INET, SOCK_STREAM, 0); + +if (sock < 0) + { + errorStr = "Cannot create socket."; + printfd(__FILE__, "Cannot create socket\n"); + return true; + } + +struct sockaddr_in addr; + +addr.sin_family = AF_INET; +addr.sin_port = htons(smuxSettings.GetPort()); +addr.sin_addr.s_addr = smuxSettings.GetIP(); + +if (connect(sock, reinterpret_cast(&addr), sizeof(addr))) + { + errorStr = "Cannot connect."; + printfd(__FILE__, "Cannot connect. Message: '%s'\n", strerror(errno)); + return true; + } + +return false; +} + +bool WaitPackets(int sd) +{ +fd_set rfds; +FD_ZERO(&rfds); +FD_SET(sd, &rfds); + +struct timeval tv; +tv.tv_sec = 0; +tv.tv_usec = 500000; + +int res = select(sd + 1, &rfds, NULL, NULL, &tv); +if (res == -1) // Error + { + if (errno != EINTR) + { + printfd(__FILE__, "Error on select: '%s'\n", strerror(errno)); + } + return false; + } + +if (res == 0) // Timeout + { + return false; + } + +return true; +} + +bool SMUX::DispatchPDUs(const SMUX_PDUs_t * pdus) +{ +SMUXHandlers::iterator it; +it = smuxHandlers.find(pdus->present); +if (it != smuxHandlers.end()) + { + return (this->*(it->second))(pdus); + } +else + { + switch (pdus->present) + { + case SMUX_PDUs_PR_NOTHING: + printfd(__FILE__, "PDUs: nothing\n"); + break; + case SMUX_PDUs_PR_open: + printfd(__FILE__, "PDUs: open\n"); + break; + case SMUX_PDUs_PR_registerRequest: + printfd(__FILE__, "PDUs: registerRequest\n"); + break; + default: + printfd(__FILE__, "PDUs: undefined\n"); + } + asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); + } +return false; +} diff --git a/projects/stargazer/plugins/other/smux/smux.h b/projects/stargazer/plugins/other/smux/smux.h new file mode 100644 index 00000000..c5b94d4c --- /dev/null +++ b/projects/stargazer/plugins/other/smux/smux.h @@ -0,0 +1,113 @@ +#ifndef __SMUX_H__ +#define __SMUX_H__ + +#include + +#include +#include + +#include "asn1/SMUX-PDUs.h" +#include "asn1/ObjectSyntax.h" + +#include "stg/os_int.h" +#include "stg/plugin.h" +#include "stg/module_settings.h" +#include "stg/users.h" +#include "stg/tariffs.h" + +#include "sensors.h" + +extern "C" PLUGIN * GetPlugin(); + +class USER; +class SETTINGS; +class SMUX; + +typedef bool (SMUX::*SMUXPacketHandler)(const SMUX_PDUs_t * pdus); +typedef bool (SMUX::*PDUsHandler)(const PDUs_t * pdus); +typedef std::map SMUXHandlers; +typedef std::map PDUsHandlers; +//----------------------------------------------------------------------------- +class SMUX_SETTINGS { +public: + SMUX_SETTINGS(); + virtual ~SMUX_SETTINGS() {} + const std::string & GetStrError() const { return errorStr; } + int ParseSettings(const MODULE_SETTINGS & s); + + uint32_t GetIP() const { return ip; } + uint16_t GetPort() const { return port; } + const std::string GetPassword() const { return password; } + +private: + mutable std::string errorStr; + + uint32_t ip; + uint16_t port; + std::string password; +}; +//----------------------------------------------------------------------------- +class SMUX : public PLUGIN { +public: + SMUX(); + virtual ~SMUX(); + + void SetUsers(USERS * u) { users = u; } + void SetTariffs(TARIFFS * t) { tariffs = t; } + void SetAdmins(ADMINS *) {} + void SetTraffcounter(TRAFFCOUNTER *) {} + void SetStore(STORE *) {} + void SetStgSettings(const SETTINGS *) {} + void SetSettings(const MODULE_SETTINGS & s) { settings = s; } + int ParseSettings(); + + int Start(); + int Stop(); + int Reload() { return 0; } + bool IsRunning() { return running && !stopped; } + + const std::string & GetStrError() const { return errorStr; } + const std::string GetVersion() const { return "Stg SMUX Plugin 1.0"; } + uint16_t GetStartPosition() const { return 100; } + uint16_t GetStopPosition() const { return 100; } + +private: + static void * Runner(void * d); + void Run(); + bool PrepareNet(); + + bool DispatchPDUs(const SMUX_PDUs_t * pdus); + + bool CloseHandler(const SMUX_PDUs_t * pdus); + bool RegisterResponseHandler(const SMUX_PDUs_t * pdus); + bool PDUsHandler(const SMUX_PDUs_t * pdus); + bool CommitOrRollbackHandler(const SMUX_PDUs_t * pdus); + + bool GetRequestHandler(const PDUs_t * pdus); + bool GetNextRequestHandler(const PDUs_t * pdus); + bool SetRequestHandler(const PDUs_t * pdus); + + USERS * users; + TARIFFS * tariffs; + + mutable std::string errorStr; + SMUX_SETTINGS smuxSettings; + MODULE_SETTINGS settings; + + pthread_t thread; + pthread_mutex_t mutex; + bool running; + bool stopped; + + int sock; + + SMUXHandlers smuxHandlers; + PDUsHandlers pdusHandlers; + Sensors sensors; + +}; +//----------------------------------------------------------------------------- + +extern "C" PLUGIN * GetPlugin(); + +#endif diff --git a/projects/stargazer/plugins/other/snmp/snmp.cpp b/projects/stargazer/plugins/other/smux/snmp.cpp similarity index 100% rename from projects/stargazer/plugins/other/snmp/snmp.cpp rename to projects/stargazer/plugins/other/smux/snmp.cpp diff --git a/projects/stargazer/plugins/other/snmp/snmp.h b/projects/stargazer/plugins/other/smux/snmp.h similarity index 100% rename from projects/stargazer/plugins/other/snmp/snmp.h rename to projects/stargazer/plugins/other/smux/snmp.h diff --git a/projects/stargazer/plugins/other/smux/value2os.h b/projects/stargazer/plugins/other/smux/value2os.h new file mode 100644 index 00000000..830fb3b3 --- /dev/null +++ b/projects/stargazer/plugins/other/smux/value2os.h @@ -0,0 +1,18 @@ +#ifndef __VALUE_2_OS_H__ +#define __VALUE_2_OS_H__ + +template +bool ValueToOS(const T & value, ObjectSyntax * objectSyntax); + +template <> +inline +bool ValueToOS(const int & value, ObjectSyntax * objectSyntax) +{ +objectSyntax->present = ObjectSyntax_PR_simple; +SimpleSyntax_t * simpleSyntax = &objectSyntax->choice.simple; +simpleSyntax->present = SimpleSyntax_PR_number; +asn_long2INTEGER(&simpleSyntax->choice.number, value); +return true; +} + +#endif diff --git a/projects/stargazer/plugins/other/snmp/Makefile b/projects/stargazer/plugins/other/snmp/Makefile deleted file mode 100644 index d4339824..00000000 --- a/projects/stargazer/plugins/other/snmp/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.11 2008/12/04 17:21:14 faust Exp $ -############################################################################### - -include ../../../../../Makefile.conf - -LIBS += $(LIB_THREAD) - -PROG = mod_snmp_agent.so - -SRCS = snmp.cpp \ - sensors.cpp \ - asn1/DisplayString.c \ - asn1/PhysAddress.c \ - asn1/IfEntry.c \ - asn1/AtEntry.c \ - asn1/IpAddrEntry.c \ - asn1/IpRouteEntry.c \ - asn1/IpNetToMediaEntry.c \ - asn1/TcpConnEntry.c \ - asn1/UdpEntry.c \ - asn1/EgpNeighEntry.c \ - asn1/ObjectName.c \ - asn1/ObjectSyntax.c \ - asn1/SimpleSyntax.c \ - asn1/ApplicationSyntax.c \ - asn1/NetworkAddress.c \ - asn1/IpAddress.c \ - asn1/Counter.c \ - asn1/Gauge.c \ - asn1/TimeTicks.c \ - asn1/Opaque.c \ - asn1/Message.c \ - asn1/PDUs.c \ - asn1/GetRequest-PDU.c \ - asn1/GetNextRequest-PDU.c \ - asn1/GetResponse-PDU.c \ - asn1/SetRequest-PDU.c \ - asn1/PDU.c \ - asn1/Trap-PDU.c \ - asn1/VarBind.c \ - asn1/VarBindList.c \ - asn1/SMUX-PDUs.c \ - asn1/OpenPDU.c \ - asn1/SimpleOpen.c \ - asn1/ClosePDU.c \ - asn1/RReqPDU.c \ - asn1/RRspPDU.c \ - asn1/SOutPDU.c \ - asn1/ANY.c \ - asn1/BOOLEAN.c \ - asn1/INTEGER.c \ - asn1/NULL.c \ - asn1/NativeEnumerated.c \ - asn1/NativeInteger.c \ - asn1/OBJECT_IDENTIFIER.c \ - asn1/asn_SEQUENCE_OF.c \ - asn1/asn_SET_OF.c \ - asn1/constr_CHOICE.c \ - asn1/constr_SEQUENCE.c \ - asn1/constr_SEQUENCE_OF.c \ - asn1/constr_SET_OF.c \ - asn1/OCTET_STRING.c \ - asn1/BIT_STRING.c \ - asn1/asn_codecs_prim.c \ - asn1/ber_tlv_length.c \ - asn1/ber_tlv_tag.c \ - asn1/ber_decoder.c \ - asn1/der_encoder.c \ - asn1/constr_TYPE.c \ - asn1/constraints.c \ - asn1/xer_support.c \ - asn1/xer_decoder.c \ - asn1/xer_encoder.c \ - asn1/per_support.c \ - asn1/per_decoder.c \ - asn1/per_encoder.c - -STGLIBS = -lstgcommon - -CXXFLAGS += -Iasn1 - -include ../../Makefile.in - -.PHONY: asn1 - -asn1: - $(MAKE) -C asn1 asn1 -- 2.44.2