From 46b0747592074017ff0ea4b33d4a7194235886e5 Mon Sep 17 00:00:00 2001 From: Maksym Mamontov Date: Tue, 7 Jan 2020 19:35:08 +0200 Subject: [PATCH] Port to CMake, get rid of os_int.h. --- .gitignore | 21 +- CMakeLists.txt | 181 +++ cmake/modules/FindFBClient.cmake | 22 + cmake/modules/FindMNL.cmake | 22 + cmake/modules/FindMySQLConnector.cmake | 32 + cmake/modules/FindNFNetLink.cmake | 22 + cmake/modules/FindNFQueue.cmake | 22 + cmake/modules/FindPCap.cmake | 38 + cmake/modules/FindYAJL.cmake | 42 + include/stg/admin.h | 2 +- include/stg/admin_conf.h | 2 +- include/stg/ia_packets.h | 2 +- include/stg/message.h | 3 +- include/stg/os_int.h | 61 - include/stg/plugin.h | 2 +- include/stg/rad_packets.h | 2 +- include/stg/raw_ip_packet.h | 2 +- include/stg/rs_packets.h | 2 +- include/stg/service_conf.h | 2 +- include/stg/tariff.h | 5 +- include/stg/user.h | 2 +- include/stg/user_conf.h | 2 +- include/stg/user_ips.h | 2 +- include/stg/user_stat.h | 2 +- include/stg/user_traff.h | 2 +- lib/.placeholder | 0 libs/CMakeLists.txt | 49 + libs/common/CMakeLists.txt | 7 + {stglibs/common.lib => libs/common}/Makefile | 0 .../common.lib => libs/common}/blockio.cpp | 0 .../common.lib => libs/common}/common.cpp | 4 +- .../common}/include/stg/blockio.h | 0 .../common}/include/stg/common.h | 4 +- .../common.lib => libs/common}/strptime.cpp | 0 libs/conffiles/CMakeLists.txt | 5 + .../conffiles.lib => libs/conffiles}/Makefile | 0 .../conffiles}/conffiles.cpp | 4 +- .../conffiles}/include/stg/conffiles.h | 3 +- libs/crypto/CMakeLists.txt | 6 + {stglibs/crypto.lib => libs/crypto}/Makefile | 0 {stglibs/crypto.lib => libs/crypto}/ag_md5.c | 0 .../crypto.lib => libs/crypto}/bfstream.cpp | 0 .../crypto.lib => libs/crypto}/blowfish.c | 0 .../crypto}/include/stg/ag_md5.h | 3 +- .../crypto}/include/stg/bfstream.h | 0 .../crypto}/include/stg/blowfish.h | 4 +- libs/dotconfpp/CMakeLists.txt | 5 + .../dotconfpp.lib => libs/dotconfpp}/Makefile | 0 .../dotconfpp}/dotconfpp.cpp | 0 .../dotconfpp}/include/stg/dotconfpp.h | 2 - .../dotconfpp}/mempool.cpp | 0 .../dotconfpp}/mempool.h | 0 libs/ia/CMakeLists.txt | 7 + {stglibs/ia.lib => libs/ia}/Makefile | 0 {stglibs/ia.lib => libs/ia}/ia.cpp | 0 {stglibs/ia.lib => libs/ia}/include/stg/ia.h | 0 libs/ibpp/CMakeLists.txt | 5 + {stglibs/ibpp.lib => libs/ibpp}/Makefile | 0 {stglibs/ibpp.lib => libs/ibpp}/_dpb.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/_ibpp.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/_ibpp.h | 0 {stglibs/ibpp.lib => libs/ibpp}/_ibs.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/_rb.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/_spb.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/_tpb.cpp | 0 .../ibpp.lib => libs/ibpp}/all_in_one.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/array.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/blob.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/database.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/date.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/dbkey.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/events.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/exception.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/ibase.h | 0 {stglibs/ibpp.lib => libs/ibpp}/iberror.h | 0 .../ibpp.lib => libs/ibpp}/include/stg/ibpp.h | 2 +- {stglibs/ibpp.lib => libs/ibpp}/row.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/service.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/statement.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/time.cpp | 0 .../ibpp.lib => libs/ibpp}/transaction.cpp | 0 {stglibs/ibpp.lib => libs/ibpp}/user.cpp | 0 libs/json/CMakeLists.txt | 7 + {stglibs/json.lib => libs/json}/Makefile | 0 {stglibs/json.lib => libs/json}/generator.cpp | 0 .../json}/include/stg/json_generator.h | 0 .../json}/include/stg/json_parser.h | 0 {stglibs/json.lib => libs/json}/parser.cpp | 0 libs/logger/CMakeLists.txt | 5 + {stglibs/logger.lib => libs/logger}/Makefile | 0 .../logger}/include/stg/logger.h | 0 .../logger.lib => libs/logger}/logger.cpp | 0 libs/pinger/CMakeLists.txt | 7 + {stglibs/pinger.lib => libs/pinger}/Makefile | 0 .../pinger}/include/stg/pinger.h | 4 +- .../pinger.lib => libs/pinger}/pinger.cpp | 0 libs/scriptexecuter/CMakeLists.txt | 5 + .../scriptexecuter}/Makefile | 0 .../include/stg/scriptexecuter.h | 0 .../scriptexecuter}/scriptexecuter.c | 0 {stglibs/smux.lib => libs/smux}/ANY.c | 0 .../smux}/ApplicationSyntax.c | 0 {stglibs/smux.lib => libs/smux}/AtEntry.c | 0 {stglibs/smux.lib => libs/smux}/BIT_STRING.c | 0 {stglibs/smux.lib => libs/smux}/BOOLEAN.c | 0 libs/smux/CMakeLists.txt | 5 + {stglibs/smux.lib => libs/smux}/ClosePDU.c | 0 {stglibs/smux.lib => libs/smux}/Counter.c | 0 .../smux.lib => libs/smux}/DisplayString.c | 0 .../smux.lib => libs/smux}/EgpNeighEntry.c | 0 {stglibs/smux.lib => libs/smux}/Gauge.c | 0 .../smux}/GetNextRequest-PDU.c | 0 .../smux.lib => libs/smux}/GetRequest-PDU.c | 0 .../smux.lib => libs/smux}/GetResponse-PDU.c | 0 {stglibs/smux.lib => libs/smux}/INTEGER.c | 0 {stglibs/smux.lib => libs/smux}/IfEntry.c | 0 {stglibs/smux.lib => libs/smux}/IpAddrEntry.c | 0 {stglibs/smux.lib => libs/smux}/IpAddress.c | 0 .../smux}/IpNetToMediaEntry.c | 0 .../smux.lib => libs/smux}/IpRouteEntry.c | 0 {stglibs/smux.lib => libs/smux}/Makefile | 0 {stglibs/smux.lib => libs/smux}/Message.c | 0 {stglibs/smux.lib => libs/smux}/NULL.c | 0 .../smux.lib => libs/smux}/NativeEnumerated.c | 0 .../smux.lib => libs/smux}/NativeInteger.c | 0 .../smux.lib => libs/smux}/NetworkAddress.c | 0 .../smux}/OBJECT_IDENTIFIER.c | 0 .../smux.lib => libs/smux}/OCTET_STRING.c | 0 {stglibs/smux.lib => libs/smux}/ObjectName.c | 0 .../smux.lib => libs/smux}/ObjectSyntax.c | 0 {stglibs/smux.lib => libs/smux}/Opaque.c | 0 {stglibs/smux.lib => libs/smux}/OpenPDU.c | 0 {stglibs/smux.lib => libs/smux}/PDU.c | 0 {stglibs/smux.lib => libs/smux}/PDUs.c | 0 {stglibs/smux.lib => libs/smux}/PhysAddress.c | 0 .../smux.lib => libs/smux}/RFC1155-SMI.asn1 | 0 .../smux.lib => libs/smux}/RFC1157-SNMP.asn1 | 0 .../smux.lib => libs/smux}/RFC1213-MIB.asn1 | 0 {stglibs/smux.lib => libs/smux}/RReqPDU.c | 0 {stglibs/smux.lib => libs/smux}/RRspPDU.c | 0 {stglibs/smux.lib => libs/smux}/SMUX-PDUs.c | 0 {stglibs/smux.lib => libs/smux}/SMUX.asn1 | 0 {stglibs/smux.lib => libs/smux}/SOutPDU.c | 0 .../smux.lib => libs/smux}/SetRequest-PDU.c | 0 {stglibs/smux.lib => libs/smux}/SimpleOpen.c | 0 .../smux.lib => libs/smux}/SimpleSyntax.c | 0 .../smux.lib => libs/smux}/TcpConnEntry.c | 0 {stglibs/smux.lib => libs/smux}/TimeTicks.c | 0 {stglibs/smux.lib => libs/smux}/Trap-PDU.c | 0 {stglibs/smux.lib => libs/smux}/UdpEntry.c | 0 {stglibs/smux.lib => libs/smux}/VarBind.c | 0 {stglibs/smux.lib => libs/smux}/VarBindList.c | 0 .../smux.lib => libs/smux}/asn_SEQUENCE_OF.c | 0 {stglibs/smux.lib => libs/smux}/asn_SET_OF.c | 0 .../smux.lib => libs/smux}/asn_codecs_prim.c | 0 {stglibs/smux.lib => libs/smux}/ber_decoder.c | 0 .../smux.lib => libs/smux}/ber_tlv_length.c | 0 {stglibs/smux.lib => libs/smux}/ber_tlv_tag.c | 0 .../smux.lib => libs/smux}/constr_CHOICE.c | 0 .../smux.lib => libs/smux}/constr_SEQUENCE.c | 0 .../smux}/constr_SEQUENCE_OF.c | 0 .../smux.lib => libs/smux}/constr_SET_OF.c | 0 {stglibs/smux.lib => libs/smux}/constr_TYPE.c | 0 {stglibs/smux.lib => libs/smux}/constraints.c | 0 {stglibs/smux.lib => libs/smux}/der_encoder.c | 0 .../smux.lib => libs/smux}/include/stg/ANY.h | 0 .../smux}/include/stg/ApplicationSyntax.h | 0 .../smux}/include/stg/AtEntry.h | 0 .../smux}/include/stg/BIT_STRING.h | 0 .../smux}/include/stg/BOOLEAN.h | 0 .../smux}/include/stg/ClosePDU.h | 0 .../smux}/include/stg/Counter.h | 0 .../smux}/include/stg/DisplayString.h | 0 .../smux}/include/stg/EgpNeighEntry.h | 0 .../smux}/include/stg/Gauge.h | 0 .../smux}/include/stg/GetNextRequest-PDU.h | 0 .../smux}/include/stg/GetRequest-PDU.h | 0 .../smux}/include/stg/GetResponse-PDU.h | 0 .../smux}/include/stg/INTEGER.h | 0 .../smux}/include/stg/IfEntry.h | 0 .../smux}/include/stg/IpAddrEntry.h | 0 .../smux}/include/stg/IpAddress.h | 0 .../smux}/include/stg/IpNetToMediaEntry.h | 0 .../smux}/include/stg/IpRouteEntry.h | 0 .../smux}/include/stg/Message.h | 0 .../smux.lib => libs/smux}/include/stg/NULL.h | 0 .../smux}/include/stg/NativeEnumerated.h | 0 .../smux}/include/stg/NativeInteger.h | 0 .../smux}/include/stg/NetworkAddress.h | 0 .../smux}/include/stg/OBJECT_IDENTIFIER.h | 0 .../smux}/include/stg/OCTET_STRING.h | 0 .../smux}/include/stg/ObjectName.h | 0 .../smux}/include/stg/ObjectSyntax.h | 0 .../smux}/include/stg/Opaque.h | 0 .../smux}/include/stg/OpenPDU.h | 0 .../smux.lib => libs/smux}/include/stg/PDU.h | 0 .../smux.lib => libs/smux}/include/stg/PDUs.h | 0 .../smux}/include/stg/PhysAddress.h | 0 .../smux}/include/stg/RReqPDU.h | 0 .../smux}/include/stg/RRspPDU.h | 0 .../smux}/include/stg/SMUX-PDUs.h | 0 .../smux}/include/stg/SOutPDU.h | 0 .../smux}/include/stg/SetRequest-PDU.h | 0 .../smux}/include/stg/SimpleOpen.h | 0 .../smux}/include/stg/SimpleSyntax.h | 0 .../smux}/include/stg/TcpConnEntry.h | 0 .../smux}/include/stg/TimeTicks.h | 0 .../smux}/include/stg/Trap-PDU.h | 0 .../smux}/include/stg/UdpEntry.h | 0 .../smux}/include/stg/VarBind.h | 0 .../smux}/include/stg/VarBindList.h | 0 .../smux}/include/stg/asn_SEQUENCE_OF.h | 0 .../smux}/include/stg/asn_SET_OF.h | 0 .../smux}/include/stg/asn_application.h | 0 .../smux}/include/stg/asn_codecs.h | 0 .../smux}/include/stg/asn_codecs_prim.h | 0 .../smux}/include/stg/asn_internal.h | 0 .../smux}/include/stg/asn_system.h | 0 .../smux}/include/stg/ber_decoder.h | 0 .../smux}/include/stg/ber_tlv_length.h | 0 .../smux}/include/stg/ber_tlv_tag.h | 0 .../smux}/include/stg/constr_CHOICE.h | 0 .../smux}/include/stg/constr_SEQUENCE.h | 0 .../smux}/include/stg/constr_SEQUENCE_OF.h | 0 .../smux}/include/stg/constr_SET_OF.h | 0 .../smux}/include/stg/constr_TYPE.h | 0 .../smux}/include/stg/constraints.h | 0 .../smux}/include/stg/der_encoder.h | 0 .../smux}/include/stg/per_decoder.h | 0 .../smux}/include/stg/per_encoder.h | 0 .../smux}/include/stg/per_support.h | 0 .../smux}/include/stg/xer_decoder.h | 0 .../smux}/include/stg/xer_encoder.h | 0 .../smux}/include/stg/xer_support.h | 0 {stglibs/smux.lib => libs/smux}/per_decoder.c | 0 {stglibs/smux.lib => libs/smux}/per_encoder.c | 0 {stglibs/smux.lib => libs/smux}/per_support.c | 0 {stglibs/smux.lib => libs/smux}/xer_decoder.c | 0 {stglibs/smux.lib => libs/smux}/xer_encoder.c | 0 {stglibs/smux.lib => libs/smux}/xer_support.c | 0 libs/srvconf/CMakeLists.txt | 8 + .../srvconf.lib => libs/srvconf}/Makefile | 0 .../srvconf}/include/stg/servconf.h | 2 +- .../srvconf}/include/stg/servconf_types.h | 2 +- .../srvconf.lib => libs/srvconf}/netunit.cpp | 0 .../srvconf.lib => libs/srvconf}/netunit.h | 2 +- .../srvconf}/parsers/auth_by.cpp | 0 .../srvconf}/parsers/auth_by.h | 0 .../srvconf}/parsers/base.h | 0 .../srvconf}/parsers/chg_admin.cpp | 0 .../srvconf}/parsers/chg_admin.h | 0 .../srvconf}/parsers/chg_corp.cpp | 0 .../srvconf}/parsers/chg_corp.h | 0 .../srvconf}/parsers/chg_service.cpp | 0 .../srvconf}/parsers/chg_service.h | 0 .../srvconf}/parsers/chg_tariff.cpp | 0 .../srvconf}/parsers/chg_tariff.h | 0 .../srvconf}/parsers/chg_user.cpp | 0 .../srvconf}/parsers/chg_user.h | 0 .../srvconf}/parsers/get_admin.cpp | 0 .../srvconf}/parsers/get_admin.h | 0 .../srvconf}/parsers/get_container.h | 0 .../srvconf}/parsers/get_corp.cpp | 2 +- .../srvconf}/parsers/get_corp.h | 0 .../srvconf}/parsers/get_service.cpp | 2 +- .../srvconf}/parsers/get_service.h | 0 .../srvconf}/parsers/get_tariff.cpp | 2 +- .../srvconf}/parsers/get_tariff.h | 0 .../srvconf}/parsers/get_user.cpp | 0 .../srvconf}/parsers/get_user.h | 0 .../srvconf}/parsers/property.cpp | 0 .../srvconf}/parsers/property.h | 0 .../srvconf}/parsers/resetable_utils.h | 0 .../srvconf}/parsers/server_info.cpp | 0 .../srvconf}/parsers/server_info.h | 0 .../srvconf}/parsers/simple.cpp | 0 .../srvconf}/parsers/simple.h | 0 .../srvconf.lib => libs/srvconf}/servconf.cpp | 0 .../get_from_cvs | 0 .../make_tarball => make_tarball}/make.sh | 0 {projects/make_tarball => make_tarball}/mt.sh | 0 projects/libs/Makefile | 44 - projects/libs/build | 289 ----- projects/sgauthstress/Makefile | 76 -- projects/sgauthstress/build | 375 ------- projects/sgauthstress/main.cpp | 170 --- projects/sgauthstress/mkifs.sh | 16 - projects/sgauthstress/proto.cpp | 574 ---------- projects/sgauthstress/proto.h | 88 -- projects/sgauthstress/rmifs.sh | 16 - projects/sgauthstress/settings.cpp | 141 --- projects/sgauthstress/settings.h | 66 -- projects/sgauthstress/sgauthstress.conf | 34 - projects/sgauthstress/store_loader.cpp | 132 --- projects/sgauthstress/store_loader.h | 63 -- projects/sgauthstress/user.cpp | 98 -- projects/sgauthstress/user.h | 52 - projects/sgauthstress/users.1000 | 1000 ----------------- projects/sgconf_xml/Makefile | 104 -- projects/sgconf_xml/README.txt | 3 - projects/sgconf_xml/build | 218 ---- projects/sgconf_xml/main.cpp | 313 ------ projects/sgconf_xml/parser.cpp | 177 --- projects/sgconf_xml/request.h | 67 -- projects/sgconf_xml/stg_req | 1 - projects/sgconv/Makefile | 104 -- projects/sgconv/build | 381 ------- projects/sgconv/main.cpp | 444 -------- projects/sgconv/settings_impl.cpp | 156 --- projects/sgconv/settings_impl.h | 65 -- projects/sgconv/sgconv.conf | 124 -- projects/stargazer/CHANGES | 0 projects/stargazer/modules/.placeholder | 0 .../plugins/authorization/stress/Makefile | 18 - .../plugins/authorization/stress/stress.cpp | 390 ------- .../plugins/authorization/stress/stress.h | 168 --- .../plugins/capture/cap_debug/Makefile | 20 - .../plugins/capture/cap_debug/checksum.c | 47 - .../plugins/capture/cap_debug/checksum.h | 20 - .../plugins/capture/cap_debug/constants.h | 106 -- .../plugins/capture/cap_debug/debug_cap.cpp | 504 --------- .../plugins/capture/cap_debug/debug_cap.h | 91 -- .../stargazer/plugins/capture/cap_debug/ip.c | 55 - .../plugins/capture/cap_debug/libpal.h | 99 -- .../plugins/capture/cap_debug/packet.c | 88 -- .../stargazer/plugins/capture/cap_debug/tcp.c | 154 --- .../plugins/capture/cap_debug/types.h | 35 - .../plugins/capture/ipq_linux/Makefile | 18 - .../plugins/capture/ipq_linux/ipq_cap.cpp | 204 ---- .../plugins/capture/ipq_linux/ipq_cap.h | 82 -- .../plugins/capture/ipq_linux/libipq.c | 395 ------- .../plugins/capture/ipq_linux/libipq.h | 84 -- rlm_stg/CMakeLists.txt | 13 + {projects/rlm_stg => rlm_stg}/Makefile | 0 {projects/rlm_stg => rlm_stg}/build | 0 {projects/rlm_stg => rlm_stg}/conn.cpp | 0 {projects/rlm_stg => rlm_stg}/conn.h | 3 +- {projects/rlm_stg => rlm_stg}/iface.cpp | 0 {projects/rlm_stg => rlm_stg}/iface.h | 0 {projects/rlm_stg => rlm_stg}/radlog.c | 0 {projects/rlm_stg => rlm_stg}/radlog.h | 0 {projects/rlm_stg => rlm_stg}/rlm_stg.c | 0 {projects/rlm_stg => rlm_stg}/stg_client.cpp | 0 {projects/rlm_stg => rlm_stg}/stg_client.h | 3 +- {projects/rlm_stg => rlm_stg}/stgpair.h | 0 {projects/rlm_stg => rlm_stg}/types.h | 0 rscriptd/CMakeLists.txt | 10 + {projects/rscriptd => rscriptd}/Makefile | 0 {projects/rscriptd => rscriptd}/build | 0 {projects/rscriptd => rscriptd}/listener.cpp | 1 + {projects/rscriptd => rscriptd}/listener.h | 2 +- {projects/rscriptd => rscriptd}/main.cpp | 0 {projects/rscriptd => rscriptd}/pidfile.cpp | 0 {projects/rscriptd => rscriptd}/pidfile.h | 0 {projects/rscriptd => rscriptd}/rscriptd.conf | 0 {projects/sgauth => sgauth}/.gitignore | 0 sgauth/CMakeLists.txt | 10 + {projects/sgauth => sgauth}/Makefile | 0 {projects/sgauth => sgauth}/build | 0 {projects/sgauth => sgauth}/main.cpp | 0 {projects/sgauth => sgauth}/make_css.sh | 0 {projects/sgauth => sgauth}/settings_impl.cpp | 0 {projects/sgauth => sgauth}/settings_impl.h | 3 +- {projects/sgauth => sgauth}/sgauth.conf | 0 {projects/sgauth => sgauth}/sgauth.css | 0 {projects/sgauth => sgauth}/web.cpp | 0 {projects/sgauth => sgauth}/web.h | 0 {projects/sgconf => sgconf}/CHANGES | 0 sgconf/CMakeLists.txt | 12 + {projects/sgconf => sgconf}/Makefile | 0 {projects/sgconf => sgconf}/README.txt | 0 {projects/sgconf => sgconf}/TODO | 0 {projects/sgconf => sgconf}/action.h | 0 {projects/sgconf => sgconf}/actions.cpp | 0 {projects/sgconf => sgconf}/actions.h | 0 {projects/sgconf => sgconf}/admins.cpp | 2 +- {projects/sgconf => sgconf}/admins.h | 0 {projects/sgconf => sgconf}/api_action.cpp | 0 {projects/sgconf => sgconf}/api_action.h | 0 {projects/sgconf => sgconf}/build | 0 {projects/sgconf => sgconf}/config.h | 2 +- {projects/sgconf => sgconf}/corps.cpp | 0 {projects/sgconf => sgconf}/corps.h | 0 {projects/sgconf => sgconf}/info.cpp | 0 {projects/sgconf => sgconf}/info.h | 0 {projects/sgconf => sgconf}/main.cpp | 0 {projects/sgconf => sgconf}/options.cpp | 0 {projects/sgconf => sgconf}/options.h | 0 {projects/sgconf => sgconf}/parser_state.h | 0 {projects/sgconf => sgconf}/services.cpp | 0 {projects/sgconf => sgconf}/services.h | 0 {projects/sgconf => sgconf}/tariffs.cpp | 2 +- {projects/sgconf => sgconf}/tariffs.h | 0 {projects/sgconf => sgconf}/users.cpp | 0 {projects/sgconf => sgconf}/users.h | 0 {projects/sgconf => sgconf}/utils.h | 0 {projects/sgconf => sgconf}/xml.cpp | 0 {projects/sgconf => sgconf}/xml.h | 0 {projects/stargazer => stargazer}/BUGS | 0 {projects/sgconf_xml => stargazer}/CHANGES | 0 stargazer/CMakeLists.txt | 29 + {projects/stargazer => stargazer}/Makefile | 0 {projects/stargazer => stargazer}/README | 0 {projects/stargazer => stargazer}/TODO | 0 {projects/stargazer => stargazer}/actions.h | 0 .../stargazer => stargazer}/actions.inl.h | 0 .../stargazer => stargazer}/admin_impl.cpp | 0 .../stargazer => stargazer}/admin_impl.h | 2 +- .../stargazer => stargazer}/admins_impl.cpp | 0 .../stargazer => stargazer}/admins_impl.h | 0 {projects/stargazer => stargazer}/build | 0 .../stargazer => stargazer}/corps_impl.cpp | 0 .../stargazer => stargazer}/corps_impl.h | 0 .../stargazer => stargazer}/eventloop.cpp | 0 {projects/stargazer => stargazer}/eventloop.h | 0 .../inst/freebsd/etc/stargazer/OnChange | 0 .../inst/freebsd/etc/stargazer/OnConnect | 0 .../inst/freebsd/etc/stargazer/OnDisconnect | 0 .../inst/freebsd/etc/stargazer/OnUserAdd | 0 .../inst/freebsd/etc/stargazer/OnUserDel | 0 .../stargazer/conf-available.d/mod_ao.conf | 0 .../conf-available.d/mod_cap_bpf.conf | 0 .../conf-available.d/mod_cap_divert.conf | 0 .../conf-available.d/mod_cap_nf.conf | 0 .../stargazer/conf-available.d/mod_ia.conf | 0 .../stargazer/conf-available.d/mod_ping.conf | 0 .../conf-available.d/mod_radius.conf | 0 .../conf-available.d/mod_remote_script.conf | 0 .../stargazer/conf-available.d/mod_rpc.conf | 0 .../stargazer/conf-available.d/mod_sg.conf | 0 .../stargazer/conf-available.d/mod_smux.conf | 0 .../conf-available.d/store_files.conf | 0 .../conf-available.d/store_firebird.conf | 0 .../conf-available.d/store_mysql.conf | 0 .../conf-available.d/store_postgresql.conf | 0 .../etc/stargazer/conf-enabled.d/mod_ao.conf | 0 .../stargazer/conf-enabled.d/mod_cap_bpf.conf | 0 .../etc/stargazer/conf-enabled.d/mod_ia.conf | 0 .../stargazer/conf-enabled.d/mod_ping.conf | 0 .../etc/stargazer/conf-enabled.d/mod_sg.conf | 0 .../stargazer/conf-enabled.d/store_files.conf | 0 .../inst/freebsd/etc/stargazer/rules | 0 .../inst/freebsd/etc/stargazer/stargazer.conf | 0 .../inst/linux/etc/init.d/stargazer.gentoo | 0 .../inst/linux/etc/init.d/stargazer.suse.9.3 | 0 .../linux/etc/init.d/stargazer.ubuntu.7.10 | 0 .../inst/linux/etc/stargazer/OnChange | 0 .../inst/linux/etc/stargazer/OnConnect | 0 .../inst/linux/etc/stargazer/OnDisconnect | 0 .../inst/linux/etc/stargazer/OnUserAdd | 0 .../inst/linux/etc/stargazer/OnUserDel | 0 .../stargazer/conf-available.d/mod_ao.conf | 0 .../conf-available.d/mod_cap_ether.conf | 0 .../conf-available.d/mod_cap_ipq.conf | 0 .../conf-available.d/mod_cap_nf.conf | 0 .../stargazer/conf-available.d/mod_ia.conf | 0 .../stargazer/conf-available.d/mod_ping.conf | 0 .../conf-available.d/mod_radius.conf | 0 .../conf-available.d/mod_remote_script.conf | 0 .../stargazer/conf-available.d/mod_rpc.conf | 0 .../stargazer/conf-available.d/mod_sg.conf | 0 .../stargazer/conf-available.d/mod_smux.conf | 0 .../conf-available.d/store_files.conf | 0 .../conf-available.d/store_firebird.conf | 0 .../conf-available.d/store_mysql.conf | 0 .../conf-available.d/store_postgresql.conf | 0 .../etc/stargazer/conf-enabled.d/mod_ao.conf | 0 .../conf-enabled.d/mod_cap_ether.conf | 0 .../etc/stargazer/conf-enabled.d/mod_ia.conf | 0 .../stargazer/conf-enabled.d/mod_ping.conf | 0 .../etc/stargazer/conf-enabled.d/mod_sg.conf | 0 .../stargazer/conf-enabled.d/store_files.conf | 0 .../inst/linux/etc/stargazer/rules | 0 .../inst/linux/etc/stargazer/stargazer.conf | 0 .../inst/var/00-alter-01.postgresql.sql | 0 .../inst/var/00-alter-01.sql | 0 .../inst/var/00-base-00.postgresql.sql | 0 .../inst/var/00-base-00.sql | 0 .../inst/var/00-mysql-01.sql | 0 .../inst/var/01-alter-02.mysql.sql | 0 .../inst/var/01-alter-02.postgresql.sql | 0 .../inst/var/01-alter-02.sql | 0 .../inst/var/02-alter-03.postgresql.sql | 0 .../inst/var/02-alter-03.sql | 0 .../stargazer => stargazer}/inst/var/base.dia | Bin .../inst/var/stargazer/admins/admin.adm | 0 .../inst/var/stargazer/tariffs/tariff.tf | 0 .../inst/var/stargazer/users/test/conf | 0 .../inst/var/stargazer/users/test/stat | 0 {projects/stargazer => stargazer}/main.cpp | 0 {projects/stargazer => stargazer}/pidfile.cpp | 0 {projects/stargazer => stargazer}/pidfile.h | 0 .../stargazer => stargazer}/plugin_mgr.cpp | 0 .../stargazer => stargazer}/plugin_mgr.h | 0 .../stargazer => stargazer}/plugin_runner.cpp | 0 .../stargazer => stargazer}/plugin_runner.h | 2 +- stargazer/plugins/CMakeLists.txt | 5 + .../stargazer => stargazer}/plugins/Makefile | 0 .../plugins/Makefile.in | 0 .../plugins/authorization/CMakeLists.txt | 7 + .../plugins/authorization/ao/CMakeLists.txt | 5 + .../plugins/authorization/ao/Makefile | 0 .../plugins/authorization/ao/ao.cpp | 0 .../plugins/authorization/ao/ao.h | 0 .../authorization/inetaccess/CMakeLists.txt | 5 + .../plugins/authorization/inetaccess/Makefile | 0 .../authorization/inetaccess/inetaccess.cpp | 0 .../authorization/inetaccess/inetaccess.h | 2 +- stargazer/plugins/capture/CMakeLists.txt | 23 + .../plugins/capture/cap_nf/CMakeLists.txt | 5 + .../plugins/capture/cap_nf/Makefile | 0 .../plugins/capture/cap_nf/cap_nf.cpp | 0 .../plugins/capture/cap_nf/cap_nf.h | 2 +- .../capture/divert_freebsd/CMakeLists.txt | 5 + .../plugins/capture/divert_freebsd/Makefile | 0 .../capture/divert_freebsd/divert_cap.cpp | 0 .../capture/divert_freebsd/divert_cap.h | 0 .../capture/ether_freebsd/CMakeLists.txt | 5 + .../plugins/capture/ether_freebsd/Makefile | 0 .../capture/ether_freebsd/ether_cap.cpp | 0 .../plugins/capture/ether_freebsd/ether_cap.h | 2 +- .../capture/ether_linux/CMakeLists.txt | 5 + .../plugins/capture/ether_linux/Makefile | 0 .../plugins/capture/ether_linux/ether_cap.cpp | 0 .../plugins/capture/ether_linux/ether_cap.h | 0 .../plugins/capture/nfqueue/CMakeLists.txt | 9 + .../plugins/capture/nfqueue/Makefile | 0 .../plugins/capture/nfqueue/nfqueue.cpp | 0 .../plugins/capture/nfqueue/nfqueue.h | 0 stargazer/plugins/capture/pcap/CMakeLists.txt | 7 + .../plugins/capture/pcap/Makefile | 0 .../plugins/capture/pcap/pcap_cap.cpp | 0 .../plugins/capture/pcap/pcap_cap.h | 0 .../plugins/configuration/CMakeLists.txt | 7 + .../configuration/rpcconfig/CMakeLists.txt | 14 + .../plugins/configuration/rpcconfig/Makefile | 0 .../rpcconfig/admins_methods.cpp | 0 .../configuration/rpcconfig/admins_methods.h | 0 .../configuration/rpcconfig/info_methods.cpp | 0 .../configuration/rpcconfig/info_methods.h | 0 .../rpcconfig/messages_methods.cpp | 0 .../rpcconfig/messages_methods.h | 0 .../configuration/rpcconfig/rpcconfig.cpp | 0 .../configuration/rpcconfig/rpcconfig.h | 2 +- .../configuration/rpcconfig/tariff_helper.cpp | 0 .../configuration/rpcconfig/tariff_helper.h | 0 .../rpcconfig/tariffs_methods.cpp | 0 .../configuration/rpcconfig/tariffs_methods.h | 0 .../configuration/rpcconfig/user_helper.cpp | 0 .../configuration/rpcconfig/user_helper.h | 0 .../configuration/rpcconfig/users_methods.cpp | 0 .../configuration/rpcconfig/users_methods.h | 0 .../configuration/sgconfig/CMakeLists.txt | 18 + .../plugins/configuration/sgconfig/Makefile | 0 .../configuration/sgconfig/configproto.cpp | 0 .../configuration/sgconfig/configproto.h | 2 +- .../plugins/configuration/sgconfig/conn.cpp | 0 .../plugins/configuration/sgconfig/conn.h | 2 +- .../configuration/sgconfig/dumphelpers.h | 0 .../plugins/configuration/sgconfig/parser.cpp | 0 .../plugins/configuration/sgconfig/parser.h | 0 .../configuration/sgconfig/parser_admins.cpp | 0 .../configuration/sgconfig/parser_admins.h | 0 .../configuration/sgconfig/parser_auth_by.cpp | 0 .../configuration/sgconfig/parser_auth_by.h | 0 .../configuration/sgconfig/parser_message.cpp | 0 .../configuration/sgconfig/parser_message.h | 0 .../sgconfig/parser_server_info.cpp | 0 .../sgconfig/parser_server_info.h | 0 .../sgconfig/parser_services.cpp | 0 .../configuration/sgconfig/parser_services.h | 0 .../configuration/sgconfig/parser_tariffs.cpp | 0 .../configuration/sgconfig/parser_tariffs.h | 0 .../sgconfig/parser_user_info.cpp | 0 .../configuration/sgconfig/parser_user_info.h | 0 .../configuration/sgconfig/parser_users.cpp | 0 .../configuration/sgconfig/parser_users.h | 0 .../configuration/sgconfig/stgconfig.cpp | 0 .../configuration/sgconfig/stgconfig.h | 0 stargazer/plugins/other/CMakeLists.txt | 15 + stargazer/plugins/other/ping/CMakeLists.txt | 5 + .../plugins/other/ping/Makefile | 0 .../plugins/other/ping/ping.cpp | 0 .../plugins/other/ping/ping.h | 2 +- stargazer/plugins/other/radius/CMakeLists.txt | 9 + .../plugins/other/radius/Makefile | 0 .../plugins/other/radius/config.cpp | 0 .../plugins/other/radius/config.h | 3 +- .../plugins/other/radius/conn.cpp | 0 .../plugins/other/radius/conn.h | 0 .../plugins/other/radius/radius.cpp | 0 .../plugins/other/radius/radius.h | 2 +- .../plugins/other/rscript/CMakeLists.txt | 5 + .../plugins/other/rscript/Makefile | 0 .../plugins/other/rscript/nrmap_parser.cpp | 0 .../plugins/other/rscript/nrmap_parser.h | 3 +- .../plugins/other/rscript/rscript.cpp | 0 .../plugins/other/rscript/rscript.h | 2 +- .../plugins/other/rscript/send_functor.h | 3 +- .../plugins/other/rscript/ur_functor.h | 2 +- stargazer/plugins/other/smux/CMakeLists.txt | 10 + .../plugins/other/smux/Makefile | 0 .../plugins/other/smux/STG-MIB.mib | 0 .../plugins/other/smux/TODO | 0 .../plugins/other/smux/handlers.cpp | 0 .../plugins/other/smux/pen.h | 0 .../plugins/other/smux/sensors.cpp | 0 .../plugins/other/smux/sensors.h | 0 .../plugins/other/smux/smux.cpp | 0 .../plugins/other/smux/smux.h | 2 +- .../plugins/other/smux/tables.cpp | 0 .../plugins/other/smux/tables.h | 0 .../plugins/other/smux/types.cpp | 0 .../plugins/other/smux/types.h | 0 .../plugins/other/smux/utils.cpp | 0 .../plugins/other/smux/utils.h | 0 .../plugins/other/smux/value2os.h | 0 stargazer/plugins/store/CMakeLists.txt | 15 + stargazer/plugins/store/files/CMakeLists.txt | 5 + .../plugins/store/files/Makefile | 0 .../plugins/store/files/file_store.cpp | 0 .../plugins/store/files/file_store.h | 0 .../plugins/store/firebird/CMakeLists.txt | 14 + .../plugins/store/firebird/Makefile | 0 .../plugins/store/firebird/firebird_store.cpp | 0 .../plugins/store/firebird/firebird_store.h | 0 .../store/firebird/firebird_store_admins.cpp | 0 .../firebird/firebird_store_corporations.cpp | 0 .../firebird/firebird_store_messages.cpp | 0 .../firebird/firebird_store_services.cpp | 0 .../store/firebird/firebird_store_tariffs.cpp | 0 .../store/firebird/firebird_store_users.cpp | 0 .../store/firebird/firebird_store_utils.cpp | 0 stargazer/plugins/store/mysql/CMakeLists.txt | 7 + .../plugins/store/mysql/Makefile | 0 .../plugins/store/mysql/mysql_store.cpp | 3 +- .../plugins/store/mysql/mysql_store.h | 0 .../plugins/store/postgresql/CMakeLists.txt | 14 + .../plugins/store/postgresql/Makefile | 0 .../store/postgresql/postgresql_store.cpp | 0 .../store/postgresql/postgresql_store.h | 0 .../postgresql/postgresql_store_admins.cpp | 0 .../postgresql_store_corporations.cpp | 0 .../postgresql/postgresql_store_messages.cpp | 0 .../postgresql/postgresql_store_services.cpp | 0 .../postgresql/postgresql_store_tariffs.cpp | 0 .../postgresql/postgresql_store_users.cpp | 0 .../postgresql/postgresql_store_utils.cpp | 0 .../store/postgresql/postgresql_store_utils.h | 0 .../stargazer => stargazer}/scripts/clean_db | 0 .../stargazer => stargazer}/scripts/monitor | 0 .../scripts/shaper/OnConnect | 0 .../scripts/shaper/OnDisconnect | 0 .../scripts/shaper/Readme.txt | 0 .../scripts/shaper/shaper.sh | 0 .../scripts/shaper/shaper.stop.sh | 0 .../scripts/shaper_vpn_radius/Readme | 0 .../shaper_vpn_radius/firewall/firewall | 0 .../shaper_vpn_radius/freeradius/clients.conf | 0 .../shaper_vpn_radius/freeradius/radiusd.conf | 0 .../shaper_vpn_radius/ppp/ip-down.d/stg | 0 .../scripts/shaper_vpn_radius/ppp/ip-up.d/stg | 0 .../shaper_vpn_radius/ppp/pptpd-options | 0 .../scripts/shaper_vpn_radius/pptpd.conf | 0 .../shaper_vpn_radius/radiusclient/servers | 0 .../shaper_vpn_radius/stargazer/OnChange | 0 .../shaper_vpn_radius/stargazer/OnConnect | 0 .../shaper_vpn_radius/stargazer/OnDisconnect | 0 .../shaper_vpn_radius/stargazer/OnUserAdd | 0 .../shaper_vpn_radius/stargazer/OnUserDel | 0 .../scripts/shaper_vpn_radius/stargazer/rules | 0 .../stargazer/stargazer.conf | 0 .../stargazer => stargazer}/services_impl.cpp | 0 .../stargazer => stargazer}/services_impl.h | 0 .../stargazer => stargazer}/settings_impl.cpp | 1 + .../stargazer => stargazer}/settings_impl.h | 0 .../stargazer => stargazer}/stg_timer.cpp | 0 {projects/stargazer => stargazer}/stg_timer.h | 0 .../stargazer => stargazer}/store_loader.cpp | 0 .../stargazer => stargazer}/store_loader.h | 0 .../stargazer => stargazer}/tariff_impl.cpp | 0 .../stargazer => stargazer}/tariff_impl.h | 2 +- .../stargazer => stargazer}/tariffs_impl.cpp | 0 .../stargazer => stargazer}/tariffs_impl.h | 0 .../traffcounter_impl.cpp | 0 .../traffcounter_impl.h | 2 +- .../stargazer => stargazer}/user_impl.cpp | 0 {projects/stargazer => stargazer}/user_impl.h | 2 +- .../stargazer => stargazer}/user_property.cpp | 0 .../stargazer => stargazer}/users_impl.cpp | 0 .../stargazer => stargazer}/users_impl.h | 4 +- stglibs/Makefile | 20 - stglibs/Makefile.in | 74 -- stglibs/common.lib/common.bpf | 9 - stglibs/common.lib/common.bpr | 130 --- stglibs/crypto.lib/crypto.bpf | 9 - stglibs/crypto.lib/crypto.bpr | 144 --- stglibs/ia.lib/ia.bpf | 9 - stglibs/ia.lib/ia.bpr | 129 --- tests/CMakeLists.txt | 25 + tests/test_bfstream.cpp | 2 +- tests/test_conffiles.cpp | 2 +- tests/test_raw_ip.cpp | 2 +- tests/testtariffs.h | 2 +- 704 files changed, 891 insertions(+), 8655 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/modules/FindFBClient.cmake create mode 100644 cmake/modules/FindMNL.cmake create mode 100644 cmake/modules/FindMySQLConnector.cmake create mode 100644 cmake/modules/FindNFNetLink.cmake create mode 100644 cmake/modules/FindNFQueue.cmake create mode 100644 cmake/modules/FindPCap.cmake create mode 100644 cmake/modules/FindYAJL.cmake delete mode 100644 include/stg/os_int.h delete mode 100644 lib/.placeholder create mode 100644 libs/CMakeLists.txt create mode 100644 libs/common/CMakeLists.txt rename {stglibs/common.lib => libs/common}/Makefile (100%) rename {stglibs/common.lib => libs/common}/blockio.cpp (100%) rename {stglibs/common.lib => libs/common}/common.cpp (99%) rename {stglibs/common.lib => libs/common}/include/stg/blockio.h (100%) rename {stglibs/common.lib => libs/common}/include/stg/common.h (99%) rename {stglibs/common.lib => libs/common}/strptime.cpp (100%) create mode 100644 libs/conffiles/CMakeLists.txt rename {stglibs/conffiles.lib => libs/conffiles}/Makefile (100%) rename {stglibs/conffiles.lib => libs/conffiles}/conffiles.cpp (98%) rename {stglibs/conffiles.lib => libs/conffiles}/include/stg/conffiles.h (99%) create mode 100644 libs/crypto/CMakeLists.txt rename {stglibs/crypto.lib => libs/crypto}/Makefile (100%) rename {stglibs/crypto.lib => libs/crypto}/ag_md5.c (100%) rename {stglibs/crypto.lib => libs/crypto}/bfstream.cpp (100%) rename {stglibs/crypto.lib => libs/crypto}/blowfish.c (100%) rename {stglibs/crypto.lib => libs/crypto}/include/stg/ag_md5.h (96%) rename {stglibs/crypto.lib => libs/crypto}/include/stg/bfstream.h (100%) rename {stglibs/crypto.lib => libs/crypto}/include/stg/blowfish.h (96%) create mode 100644 libs/dotconfpp/CMakeLists.txt rename {stglibs/dotconfpp.lib => libs/dotconfpp}/Makefile (100%) rename {stglibs/dotconfpp.lib => libs/dotconfpp}/dotconfpp.cpp (100%) rename {stglibs/dotconfpp.lib => libs/dotconfpp}/include/stg/dotconfpp.h (99%) rename {stglibs/dotconfpp.lib => libs/dotconfpp}/mempool.cpp (100%) rename {stglibs/dotconfpp.lib => libs/dotconfpp}/mempool.h (100%) create mode 100644 libs/ia/CMakeLists.txt rename {stglibs/ia.lib => libs/ia}/Makefile (100%) rename {stglibs/ia.lib => libs/ia}/ia.cpp (100%) rename {stglibs/ia.lib => libs/ia}/include/stg/ia.h (100%) create mode 100644 libs/ibpp/CMakeLists.txt rename {stglibs/ibpp.lib => libs/ibpp}/Makefile (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_dpb.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_ibpp.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_ibpp.h (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_ibs.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_rb.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_spb.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/_tpb.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/all_in_one.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/array.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/blob.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/database.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/date.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/dbkey.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/events.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/exception.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/ibase.h (100%) rename {stglibs/ibpp.lib => libs/ibpp}/iberror.h (100%) rename {stglibs/ibpp.lib => libs/ibpp}/include/stg/ibpp.h (97%) rename {stglibs/ibpp.lib => libs/ibpp}/row.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/service.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/statement.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/time.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/transaction.cpp (100%) rename {stglibs/ibpp.lib => libs/ibpp}/user.cpp (100%) create mode 100644 libs/json/CMakeLists.txt rename {stglibs/json.lib => libs/json}/Makefile (100%) rename {stglibs/json.lib => libs/json}/generator.cpp (100%) rename {stglibs/json.lib => libs/json}/include/stg/json_generator.h (100%) rename {stglibs/json.lib => libs/json}/include/stg/json_parser.h (100%) rename {stglibs/json.lib => libs/json}/parser.cpp (100%) create mode 100644 libs/logger/CMakeLists.txt rename {stglibs/logger.lib => libs/logger}/Makefile (100%) rename {stglibs/logger.lib => libs/logger}/include/stg/logger.h (100%) rename {stglibs/logger.lib => libs/logger}/logger.cpp (100%) create mode 100644 libs/pinger/CMakeLists.txt rename {stglibs/pinger.lib => libs/pinger}/Makefile (100%) rename {stglibs/pinger.lib => libs/pinger}/include/stg/pinger.h (97%) rename {stglibs/pinger.lib => libs/pinger}/pinger.cpp (100%) create mode 100644 libs/scriptexecuter/CMakeLists.txt rename {stglibs/scriptexecuter.lib => libs/scriptexecuter}/Makefile (100%) rename {stglibs/scriptexecuter.lib => libs/scriptexecuter}/include/stg/scriptexecuter.h (100%) rename {stglibs/scriptexecuter.lib => libs/scriptexecuter}/scriptexecuter.c (100%) rename {stglibs/smux.lib => libs/smux}/ANY.c (100%) rename {stglibs/smux.lib => libs/smux}/ApplicationSyntax.c (100%) rename {stglibs/smux.lib => libs/smux}/AtEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/BIT_STRING.c (100%) rename {stglibs/smux.lib => libs/smux}/BOOLEAN.c (100%) create mode 100644 libs/smux/CMakeLists.txt rename {stglibs/smux.lib => libs/smux}/ClosePDU.c (100%) rename {stglibs/smux.lib => libs/smux}/Counter.c (100%) rename {stglibs/smux.lib => libs/smux}/DisplayString.c (100%) rename {stglibs/smux.lib => libs/smux}/EgpNeighEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/Gauge.c (100%) rename {stglibs/smux.lib => libs/smux}/GetNextRequest-PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/GetRequest-PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/GetResponse-PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/INTEGER.c (100%) rename {stglibs/smux.lib => libs/smux}/IfEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/IpAddrEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/IpAddress.c (100%) rename {stglibs/smux.lib => libs/smux}/IpNetToMediaEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/IpRouteEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/Makefile (100%) rename {stglibs/smux.lib => libs/smux}/Message.c (100%) rename {stglibs/smux.lib => libs/smux}/NULL.c (100%) rename {stglibs/smux.lib => libs/smux}/NativeEnumerated.c (100%) rename {stglibs/smux.lib => libs/smux}/NativeInteger.c (100%) rename {stglibs/smux.lib => libs/smux}/NetworkAddress.c (100%) rename {stglibs/smux.lib => libs/smux}/OBJECT_IDENTIFIER.c (100%) rename {stglibs/smux.lib => libs/smux}/OCTET_STRING.c (100%) rename {stglibs/smux.lib => libs/smux}/ObjectName.c (100%) rename {stglibs/smux.lib => libs/smux}/ObjectSyntax.c (100%) rename {stglibs/smux.lib => libs/smux}/Opaque.c (100%) rename {stglibs/smux.lib => libs/smux}/OpenPDU.c (100%) rename {stglibs/smux.lib => libs/smux}/PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/PDUs.c (100%) rename {stglibs/smux.lib => libs/smux}/PhysAddress.c (100%) rename {stglibs/smux.lib => libs/smux}/RFC1155-SMI.asn1 (100%) rename {stglibs/smux.lib => libs/smux}/RFC1157-SNMP.asn1 (100%) rename {stglibs/smux.lib => libs/smux}/RFC1213-MIB.asn1 (100%) rename {stglibs/smux.lib => libs/smux}/RReqPDU.c (100%) rename {stglibs/smux.lib => libs/smux}/RRspPDU.c (100%) rename {stglibs/smux.lib => libs/smux}/SMUX-PDUs.c (100%) rename {stglibs/smux.lib => libs/smux}/SMUX.asn1 (100%) rename {stglibs/smux.lib => libs/smux}/SOutPDU.c (100%) rename {stglibs/smux.lib => libs/smux}/SetRequest-PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/SimpleOpen.c (100%) rename {stglibs/smux.lib => libs/smux}/SimpleSyntax.c (100%) rename {stglibs/smux.lib => libs/smux}/TcpConnEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/TimeTicks.c (100%) rename {stglibs/smux.lib => libs/smux}/Trap-PDU.c (100%) rename {stglibs/smux.lib => libs/smux}/UdpEntry.c (100%) rename {stglibs/smux.lib => libs/smux}/VarBind.c (100%) rename {stglibs/smux.lib => libs/smux}/VarBindList.c (100%) rename {stglibs/smux.lib => libs/smux}/asn_SEQUENCE_OF.c (100%) rename {stglibs/smux.lib => libs/smux}/asn_SET_OF.c (100%) rename {stglibs/smux.lib => libs/smux}/asn_codecs_prim.c (100%) rename {stglibs/smux.lib => libs/smux}/ber_decoder.c (100%) rename {stglibs/smux.lib => libs/smux}/ber_tlv_length.c (100%) rename {stglibs/smux.lib => libs/smux}/ber_tlv_tag.c (100%) rename {stglibs/smux.lib => libs/smux}/constr_CHOICE.c (100%) rename {stglibs/smux.lib => libs/smux}/constr_SEQUENCE.c (100%) rename {stglibs/smux.lib => libs/smux}/constr_SEQUENCE_OF.c (100%) rename {stglibs/smux.lib => libs/smux}/constr_SET_OF.c (100%) rename {stglibs/smux.lib => libs/smux}/constr_TYPE.c (100%) rename {stglibs/smux.lib => libs/smux}/constraints.c (100%) rename {stglibs/smux.lib => libs/smux}/der_encoder.c (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ANY.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ApplicationSyntax.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/AtEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/BIT_STRING.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/BOOLEAN.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ClosePDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/Counter.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/DisplayString.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/EgpNeighEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/Gauge.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/GetNextRequest-PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/GetRequest-PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/GetResponse-PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/INTEGER.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/IfEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/IpAddrEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/IpAddress.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/IpNetToMediaEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/IpRouteEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/Message.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/NULL.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/NativeEnumerated.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/NativeInteger.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/NetworkAddress.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/OBJECT_IDENTIFIER.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/OCTET_STRING.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ObjectName.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ObjectSyntax.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/Opaque.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/OpenPDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/PDUs.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/PhysAddress.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/RReqPDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/RRspPDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/SMUX-PDUs.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/SOutPDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/SetRequest-PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/SimpleOpen.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/SimpleSyntax.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/TcpConnEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/TimeTicks.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/Trap-PDU.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/UdpEntry.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/VarBind.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/VarBindList.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_SEQUENCE_OF.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_SET_OF.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_application.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_codecs.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_codecs_prim.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_internal.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/asn_system.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ber_decoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ber_tlv_length.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/ber_tlv_tag.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constr_CHOICE.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constr_SEQUENCE.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constr_SEQUENCE_OF.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constr_SET_OF.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constr_TYPE.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/constraints.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/der_encoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/per_decoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/per_encoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/per_support.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/xer_decoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/xer_encoder.h (100%) rename {stglibs/smux.lib => libs/smux}/include/stg/xer_support.h (100%) rename {stglibs/smux.lib => libs/smux}/per_decoder.c (100%) rename {stglibs/smux.lib => libs/smux}/per_encoder.c (100%) rename {stglibs/smux.lib => libs/smux}/per_support.c (100%) rename {stglibs/smux.lib => libs/smux}/xer_decoder.c (100%) rename {stglibs/smux.lib => libs/smux}/xer_encoder.c (100%) rename {stglibs/smux.lib => libs/smux}/xer_support.c (100%) create mode 100644 libs/srvconf/CMakeLists.txt rename {stglibs/srvconf.lib => libs/srvconf}/Makefile (100%) rename {stglibs/srvconf.lib => libs/srvconf}/include/stg/servconf.h (99%) rename {stglibs/srvconf.lib => libs/srvconf}/include/stg/servconf_types.h (98%) rename {stglibs/srvconf.lib => libs/srvconf}/netunit.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/netunit.h (98%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/auth_by.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/auth_by.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/base.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_admin.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_admin.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_corp.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_corp.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_service.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_service.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_tariff.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_tariff.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_user.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/chg_user.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_admin.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_admin.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_container.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_corp.cpp (98%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_corp.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_service.cpp (99%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_service.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_tariff.cpp (99%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_tariff.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_user.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/get_user.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/property.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/property.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/resetable_utils.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/server_info.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/server_info.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/simple.cpp (100%) rename {stglibs/srvconf.lib => libs/srvconf}/parsers/simple.h (100%) rename {stglibs/srvconf.lib => libs/srvconf}/servconf.cpp (100%) rename {projects/make_tarball => make_tarball}/get_from_cvs (100%) rename {projects/make_tarball => make_tarball}/make.sh (100%) rename {projects/make_tarball => make_tarball}/mt.sh (100%) delete mode 100644 projects/libs/Makefile delete mode 100755 projects/libs/build delete mode 100644 projects/sgauthstress/Makefile delete mode 100755 projects/sgauthstress/build delete mode 100644 projects/sgauthstress/main.cpp delete mode 100755 projects/sgauthstress/mkifs.sh delete mode 100644 projects/sgauthstress/proto.cpp delete mode 100644 projects/sgauthstress/proto.h delete mode 100755 projects/sgauthstress/rmifs.sh delete mode 100644 projects/sgauthstress/settings.cpp delete mode 100644 projects/sgauthstress/settings.h delete mode 100644 projects/sgauthstress/sgauthstress.conf delete mode 100644 projects/sgauthstress/store_loader.cpp delete mode 100644 projects/sgauthstress/store_loader.h delete mode 100644 projects/sgauthstress/user.cpp delete mode 100644 projects/sgauthstress/user.h delete mode 100644 projects/sgauthstress/users.1000 delete mode 100644 projects/sgconf_xml/Makefile delete mode 100644 projects/sgconf_xml/README.txt delete mode 100755 projects/sgconf_xml/build delete mode 100644 projects/sgconf_xml/main.cpp delete mode 100644 projects/sgconf_xml/parser.cpp delete mode 100644 projects/sgconf_xml/request.h delete mode 100644 projects/sgconf_xml/stg_req delete mode 100644 projects/sgconv/Makefile delete mode 100755 projects/sgconv/build delete mode 100644 projects/sgconv/main.cpp delete mode 100644 projects/sgconv/settings_impl.cpp delete mode 100644 projects/sgconv/settings_impl.h delete mode 100644 projects/sgconv/sgconv.conf delete mode 100644 projects/stargazer/CHANGES delete mode 100644 projects/stargazer/modules/.placeholder delete mode 100644 projects/stargazer/plugins/authorization/stress/Makefile delete mode 100644 projects/stargazer/plugins/authorization/stress/stress.cpp delete mode 100644 projects/stargazer/plugins/authorization/stress/stress.h delete mode 100644 projects/stargazer/plugins/capture/cap_debug/Makefile delete mode 100644 projects/stargazer/plugins/capture/cap_debug/checksum.c delete mode 100644 projects/stargazer/plugins/capture/cap_debug/checksum.h delete mode 100644 projects/stargazer/plugins/capture/cap_debug/constants.h delete mode 100644 projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp delete mode 100644 projects/stargazer/plugins/capture/cap_debug/debug_cap.h delete mode 100644 projects/stargazer/plugins/capture/cap_debug/ip.c delete mode 100644 projects/stargazer/plugins/capture/cap_debug/libpal.h delete mode 100644 projects/stargazer/plugins/capture/cap_debug/packet.c delete mode 100644 projects/stargazer/plugins/capture/cap_debug/tcp.c delete mode 100644 projects/stargazer/plugins/capture/cap_debug/types.h delete mode 100644 projects/stargazer/plugins/capture/ipq_linux/Makefile delete mode 100644 projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp delete mode 100644 projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h delete mode 100644 projects/stargazer/plugins/capture/ipq_linux/libipq.c delete mode 100644 projects/stargazer/plugins/capture/ipq_linux/libipq.h create mode 100644 rlm_stg/CMakeLists.txt rename {projects/rlm_stg => rlm_stg}/Makefile (100%) rename {projects/rlm_stg => rlm_stg}/build (100%) rename {projects/rlm_stg => rlm_stg}/conn.cpp (100%) rename {projects/rlm_stg => rlm_stg}/conn.h (98%) rename {projects/rlm_stg => rlm_stg}/iface.cpp (100%) rename {projects/rlm_stg => rlm_stg}/iface.h (100%) rename {projects/rlm_stg => rlm_stg}/radlog.c (100%) rename {projects/rlm_stg => rlm_stg}/radlog.h (100%) rename {projects/rlm_stg => rlm_stg}/rlm_stg.c (100%) rename {projects/rlm_stg => rlm_stg}/stg_client.cpp (100%) rename {projects/rlm_stg => rlm_stg}/stg_client.h (98%) rename {projects/rlm_stg => rlm_stg}/stgpair.h (100%) rename {projects/rlm_stg => rlm_stg}/types.h (100%) create mode 100644 rscriptd/CMakeLists.txt rename {projects/rscriptd => rscriptd}/Makefile (100%) rename {projects/rscriptd => rscriptd}/build (100%) rename {projects/rscriptd => rscriptd}/listener.cpp (99%) rename {projects/rscriptd => rscriptd}/listener.h (99%) rename {projects/rscriptd => rscriptd}/main.cpp (100%) rename {projects/rscriptd => rscriptd}/pidfile.cpp (100%) rename {projects/rscriptd => rscriptd}/pidfile.h (100%) rename {projects/rscriptd => rscriptd}/rscriptd.conf (100%) rename {projects/sgauth => sgauth}/.gitignore (100%) create mode 100644 sgauth/CMakeLists.txt rename {projects/sgauth => sgauth}/Makefile (100%) rename {projects/sgauth => sgauth}/build (100%) rename {projects/sgauth => sgauth}/main.cpp (100%) rename {projects/sgauth => sgauth}/make_css.sh (100%) rename {projects/sgauth => sgauth}/settings_impl.cpp (100%) rename {projects/sgauth => sgauth}/settings_impl.h (98%) rename {projects/sgauth => sgauth}/sgauth.conf (100%) rename {projects/sgauth => sgauth}/sgauth.css (100%) rename {projects/sgauth => sgauth}/web.cpp (100%) rename {projects/sgauth => sgauth}/web.h (100%) rename {projects/sgconf => sgconf}/CHANGES (100%) create mode 100644 sgconf/CMakeLists.txt rename {projects/sgconf => sgconf}/Makefile (100%) rename {projects/sgconf => sgconf}/README.txt (100%) rename {projects/sgconf => sgconf}/TODO (100%) rename {projects/sgconf => sgconf}/action.h (100%) rename {projects/sgconf => sgconf}/actions.cpp (100%) rename {projects/sgconf => sgconf}/actions.h (100%) rename {projects/sgconf => sgconf}/admins.cpp (99%) rename {projects/sgconf => sgconf}/admins.h (100%) rename {projects/sgconf => sgconf}/api_action.cpp (100%) rename {projects/sgconf => sgconf}/api_action.h (100%) rename {projects/sgconf => sgconf}/build (100%) rename {projects/sgconf => sgconf}/config.h (99%) rename {projects/sgconf => sgconf}/corps.cpp (100%) rename {projects/sgconf => sgconf}/corps.h (100%) rename {projects/sgconf => sgconf}/info.cpp (100%) rename {projects/sgconf => sgconf}/info.h (100%) rename {projects/sgconf => sgconf}/main.cpp (100%) rename {projects/sgconf => sgconf}/options.cpp (100%) rename {projects/sgconf => sgconf}/options.h (100%) rename {projects/sgconf => sgconf}/parser_state.h (100%) rename {projects/sgconf => sgconf}/services.cpp (100%) rename {projects/sgconf => sgconf}/services.h (100%) rename {projects/sgconf => sgconf}/tariffs.cpp (99%) rename {projects/sgconf => sgconf}/tariffs.h (100%) rename {projects/sgconf => sgconf}/users.cpp (100%) rename {projects/sgconf => sgconf}/users.h (100%) rename {projects/sgconf => sgconf}/utils.h (100%) rename {projects/sgconf => sgconf}/xml.cpp (100%) rename {projects/sgconf => sgconf}/xml.h (100%) rename {projects/stargazer => stargazer}/BUGS (100%) rename {projects/sgconf_xml => stargazer}/CHANGES (100%) create mode 100644 stargazer/CMakeLists.txt rename {projects/stargazer => stargazer}/Makefile (100%) rename {projects/stargazer => stargazer}/README (100%) rename {projects/stargazer => stargazer}/TODO (100%) rename {projects/stargazer => stargazer}/actions.h (100%) rename {projects/stargazer => stargazer}/actions.inl.h (100%) rename {projects/stargazer => stargazer}/admin_impl.cpp (100%) rename {projects/stargazer => stargazer}/admin_impl.h (98%) rename {projects/stargazer => stargazer}/admins_impl.cpp (100%) rename {projects/stargazer => stargazer}/admins_impl.h (100%) rename {projects/stargazer => stargazer}/build (100%) rename {projects/stargazer => stargazer}/corps_impl.cpp (100%) rename {projects/stargazer => stargazer}/corps_impl.h (100%) rename {projects/stargazer => stargazer}/eventloop.cpp (100%) rename {projects/stargazer => stargazer}/eventloop.h (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/OnChange (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/OnConnect (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/OnDisconnect (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/OnUserAdd (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/OnUserDel (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/rules (100%) rename {projects/stargazer => stargazer}/inst/freebsd/etc/stargazer/stargazer.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/init.d/stargazer.gentoo (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/init.d/stargazer.suse.9.3 (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/init.d/stargazer.ubuntu.7.10 (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/OnChange (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/OnConnect (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/OnDisconnect (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/OnUserAdd (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/OnUserDel (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/store_files.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/rules (100%) rename {projects/stargazer => stargazer}/inst/linux/etc/stargazer/stargazer.conf (100%) rename {projects/stargazer => stargazer}/inst/var/00-alter-01.postgresql.sql (100%) rename {projects/stargazer => stargazer}/inst/var/00-alter-01.sql (100%) rename {projects/stargazer => stargazer}/inst/var/00-base-00.postgresql.sql (100%) rename {projects/stargazer => stargazer}/inst/var/00-base-00.sql (100%) rename {projects/stargazer => stargazer}/inst/var/00-mysql-01.sql (100%) rename {projects/stargazer => stargazer}/inst/var/01-alter-02.mysql.sql (100%) rename {projects/stargazer => stargazer}/inst/var/01-alter-02.postgresql.sql (100%) rename {projects/stargazer => stargazer}/inst/var/01-alter-02.sql (100%) rename {projects/stargazer => stargazer}/inst/var/02-alter-03.postgresql.sql (100%) rename {projects/stargazer => stargazer}/inst/var/02-alter-03.sql (100%) rename {projects/stargazer => stargazer}/inst/var/base.dia (100%) rename {projects/stargazer => stargazer}/inst/var/stargazer/admins/admin.adm (100%) rename {projects/stargazer => stargazer}/inst/var/stargazer/tariffs/tariff.tf (100%) rename {projects/stargazer => stargazer}/inst/var/stargazer/users/test/conf (100%) rename {projects/stargazer => stargazer}/inst/var/stargazer/users/test/stat (100%) rename {projects/stargazer => stargazer}/main.cpp (100%) rename {projects/stargazer => stargazer}/pidfile.cpp (100%) rename {projects/stargazer => stargazer}/pidfile.h (100%) rename {projects/stargazer => stargazer}/plugin_mgr.cpp (100%) rename {projects/stargazer => stargazer}/plugin_mgr.h (100%) rename {projects/stargazer => stargazer}/plugin_runner.cpp (100%) rename {projects/stargazer => stargazer}/plugin_runner.h (99%) create mode 100644 stargazer/plugins/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/Makefile.in (100%) create mode 100644 stargazer/plugins/authorization/CMakeLists.txt create mode 100644 stargazer/plugins/authorization/ao/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/authorization/ao/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/authorization/ao/ao.cpp (100%) rename {projects/stargazer => stargazer}/plugins/authorization/ao/ao.h (100%) create mode 100644 stargazer/plugins/authorization/inetaccess/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/authorization/inetaccess/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/authorization/inetaccess/inetaccess.cpp (100%) rename {projects/stargazer => stargazer}/plugins/authorization/inetaccess/inetaccess.h (99%) create mode 100644 stargazer/plugins/capture/CMakeLists.txt create mode 100644 stargazer/plugins/capture/cap_nf/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/cap_nf/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/cap_nf/cap_nf.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/cap_nf/cap_nf.h (99%) create mode 100644 stargazer/plugins/capture/divert_freebsd/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/divert_freebsd/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/divert_freebsd/divert_cap.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/divert_freebsd/divert_cap.h (100%) create mode 100644 stargazer/plugins/capture/ether_freebsd/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/ether_freebsd/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/ether_freebsd/ether_cap.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/ether_freebsd/ether_cap.h (99%) create mode 100644 stargazer/plugins/capture/ether_linux/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/ether_linux/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/ether_linux/ether_cap.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/ether_linux/ether_cap.h (100%) create mode 100644 stargazer/plugins/capture/nfqueue/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/nfqueue/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/nfqueue/nfqueue.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/nfqueue/nfqueue.h (100%) create mode 100644 stargazer/plugins/capture/pcap/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/capture/pcap/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/capture/pcap/pcap_cap.cpp (100%) rename {projects/stargazer => stargazer}/plugins/capture/pcap/pcap_cap.h (100%) create mode 100644 stargazer/plugins/configuration/CMakeLists.txt create mode 100644 stargazer/plugins/configuration/rpcconfig/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/admins_methods.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/admins_methods.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/info_methods.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/info_methods.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/messages_methods.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/messages_methods.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/rpcconfig.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/rpcconfig.h (99%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/tariff_helper.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/tariff_helper.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/tariffs_methods.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/tariffs_methods.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/user_helper.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/user_helper.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/users_methods.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/rpcconfig/users_methods.h (100%) create mode 100644 stargazer/plugins/configuration/sgconfig/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/configproto.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/configproto.h (99%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/conn.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/conn.h (99%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/dumphelpers.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_admins.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_admins.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_auth_by.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_auth_by.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_message.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_message.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_server_info.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_server_info.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_services.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_services.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_tariffs.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_tariffs.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_user_info.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_user_info.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_users.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/parser_users.h (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/stgconfig.cpp (100%) rename {projects/stargazer => stargazer}/plugins/configuration/sgconfig/stgconfig.h (100%) create mode 100644 stargazer/plugins/other/CMakeLists.txt create mode 100644 stargazer/plugins/other/ping/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/other/ping/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/other/ping/ping.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/ping/ping.h (99%) create mode 100644 stargazer/plugins/other/radius/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/other/radius/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/other/radius/config.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/radius/config.h (99%) rename {projects/stargazer => stargazer}/plugins/other/radius/conn.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/radius/conn.h (100%) rename {projects/stargazer => stargazer}/plugins/other/radius/radius.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/radius/radius.h (99%) create mode 100644 stargazer/plugins/other/rscript/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/other/rscript/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/other/rscript/nrmap_parser.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/rscript/nrmap_parser.h (98%) rename {projects/stargazer => stargazer}/plugins/other/rscript/rscript.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/rscript/rscript.h (99%) rename {projects/stargazer => stargazer}/plugins/other/rscript/send_functor.h (98%) rename {projects/stargazer => stargazer}/plugins/other/rscript/ur_functor.h (99%) create mode 100644 stargazer/plugins/other/smux/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/other/smux/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/STG-MIB.mib (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/TODO (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/handlers.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/pen.h (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/sensors.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/sensors.h (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/smux.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/smux.h (99%) rename {projects/stargazer => stargazer}/plugins/other/smux/tables.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/tables.h (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/types.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/types.h (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/utils.cpp (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/utils.h (100%) rename {projects/stargazer => stargazer}/plugins/other/smux/value2os.h (100%) create mode 100644 stargazer/plugins/store/CMakeLists.txt create mode 100644 stargazer/plugins/store/files/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/store/files/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/store/files/file_store.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/files/file_store.h (100%) create mode 100644 stargazer/plugins/store/firebird/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/store/firebird/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store.h (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_admins.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_corporations.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_messages.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_services.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_tariffs.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_users.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/firebird/firebird_store_utils.cpp (100%) create mode 100644 stargazer/plugins/store/mysql/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/store/mysql/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/store/mysql/mysql_store.cpp (99%) rename {projects/stargazer => stargazer}/plugins/store/mysql/mysql_store.h (100%) create mode 100644 stargazer/plugins/store/postgresql/CMakeLists.txt rename {projects/stargazer => stargazer}/plugins/store/postgresql/Makefile (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store.h (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_admins.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_corporations.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_messages.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_services.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_tariffs.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_users.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_utils.cpp (100%) rename {projects/stargazer => stargazer}/plugins/store/postgresql/postgresql_store_utils.h (100%) rename {projects/stargazer => stargazer}/scripts/clean_db (100%) rename {projects/stargazer => stargazer}/scripts/monitor (100%) rename {projects/stargazer => stargazer}/scripts/shaper/OnConnect (100%) rename {projects/stargazer => stargazer}/scripts/shaper/OnDisconnect (100%) rename {projects/stargazer => stargazer}/scripts/shaper/Readme.txt (100%) rename {projects/stargazer => stargazer}/scripts/shaper/shaper.sh (100%) rename {projects/stargazer => stargazer}/scripts/shaper/shaper.stop.sh (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/Readme (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/firewall/firewall (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/freeradius/clients.conf (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/freeradius/radiusd.conf (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/ppp/ip-down.d/stg (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/ppp/ip-up.d/stg (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/ppp/pptpd-options (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/pptpd.conf (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/radiusclient/servers (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/OnChange (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/OnConnect (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/OnDisconnect (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/OnUserAdd (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/OnUserDel (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/rules (100%) rename {projects/stargazer => stargazer}/scripts/shaper_vpn_radius/stargazer/stargazer.conf (100%) rename {projects/stargazer => stargazer}/services_impl.cpp (100%) rename {projects/stargazer => stargazer}/services_impl.h (100%) rename {projects/stargazer => stargazer}/settings_impl.cpp (99%) rename {projects/stargazer => stargazer}/settings_impl.h (100%) rename {projects/stargazer => stargazer}/stg_timer.cpp (100%) rename {projects/stargazer => stargazer}/stg_timer.h (100%) rename {projects/stargazer => stargazer}/store_loader.cpp (100%) rename {projects/stargazer => stargazer}/store_loader.h (100%) rename {projects/stargazer => stargazer}/tariff_impl.cpp (100%) rename {projects/stargazer => stargazer}/tariff_impl.h (99%) rename {projects/stargazer => stargazer}/tariffs_impl.cpp (100%) rename {projects/stargazer => stargazer}/tariffs_impl.h (100%) rename {projects/stargazer => stargazer}/traffcounter_impl.cpp (100%) rename {projects/stargazer => stargazer}/traffcounter_impl.h (99%) rename {projects/stargazer => stargazer}/user_impl.cpp (100%) rename {projects/stargazer => stargazer}/user_impl.h (99%) rename {projects/stargazer => stargazer}/user_property.cpp (100%) rename {projects/stargazer => stargazer}/users_impl.cpp (100%) rename {projects/stargazer => stargazer}/users_impl.h (99%) delete mode 100644 stglibs/Makefile delete mode 100644 stglibs/Makefile.in delete mode 100644 stglibs/common.lib/common.bpf delete mode 100644 stglibs/common.lib/common.bpr delete mode 100644 stglibs/crypto.lib/crypto.bpf delete mode 100644 stglibs/crypto.lib/crypto.bpr delete mode 100644 stglibs/ia.lib/ia.bpf delete mode 100644 stglibs/ia.lib/ia.bpr create mode 100644 tests/CMakeLists.txt diff --git a/.gitignore b/.gitignore index b49a31e2..ba791f70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,10 @@ -*.[ao] -*.d -*.so +build *.swp *.log *.diff *.patch *.vp* CVS* -make_tarball.sh -deps -projects/rscriptd/On* -projects/stargazer/On* -projects/stargazer/stargazer.conf -projects/stargazer/stargazer -projects/stargazer/rules -projects/stargazer/subnets -projects/stargazer/conf.d -projects/stargazer/var -stglibs/smtp.lib -stglibs/crypto.lib/blowfish.c -Makefile.conf -projects/convertor/convertor -projects/rscriptd/rscriptd -projects/sgconf/sgconf -projects/sgconf_xml/sgconf_xml doc/xmlrpc-doc/book doc/help/book doc/help/help.pdf diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..0872ec22 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,181 @@ +cmake_minimum_required (VERSION 3.1) + +set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ) + +option ( BUILD_STG "Build Stargazer server." OFF ) +option ( BUILD_SGCONF "Build SGConf client." OFF ) +option ( BUILD_RSCRIPTD "Build RScriptD server." OFF ) +option ( BUILD_RLM_STG "Build rlm_stg FreeRADIUS module." OFF ) +option ( BUILD_SGAUTH "Build SGAuth client." OFF ) + +# General modules +option ( BUILD_MOD_AO "Build AlwaysOnline STG module." ON ) +option ( BUILD_MOD_IA "Buils InetAccess STG module." ON ) +option ( BUILD_MOD_SGCONFIG "Build SGConfig STG module." ON ) +option ( BUILD_MOD_PING "Build Ping STG module." ON ) +option ( BUILD_MOD_RSCRYPT "Build RScrypt STG module." ON ) +option ( BUILD_MOD_SMUX "Buils SMUX STG module." ON ) +option ( BUILD_MOD_STORE_FILES "Build file store STG module." ON ) +option ( BUILD_MOD_CAP_NF "Build NetFlow capture STG module." ON ) + +# OS-specific modules +option ( BUILD_MOD_CAP_ETHER_LINUX "Build Linux Ethernet capture STG module." OFF ) +option ( BUILD_MOD_CAP_ETHER_FREEBSD "Build FreeBSD Ethernet capture STG module." OFF ) +option ( BUILD_MOD_CAP_DIVERT "Build FreeBSD divert-socket capture STG MODULE." OFF ) + +# Lib-specific modules +option ( BUILD_MOD_STORE_FIREBIRD "Build Firebird store STG module." OFF ) +option ( BUILD_MOD_STORE_POSTGRESQL "Build PostgreSQL store STG module." OFF ) +option ( BUILD_MOD_STORE_MYSQL "Build MySQL store STG module." OFF ) +option ( BUILD_MOD_RPCCONFIG "Build XML-RPC configuretion STG module." OFF ) +option ( BUILD_MOD_CAP_PCAP "Build PCap capture STG module." OFF ) +option ( BUILD_MOD_CAP_NFQUEUE "Build NFQueue capture STG module." OFF ) +option ( BUILD_MOD_RADIUS "Build rlm_stg backend STG module." OFF ) + +option ( BUILD_ALL_MODS "Build all modules." OFF ) +option ( BUILD_ALL_LIBS "Build all libraries." OFF ) +option ( BUILD_TESTS "Build tests." OFF ) +option ( BUILD_ALL "Build binaries, libraries and tests." OFF ) +option ( ENABLE_COVERAGE "Enable code coverage analysis." OFF ) + +if ( BUILD_ALL ) + set ( BUILD_ALL_MODS ON ) + set ( BUILD_ALL_LIBS ON ) + set ( BUILD_TESTS ON ) + set ( BUILD_SGAUTH ON ) + set ( BUILD_RSCRIPTD ON ) + set ( BUILD_RLM_STG ON ) + set ( BUILD_SGCONF ON ) + set ( BUILD_STG ON ) +endif ( BUILD_ALL ) + +set ( BUILD_LIB_COMMON ON ) + +if ( BUILD_SGAUTH OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_CONFFILES ON ) + set ( BUILD_LIB_CRYPTO ON ) + set ( BUILD_LIB_IA ON ) +endif ( BUILD_SGAUTH OR BUILD_ALL_LIBS ) + +if ( BUILD_SGCONF OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_CRYPTO ON ) + set ( BUILD_LIB_SRVCONF ON ) +endif ( BUILD_SGCONF OR BUILD_ALL_LIBS ) + +if ( BUILD_RSCRIPTD OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_CONFFILES ON ) + set ( BUILD_LIB_CRYPTO ON ) + set ( BUILD_LIB_LOGGER ON ) + set ( BUILD_LIB_SCRIPTEXECUTER ON ) +endif ( BUILD_RSCRIPTD OR BUILD_ALL_LIBS ) + +if ( BUILD_RLM_STG OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_CRYPTO ON ) + set ( BUILD_LIB_JSON ON ) +endif ( BUILD_RLM_STG OR BUILD_ALL_LIBS ) + +if ( BUILD_STG OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_CONFFILES ON ) + set ( BUILD_LIB_CRYPTO ON ) + set ( BUILD_LIB_DOTCONFPP ON ) + set ( BUILD_LIB_LOGGER ON ) + set ( BUILD_LIB_SCRIPTEXECUTER ON ) + + # if ( BUILD_STG ) + # set ( BUILD_MOD_AO ON ) + # set ( BUILD_MOD_IA ON ) + # set ( BUILD_MOD_SGCONFIG ON ) + # set ( BUILD_MOD_PING ON ) + # set ( BUILD_MOD_RSCRYPT ON ) + # set ( BUILD_MOD_SMUX ON ) + # set ( BUILD_MOD_STORE_FILES ON ) + # set ( BUILD_MOD_CAP_NF ON ) + #endif ( BUILD_STG ) +endif ( BUILD_STG OR BUILD_ALL_LIBS ) + +if ( BUILD_ALL_MODS ) + set ( BUILD_MOD_STORE_FIREBIRD ON ) + set ( BUILD_MOD_STORE_MYSQL ON ) + set ( BUILD_MOD_STORE_POSTGRESQL ON ) + set ( BUILD_MOD_RPCCONFIG ON ) + set ( BUILD_MOD_CAP_PCAP ON ) + set ( BUILD_MOD_CAP_NFQUEUE ON ) + set ( BUILD_MOD_RADIUS ON ) +endif ( BUILD_ALL_MODS ) + +if ( BUILD_MOD_STORE_FIREBIRD OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_IBPP ON ) +endif ( BUILD_MOD_STORE_FIREBIRD OR BUILD_ALL_LIBS ) + +if ( BUILD_MOD_RADIUS OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_JSON ON ) + set ( BUILD_LIB_IBPP ON ) +endif ( BUILD_MOD_RADIUS OR BUILD_ALL_LIBS ) + +if ( BUILD_MOD_PING OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_PINGER ON ) +endif ( BUILD_MOD_PING OR BUILD_ALL_LIBS ) + +if ( BUILD_MOD_SMUX OR BUILD_ALL_LIBS ) + set ( BUILD_LIB_SMUX ON ) +endif ( BUILD_MOD_SMUX OR BUILD_ALL_LIBS ) + +enable_language (CXX) +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -Wshadow -Wlogical-op -Wuseless-cast -Wno-long-long -Wold-style-cast -Wstrict-aliasing -pedantic") + +if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) + add_definitions ( -DLINUX ) + set ( BUILD_MOD_CAP_ETHER_LINUX ON ) + if ( BUILD_LIB_IBPP ) + add_definitions ( -DIBPP_LINUX ) + endif ( BUILD_LIB_IBPP ) +elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" ) + add_definitions ( -DFREE_BSD ) + set ( BUILD_MOD_CAP_ETHER_FREEBSD ON ) + set ( BUILD_MOD_CAP_DIVERT ON ) + if ( BUILD_LIB_IBPP ) + add_definitions ( -DIBPP_LINUX ) + message ( WARNING "IBPP does not support '${CMAKE_SYSTEM_NAME}'" ) + endif ( BUILD_LIB_IBPP ) +elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + add_definitions ( -DDARWIN ) + if ( BUILD_LIB_IBPP ) + add_definitions ( -DIBPP_DARWIN ) + endif ( BUILD_LIB_IBPP ) +else () + message ( WARNING "Unsupported system: '${CMAKE_SYSTEM_NAME}'" ) +endif () + +include_directories ( include ) + +#find_package ( OpenSSL 1.0.0 REQUIRED ) +#find_package ( Boost 1.66.0 REQUIRED COMPONENTS system unit_test_framework ) + +add_subdirectory ( libs ) + +if ( BUILD_RLM_STG ) + add_subdirectory ( rlm_stg ) +endif ( BUILD_RLM_STG ) + +if ( BUILD_RSCRIPTD ) + add_subdirectory ( rscriptd ) +endif ( BUILD_RSCRIPTD ) + +if ( BUILD_SGAUTH ) + add_subdirectory ( sgauth ) +endif ( BUILD_SGAUTH ) + +if ( BUILD_SGCONF ) + add_subdirectory ( sgconf ) +endif ( BUILD_SGCONF ) + +if ( BUILD_STG ) + add_subdirectory ( stargazer ) +endif ( BUILD_STG ) + +if ( BUILD_TESTS ) + add_subdirectory ( tests ) +endif ( BUILD_TESTS ) + +add_custom_target (cppcheck COMMAND cppcheck --enable=all --std=c++14 ${CMAKE_SOURCE_DIR}/rlm_stg ${CMAKE_SOURCE_DIR}/rscriptd ${CMAKE_SOURCE_DIR}/sgauth ${CMAKE_SOURCE_DIR}/sgconf ${CMAKE_SOURCE_DIR}/sgconv ${CMAKE_SOURCE_DIR}/stargazer) diff --git a/cmake/modules/FindFBClient.cmake b/cmake/modules/FindFBClient.cmake new file mode 100644 index 00000000..5199beff --- /dev/null +++ b/cmake/modules/FindFBClient.cmake @@ -0,0 +1,22 @@ +find_path ( FBClient_INCLUDE_DIR NAMES ibase.h DOC "Path to FBClient header files." ) +mark_as_advanced ( FBClient_INCLUDE_DIR ) + +find_library ( FBClient_LIB NAMES fbclient DOC "Location of FBClient library." ) +mark_as_advanced ( FBClient_LIB ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( FBClient + REQUIRED_VARS FBClient_LIB FBClient_INCLUDE_DIR + VERSION_VAR FBClient_VERSION ) + +# Create the imported target +if ( FBClient_FOUND ) + set ( FBClient_INCLUDE_DIRS ${FBClient_INCLUDE_DIR} ) + set ( FBClient_LIBRARIES ${FBClient_LIB} ) + if ( NOT TARGET FBClient::FBClient ) + add_library ( FBClient::FBClient UNKNOWN IMPORTED ) + set_target_properties ( FBClient::FBClient PROPERTIES + IMPORTED_LOCATION "${FBClient_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${FBClient_INCLUDE_DIR}" ) + endif ( NOT TARGET FBClient::FBClient ) +endif ( FBClient_FOUND ) diff --git a/cmake/modules/FindMNL.cmake b/cmake/modules/FindMNL.cmake new file mode 100644 index 00000000..833f1bcd --- /dev/null +++ b/cmake/modules/FindMNL.cmake @@ -0,0 +1,22 @@ +find_path ( MNL_INCLUDE_DIR NAMES libmnl/libmnl.h DOC "Path to MNL header files." ) +mark_as_advanced ( MNL_INCLUDE_DIR ) + +find_library ( MNL_LIB NAMES mnl DOC "Location of MNL library." ) +mark_as_advanced ( MNL_LIB ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( MNL + REQUIRED_VARS MNL_LIB MNL_INCLUDE_DIR + VERSION_VAR MNL_VERSION ) + +# Create the imported target +if ( MNL_FOUND ) + set ( MNL_INCLUDE_DIRS ${MNL_INCLUDE_DIR} ) + set ( MNL_LIBRARIES ${MNL_LIB} ) + if ( NOT TARGET MNL::MNL ) + add_library ( MNL::MNL UNKNOWN IMPORTED ) + set_target_properties ( MNL::MNL PROPERTIES + IMPORTED_LOCATION "${MNL_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${MNL_INCLUDE_DIR}" ) + endif ( NOT TARGET MNL::MNL ) +endif ( MNL_FOUND ) diff --git a/cmake/modules/FindMySQLConnector.cmake b/cmake/modules/FindMySQLConnector.cmake new file mode 100644 index 00000000..6ab31aea --- /dev/null +++ b/cmake/modules/FindMySQLConnector.cmake @@ -0,0 +1,32 @@ +find_path ( MySQLConnector_INCLUDE_DIR NAMES mysql/mysql.h mysql/mysql_version.h DOC "Path to MySQLConnector header files." ) +mark_as_advanced ( MySQLConnector_INCLUDE_DIR ) + +find_library ( MySQLConnector_LIB NAMES mysqlclient DOC "Location of MySQLConnector library." ) +mark_as_advanced ( MySQLConnector_LIB ) + +if ( MySQLConnector_INCLUDE_DIR ) + file ( READ "${MySQLConnector_INCLUDE_DIR}/mysql/mysql_version.h" ver ) + + string ( REGEX MATCH "LIBMYSQL_VERSION ([0-9]*)" _ ${ver} ) + + set ( MySQLConnector_VERSION ${CMAKE_MATCH_1} ) + + unset ( ver ) +endif ( MySQLConnector_INCLUDE_DIR ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( MySQLConnector + REQUIRED_VARS MySQLConnector_LIB MySQLConnector_INCLUDE_DIR + VERSION_VAR MySQLConnector_VERSION ) + +# Create the imported target +if ( MySQLConnector_FOUND ) + set ( MySQLConnector_INCLUDE_DIRS ${MySQLConnector_INCLUDE_DIR} ) + set ( MySQLConnector_LIBRARIES ${MySQLConnector_LIB} ) + if ( NOT TARGET MySQL::Connector ) + add_library ( MySQL::Connector UNKNOWN IMPORTED ) + set_target_properties ( MySQL::Connector PROPERTIES + IMPORTED_LOCATION "${MySQLConnector_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${MySQLConnector_INCLUDE_DIR}" ) + endif ( NOT TARGET MySQL::Connector ) +endif ( MySQLConnector_FOUND ) diff --git a/cmake/modules/FindNFNetLink.cmake b/cmake/modules/FindNFNetLink.cmake new file mode 100644 index 00000000..7909cb05 --- /dev/null +++ b/cmake/modules/FindNFNetLink.cmake @@ -0,0 +1,22 @@ +find_path ( NFNetLink_INCLUDE_DIR NAMES libnfnetlink/libnfnetlink.h DOC "Path to NFNetLink header files." ) +mark_as_advanced ( NFNetLink_INCLUDE_DIR ) + +find_library ( NFNetLink_LIB NAMES nfnetlink DOC "Location of NFNetLink library." ) +mark_as_advanced ( NFNetLink_LIB ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( NFNetLink + REQUIRED_VARS NFNetLink_LIB NFNetLink_INCLUDE_DIR + VERSION_VAR NFNetLink_VERSION ) + +# Create the imported target +if ( NFNetLink_FOUND ) + set ( NFNetLink_INCLUDE_DIRS ${NFNetLink_INCLUDE_DIR} ) + set ( NFNetLink_LIBRARIES ${NFNetLink_LIB} ) + if ( NOT TARGET NF::NetLink ) + add_library ( NF::NetLink UNKNOWN IMPORTED ) + set_target_properties ( NF::NetLink PROPERTIES + IMPORTED_LOCATION "${NFNetLink_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${NFNetLink_INCLUDE_DIR}" ) + endif ( NOT TARGET NF::NetLink ) +endif ( NFNetLink_FOUND ) diff --git a/cmake/modules/FindNFQueue.cmake b/cmake/modules/FindNFQueue.cmake new file mode 100644 index 00000000..b05e61b8 --- /dev/null +++ b/cmake/modules/FindNFQueue.cmake @@ -0,0 +1,22 @@ +find_path ( NFQueue_INCLUDE_DIR NAMES libnetfilter_queue/libnetfilter_queue.h DOC "Path to NFQueue header files." ) +mark_as_advanced ( NFQueue_INCLUDE_DIR ) + +find_library ( NFQueue_LIB NAMES netfilter_queue DOC "Location of NFQueue library." ) +mark_as_advanced ( NFQueue_LIB ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( NFQueue + REQUIRED_VARS NFQueue_LIB NFQueue_INCLUDE_DIR + VERSION_VAR NFQueue_VERSION ) + +# Create the imported target +if ( NFQueue_FOUND ) + set ( NFQueue_INCLUDE_DIRS ${NFQueue_INCLUDE_DIR} ) + set ( NFQueue_LIBRARIES ${NFQueue_LIB} ) + if ( NOT TARGET NF::Queue ) + add_library ( NF::Queue UNKNOWN IMPORTED ) + set_target_properties ( NF::Queue PROPERTIES + IMPORTED_LOCATION "${NFQueue_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${NFQueue_INCLUDE_DIR}" ) + endif ( NOT TARGET NF::Queue ) +endif ( NFQueue_FOUND ) diff --git a/cmake/modules/FindPCap.cmake b/cmake/modules/FindPCap.cmake new file mode 100644 index 00000000..d1dff55a --- /dev/null +++ b/cmake/modules/FindPCap.cmake @@ -0,0 +1,38 @@ +find_path ( PCap_INCLUDE_DIR NAMES pcap.h pcap/pcap.h DOC "Path to PCap header files." ) +mark_as_advanced ( PCap_INCLUDE_DIR ) + +find_library ( PCap_LIB NAMES pcap DOC "Location of PCap library." ) +mark_as_advanced ( PCap_LIB ) + +if ( PCap_INCLUDE_DIR ) + file ( READ "${PCap_INCLUDE_DIR}/pcap/pcap.h" ver ) + + string ( REGEX MATCH "PCAP_VERSION_MAJOR ([0-9]*)" _ ${ver} ) + set ( ver_major ${CMAKE_MATCH_1} ) + + string ( REGEX MATCH "PCAP_VERSION_MINOR ([0-9]*)" _ ${ver} ) + set ( ver_minor ${CMAKE_MATCH_1} ) + + set ( PCap_VERSION "${ver_major}.${ver_minor}" ) + + unset ( ver ) + unset ( ver_major ) + unset ( ver_minor ) +endif ( PCap_INCLUDE_DIR ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( PCap + REQUIRED_VARS PCap_LIB PCap_INCLUDE_DIR + VERSION_VAR PCap_VERSION ) + +# Create the imported target +if ( PCap_FOUND ) + set ( PCap_INCLUDE_DIRS ${PCap_INCLUDE_DIR} ) + set ( PCap_LIBRARIES ${PCap_LIB} ) + if ( NOT TARGET PCap::PCap ) + add_library ( PCap::PCap UNKNOWN IMPORTED ) + set_target_properties ( PCap::PCap PROPERTIES + IMPORTED_LOCATION "${PCap_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${PCap_INCLUDE_DIR}" ) + endif ( NOT TARGET PCap::PCap ) +endif ( PCap_FOUND ) diff --git a/cmake/modules/FindYAJL.cmake b/cmake/modules/FindYAJL.cmake new file mode 100644 index 00000000..2e18caf0 --- /dev/null +++ b/cmake/modules/FindYAJL.cmake @@ -0,0 +1,42 @@ +find_path ( YAJL_INCLUDE_DIR NAMES yajl/yajl_parse.h yajl/yajl_version.h DOC "Path to YAJL header files." ) +mark_as_advanced ( YAJL_INCLUDE_DIR ) + +find_library ( YAJL_LIB NAMES yajl DOC "Location of YAJL library." ) +mark_as_advanced ( YAJL_LIB ) + +if ( YAJL_INCLUDE_DIR ) + file ( READ "${YAJL_INCLUDE_DIR}/yajl/yajl_version.h" ver ) + + string ( REGEX MATCH "YAJL_MAJOR ([0-9]*)" _ ${ver} ) + set ( ver_major ${CMAKE_MATCH_1} ) + + string ( REGEX MATCH "YAJL_MINOR ([0-9]*)" _ ${ver} ) + set ( ver_minor ${CMAKE_MATCH_1} ) + + string ( REGEX MATCH "YAJL_MICRO ([0-9]*)" _ ${ver} ) + set ( ver_micro ${CMAKE_MATCH_1} ) + + set ( YAJL_VERSION "${ver_major}.${ver_minor}.${ver_micro}" ) + + unset ( ver ) + unset ( ver_major ) + unset ( ver_minor ) + unset ( ver_micro ) +endif ( YAJL_INCLUDE_DIR ) + +include ( FindPackageHandleStandardArgs ) +find_package_handle_standard_args ( YAJL + REQUIRED_VARS YAJL_LIB YAJL_INCLUDE_DIR + VERSION_VAR YAJL_VERSION ) + +# Create the imported target +if ( YAJL_FOUND ) + set ( YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR} ) + set ( YAJL_LIBRARIES ${YAJL_LIB} ) + if ( NOT TARGET YAJL::YAJL ) + add_library ( YAJL::YAJL UNKNOWN IMPORTED ) + set_target_properties ( YAJL::YAJL PROPERTIES + IMPORTED_LOCATION "${YAJL_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${YAJL_INCLUDE_DIR}" ) + endif ( NOT TARGET YAJL::YAJL ) +endif ( YAJL_FOUND ) diff --git a/include/stg/admin.h b/include/stg/admin.h index 961968a1..f3851291 100644 --- a/include/stg/admin.h +++ b/include/stg/admin.h @@ -22,9 +22,9 @@ #define ADMIN_H #include +#include #include "admin_conf.h" -#include "os_int.h" class ADMIN { public: diff --git a/include/stg/admin_conf.h b/include/stg/admin_conf.h index 6f8005f5..88d944bf 100644 --- a/include/stg/admin_conf.h +++ b/include/stg/admin_conf.h @@ -11,7 +11,7 @@ #include -#include "os_int.h" +#include #define ADM_LOGIN_LEN (32) #define ADM_PASSWD_LEN (32) diff --git a/include/stg/ia_packets.h b/include/stg/ia_packets.h index 3520270c..afc014c6 100644 --- a/include/stg/ia_packets.h +++ b/include/stg/ia_packets.h @@ -1,7 +1,7 @@ #ifndef PACKETH #define PACKETH -#include "os_int.h" +#include #define CONN_SYN_N 0 #define CONN_SYN_ACK_N 1 diff --git a/include/stg/message.h b/include/stg/message.h index 5a0e918e..49f8c7c6 100644 --- a/include/stg/message.h +++ b/include/stg/message.h @@ -11,10 +11,9 @@ */ #include +#include #include -#include "os_int.h" - //----------------------------------------------------------------------------- struct STG_MSG_HDR { diff --git a/include/stg/os_int.h b/include/stg/os_int.h deleted file mode 100644 index 00ab3fad..00000000 --- a/include/stg/os_int.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Boris Mikhailenko - */ - - /* - $Revision: 1.4 $ - $Date: 2008/03/25 17:41:50 $ - */ - - -#ifndef OS_INT_H -#define OS_INT_H - -#ifdef LINUX -#include -#endif - -#if defined(FREE_BSD5) || defined(DARWIN) -#include -#endif - -#ifdef FREE_BSD -#include -#endif - -#ifdef WIN32 - -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -typedef int int32_t; -typedef unsigned int uint32_t; - -typedef short int int16_t; -typedef short unsigned int uint16_t; - -typedef char int8_t; -typedef unsigned char uint8_t; - - -#endif - - -#endif - diff --git a/include/stg/plugin.h b/include/stg/plugin.h index 2deabcc3..d02ff699 100644 --- a/include/stg/plugin.h +++ b/include/stg/plugin.h @@ -29,9 +29,9 @@ #define PLUGIN_H #include +#include #include "noncopyable.h" -#include "os_int.h" #include "admins.h" #include "users.h" #include "tariffs.h" diff --git a/include/stg/rad_packets.h b/include/stg/rad_packets.h index 96cddc4b..90ed9298 100644 --- a/include/stg/rad_packets.h +++ b/include/stg/rad_packets.h @@ -23,7 +23,7 @@ #define RAD_ID "00100" -#include "os_int.h" +#include struct RAD_PACKET { diff --git a/include/stg/raw_ip_packet.h b/include/stg/raw_ip_packet.h index b94faf86..30e1c8fe 100644 --- a/include/stg/raw_ip_packet.h +++ b/include/stg/raw_ip_packet.h @@ -1,7 +1,7 @@ #ifndef RAW_IP_PACKET_H #define RAW_IP_PACKET_H -#if defined(FREE_BSD) || defined(FREE_BSD5) +#if defined(FREE_BSD) #include // n_long in netinet/ip.h #endif diff --git a/include/stg/rs_packets.h b/include/stg/rs_packets.h index 503fe91d..0c31e228 100644 --- a/include/stg/rs_packets.h +++ b/include/stg/rs_packets.h @@ -34,7 +34,7 @@ #define RS_ID "RSP00" -#include "os_int.h" +#include namespace RS { diff --git a/include/stg/service_conf.h b/include/stg/service_conf.h index b6c24490..a9b8d5c4 100644 --- a/include/stg/service_conf.h +++ b/include/stg/service_conf.h @@ -22,9 +22,9 @@ #define SERVICE_CONF_H #include "resetable.h" -#include "os_int.h" #include +#include struct SERVICE_CONF { diff --git a/include/stg/tariff.h b/include/stg/tariff.h index 4f5b4166..6f9d8767 100644 --- a/include/stg/tariff.h +++ b/include/stg/tariff.h @@ -21,12 +21,11 @@ #ifndef TARIFF_H #define TARIFF_H -#include "os_int.h" - #include +#include #include #include -#include +#include struct TARIFF_DATA; diff --git a/include/stg/user.h b/include/stg/user.h index 7772a298..654f3344 100644 --- a/include/stg/user.h +++ b/include/stg/user.h @@ -25,12 +25,12 @@ #include "message.h" #include "tariff.h" #include "user_traff.h" -#include "os_int.h" #include #include #include +#include class USER_PROPERTIES; class AUTH; diff --git a/include/stg/user_conf.h b/include/stg/user_conf.h index a16b3929..d48682d6 100644 --- a/include/stg/user_conf.h +++ b/include/stg/user_conf.h @@ -9,10 +9,10 @@ #include #include +#include #include "const.h" #include "user_ips.h" #include "resetable.h" -#include "os_int.h" //----------------------------------------------------------------------------- struct USER_CONF diff --git a/include/stg/user_ips.h b/include/stg/user_ips.h index bb920957..ee227e5d 100644 --- a/include/stg/user_ips.h +++ b/include/stg/user_ips.h @@ -28,9 +28,9 @@ #define USER_IPS_H #include "stg/common.h" -#include "os_int.h" #include +#include #include #include #include diff --git a/include/stg/user_stat.h b/include/stg/user_stat.h index ff020dc7..4cedb591 100644 --- a/include/stg/user_stat.h +++ b/include/stg/user_stat.h @@ -28,11 +28,11 @@ #define USER_STAT_H #include +#include #include #include #include -#include "os_int.h" #include "resetable.h" #include "user_traff.h" //----------------------------------------------------------------------------- diff --git a/include/stg/user_traff.h b/include/stg/user_traff.h index 3ca9768e..5abcee33 100644 --- a/include/stg/user_traff.h +++ b/include/stg/user_traff.h @@ -29,10 +29,10 @@ #include "resetable.h" #include "const.h" -#include "os_int.h" #include #include +#include enum TRAFF_DIRECTION {TRAFF_UPLOAD, TRAFF_DOWNLOAD}; diff --git a/lib/.placeholder b/lib/.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt new file mode 100644 index 00000000..af3d944f --- /dev/null +++ b/libs/CMakeLists.txt @@ -0,0 +1,49 @@ +set ( CMAKE_POSITION_INDEPENDENT_CODE ON ) + +if ( BUILD_LIB_COMMON ) + add_subdirectory (common) +endif ( BUILD_LIB_COMMON ) + +if ( BUILD_LIB_CONFFILES ) + add_subdirectory (conffiles) +endif ( BUILD_LIB_CONFFILES ) + +if ( BUILD_LIB_CRYPTO ) + add_subdirectory (crypto) +endif ( BUILD_LIB_CRYPTO ) + +if ( BUILD_LIB_DOTCONFPP ) + add_subdirectory (dotconfpp) +endif ( BUILD_LIB_DOTCONFPP ) + +if ( BUILD_LIB_IA ) + add_subdirectory (ia) +endif ( BUILD_LIB_IA ) + +if ( BUILD_LIB_IBPP ) + add_subdirectory (ibpp) +endif ( BUILD_LIB_IBPP ) + +if ( BUILD_LIB_JSON ) + add_subdirectory (json) +endif ( BUILD_LIB_JSON ) + +if ( BUILD_LIB_LOGGER ) + add_subdirectory (logger) +endif ( BUILD_LIB_LOGGER ) + +if ( BUILD_LIB_PINGER ) + add_subdirectory (pinger) +endif ( BUILD_LIB_PINGER ) + +if ( BUILD_LIB_SCRIPTEXECUTER ) + add_subdirectory (scriptexecuter) +endif ( BUILD_LIB_SCRIPTEXECUTER ) + +if ( BUILD_LIB_SMUX ) + add_subdirectory (smux) +endif ( BUILD_LIB_SMUX ) + +if ( BUILD_LIB_SRVCONF ) + add_subdirectory (srvconf) +endif ( BUILD_LIB_SRVCONF ) diff --git a/libs/common/CMakeLists.txt b/libs/common/CMakeLists.txt new file mode 100644 index 00000000..330ee0d6 --- /dev/null +++ b/libs/common/CMakeLists.txt @@ -0,0 +1,7 @@ +set ( CPP_FILES blockio.cpp common.cpp strptime.cpp ) + +include_directories ( include ) + +add_library ( common STATIC ${CPP_FILES} ) + +target_include_directories ( common PUBLIC include ) diff --git a/stglibs/common.lib/Makefile b/libs/common/Makefile similarity index 100% rename from stglibs/common.lib/Makefile rename to libs/common/Makefile diff --git a/stglibs/common.lib/blockio.cpp b/libs/common/blockio.cpp similarity index 100% rename from stglibs/common.lib/blockio.cpp rename to libs/common/blockio.cpp diff --git a/stglibs/common.lib/common.cpp b/libs/common/common.cpp similarity index 99% rename from stglibs/common.lib/common.cpp rename to libs/common/common.cpp index fcea5ebc..8cfcf402 100644 --- a/stglibs/common.lib/common.cpp +++ b/libs/common/common.cpp @@ -303,7 +303,7 @@ void KOIToWin(const std::string & s1, std::string * s2) { s2->erase(s2->begin(), s2->end()); s2->reserve(s1.length()); -for (int j = 0; j < (int)s1.length(); j++) +for (size_t j = 0; j < s1.length(); j++) { unsigned char t = s1[j]; s2->push_back(koi2win[t]); @@ -314,7 +314,7 @@ void WinToKOI(const std::string & s1, std::string * s2) { s2->erase(s2->begin(), s2->end()); s2->reserve(s1.length()); -for (int j = 0; j < (int)s1.length(); j++) +for (size_t j = 0; j < s1.length(); j++) { unsigned char t = s1[j]; s2->push_back(win2koi[t]); diff --git a/stglibs/common.lib/include/stg/blockio.h b/libs/common/include/stg/blockio.h similarity index 100% rename from stglibs/common.lib/include/stg/blockio.h rename to libs/common/include/stg/blockio.h diff --git a/stglibs/common.lib/include/stg/common.h b/libs/common/include/stg/common.h similarity index 99% rename from stglibs/common.lib/include/stg/common.h rename to libs/common/include/stg/common.h index 1836ae7d..94cf9f06 100644 --- a/stglibs/common.lib/include/stg/common.h +++ b/libs/common/include/stg/common.h @@ -27,13 +27,13 @@ #ifndef common_h #define common_h -#include "stg/os_int.h" -#include "stg/const.h" +//#include "stg/const.h" #include #include #include #include // NAME_MAX +#include #include // uid_t, gid_t #include // mode_t diff --git a/stglibs/common.lib/strptime.cpp b/libs/common/strptime.cpp similarity index 100% rename from stglibs/common.lib/strptime.cpp rename to libs/common/strptime.cpp diff --git a/libs/conffiles/CMakeLists.txt b/libs/conffiles/CMakeLists.txt new file mode 100644 index 00000000..34e18014 --- /dev/null +++ b/libs/conffiles/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES conffiles.cpp ) + +add_library ( conffiles STATIC ${CPP_FILES} ) + +target_include_directories ( conffiles PUBLIC include ) diff --git a/stglibs/conffiles.lib/Makefile b/libs/conffiles/Makefile similarity index 100% rename from stglibs/conffiles.lib/Makefile rename to libs/conffiles/Makefile diff --git a/stglibs/conffiles.lib/conffiles.cpp b/libs/conffiles/conffiles.cpp similarity index 98% rename from stglibs/conffiles.lib/conffiles.cpp rename to libs/conffiles/conffiles.cpp index 9578e24f..b254128b 100644 --- a/stglibs/conffiles.lib/conffiles.cpp +++ b/libs/conffiles/conffiles.cpp @@ -305,7 +305,7 @@ const std::map::const_iterator it(par if (it != param_val.end()) { char *res; - *val = (short)strtol(it->second.c_str(), &res, 10); + *val = static_cast(strtol(it->second.c_str(), &res, 10)); if (*res != 0) { *val = defaultVal; //Error! @@ -325,7 +325,7 @@ const std::map::const_iterator it(par if (it != param_val.end()) { char *res; - *val = (short)strtoul(it->second.c_str(), &res, 10); + *val = static_cast(strtoul(it->second.c_str(), &res, 10)); if (*res != 0) { *val = defaultVal; //Error! diff --git a/stglibs/conffiles.lib/include/stg/conffiles.h b/libs/conffiles/include/stg/conffiles.h similarity index 99% rename from stglibs/conffiles.lib/include/stg/conffiles.h rename to libs/conffiles/include/stg/conffiles.h index 49bb6ff3..710cd042 100644 --- a/stglibs/conffiles.lib/include/stg/conffiles.h +++ b/libs/conffiles/include/stg/conffiles.h @@ -34,8 +34,7 @@ #include #include - -#include "stg/os_int.h" +#include //--------------------------------------------------------------------------- diff --git a/libs/crypto/CMakeLists.txt b/libs/crypto/CMakeLists.txt new file mode 100644 index 00000000..9b40d18b --- /dev/null +++ b/libs/crypto/CMakeLists.txt @@ -0,0 +1,6 @@ +set ( CPP_FILES bfstream.cpp ) +set ( C_FILES ag_md5.c blowfish.c ) + +add_library ( crypto STATIC ${CPP_FILES} ${C_FILES} ) + +target_include_directories ( crypto PUBLIC include ) diff --git a/stglibs/crypto.lib/Makefile b/libs/crypto/Makefile similarity index 100% rename from stglibs/crypto.lib/Makefile rename to libs/crypto/Makefile diff --git a/stglibs/crypto.lib/ag_md5.c b/libs/crypto/ag_md5.c similarity index 100% rename from stglibs/crypto.lib/ag_md5.c rename to libs/crypto/ag_md5.c diff --git a/stglibs/crypto.lib/bfstream.cpp b/libs/crypto/bfstream.cpp similarity index 100% rename from stglibs/crypto.lib/bfstream.cpp rename to libs/crypto/bfstream.cpp diff --git a/stglibs/crypto.lib/blowfish.c b/libs/crypto/blowfish.c similarity index 100% rename from stglibs/crypto.lib/blowfish.c rename to libs/crypto/blowfish.c diff --git a/stglibs/crypto.lib/include/stg/ag_md5.h b/libs/crypto/include/stg/ag_md5.h similarity index 96% rename from stglibs/crypto.lib/include/stg/ag_md5.h rename to libs/crypto/include/stg/ag_md5.h index b278f97b..e56b09e5 100644 --- a/stglibs/crypto.lib/include/stg/ag_md5.h +++ b/libs/crypto/include/stg/ag_md5.h @@ -2,8 +2,7 @@ #define _MD5_H #include - -#include "stg/os_int.h" +#include #ifdef __cplusplus extern "C" { diff --git a/stglibs/crypto.lib/include/stg/bfstream.h b/libs/crypto/include/stg/bfstream.h similarity index 100% rename from stglibs/crypto.lib/include/stg/bfstream.h rename to libs/crypto/include/stg/bfstream.h diff --git a/stglibs/crypto.lib/include/stg/blowfish.h b/libs/crypto/include/stg/blowfish.h similarity index 96% rename from stglibs/crypto.lib/include/stg/blowfish.h rename to libs/crypto/include/stg/blowfish.h index 80e39cd3..6a4e6f31 100644 --- a/stglibs/crypto.lib/include/stg/blowfish.h +++ b/libs/crypto/include/stg/blowfish.h @@ -8,15 +8,15 @@ #ifndef BLOWFISH_H #define BLOWFISH_H -#include "stg/os_int.h" - #define MAXKEYBYTES 56 /* 448 bits */ #ifdef __cplusplus #include // size_t +#include extern "C" { #else #include // size_t +#include #endif typedef struct { diff --git a/libs/dotconfpp/CMakeLists.txt b/libs/dotconfpp/CMakeLists.txt new file mode 100644 index 00000000..eec079ed --- /dev/null +++ b/libs/dotconfpp/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES dotconfpp.cpp mempool.cpp ) + +add_library ( dotconfpp STATIC ${CPP_FILES} ) + +target_include_directories ( dotconfpp PUBLIC include ) diff --git a/stglibs/dotconfpp.lib/Makefile b/libs/dotconfpp/Makefile similarity index 100% rename from stglibs/dotconfpp.lib/Makefile rename to libs/dotconfpp/Makefile diff --git a/stglibs/dotconfpp.lib/dotconfpp.cpp b/libs/dotconfpp/dotconfpp.cpp similarity index 100% rename from stglibs/dotconfpp.lib/dotconfpp.cpp rename to libs/dotconfpp/dotconfpp.cpp diff --git a/stglibs/dotconfpp.lib/include/stg/dotconfpp.h b/libs/dotconfpp/include/stg/dotconfpp.h similarity index 99% rename from stglibs/dotconfpp.lib/include/stg/dotconfpp.h rename to libs/dotconfpp/include/stg/dotconfpp.h index 63cd7eb3..d9231348 100644 --- a/stglibs/dotconfpp.lib/include/stg/dotconfpp.h +++ b/libs/dotconfpp/include/stg/dotconfpp.h @@ -33,8 +33,6 @@ #include #include -#include "stg/os_int.h" - typedef void (* DOTCONFCallback) (void * data, const char * buf); class DOTCONFDocument; diff --git a/stglibs/dotconfpp.lib/mempool.cpp b/libs/dotconfpp/mempool.cpp similarity index 100% rename from stglibs/dotconfpp.lib/mempool.cpp rename to libs/dotconfpp/mempool.cpp diff --git a/stglibs/dotconfpp.lib/mempool.h b/libs/dotconfpp/mempool.h similarity index 100% rename from stglibs/dotconfpp.lib/mempool.h rename to libs/dotconfpp/mempool.h diff --git a/libs/ia/CMakeLists.txt b/libs/ia/CMakeLists.txt new file mode 100644 index 00000000..73ab8e46 --- /dev/null +++ b/libs/ia/CMakeLists.txt @@ -0,0 +1,7 @@ +set ( CPP_FILES ia.cpp ) + +add_library ( ia STATIC ${CPP_FILES} ) + +target_include_directories ( ia PUBLIC include ) + +target_link_libraries ( ia crypto common ) diff --git a/stglibs/ia.lib/Makefile b/libs/ia/Makefile similarity index 100% rename from stglibs/ia.lib/Makefile rename to libs/ia/Makefile diff --git a/stglibs/ia.lib/ia.cpp b/libs/ia/ia.cpp similarity index 100% rename from stglibs/ia.lib/ia.cpp rename to libs/ia/ia.cpp diff --git a/stglibs/ia.lib/include/stg/ia.h b/libs/ia/include/stg/ia.h similarity index 100% rename from stglibs/ia.lib/include/stg/ia.h rename to libs/ia/include/stg/ia.h diff --git a/libs/ibpp/CMakeLists.txt b/libs/ibpp/CMakeLists.txt new file mode 100644 index 00000000..109ba752 --- /dev/null +++ b/libs/ibpp/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES all_in_one.cpp ) + +add_library ( ibpp STATIC ${CPP_FILES} ) + +target_include_directories ( ibpp PUBLIC include ) diff --git a/stglibs/ibpp.lib/Makefile b/libs/ibpp/Makefile similarity index 100% rename from stglibs/ibpp.lib/Makefile rename to libs/ibpp/Makefile diff --git a/stglibs/ibpp.lib/_dpb.cpp b/libs/ibpp/_dpb.cpp similarity index 100% rename from stglibs/ibpp.lib/_dpb.cpp rename to libs/ibpp/_dpb.cpp diff --git a/stglibs/ibpp.lib/_ibpp.cpp b/libs/ibpp/_ibpp.cpp similarity index 100% rename from stglibs/ibpp.lib/_ibpp.cpp rename to libs/ibpp/_ibpp.cpp diff --git a/stglibs/ibpp.lib/_ibpp.h b/libs/ibpp/_ibpp.h similarity index 100% rename from stglibs/ibpp.lib/_ibpp.h rename to libs/ibpp/_ibpp.h diff --git a/stglibs/ibpp.lib/_ibs.cpp b/libs/ibpp/_ibs.cpp similarity index 100% rename from stglibs/ibpp.lib/_ibs.cpp rename to libs/ibpp/_ibs.cpp diff --git a/stglibs/ibpp.lib/_rb.cpp b/libs/ibpp/_rb.cpp similarity index 100% rename from stglibs/ibpp.lib/_rb.cpp rename to libs/ibpp/_rb.cpp diff --git a/stglibs/ibpp.lib/_spb.cpp b/libs/ibpp/_spb.cpp similarity index 100% rename from stglibs/ibpp.lib/_spb.cpp rename to libs/ibpp/_spb.cpp diff --git a/stglibs/ibpp.lib/_tpb.cpp b/libs/ibpp/_tpb.cpp similarity index 100% rename from stglibs/ibpp.lib/_tpb.cpp rename to libs/ibpp/_tpb.cpp diff --git a/stglibs/ibpp.lib/all_in_one.cpp b/libs/ibpp/all_in_one.cpp similarity index 100% rename from stglibs/ibpp.lib/all_in_one.cpp rename to libs/ibpp/all_in_one.cpp diff --git a/stglibs/ibpp.lib/array.cpp b/libs/ibpp/array.cpp similarity index 100% rename from stglibs/ibpp.lib/array.cpp rename to libs/ibpp/array.cpp diff --git a/stglibs/ibpp.lib/blob.cpp b/libs/ibpp/blob.cpp similarity index 100% rename from stglibs/ibpp.lib/blob.cpp rename to libs/ibpp/blob.cpp diff --git a/stglibs/ibpp.lib/database.cpp b/libs/ibpp/database.cpp similarity index 100% rename from stglibs/ibpp.lib/database.cpp rename to libs/ibpp/database.cpp diff --git a/stglibs/ibpp.lib/date.cpp b/libs/ibpp/date.cpp similarity index 100% rename from stglibs/ibpp.lib/date.cpp rename to libs/ibpp/date.cpp diff --git a/stglibs/ibpp.lib/dbkey.cpp b/libs/ibpp/dbkey.cpp similarity index 100% rename from stglibs/ibpp.lib/dbkey.cpp rename to libs/ibpp/dbkey.cpp diff --git a/stglibs/ibpp.lib/events.cpp b/libs/ibpp/events.cpp similarity index 100% rename from stglibs/ibpp.lib/events.cpp rename to libs/ibpp/events.cpp diff --git a/stglibs/ibpp.lib/exception.cpp b/libs/ibpp/exception.cpp similarity index 100% rename from stglibs/ibpp.lib/exception.cpp rename to libs/ibpp/exception.cpp diff --git a/stglibs/ibpp.lib/ibase.h b/libs/ibpp/ibase.h similarity index 100% rename from stglibs/ibpp.lib/ibase.h rename to libs/ibpp/ibase.h diff --git a/stglibs/ibpp.lib/iberror.h b/libs/ibpp/iberror.h similarity index 100% rename from stglibs/ibpp.lib/iberror.h rename to libs/ibpp/iberror.h diff --git a/stglibs/ibpp.lib/include/stg/ibpp.h b/libs/ibpp/include/stg/ibpp.h similarity index 97% rename from stglibs/ibpp.lib/include/stg/ibpp.h rename to libs/ibpp/include/stg/ibpp.h index 0029094e..f666b16d 100644 --- a/stglibs/ibpp.lib/include/stg/ibpp.h +++ b/libs/ibpp/include/stg/ibpp.h @@ -79,7 +79,7 @@ #endif typedef __int64 int64_t; #else - #include // C99 (§7.18) integer types definitions + #include // C99 (§7.18) integer types definitions #endif #if !defined(_) diff --git a/stglibs/ibpp.lib/row.cpp b/libs/ibpp/row.cpp similarity index 100% rename from stglibs/ibpp.lib/row.cpp rename to libs/ibpp/row.cpp diff --git a/stglibs/ibpp.lib/service.cpp b/libs/ibpp/service.cpp similarity index 100% rename from stglibs/ibpp.lib/service.cpp rename to libs/ibpp/service.cpp diff --git a/stglibs/ibpp.lib/statement.cpp b/libs/ibpp/statement.cpp similarity index 100% rename from stglibs/ibpp.lib/statement.cpp rename to libs/ibpp/statement.cpp diff --git a/stglibs/ibpp.lib/time.cpp b/libs/ibpp/time.cpp similarity index 100% rename from stglibs/ibpp.lib/time.cpp rename to libs/ibpp/time.cpp diff --git a/stglibs/ibpp.lib/transaction.cpp b/libs/ibpp/transaction.cpp similarity index 100% rename from stglibs/ibpp.lib/transaction.cpp rename to libs/ibpp/transaction.cpp diff --git a/stglibs/ibpp.lib/user.cpp b/libs/ibpp/user.cpp similarity index 100% rename from stglibs/ibpp.lib/user.cpp rename to libs/ibpp/user.cpp diff --git a/libs/json/CMakeLists.txt b/libs/json/CMakeLists.txt new file mode 100644 index 00000000..c6031550 --- /dev/null +++ b/libs/json/CMakeLists.txt @@ -0,0 +1,7 @@ +set ( CPP_FILES generator.cpp parser.cpp ) + +add_library ( json STATIC ${CPP_FILES} ) + +target_include_directories ( json PUBLIC include ) + +target_link_libraries ( json common ) diff --git a/stglibs/json.lib/Makefile b/libs/json/Makefile similarity index 100% rename from stglibs/json.lib/Makefile rename to libs/json/Makefile diff --git a/stglibs/json.lib/generator.cpp b/libs/json/generator.cpp similarity index 100% rename from stglibs/json.lib/generator.cpp rename to libs/json/generator.cpp diff --git a/stglibs/json.lib/include/stg/json_generator.h b/libs/json/include/stg/json_generator.h similarity index 100% rename from stglibs/json.lib/include/stg/json_generator.h rename to libs/json/include/stg/json_generator.h diff --git a/stglibs/json.lib/include/stg/json_parser.h b/libs/json/include/stg/json_parser.h similarity index 100% rename from stglibs/json.lib/include/stg/json_parser.h rename to libs/json/include/stg/json_parser.h diff --git a/stglibs/json.lib/parser.cpp b/libs/json/parser.cpp similarity index 100% rename from stglibs/json.lib/parser.cpp rename to libs/json/parser.cpp diff --git a/libs/logger/CMakeLists.txt b/libs/logger/CMakeLists.txt new file mode 100644 index 00000000..44b1e0d9 --- /dev/null +++ b/libs/logger/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES logger.cpp ) + +add_library ( logger STATIC ${CPP_FILES} ) + +target_include_directories ( logger PUBLIC include ) diff --git a/stglibs/logger.lib/Makefile b/libs/logger/Makefile similarity index 100% rename from stglibs/logger.lib/Makefile rename to libs/logger/Makefile diff --git a/stglibs/logger.lib/include/stg/logger.h b/libs/logger/include/stg/logger.h similarity index 100% rename from stglibs/logger.lib/include/stg/logger.h rename to libs/logger/include/stg/logger.h diff --git a/stglibs/logger.lib/logger.cpp b/libs/logger/logger.cpp similarity index 100% rename from stglibs/logger.lib/logger.cpp rename to libs/logger/logger.cpp diff --git a/libs/pinger/CMakeLists.txt b/libs/pinger/CMakeLists.txt new file mode 100644 index 00000000..f70e580a --- /dev/null +++ b/libs/pinger/CMakeLists.txt @@ -0,0 +1,7 @@ +set ( CPP_FILES pinger.cpp ) + +add_library ( pinger STATIC ${CPP_FILES} ) + +target_include_directories ( pinger PUBLIC include ) + +target_link_libraries ( pinger common ) diff --git a/stglibs/pinger.lib/Makefile b/libs/pinger/Makefile similarity index 100% rename from stglibs/pinger.lib/Makefile rename to libs/pinger/Makefile diff --git a/stglibs/pinger.lib/include/stg/pinger.h b/libs/pinger/include/stg/pinger.h similarity index 97% rename from stglibs/pinger.lib/include/stg/pinger.h rename to libs/pinger/include/stg/pinger.h index f31cc270..26f5f4b3 100644 --- a/stglibs/pinger.lib/include/stg/pinger.h +++ b/libs/pinger/include/stg/pinger.h @@ -18,7 +18,7 @@ #include #endif -#if defined (FREE_BSD) || defined (FREE_BSD5) || defined(DARWIN) +#if defined (FREE_BSD) || defined(DARWIN) #include #include #include @@ -27,7 +27,7 @@ #include #endif -#include "stg/os_int.h" +#include //----------------------------------------------------------------------------- struct ICMP_HDR diff --git a/stglibs/pinger.lib/pinger.cpp b/libs/pinger/pinger.cpp similarity index 100% rename from stglibs/pinger.lib/pinger.cpp rename to libs/pinger/pinger.cpp diff --git a/libs/scriptexecuter/CMakeLists.txt b/libs/scriptexecuter/CMakeLists.txt new file mode 100644 index 00000000..88d9b23d --- /dev/null +++ b/libs/scriptexecuter/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( C_FILES scriptexecuter.c ) + +add_library ( scriptexecuter STATIC ${C_FILES} ) + +target_include_directories ( scriptexecuter PUBLIC include ) diff --git a/stglibs/scriptexecuter.lib/Makefile b/libs/scriptexecuter/Makefile similarity index 100% rename from stglibs/scriptexecuter.lib/Makefile rename to libs/scriptexecuter/Makefile diff --git a/stglibs/scriptexecuter.lib/include/stg/scriptexecuter.h b/libs/scriptexecuter/include/stg/scriptexecuter.h similarity index 100% rename from stglibs/scriptexecuter.lib/include/stg/scriptexecuter.h rename to libs/scriptexecuter/include/stg/scriptexecuter.h diff --git a/stglibs/scriptexecuter.lib/scriptexecuter.c b/libs/scriptexecuter/scriptexecuter.c similarity index 100% rename from stglibs/scriptexecuter.lib/scriptexecuter.c rename to libs/scriptexecuter/scriptexecuter.c diff --git a/stglibs/smux.lib/ANY.c b/libs/smux/ANY.c similarity index 100% rename from stglibs/smux.lib/ANY.c rename to libs/smux/ANY.c diff --git a/stglibs/smux.lib/ApplicationSyntax.c b/libs/smux/ApplicationSyntax.c similarity index 100% rename from stglibs/smux.lib/ApplicationSyntax.c rename to libs/smux/ApplicationSyntax.c diff --git a/stglibs/smux.lib/AtEntry.c b/libs/smux/AtEntry.c similarity index 100% rename from stglibs/smux.lib/AtEntry.c rename to libs/smux/AtEntry.c diff --git a/stglibs/smux.lib/BIT_STRING.c b/libs/smux/BIT_STRING.c similarity index 100% rename from stglibs/smux.lib/BIT_STRING.c rename to libs/smux/BIT_STRING.c diff --git a/stglibs/smux.lib/BOOLEAN.c b/libs/smux/BOOLEAN.c similarity index 100% rename from stglibs/smux.lib/BOOLEAN.c rename to libs/smux/BOOLEAN.c diff --git a/libs/smux/CMakeLists.txt b/libs/smux/CMakeLists.txt new file mode 100644 index 00000000..81fe22f4 --- /dev/null +++ b/libs/smux/CMakeLists.txt @@ -0,0 +1,5 @@ +file ( GLOB C_FILES *.c ) + +add_library ( smux STATIC ${C_FILES} ) + +target_include_directories ( smux PUBLIC include include/stg ) diff --git a/stglibs/smux.lib/ClosePDU.c b/libs/smux/ClosePDU.c similarity index 100% rename from stglibs/smux.lib/ClosePDU.c rename to libs/smux/ClosePDU.c diff --git a/stglibs/smux.lib/Counter.c b/libs/smux/Counter.c similarity index 100% rename from stglibs/smux.lib/Counter.c rename to libs/smux/Counter.c diff --git a/stglibs/smux.lib/DisplayString.c b/libs/smux/DisplayString.c similarity index 100% rename from stglibs/smux.lib/DisplayString.c rename to libs/smux/DisplayString.c diff --git a/stglibs/smux.lib/EgpNeighEntry.c b/libs/smux/EgpNeighEntry.c similarity index 100% rename from stglibs/smux.lib/EgpNeighEntry.c rename to libs/smux/EgpNeighEntry.c diff --git a/stglibs/smux.lib/Gauge.c b/libs/smux/Gauge.c similarity index 100% rename from stglibs/smux.lib/Gauge.c rename to libs/smux/Gauge.c diff --git a/stglibs/smux.lib/GetNextRequest-PDU.c b/libs/smux/GetNextRequest-PDU.c similarity index 100% rename from stglibs/smux.lib/GetNextRequest-PDU.c rename to libs/smux/GetNextRequest-PDU.c diff --git a/stglibs/smux.lib/GetRequest-PDU.c b/libs/smux/GetRequest-PDU.c similarity index 100% rename from stglibs/smux.lib/GetRequest-PDU.c rename to libs/smux/GetRequest-PDU.c diff --git a/stglibs/smux.lib/GetResponse-PDU.c b/libs/smux/GetResponse-PDU.c similarity index 100% rename from stglibs/smux.lib/GetResponse-PDU.c rename to libs/smux/GetResponse-PDU.c diff --git a/stglibs/smux.lib/INTEGER.c b/libs/smux/INTEGER.c similarity index 100% rename from stglibs/smux.lib/INTEGER.c rename to libs/smux/INTEGER.c diff --git a/stglibs/smux.lib/IfEntry.c b/libs/smux/IfEntry.c similarity index 100% rename from stglibs/smux.lib/IfEntry.c rename to libs/smux/IfEntry.c diff --git a/stglibs/smux.lib/IpAddrEntry.c b/libs/smux/IpAddrEntry.c similarity index 100% rename from stglibs/smux.lib/IpAddrEntry.c rename to libs/smux/IpAddrEntry.c diff --git a/stglibs/smux.lib/IpAddress.c b/libs/smux/IpAddress.c similarity index 100% rename from stglibs/smux.lib/IpAddress.c rename to libs/smux/IpAddress.c diff --git a/stglibs/smux.lib/IpNetToMediaEntry.c b/libs/smux/IpNetToMediaEntry.c similarity index 100% rename from stglibs/smux.lib/IpNetToMediaEntry.c rename to libs/smux/IpNetToMediaEntry.c diff --git a/stglibs/smux.lib/IpRouteEntry.c b/libs/smux/IpRouteEntry.c similarity index 100% rename from stglibs/smux.lib/IpRouteEntry.c rename to libs/smux/IpRouteEntry.c diff --git a/stglibs/smux.lib/Makefile b/libs/smux/Makefile similarity index 100% rename from stglibs/smux.lib/Makefile rename to libs/smux/Makefile diff --git a/stglibs/smux.lib/Message.c b/libs/smux/Message.c similarity index 100% rename from stglibs/smux.lib/Message.c rename to libs/smux/Message.c diff --git a/stglibs/smux.lib/NULL.c b/libs/smux/NULL.c similarity index 100% rename from stglibs/smux.lib/NULL.c rename to libs/smux/NULL.c diff --git a/stglibs/smux.lib/NativeEnumerated.c b/libs/smux/NativeEnumerated.c similarity index 100% rename from stglibs/smux.lib/NativeEnumerated.c rename to libs/smux/NativeEnumerated.c diff --git a/stglibs/smux.lib/NativeInteger.c b/libs/smux/NativeInteger.c similarity index 100% rename from stglibs/smux.lib/NativeInteger.c rename to libs/smux/NativeInteger.c diff --git a/stglibs/smux.lib/NetworkAddress.c b/libs/smux/NetworkAddress.c similarity index 100% rename from stglibs/smux.lib/NetworkAddress.c rename to libs/smux/NetworkAddress.c diff --git a/stglibs/smux.lib/OBJECT_IDENTIFIER.c b/libs/smux/OBJECT_IDENTIFIER.c similarity index 100% rename from stglibs/smux.lib/OBJECT_IDENTIFIER.c rename to libs/smux/OBJECT_IDENTIFIER.c diff --git a/stglibs/smux.lib/OCTET_STRING.c b/libs/smux/OCTET_STRING.c similarity index 100% rename from stglibs/smux.lib/OCTET_STRING.c rename to libs/smux/OCTET_STRING.c diff --git a/stglibs/smux.lib/ObjectName.c b/libs/smux/ObjectName.c similarity index 100% rename from stglibs/smux.lib/ObjectName.c rename to libs/smux/ObjectName.c diff --git a/stglibs/smux.lib/ObjectSyntax.c b/libs/smux/ObjectSyntax.c similarity index 100% rename from stglibs/smux.lib/ObjectSyntax.c rename to libs/smux/ObjectSyntax.c diff --git a/stglibs/smux.lib/Opaque.c b/libs/smux/Opaque.c similarity index 100% rename from stglibs/smux.lib/Opaque.c rename to libs/smux/Opaque.c diff --git a/stglibs/smux.lib/OpenPDU.c b/libs/smux/OpenPDU.c similarity index 100% rename from stglibs/smux.lib/OpenPDU.c rename to libs/smux/OpenPDU.c diff --git a/stglibs/smux.lib/PDU.c b/libs/smux/PDU.c similarity index 100% rename from stglibs/smux.lib/PDU.c rename to libs/smux/PDU.c diff --git a/stglibs/smux.lib/PDUs.c b/libs/smux/PDUs.c similarity index 100% rename from stglibs/smux.lib/PDUs.c rename to libs/smux/PDUs.c diff --git a/stglibs/smux.lib/PhysAddress.c b/libs/smux/PhysAddress.c similarity index 100% rename from stglibs/smux.lib/PhysAddress.c rename to libs/smux/PhysAddress.c diff --git a/stglibs/smux.lib/RFC1155-SMI.asn1 b/libs/smux/RFC1155-SMI.asn1 similarity index 100% rename from stglibs/smux.lib/RFC1155-SMI.asn1 rename to libs/smux/RFC1155-SMI.asn1 diff --git a/stglibs/smux.lib/RFC1157-SNMP.asn1 b/libs/smux/RFC1157-SNMP.asn1 similarity index 100% rename from stglibs/smux.lib/RFC1157-SNMP.asn1 rename to libs/smux/RFC1157-SNMP.asn1 diff --git a/stglibs/smux.lib/RFC1213-MIB.asn1 b/libs/smux/RFC1213-MIB.asn1 similarity index 100% rename from stglibs/smux.lib/RFC1213-MIB.asn1 rename to libs/smux/RFC1213-MIB.asn1 diff --git a/stglibs/smux.lib/RReqPDU.c b/libs/smux/RReqPDU.c similarity index 100% rename from stglibs/smux.lib/RReqPDU.c rename to libs/smux/RReqPDU.c diff --git a/stglibs/smux.lib/RRspPDU.c b/libs/smux/RRspPDU.c similarity index 100% rename from stglibs/smux.lib/RRspPDU.c rename to libs/smux/RRspPDU.c diff --git a/stglibs/smux.lib/SMUX-PDUs.c b/libs/smux/SMUX-PDUs.c similarity index 100% rename from stglibs/smux.lib/SMUX-PDUs.c rename to libs/smux/SMUX-PDUs.c diff --git a/stglibs/smux.lib/SMUX.asn1 b/libs/smux/SMUX.asn1 similarity index 100% rename from stglibs/smux.lib/SMUX.asn1 rename to libs/smux/SMUX.asn1 diff --git a/stglibs/smux.lib/SOutPDU.c b/libs/smux/SOutPDU.c similarity index 100% rename from stglibs/smux.lib/SOutPDU.c rename to libs/smux/SOutPDU.c diff --git a/stglibs/smux.lib/SetRequest-PDU.c b/libs/smux/SetRequest-PDU.c similarity index 100% rename from stglibs/smux.lib/SetRequest-PDU.c rename to libs/smux/SetRequest-PDU.c diff --git a/stglibs/smux.lib/SimpleOpen.c b/libs/smux/SimpleOpen.c similarity index 100% rename from stglibs/smux.lib/SimpleOpen.c rename to libs/smux/SimpleOpen.c diff --git a/stglibs/smux.lib/SimpleSyntax.c b/libs/smux/SimpleSyntax.c similarity index 100% rename from stglibs/smux.lib/SimpleSyntax.c rename to libs/smux/SimpleSyntax.c diff --git a/stglibs/smux.lib/TcpConnEntry.c b/libs/smux/TcpConnEntry.c similarity index 100% rename from stglibs/smux.lib/TcpConnEntry.c rename to libs/smux/TcpConnEntry.c diff --git a/stglibs/smux.lib/TimeTicks.c b/libs/smux/TimeTicks.c similarity index 100% rename from stglibs/smux.lib/TimeTicks.c rename to libs/smux/TimeTicks.c diff --git a/stglibs/smux.lib/Trap-PDU.c b/libs/smux/Trap-PDU.c similarity index 100% rename from stglibs/smux.lib/Trap-PDU.c rename to libs/smux/Trap-PDU.c diff --git a/stglibs/smux.lib/UdpEntry.c b/libs/smux/UdpEntry.c similarity index 100% rename from stglibs/smux.lib/UdpEntry.c rename to libs/smux/UdpEntry.c diff --git a/stglibs/smux.lib/VarBind.c b/libs/smux/VarBind.c similarity index 100% rename from stglibs/smux.lib/VarBind.c rename to libs/smux/VarBind.c diff --git a/stglibs/smux.lib/VarBindList.c b/libs/smux/VarBindList.c similarity index 100% rename from stglibs/smux.lib/VarBindList.c rename to libs/smux/VarBindList.c diff --git a/stglibs/smux.lib/asn_SEQUENCE_OF.c b/libs/smux/asn_SEQUENCE_OF.c similarity index 100% rename from stglibs/smux.lib/asn_SEQUENCE_OF.c rename to libs/smux/asn_SEQUENCE_OF.c diff --git a/stglibs/smux.lib/asn_SET_OF.c b/libs/smux/asn_SET_OF.c similarity index 100% rename from stglibs/smux.lib/asn_SET_OF.c rename to libs/smux/asn_SET_OF.c diff --git a/stglibs/smux.lib/asn_codecs_prim.c b/libs/smux/asn_codecs_prim.c similarity index 100% rename from stglibs/smux.lib/asn_codecs_prim.c rename to libs/smux/asn_codecs_prim.c diff --git a/stglibs/smux.lib/ber_decoder.c b/libs/smux/ber_decoder.c similarity index 100% rename from stglibs/smux.lib/ber_decoder.c rename to libs/smux/ber_decoder.c diff --git a/stglibs/smux.lib/ber_tlv_length.c b/libs/smux/ber_tlv_length.c similarity index 100% rename from stglibs/smux.lib/ber_tlv_length.c rename to libs/smux/ber_tlv_length.c diff --git a/stglibs/smux.lib/ber_tlv_tag.c b/libs/smux/ber_tlv_tag.c similarity index 100% rename from stglibs/smux.lib/ber_tlv_tag.c rename to libs/smux/ber_tlv_tag.c diff --git a/stglibs/smux.lib/constr_CHOICE.c b/libs/smux/constr_CHOICE.c similarity index 100% rename from stglibs/smux.lib/constr_CHOICE.c rename to libs/smux/constr_CHOICE.c diff --git a/stglibs/smux.lib/constr_SEQUENCE.c b/libs/smux/constr_SEQUENCE.c similarity index 100% rename from stglibs/smux.lib/constr_SEQUENCE.c rename to libs/smux/constr_SEQUENCE.c diff --git a/stglibs/smux.lib/constr_SEQUENCE_OF.c b/libs/smux/constr_SEQUENCE_OF.c similarity index 100% rename from stglibs/smux.lib/constr_SEQUENCE_OF.c rename to libs/smux/constr_SEQUENCE_OF.c diff --git a/stglibs/smux.lib/constr_SET_OF.c b/libs/smux/constr_SET_OF.c similarity index 100% rename from stglibs/smux.lib/constr_SET_OF.c rename to libs/smux/constr_SET_OF.c diff --git a/stglibs/smux.lib/constr_TYPE.c b/libs/smux/constr_TYPE.c similarity index 100% rename from stglibs/smux.lib/constr_TYPE.c rename to libs/smux/constr_TYPE.c diff --git a/stglibs/smux.lib/constraints.c b/libs/smux/constraints.c similarity index 100% rename from stglibs/smux.lib/constraints.c rename to libs/smux/constraints.c diff --git a/stglibs/smux.lib/der_encoder.c b/libs/smux/der_encoder.c similarity index 100% rename from stglibs/smux.lib/der_encoder.c rename to libs/smux/der_encoder.c diff --git a/stglibs/smux.lib/include/stg/ANY.h b/libs/smux/include/stg/ANY.h similarity index 100% rename from stglibs/smux.lib/include/stg/ANY.h rename to libs/smux/include/stg/ANY.h diff --git a/stglibs/smux.lib/include/stg/ApplicationSyntax.h b/libs/smux/include/stg/ApplicationSyntax.h similarity index 100% rename from stglibs/smux.lib/include/stg/ApplicationSyntax.h rename to libs/smux/include/stg/ApplicationSyntax.h diff --git a/stglibs/smux.lib/include/stg/AtEntry.h b/libs/smux/include/stg/AtEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/AtEntry.h rename to libs/smux/include/stg/AtEntry.h diff --git a/stglibs/smux.lib/include/stg/BIT_STRING.h b/libs/smux/include/stg/BIT_STRING.h similarity index 100% rename from stglibs/smux.lib/include/stg/BIT_STRING.h rename to libs/smux/include/stg/BIT_STRING.h diff --git a/stglibs/smux.lib/include/stg/BOOLEAN.h b/libs/smux/include/stg/BOOLEAN.h similarity index 100% rename from stglibs/smux.lib/include/stg/BOOLEAN.h rename to libs/smux/include/stg/BOOLEAN.h diff --git a/stglibs/smux.lib/include/stg/ClosePDU.h b/libs/smux/include/stg/ClosePDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/ClosePDU.h rename to libs/smux/include/stg/ClosePDU.h diff --git a/stglibs/smux.lib/include/stg/Counter.h b/libs/smux/include/stg/Counter.h similarity index 100% rename from stglibs/smux.lib/include/stg/Counter.h rename to libs/smux/include/stg/Counter.h diff --git a/stglibs/smux.lib/include/stg/DisplayString.h b/libs/smux/include/stg/DisplayString.h similarity index 100% rename from stglibs/smux.lib/include/stg/DisplayString.h rename to libs/smux/include/stg/DisplayString.h diff --git a/stglibs/smux.lib/include/stg/EgpNeighEntry.h b/libs/smux/include/stg/EgpNeighEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/EgpNeighEntry.h rename to libs/smux/include/stg/EgpNeighEntry.h diff --git a/stglibs/smux.lib/include/stg/Gauge.h b/libs/smux/include/stg/Gauge.h similarity index 100% rename from stglibs/smux.lib/include/stg/Gauge.h rename to libs/smux/include/stg/Gauge.h diff --git a/stglibs/smux.lib/include/stg/GetNextRequest-PDU.h b/libs/smux/include/stg/GetNextRequest-PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/GetNextRequest-PDU.h rename to libs/smux/include/stg/GetNextRequest-PDU.h diff --git a/stglibs/smux.lib/include/stg/GetRequest-PDU.h b/libs/smux/include/stg/GetRequest-PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/GetRequest-PDU.h rename to libs/smux/include/stg/GetRequest-PDU.h diff --git a/stglibs/smux.lib/include/stg/GetResponse-PDU.h b/libs/smux/include/stg/GetResponse-PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/GetResponse-PDU.h rename to libs/smux/include/stg/GetResponse-PDU.h diff --git a/stglibs/smux.lib/include/stg/INTEGER.h b/libs/smux/include/stg/INTEGER.h similarity index 100% rename from stglibs/smux.lib/include/stg/INTEGER.h rename to libs/smux/include/stg/INTEGER.h diff --git a/stglibs/smux.lib/include/stg/IfEntry.h b/libs/smux/include/stg/IfEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/IfEntry.h rename to libs/smux/include/stg/IfEntry.h diff --git a/stglibs/smux.lib/include/stg/IpAddrEntry.h b/libs/smux/include/stg/IpAddrEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/IpAddrEntry.h rename to libs/smux/include/stg/IpAddrEntry.h diff --git a/stglibs/smux.lib/include/stg/IpAddress.h b/libs/smux/include/stg/IpAddress.h similarity index 100% rename from stglibs/smux.lib/include/stg/IpAddress.h rename to libs/smux/include/stg/IpAddress.h diff --git a/stglibs/smux.lib/include/stg/IpNetToMediaEntry.h b/libs/smux/include/stg/IpNetToMediaEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/IpNetToMediaEntry.h rename to libs/smux/include/stg/IpNetToMediaEntry.h diff --git a/stglibs/smux.lib/include/stg/IpRouteEntry.h b/libs/smux/include/stg/IpRouteEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/IpRouteEntry.h rename to libs/smux/include/stg/IpRouteEntry.h diff --git a/stglibs/smux.lib/include/stg/Message.h b/libs/smux/include/stg/Message.h similarity index 100% rename from stglibs/smux.lib/include/stg/Message.h rename to libs/smux/include/stg/Message.h diff --git a/stglibs/smux.lib/include/stg/NULL.h b/libs/smux/include/stg/NULL.h similarity index 100% rename from stglibs/smux.lib/include/stg/NULL.h rename to libs/smux/include/stg/NULL.h diff --git a/stglibs/smux.lib/include/stg/NativeEnumerated.h b/libs/smux/include/stg/NativeEnumerated.h similarity index 100% rename from stglibs/smux.lib/include/stg/NativeEnumerated.h rename to libs/smux/include/stg/NativeEnumerated.h diff --git a/stglibs/smux.lib/include/stg/NativeInteger.h b/libs/smux/include/stg/NativeInteger.h similarity index 100% rename from stglibs/smux.lib/include/stg/NativeInteger.h rename to libs/smux/include/stg/NativeInteger.h diff --git a/stglibs/smux.lib/include/stg/NetworkAddress.h b/libs/smux/include/stg/NetworkAddress.h similarity index 100% rename from stglibs/smux.lib/include/stg/NetworkAddress.h rename to libs/smux/include/stg/NetworkAddress.h diff --git a/stglibs/smux.lib/include/stg/OBJECT_IDENTIFIER.h b/libs/smux/include/stg/OBJECT_IDENTIFIER.h similarity index 100% rename from stglibs/smux.lib/include/stg/OBJECT_IDENTIFIER.h rename to libs/smux/include/stg/OBJECT_IDENTIFIER.h diff --git a/stglibs/smux.lib/include/stg/OCTET_STRING.h b/libs/smux/include/stg/OCTET_STRING.h similarity index 100% rename from stglibs/smux.lib/include/stg/OCTET_STRING.h rename to libs/smux/include/stg/OCTET_STRING.h diff --git a/stglibs/smux.lib/include/stg/ObjectName.h b/libs/smux/include/stg/ObjectName.h similarity index 100% rename from stglibs/smux.lib/include/stg/ObjectName.h rename to libs/smux/include/stg/ObjectName.h diff --git a/stglibs/smux.lib/include/stg/ObjectSyntax.h b/libs/smux/include/stg/ObjectSyntax.h similarity index 100% rename from stglibs/smux.lib/include/stg/ObjectSyntax.h rename to libs/smux/include/stg/ObjectSyntax.h diff --git a/stglibs/smux.lib/include/stg/Opaque.h b/libs/smux/include/stg/Opaque.h similarity index 100% rename from stglibs/smux.lib/include/stg/Opaque.h rename to libs/smux/include/stg/Opaque.h diff --git a/stglibs/smux.lib/include/stg/OpenPDU.h b/libs/smux/include/stg/OpenPDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/OpenPDU.h rename to libs/smux/include/stg/OpenPDU.h diff --git a/stglibs/smux.lib/include/stg/PDU.h b/libs/smux/include/stg/PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/PDU.h rename to libs/smux/include/stg/PDU.h diff --git a/stglibs/smux.lib/include/stg/PDUs.h b/libs/smux/include/stg/PDUs.h similarity index 100% rename from stglibs/smux.lib/include/stg/PDUs.h rename to libs/smux/include/stg/PDUs.h diff --git a/stglibs/smux.lib/include/stg/PhysAddress.h b/libs/smux/include/stg/PhysAddress.h similarity index 100% rename from stglibs/smux.lib/include/stg/PhysAddress.h rename to libs/smux/include/stg/PhysAddress.h diff --git a/stglibs/smux.lib/include/stg/RReqPDU.h b/libs/smux/include/stg/RReqPDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/RReqPDU.h rename to libs/smux/include/stg/RReqPDU.h diff --git a/stglibs/smux.lib/include/stg/RRspPDU.h b/libs/smux/include/stg/RRspPDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/RRspPDU.h rename to libs/smux/include/stg/RRspPDU.h diff --git a/stglibs/smux.lib/include/stg/SMUX-PDUs.h b/libs/smux/include/stg/SMUX-PDUs.h similarity index 100% rename from stglibs/smux.lib/include/stg/SMUX-PDUs.h rename to libs/smux/include/stg/SMUX-PDUs.h diff --git a/stglibs/smux.lib/include/stg/SOutPDU.h b/libs/smux/include/stg/SOutPDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/SOutPDU.h rename to libs/smux/include/stg/SOutPDU.h diff --git a/stglibs/smux.lib/include/stg/SetRequest-PDU.h b/libs/smux/include/stg/SetRequest-PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/SetRequest-PDU.h rename to libs/smux/include/stg/SetRequest-PDU.h diff --git a/stglibs/smux.lib/include/stg/SimpleOpen.h b/libs/smux/include/stg/SimpleOpen.h similarity index 100% rename from stglibs/smux.lib/include/stg/SimpleOpen.h rename to libs/smux/include/stg/SimpleOpen.h diff --git a/stglibs/smux.lib/include/stg/SimpleSyntax.h b/libs/smux/include/stg/SimpleSyntax.h similarity index 100% rename from stglibs/smux.lib/include/stg/SimpleSyntax.h rename to libs/smux/include/stg/SimpleSyntax.h diff --git a/stglibs/smux.lib/include/stg/TcpConnEntry.h b/libs/smux/include/stg/TcpConnEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/TcpConnEntry.h rename to libs/smux/include/stg/TcpConnEntry.h diff --git a/stglibs/smux.lib/include/stg/TimeTicks.h b/libs/smux/include/stg/TimeTicks.h similarity index 100% rename from stglibs/smux.lib/include/stg/TimeTicks.h rename to libs/smux/include/stg/TimeTicks.h diff --git a/stglibs/smux.lib/include/stg/Trap-PDU.h b/libs/smux/include/stg/Trap-PDU.h similarity index 100% rename from stglibs/smux.lib/include/stg/Trap-PDU.h rename to libs/smux/include/stg/Trap-PDU.h diff --git a/stglibs/smux.lib/include/stg/UdpEntry.h b/libs/smux/include/stg/UdpEntry.h similarity index 100% rename from stglibs/smux.lib/include/stg/UdpEntry.h rename to libs/smux/include/stg/UdpEntry.h diff --git a/stglibs/smux.lib/include/stg/VarBind.h b/libs/smux/include/stg/VarBind.h similarity index 100% rename from stglibs/smux.lib/include/stg/VarBind.h rename to libs/smux/include/stg/VarBind.h diff --git a/stglibs/smux.lib/include/stg/VarBindList.h b/libs/smux/include/stg/VarBindList.h similarity index 100% rename from stglibs/smux.lib/include/stg/VarBindList.h rename to libs/smux/include/stg/VarBindList.h diff --git a/stglibs/smux.lib/include/stg/asn_SEQUENCE_OF.h b/libs/smux/include/stg/asn_SEQUENCE_OF.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_SEQUENCE_OF.h rename to libs/smux/include/stg/asn_SEQUENCE_OF.h diff --git a/stglibs/smux.lib/include/stg/asn_SET_OF.h b/libs/smux/include/stg/asn_SET_OF.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_SET_OF.h rename to libs/smux/include/stg/asn_SET_OF.h diff --git a/stglibs/smux.lib/include/stg/asn_application.h b/libs/smux/include/stg/asn_application.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_application.h rename to libs/smux/include/stg/asn_application.h diff --git a/stglibs/smux.lib/include/stg/asn_codecs.h b/libs/smux/include/stg/asn_codecs.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_codecs.h rename to libs/smux/include/stg/asn_codecs.h diff --git a/stglibs/smux.lib/include/stg/asn_codecs_prim.h b/libs/smux/include/stg/asn_codecs_prim.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_codecs_prim.h rename to libs/smux/include/stg/asn_codecs_prim.h diff --git a/stglibs/smux.lib/include/stg/asn_internal.h b/libs/smux/include/stg/asn_internal.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_internal.h rename to libs/smux/include/stg/asn_internal.h diff --git a/stglibs/smux.lib/include/stg/asn_system.h b/libs/smux/include/stg/asn_system.h similarity index 100% rename from stglibs/smux.lib/include/stg/asn_system.h rename to libs/smux/include/stg/asn_system.h diff --git a/stglibs/smux.lib/include/stg/ber_decoder.h b/libs/smux/include/stg/ber_decoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/ber_decoder.h rename to libs/smux/include/stg/ber_decoder.h diff --git a/stglibs/smux.lib/include/stg/ber_tlv_length.h b/libs/smux/include/stg/ber_tlv_length.h similarity index 100% rename from stglibs/smux.lib/include/stg/ber_tlv_length.h rename to libs/smux/include/stg/ber_tlv_length.h diff --git a/stglibs/smux.lib/include/stg/ber_tlv_tag.h b/libs/smux/include/stg/ber_tlv_tag.h similarity index 100% rename from stglibs/smux.lib/include/stg/ber_tlv_tag.h rename to libs/smux/include/stg/ber_tlv_tag.h diff --git a/stglibs/smux.lib/include/stg/constr_CHOICE.h b/libs/smux/include/stg/constr_CHOICE.h similarity index 100% rename from stglibs/smux.lib/include/stg/constr_CHOICE.h rename to libs/smux/include/stg/constr_CHOICE.h diff --git a/stglibs/smux.lib/include/stg/constr_SEQUENCE.h b/libs/smux/include/stg/constr_SEQUENCE.h similarity index 100% rename from stglibs/smux.lib/include/stg/constr_SEQUENCE.h rename to libs/smux/include/stg/constr_SEQUENCE.h diff --git a/stglibs/smux.lib/include/stg/constr_SEQUENCE_OF.h b/libs/smux/include/stg/constr_SEQUENCE_OF.h similarity index 100% rename from stglibs/smux.lib/include/stg/constr_SEQUENCE_OF.h rename to libs/smux/include/stg/constr_SEQUENCE_OF.h diff --git a/stglibs/smux.lib/include/stg/constr_SET_OF.h b/libs/smux/include/stg/constr_SET_OF.h similarity index 100% rename from stglibs/smux.lib/include/stg/constr_SET_OF.h rename to libs/smux/include/stg/constr_SET_OF.h diff --git a/stglibs/smux.lib/include/stg/constr_TYPE.h b/libs/smux/include/stg/constr_TYPE.h similarity index 100% rename from stglibs/smux.lib/include/stg/constr_TYPE.h rename to libs/smux/include/stg/constr_TYPE.h diff --git a/stglibs/smux.lib/include/stg/constraints.h b/libs/smux/include/stg/constraints.h similarity index 100% rename from stglibs/smux.lib/include/stg/constraints.h rename to libs/smux/include/stg/constraints.h diff --git a/stglibs/smux.lib/include/stg/der_encoder.h b/libs/smux/include/stg/der_encoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/der_encoder.h rename to libs/smux/include/stg/der_encoder.h diff --git a/stglibs/smux.lib/include/stg/per_decoder.h b/libs/smux/include/stg/per_decoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/per_decoder.h rename to libs/smux/include/stg/per_decoder.h diff --git a/stglibs/smux.lib/include/stg/per_encoder.h b/libs/smux/include/stg/per_encoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/per_encoder.h rename to libs/smux/include/stg/per_encoder.h diff --git a/stglibs/smux.lib/include/stg/per_support.h b/libs/smux/include/stg/per_support.h similarity index 100% rename from stglibs/smux.lib/include/stg/per_support.h rename to libs/smux/include/stg/per_support.h diff --git a/stglibs/smux.lib/include/stg/xer_decoder.h b/libs/smux/include/stg/xer_decoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/xer_decoder.h rename to libs/smux/include/stg/xer_decoder.h diff --git a/stglibs/smux.lib/include/stg/xer_encoder.h b/libs/smux/include/stg/xer_encoder.h similarity index 100% rename from stglibs/smux.lib/include/stg/xer_encoder.h rename to libs/smux/include/stg/xer_encoder.h diff --git a/stglibs/smux.lib/include/stg/xer_support.h b/libs/smux/include/stg/xer_support.h similarity index 100% rename from stglibs/smux.lib/include/stg/xer_support.h rename to libs/smux/include/stg/xer_support.h diff --git a/stglibs/smux.lib/per_decoder.c b/libs/smux/per_decoder.c similarity index 100% rename from stglibs/smux.lib/per_decoder.c rename to libs/smux/per_decoder.c diff --git a/stglibs/smux.lib/per_encoder.c b/libs/smux/per_encoder.c similarity index 100% rename from stglibs/smux.lib/per_encoder.c rename to libs/smux/per_encoder.c diff --git a/stglibs/smux.lib/per_support.c b/libs/smux/per_support.c similarity index 100% rename from stglibs/smux.lib/per_support.c rename to libs/smux/per_support.c diff --git a/stglibs/smux.lib/xer_decoder.c b/libs/smux/xer_decoder.c similarity index 100% rename from stglibs/smux.lib/xer_decoder.c rename to libs/smux/xer_decoder.c diff --git a/stglibs/smux.lib/xer_encoder.c b/libs/smux/xer_encoder.c similarity index 100% rename from stglibs/smux.lib/xer_encoder.c rename to libs/smux/xer_encoder.c diff --git a/stglibs/smux.lib/xer_support.c b/libs/smux/xer_support.c similarity index 100% rename from stglibs/smux.lib/xer_support.c rename to libs/smux/xer_support.c diff --git a/libs/srvconf/CMakeLists.txt b/libs/srvconf/CMakeLists.txt new file mode 100644 index 00000000..e3cc91bb --- /dev/null +++ b/libs/srvconf/CMakeLists.txt @@ -0,0 +1,8 @@ +set ( CPP_FILES netunit.cpp servconf.cpp ) +file ( GLOB PARSERS parsers/*.cpp ) + +add_library ( srvconf STATIC ${CPP_FILES} ${PARSERS} ) + +target_include_directories ( srvconf PUBLIC include ) + +target_link_libraries ( srvconf crypto common ) diff --git a/stglibs/srvconf.lib/Makefile b/libs/srvconf/Makefile similarity index 100% rename from stglibs/srvconf.lib/Makefile rename to libs/srvconf/Makefile diff --git a/stglibs/srvconf.lib/include/stg/servconf.h b/libs/srvconf/include/stg/servconf.h similarity index 99% rename from stglibs/srvconf.lib/include/stg/servconf.h rename to libs/srvconf/include/stg/servconf.h index cd37e49e..efdf4b6b 100644 --- a/stglibs/srvconf.lib/include/stg/servconf.h +++ b/libs/srvconf/include/stg/servconf.h @@ -25,9 +25,9 @@ #include "stg/servconf_types.h" #include "stg/admin_conf.h" -#include "stg/os_int.h" #include +#include struct USER_CONF_RES; struct USER_STAT_RES; diff --git a/stglibs/srvconf.lib/include/stg/servconf_types.h b/libs/srvconf/include/stg/servconf_types.h similarity index 98% rename from stglibs/srvconf.lib/include/stg/servconf_types.h rename to libs/srvconf/include/stg/servconf_types.h index 167b8091..6c01d341 100644 --- a/stglibs/srvconf.lib/include/stg/servconf_types.h +++ b/libs/srvconf/include/stg/servconf_types.h @@ -23,11 +23,11 @@ #include "stg/array.h" #include "stg/const.h" // DIR_NUM -#include "stg/os_int.h" // uint32_t, etc... #include #include #include +#include struct ADMIN_CONF; struct TARIFF_DATA; diff --git a/stglibs/srvconf.lib/netunit.cpp b/libs/srvconf/netunit.cpp similarity index 100% rename from stglibs/srvconf.lib/netunit.cpp rename to libs/srvconf/netunit.cpp diff --git a/stglibs/srvconf.lib/netunit.h b/libs/srvconf/netunit.h similarity index 98% rename from stglibs/srvconf.lib/netunit.h rename to libs/srvconf/netunit.h index ca13bbc8..34d730e1 100644 --- a/stglibs/srvconf.lib/netunit.h +++ b/libs/srvconf/netunit.h @@ -21,7 +21,7 @@ #ifndef NetUnitH #define NetUnitH -#include "stg/os_int.h" +#include #include diff --git a/stglibs/srvconf.lib/parsers/auth_by.cpp b/libs/srvconf/parsers/auth_by.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/auth_by.cpp rename to libs/srvconf/parsers/auth_by.cpp diff --git a/stglibs/srvconf.lib/parsers/auth_by.h b/libs/srvconf/parsers/auth_by.h similarity index 100% rename from stglibs/srvconf.lib/parsers/auth_by.h rename to libs/srvconf/parsers/auth_by.h diff --git a/stglibs/srvconf.lib/parsers/base.h b/libs/srvconf/parsers/base.h similarity index 100% rename from stglibs/srvconf.lib/parsers/base.h rename to libs/srvconf/parsers/base.h diff --git a/stglibs/srvconf.lib/parsers/chg_admin.cpp b/libs/srvconf/parsers/chg_admin.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_admin.cpp rename to libs/srvconf/parsers/chg_admin.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_admin.h b/libs/srvconf/parsers/chg_admin.h similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_admin.h rename to libs/srvconf/parsers/chg_admin.h diff --git a/stglibs/srvconf.lib/parsers/chg_corp.cpp b/libs/srvconf/parsers/chg_corp.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_corp.cpp rename to libs/srvconf/parsers/chg_corp.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_corp.h b/libs/srvconf/parsers/chg_corp.h similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_corp.h rename to libs/srvconf/parsers/chg_corp.h diff --git a/stglibs/srvconf.lib/parsers/chg_service.cpp b/libs/srvconf/parsers/chg_service.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_service.cpp rename to libs/srvconf/parsers/chg_service.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_service.h b/libs/srvconf/parsers/chg_service.h similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_service.h rename to libs/srvconf/parsers/chg_service.h diff --git a/stglibs/srvconf.lib/parsers/chg_tariff.cpp b/libs/srvconf/parsers/chg_tariff.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_tariff.cpp rename to libs/srvconf/parsers/chg_tariff.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_tariff.h b/libs/srvconf/parsers/chg_tariff.h similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_tariff.h rename to libs/srvconf/parsers/chg_tariff.h diff --git a/stglibs/srvconf.lib/parsers/chg_user.cpp b/libs/srvconf/parsers/chg_user.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_user.cpp rename to libs/srvconf/parsers/chg_user.cpp diff --git a/stglibs/srvconf.lib/parsers/chg_user.h b/libs/srvconf/parsers/chg_user.h similarity index 100% rename from stglibs/srvconf.lib/parsers/chg_user.h rename to libs/srvconf/parsers/chg_user.h diff --git a/stglibs/srvconf.lib/parsers/get_admin.cpp b/libs/srvconf/parsers/get_admin.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/get_admin.cpp rename to libs/srvconf/parsers/get_admin.cpp diff --git a/stglibs/srvconf.lib/parsers/get_admin.h b/libs/srvconf/parsers/get_admin.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_admin.h rename to libs/srvconf/parsers/get_admin.h diff --git a/stglibs/srvconf.lib/parsers/get_container.h b/libs/srvconf/parsers/get_container.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_container.h rename to libs/srvconf/parsers/get_container.h diff --git a/stglibs/srvconf.lib/parsers/get_corp.cpp b/libs/srvconf/parsers/get_corp.cpp similarity index 98% rename from stglibs/srvconf.lib/parsers/get_corp.cpp rename to libs/srvconf/parsers/get_corp.cpp index 732a4d69..0a6a1e02 100644 --- a/stglibs/srvconf.lib/parsers/get_corp.cpp +++ b/libs/srvconf/parsers/get_corp.cpp @@ -20,7 +20,7 @@ #include "get_corp.h" -#include "parsers/property.h" +//#include "parsers/property.h" #include "stg/common.h" diff --git a/stglibs/srvconf.lib/parsers/get_corp.h b/libs/srvconf/parsers/get_corp.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_corp.h rename to libs/srvconf/parsers/get_corp.h diff --git a/stglibs/srvconf.lib/parsers/get_service.cpp b/libs/srvconf/parsers/get_service.cpp similarity index 99% rename from stglibs/srvconf.lib/parsers/get_service.cpp rename to libs/srvconf/parsers/get_service.cpp index e9949cbc..fd19a2ff 100644 --- a/stglibs/srvconf.lib/parsers/get_service.cpp +++ b/libs/srvconf/parsers/get_service.cpp @@ -20,7 +20,7 @@ #include "get_service.h" -#include "parsers/property.h" +//#include "parsers/property.h" #include "stg/common.h" diff --git a/stglibs/srvconf.lib/parsers/get_service.h b/libs/srvconf/parsers/get_service.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_service.h rename to libs/srvconf/parsers/get_service.h diff --git a/stglibs/srvconf.lib/parsers/get_tariff.cpp b/libs/srvconf/parsers/get_tariff.cpp similarity index 99% rename from stglibs/srvconf.lib/parsers/get_tariff.cpp rename to libs/srvconf/parsers/get_tariff.cpp index a13205b3..7a6f9053 100644 --- a/stglibs/srvconf.lib/parsers/get_tariff.cpp +++ b/libs/srvconf/parsers/get_tariff.cpp @@ -20,7 +20,7 @@ #include "get_tariff.h" -#include "parsers/property.h" +//#include "parsers/property.h" #include "stg/common.h" diff --git a/stglibs/srvconf.lib/parsers/get_tariff.h b/libs/srvconf/parsers/get_tariff.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_tariff.h rename to libs/srvconf/parsers/get_tariff.h diff --git a/stglibs/srvconf.lib/parsers/get_user.cpp b/libs/srvconf/parsers/get_user.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/get_user.cpp rename to libs/srvconf/parsers/get_user.cpp diff --git a/stglibs/srvconf.lib/parsers/get_user.h b/libs/srvconf/parsers/get_user.h similarity index 100% rename from stglibs/srvconf.lib/parsers/get_user.h rename to libs/srvconf/parsers/get_user.h diff --git a/stglibs/srvconf.lib/parsers/property.cpp b/libs/srvconf/parsers/property.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/property.cpp rename to libs/srvconf/parsers/property.cpp diff --git a/stglibs/srvconf.lib/parsers/property.h b/libs/srvconf/parsers/property.h similarity index 100% rename from stglibs/srvconf.lib/parsers/property.h rename to libs/srvconf/parsers/property.h diff --git a/stglibs/srvconf.lib/parsers/resetable_utils.h b/libs/srvconf/parsers/resetable_utils.h similarity index 100% rename from stglibs/srvconf.lib/parsers/resetable_utils.h rename to libs/srvconf/parsers/resetable_utils.h diff --git a/stglibs/srvconf.lib/parsers/server_info.cpp b/libs/srvconf/parsers/server_info.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/server_info.cpp rename to libs/srvconf/parsers/server_info.cpp diff --git a/stglibs/srvconf.lib/parsers/server_info.h b/libs/srvconf/parsers/server_info.h similarity index 100% rename from stglibs/srvconf.lib/parsers/server_info.h rename to libs/srvconf/parsers/server_info.h diff --git a/stglibs/srvconf.lib/parsers/simple.cpp b/libs/srvconf/parsers/simple.cpp similarity index 100% rename from stglibs/srvconf.lib/parsers/simple.cpp rename to libs/srvconf/parsers/simple.cpp diff --git a/stglibs/srvconf.lib/parsers/simple.h b/libs/srvconf/parsers/simple.h similarity index 100% rename from stglibs/srvconf.lib/parsers/simple.h rename to libs/srvconf/parsers/simple.h diff --git a/stglibs/srvconf.lib/servconf.cpp b/libs/srvconf/servconf.cpp similarity index 100% rename from stglibs/srvconf.lib/servconf.cpp rename to libs/srvconf/servconf.cpp diff --git a/projects/make_tarball/get_from_cvs b/make_tarball/get_from_cvs similarity index 100% rename from projects/make_tarball/get_from_cvs rename to make_tarball/get_from_cvs diff --git a/projects/make_tarball/make.sh b/make_tarball/make.sh similarity index 100% rename from projects/make_tarball/make.sh rename to make_tarball/make.sh diff --git a/projects/make_tarball/mt.sh b/make_tarball/mt.sh similarity index 100% rename from projects/make_tarball/mt.sh rename to make_tarball/mt.sh diff --git a/projects/libs/Makefile b/projects/libs/Makefile deleted file mode 100644 index 675002e5..00000000 --- a/projects/libs/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# -# Author : Maxim Mamontov -# - -include ../../Makefile.conf - -.PHONY: all clean distclean libs install uninstall install-bin -all: libs - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -clean: - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin install-data - -install-bin: $(PROG) - $(MAKE) -C $(DIR_INCLUDE) install - $(MAKE) -C $(DIR_LIBSRC) install - -uninstall: uninstall-bin - -uninstall-bin: - $(MAKE) -C $(DIR_LIBSRC) uninstall diff --git a/projects/libs/build b/projects/libs/build deleted file mode 100755 index 4c1fce9b..00000000 --- a/projects/libs/build +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/sh - -# Installation path prefix - -#PREFIX="" - -# Binaries access bits - -BIN_MODE=0755 - -# Data files access bits - -DATA_MODE=0644 - -# Dir access bits - -DIR_MODE=0755 - -# Binaries and data files owner - -OWNER=root - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" - - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but we currently support Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building STG 2.4 libs for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="logger.lib - crypto.lib - common.lib - scriptexecuter.lib - conffiles.lib - pinger.lib - dotconfpp.lib - smux.lib - ia.lib - srvconf.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - fi - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for -lexpat... " -printf "#include \nint main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_EXPAT=no - printf "no\n" -else - CHECK_EXPAT=yes - printf "yes\n" -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -printf "Checking for fb_config... " -FB_VERSION=`fb_config --version 2> /dev/null` -if [ "$?" != "0" ] -then - printf "no\n" - printf "Checking for -lfbclient... " - printf "int main() { return 0; }\n" > build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - FB_CFLAGS="" - FB_LDFLAGS="-lfbclient" - CHECK_FBCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for fb_config --cflags... " - FB_CFLAGS=`fb_config --cflags` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - printf "[$FB_CFLAGS]\n" - printf "Checking for fb_config --libs " - FB_LDFLAGS=`fb_config --libs` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - CHECK_FBCLIENT=yes - printf "[$FB_LDFLAGS]\n" - fi - fi -fi - -rm -f build_check.c - -if [ "$CHECK_EXPAT" != "yes" ] -then - printf -- "-lexpat not found!\n" - exit 1 -fi - -if [ "$CHECK_FBCLIENT" = "yes" ] -then - STG_LIBS="$STG_LIBS - ibpp.lib" -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE -printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE -if [ "$CHECK_FBCLIENT" = "yes" ] -then - printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE - printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE -fi -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/projects/sgauthstress/Makefile b/projects/sgauthstress/Makefile deleted file mode 100644 index 74c09b62..00000000 --- a/projects/sgauthstress/Makefile +++ /dev/null @@ -1,76 +0,0 @@ -include ../../Makefile.conf - -PROG = sgauthstress - -SRCS = main.cpp \ - settings.cpp \ - store_loader.cpp \ - user.cpp \ - proto.cpp - -STGLIBS = dotconfpp \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -LIBS += -ldl -else -LIBS += -lintl \ - -lc -endif - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += -Wl,-E $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs plugins -all: libs plugins $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -plugins: libs - $(MAKE) -C $(DIR_PLUGINS) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o *.*~ - $(MAKE) -C $(DIR_LIBSRC) clean - $(MAKE) -C $(DIR_PLUGINS) clean - -distclean: clean - rm -f ../../Makefile.conf - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/projects/sgauthstress/build b/projects/sgauthstress/build deleted file mode 100755 index dae35b74..00000000 --- a/projects/sgauthstress/build +++ /dev/null @@ -1,375 +0,0 @@ -#!/bin/sh - -# $Author: faust $ -# $Revision: 1.24 $ -# $Date: 2010/04/14 08:59:02 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" - CFLAGS="$CFLAGS -I/opt/local/include" - CXXFLAGS="$CFLAGS -I/opt/local/include" - LDFLAGS="$LDFLAGS -L/opt/local/lib" -fi - -if [ "$OS" = "unknown" ] -then - printf "################################################################################\n" - printf "# Sorry, but sgauthstress is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "################################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building sgauthstress for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="logger.lib - crypto.lib - common.lib - conffiles.lib - dotconfpp.lib" - -PLUGINS="store/files" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - LIB_THREAD=-lc_r - else - DEFS="$DEFS -DFREE_BSD5" - if [ "$OS" = "bsd7" ] - then - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -rm -f build_check.c - -printf "Checking for fb_config... " -FB_VERSION=`fb_config --version 2> /dev/null` -if [ "$?" != "0" ] -then - printf "no\n" - printf "Checking for -lfbclient... " - printf "int main() { return 0; }\n" > build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - FB_CFLAGS="" - FB_LDFLAGS="-lfbclient" - CHECK_FBCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for fb_config --cflags... " - FB_CFLAGS=`fb_config --cflags` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - printf "[$FB_CFLAGS]\n" - printf "Checking for fb_config --libs " - FB_LDFLAGS=`fb_config --libs` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - CHECK_FBCLIENT=yes - printf "[$FB_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for mysql_config... " -MYSQL_VERSION=`mysql_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lmysqlclient... " - $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for mysql_config --cflags... " - MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - printf "[$MYSQL_CFLAGS]\n" - printf "Checking for mysql_config --libs_r... " - MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - printf "[$MYSQL_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for pg_config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -PG_VERSION=`pg_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lpq... " - $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n"; - printf "Checking for pg_config --includedir... " - PG_CFLAGS="-I"`pg_config --includedir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - printf "[$PG_CFLAGS]\n" - printf "Checking for pg_config --libdir... " - PG_LDFLAGS="-L"`pg_config --libdir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "[$PG_LDFLAGS]\n" - fi - fi -fi - -rm -f build_check.c - -if [ "$CHECK_FBCLIENT" = "yes" ] -then - STG_LIBS="$STG_LIBS - ibpp.lib" - PLUGINS="$PLUGINS - store/firebird" -fi - -if [ "$CHECK_PQ" = "yes" ] -then - PLUGINS="$PLUGINS - store/postgresql" -fi - -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - PLUGINS="$PLUGINS - store/mysql" -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules\n" >> $CONFFILE -printf "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE -if [ "$CHECK_FBCLIENT" = "yes" ] -then - printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE - printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT\n" >> $CONFFILE -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - printf "MYSQL_CFLAGS=$MYSQL_CFLAGS\n" >> $CONFFILE - printf "MYSQL_LDFLAGS=$MYSQL_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_PQ=$CHECK_PQ\n" >> $CONFFILE -if [ "$CHECK_PQ" = "yes" ] -then - printf "PG_CFLAGS=$PG_CFLAGS\n" >> $CONFFILE - printf "PG_LDFLAGS=$PG_LDFLAGS\n" >> $CONFFILE -fi -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "PLUGINS=" >> $CONFFILE -for plugin in $PLUGINS -do - printf "$plugin " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/projects/sgauthstress/main.cpp b/projects/sgauthstress/main.cpp deleted file mode 100644 index b0819c3c..00000000 --- a/projects/sgauthstress/main.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Boris Mikhailenko - */ - - /* - $Revision: 1.13 $ - $Date: 2010/04/14 09:01:29 $ - $Author: faust $ - */ - -#include - -#include -#include -#include -#include - -#include "stg/common.h" -#include "stg/store.h" -#include "stg/user_conf.h" - -#include "settings.h" -#include "store_loader.h" -#include "proto.h" -#include "user.h" - -time_t stgTime; -bool running; - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void Usage() -{ -std::cout << "Usage:\n\nsgauth " << std::endl; -} -//----------------------------------------------------------------------------- -void CatchTERM(int) -{ -running = false; -} -//----------------------------------------------------------------------------- -static void SetSignalHandlers() -{ -struct sigaction newsa, oldsa; -sigset_t sigmask; - -sigemptyset(&sigmask); -sigaddset(&sigmask, SIGTERM); -newsa.sa_handler = CatchTERM; -newsa.sa_mask = sigmask; -newsa.sa_flags = 0; -sigaction(SIGTERM, &newsa, &oldsa); - -sigemptyset(&sigmask); -sigaddset(&sigmask, SIGINT); -newsa.sa_handler = CatchTERM; -newsa.sa_mask = sigmask; -newsa.sa_flags = 0; -sigaction(SIGINT, &newsa, &oldsa); - -return; -} -//----------------------------------------------------------------------------- -int main(int argc, char *argv[]) -{ -SETTINGS settings; - -if (argc == 2) - { - settings.SetConfFile(argv[1]); - } - -if (settings.ReadSettings()) - { - std::cerr << "Failed to read settings: '" - << settings.GetStrError() << "'" << std::endl; - Usage(); - return -1; - } - -SetSignalHandlers(); - -PROTO proto(settings.GetServerName(), - settings.GetServerPort(), - settings.GetLocalPort(), - 10); - -STORE_LOADER storeLoader(settings.GetModulesPath(), settings.GetStoreModuleSettings()); -if (storeLoader.Load()) - { - std::cerr << "Failed to load storage plugin: '" << storeLoader.GetStrError() << "'" << std::endl; - return -1; - } - -STORE * dataStore = storeLoader.GetStore(); - -std::vector userList; -if (dataStore->GetUsersList(&userList)) - { - std::cerr << "Failed to get user list: '" << dataStore->GetStrError() << "'" << std::endl; - return -1; - } - -std::list ips; - { - std::vector::const_iterator it; - for (it = userList.begin(); it != userList.end(); ++it) - { - USER_CONF userConf; - if (dataStore->RestoreUserConf(&userConf, *it)) - { - std::cerr << "Failed to read user conf: '" << dataStore->GetStrError() << "'" << std::endl; - return -1; - } - proto.AddUser( - USER( - *it, - userConf.password, - userConf.ips[0].ip - ) - ); - ips.push_back(userConf.ips[0].ip); - } - } - -if (!proto.Start()) - { - std::cerr << "Failed to start listening thread: '" << proto.GetStrError() << "'" << std::endl; - return -1; - } - -std::list::const_iterator it; -for (it = ips.begin(); it != ips.end(); ++it) - { - proto.Connect(*it); - } - -std::cout << "Successfully loaded " << proto.UserCount() << " users" << std::endl; - -running = true; -while (running) - { - struct timespec ts = {0, 200000000}; - nanosleep(&ts, NULL); - } - -proto.Stop(); - -storeLoader.Unload(); - -return 0; -} -//----------------------------------------------------------------------------- diff --git a/projects/sgauthstress/mkifs.sh b/projects/sgauthstress/mkifs.sh deleted file mode 100755 index ada22f00..00000000 --- a/projects/sgauthstress/mkifs.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -users=`cat users.1000` -hi=0 -lo=0 -for user in $users -do - if (( $lo > 254 )) - then - lo=0 - let hi++ - fi - let lo++ - ip="10.22.$hi.$lo" - ip addr add $ip dev eth0 -done diff --git a/projects/sgauthstress/proto.cpp b/projects/sgauthstress/proto.cpp deleted file mode 100644 index d1114f17..00000000 --- a/projects/sgauthstress/proto.cpp +++ /dev/null @@ -1,574 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "stg/common.h" -#include "stg/ia_packets.h" -#include "stg/locker.h" - -#include "proto.h" - -class HasIP : public std::unary_function, bool> { - public: - explicit HasIP(uint32_t i) : ip(i) {} - bool operator()(const std::pair & value) { return value.first == ip; } - private: - uint32_t ip; -}; - -PROTO::PROTO(const std::string & server, - uint16_t port, - uint16_t localPort, - int to) - : timeout(to), - running(false), - stopped(true) -{ -uint32_t ip = inet_addr(server.c_str()); -if (ip == INADDR_NONE) - { - struct hostent * hePtr = gethostbyname(server.c_str()); - if (hePtr) - { - ip = *((uint32_t *)hePtr->h_addr_list[0]); - } - else - { - errorStr = "Unknown host: '"; - errorStr += server; - errorStr += "'"; - printfd(__FILE__, "PROTO::PROTO() - %s\n", errorStr.c_str()); - throw std::runtime_error(errorStr); - } - } - -localAddr.sin_family = AF_INET; -localAddr.sin_port = htons(localPort); -localAddr.sin_addr.s_addr = inet_addr("0.0.0.0"); - -serverAddr.sin_family = AF_INET; -serverAddr.sin_port = htons(port); -serverAddr.sin_addr.s_addr = ip; - -unsigned char key[IA_PASSWD_LEN]; -memset(key, 0, IA_PASSWD_LEN); -strncpy(reinterpret_cast(key), "pr7Hhen", 8); -Blowfish_Init(&ctx, key, IA_PASSWD_LEN); - -processors["CONN_SYN_ACK"] = &PROTO::CONN_SYN_ACK_Proc; -processors["ALIVE_SYN"] = &PROTO::ALIVE_SYN_Proc; -processors["DISCONN_SYN_ACK"] = &PROTO::DISCONN_SYN_ACK_Proc; -processors["FIN"] = &PROTO::FIN_Proc; -processors["INFO"] = &PROTO::INFO_Proc; -// ERR_Proc will be handled explicitly - -pthread_mutex_init(&mutex, NULL); -} - -PROTO::~PROTO() -{ -pthread_mutex_destroy(&mutex); -} - -void * PROTO::Runner(void * data) -{ -sigset_t signalSet; -sigfillset(&signalSet); -pthread_sigmask(SIG_BLOCK, &signalSet, NULL); - -PROTO * protoPtr = static_cast(data); -protoPtr->Run(); -return NULL; -} - -bool PROTO::Start() -{ -stopped = false; -running = true; -if (pthread_create(&tid, NULL, &Runner, this)) - { - errorStr = "Failed to create listening thread: '"; - errorStr += strerror(errno); - errorStr += "'"; - printfd(__FILE__, "PROTO::Start() - %s\n", errorStr.c_str()); - return false; - } -return true; -} - -bool PROTO::Stop() -{ -running = false; -int time = 0; -while (!stopped && time < timeout) - { - struct timespec ts = {1, 0}; - nanosleep(&ts, NULL); - ++time; - } -if (!stopped) - { - errorStr = "Failed to stop listening thread - timed out"; - printfd(__FILE__, "PROTO::Stop() - %s\n", errorStr.c_str()); - return false; - } -if (pthread_join(tid, NULL)) - { - errorStr = "Failed to join listening thread after stop: '"; - errorStr += strerror(errno); - errorStr += "'"; - printfd(__FILE__, "PROTO::Stop() - %s\n", errorStr.c_str()); - return false; - } -return true; -} - -void PROTO::AddUser(const USER & user, bool connect) -{ -STG_LOCKER lock(&mutex); -users.push_back(std::make_pair(user.GetIP(), user)); -users.back().second.InitNetwork(); - -struct pollfd pfd; -pfd.fd = users.back().second.GetSocket(); -pfd.events = POLLIN; -pfd.revents = 0; -pollFds.push_back(pfd); - -if (connect) - { - RealConnect(&users.back().second); - } -} - -bool PROTO::Connect(uint32_t ip) -{ -std::list >::iterator it; -STG_LOCKER lock(&mutex); -it = std::find_if(users.begin(), users.end(), HasIP(ip)); -if (it == users.end()) - return false; - -// Do something - -return RealConnect(&it->second); -} - -bool PROTO::Disconnect(uint32_t ip) -{ -std::list >::iterator it; -STG_LOCKER lock(&mutex); -it = std::find_if(users.begin(), users.end(), HasIP(ip)); -if (it == users.end()) - return false; - -// Do something - -return RealDisconnect(&it->second); -} - -void PROTO::Run() -{ -while (running) - { - int res; - { - STG_LOCKER lock(&mutex); - res = poll(&pollFds.front(), pollFds.size(), timeout); - } - if (res < 0) - break; - if (!running) - break; - if (res) - { - printfd(__FILE__, "PROTO::Run() - events: %d\n", res); - RecvPacket(); - } - else - { - CheckTimeouts(); - } - } - -stopped = true; -} - -void PROTO::CheckTimeouts() -{ -STG_LOCKER lock(&mutex); -std::list >::iterator it; -for (it = users.begin(); it != users.end(); ++it) - { - int delta = difftime(time(NULL), it->second.GetPhaseChangeTime()); - if ((it->second.GetPhase() == 3) && - (delta > it->second.GetUserTimeout())) - { - printfd(__FILE__, "PROTO::CheckTimeouts() - user alive timeout (ip: %s, login: '%s', delta: %d > %d)\n", inet_ntostring(it->second.GetIP()).c_str(), it->second.GetLogin().c_str(), delta, it->second.GetUserTimeout()); - it->second.SetPhase(1); - } - if ((it->second.GetPhase() == 2) && - (delta > it->second.GetAliveTimeout())) - { - printfd(__FILE__, "PROTO::CheckTimeouts() - user connect timeout (ip: %s, login: '%s', delta: %d > %d)\n", inet_ntostring(it->second.GetIP()).c_str(), it->second.GetLogin().c_str(), delta, it->second.GetAliveTimeout()); - it->second.SetPhase(1); - } - } -} - -bool PROTO::RecvPacket() -{ -bool result = true; -std::vector::iterator it; -std::list >::iterator userIt; -STG_LOCKER lock(&mutex); -for (it = pollFds.begin(), userIt = users.begin(); it != pollFds.end() && userIt != users.end(); ++it, ++userIt) - { - if (it->revents) - { - it->revents = 0; - assert(it->fd == userIt->second.GetSocket() && "File descriptors from poll fds and users must be syncked"); - struct sockaddr_in addr; - socklen_t fromLen = sizeof(addr); - char buffer[2048]; - int res = recvfrom(userIt->second.GetSocket(), buffer, sizeof(buffer), 0, (struct sockaddr *)&addr, &fromLen); - - if (res == -1) - { - result = false; - continue; - } - - result = result && HandlePacket(buffer, res, &(userIt->second)); - } - } - -return result; -} - -bool PROTO::HandlePacket(const char * buffer, size_t length, USER * user) -{ -if (!strncmp(buffer + 4 + sizeof(HDR_8), "ERR", 3)) - { - return ERR_Proc(buffer, user); - } - -for (size_t i = 0; i < length / 8; i++) - Blowfish_Decrypt(user->GetCtx(), - (uint32_t *)(buffer + i * 8), - (uint32_t *)(buffer + i * 8 + 4)); - -std::string packetName(buffer + 12); - -std::map::const_iterator it; -it = processors.find(packetName); -if (it != processors.end()) - return (this->*it->second)(buffer, user); - -printfd(__FILE__, "PROTO::HandlePacket() - invalid packet signature: '%s'\n", packetName.c_str()); - -return false; -} - -bool PROTO::CONN_SYN_ACK_Proc(const void * buffer, USER * user) -{ -const CONN_SYN_ACK_8 * packet = static_cast(buffer); - -uint32_t rnd = packet->rnd; -uint32_t userTimeout = packet->userTimeOut; -uint32_t aliveTimeout = packet->aliveDelay; - -#ifdef ARCH_BE -SwapBytes(rnd); -SwapBytes(userTimeout); -SwapBytes(aliveDelay); -#endif - -if (user->GetPhase() != 2) - { - errorStr = "Unexpected CONN_SYN_ACK"; - printfd(__FILE__, "PROTO::CONN_SYN_ACK_Proc() - wrong phase: %d\n", user->GetPhase()); - return false; - } - -user->SetPhase(3); -user->SetAliveTimeout(aliveTimeout); -user->SetUserTimeout(userTimeout); -user->SetRnd(rnd); - -Send_CONN_ACK(user); - -printfd(__FILE__, "PROTO::CONN_SYN_ACK_Proc() - user '%s' successfully logged in from IP %s\n", user->GetLogin().c_str(), inet_ntostring(user->GetIP()).c_str()); - -return true; -} - -bool PROTO::ALIVE_SYN_Proc(const void * buffer, USER * user) -{ -const ALIVE_SYN_8 * packet = static_cast(buffer); - -uint32_t rnd = packet->rnd; - -#ifdef ARCH_BE -SwapBytes(rnd); -#endif - -if (user->GetPhase() != 3) - { - errorStr = "Unexpected ALIVE_SYN"; - printfd(__FILE__, "PROTO::ALIVE_SYN_Proc() - wrong phase: %d\n", user->GetPhase()); - return false; - } - -user->SetPhase(3); -user->SetRnd(rnd); // Set new rnd value for ALIVE_ACK - -Send_ALIVE_ACK(user); - -return true; -} - -bool PROTO::DISCONN_SYN_ACK_Proc(const void * buffer, USER * user) -{ -const DISCONN_SYN_ACK_8 * packet = static_cast(buffer); - -uint32_t rnd = packet->rnd; - -#ifdef ARCH_BE -SwapBytes(rnd); -#endif - -if (user->GetPhase() != 4) - { - errorStr = "Unexpected DISCONN_SYN_ACK"; - printfd(__FILE__, "PROTO::DISCONN_SYN_ACK_Proc() - wrong phase: %d\n", user->GetPhase()); - return false; - } - -if (user->GetRnd() + 1 != rnd) - { - errorStr = "Wrong control value at DISCONN_SYN_ACK"; - printfd(__FILE__, "PROTO::DISCONN_SYN_ACK_Proc() - wrong control value: %d, expected: %d\n", rnd, user->GetRnd() + 1); - } - -user->SetPhase(5); -user->SetRnd(rnd); - -Send_DISCONN_ACK(user); - -return true; -} - -bool PROTO::FIN_Proc(const void * buffer, USER * user) -{ -if (user->GetPhase() != 5) - { - errorStr = "Unexpected FIN"; - printfd(__FILE__, "PROTO::FIN_Proc() - wrong phase: %d\n", user->GetPhase()); - return false; - } - -user->SetPhase(1); - -return true; -} - -bool PROTO::INFO_Proc(const void * buffer, USER * user) -{ -//const INFO_8 * packet = static_cast(buffer); - -return true; -} - -bool PROTO::ERR_Proc(const void * /*buffer*/, USER * user) -{ -//uint32_t len = packet->len; - -#ifdef ARCH_BE -//SwapBytes(len); -#endif - -user->SetPhase(1); //TODO: Check -/*KOIToWin((const char*)err.text, &messageText); -if (pErrorCb != NULL) - pErrorCb(messageText, IA_SERVER_ERROR, errorCbData); -phaseTime = GetTickCount(); -codeError = IA_SERVER_ERROR;*/ - -return true; -} - -bool PROTO::Send_CONN_SYN(USER * user) -{ -CONN_SYN_8 packet; - -packet.len = sizeof(packet); - -#ifdef ARCH_BE -SwapBytes(packet.len); -#endif - -strncpy((char *)packet.loginS, user->GetLogin().c_str(), sizeof(packet.loginS)); -strncpy((char *)packet.type, "CONN_SYN", sizeof(packet.type)); -strncpy((char *)packet.login, user->GetLogin().c_str(), sizeof(packet.login)); -packet.dirs = 0xFFffFFff; - -return SendPacket(&packet, sizeof(packet), user); -} - -bool PROTO::Send_CONN_ACK(USER * user) -{ -CONN_ACK_8 packet; - -packet.len = sizeof(packet); -packet.rnd = user->IncRnd(); - -#ifdef ARCH_BE -SwapBytes(packet.len); -SwapBytes(packet.rnd); -#endif - -strncpy((char *)packet.loginS, user->GetLogin().c_str(), sizeof(packet.loginS)); -strncpy((char *)packet.type, "CONN_ACK", sizeof(packet.type)); - -return SendPacket(&packet, sizeof(packet), user); -} - -bool PROTO::Send_ALIVE_ACK(USER * user) -{ -ALIVE_ACK_8 packet; - -packet.len = sizeof(packet); -packet.rnd = user->IncRnd(); - -#ifdef ARCH_BE -SwapBytes(packet.len); -SwapBytes(packet.rnd); -#endif - -strncpy((char *)packet.loginS, user->GetLogin().c_str(), sizeof(packet.loginS)); -strncpy((char *)packet.type, "ALIVE_ACK", sizeof(packet.type)); - -return SendPacket(&packet, sizeof(packet), user); -} - -bool PROTO::Send_DISCONN_SYN(USER * user) -{ -DISCONN_SYN_8 packet; - -packet.len = sizeof(packet); - -#ifdef ARCH_BE -SwapBytes(packet.len); -#endif - -strncpy((char *)packet.loginS, user->GetLogin().c_str(), sizeof(packet.loginS)); -strncpy((char *)packet.type, "DISCONN_SYN", sizeof(packet.type)); -strncpy((char *)packet.login, user->GetLogin().c_str(), sizeof(packet.login)); - -return SendPacket(&packet, sizeof(packet), user); -} - -bool PROTO::Send_DISCONN_ACK(USER * user) -{ -DISCONN_ACK_8 packet; - -packet.len = sizeof(packet); -packet.rnd = user->IncRnd(); - -#ifdef ARCH_BE -SwapBytes(packet.len); -SwapBytes(packet.rnd); -#endif - -strncpy((char *)packet.loginS, user->GetLogin().c_str(), sizeof(packet.loginS)); -strncpy((char *)packet.type, "DISCONN_ACK", sizeof(packet.type)); - -return SendPacket(&packet, sizeof(packet), user); -} - -bool PROTO::SendPacket(const void * packet, size_t length, USER * user) -{ -HDR_8 hdr; - -assert(length < 2048 && "Packet length must not exceed 2048 bytes"); - -strncpy((char *)hdr.magic, IA_ID, sizeof(hdr.magic)); -hdr.protoVer[0] = 0; -hdr.protoVer[1] = 8; // IA_PROTO_VER - -unsigned char buffer[2048]; -memcpy(buffer, &hdr, sizeof(hdr)); -memcpy(buffer + sizeof(hdr), packet, length); - -size_t offset = sizeof(HDR_8); -for (size_t i = 0; i < IA_LOGIN_LEN / 8; i++) - { - Blowfish_Encrypt(&ctx, - (uint32_t *)(buffer + offset + i * 8), - (uint32_t *)(buffer + offset + i * 8 + 4)); - } - -offset += IA_LOGIN_LEN; -size_t encLen = (length - IA_LOGIN_LEN) / 8; -for (size_t i = 0; i < encLen; i++) - { - Blowfish_Encrypt(user->GetCtx(), - (uint32_t*)(buffer + offset + i * 8), - (uint32_t*)(buffer + offset + i * 8 + 4)); - } - -int res = sendto(user->GetSocket(), buffer, length, 0, (struct sockaddr *)&serverAddr, sizeof(serverAddr)); - -if (res < 0) - { - errorStr = "Failed to send packet: '"; - errorStr += strerror(errno); - errorStr += "'"; - printfd(__FILE__, "PROTO::SendPacket() - %s, fd: %d\n", errorStr.c_str(), user->GetSocket()); - return false; - } - -if (res < length) - { - errorStr = "Packet sent partially"; - printfd(__FILE__, "PROTO::SendPacket() - %s\n", errorStr.c_str()); - return false; - } - -return true; -} - -bool PROTO::RealConnect(USER * user) -{ -if (user->GetPhase() != 1 && - user->GetPhase() != 5) - { - errorStr = "Unexpected connect"; - printfd(__FILE__, "PROTO::RealConnect() - wrong phase: %d\n", user->GetPhase()); - } -user->SetPhase(2); - -return Send_CONN_SYN(user); -} - -bool PROTO::RealDisconnect(USER * user) -{ -if (user->GetPhase() != 3) - { - errorStr = "Unexpected disconnect"; - printfd(__FILE__, "PROTO::RealDisconnect() - wrong phase: %d\n", user->GetPhase()); - } -user->SetPhase(4); - -return Send_DISCONN_SYN(user); -} diff --git a/projects/sgauthstress/proto.h b/projects/sgauthstress/proto.h deleted file mode 100644 index 746622b7..00000000 --- a/projects/sgauthstress/proto.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef __PROTO_H__ -#define __PROTO_H__ - -#ifndef LINUX -#include -#endif -#include -#include -#include - -#include -#include -#include -#include - -#include "stg/os_int.h" -#include "stg/blowfish.h" - -#include "user.h" - -class PROTO; - -typedef bool (PROTO::*PacketProcessor)(const void *, USER *); - -class PROTO { - public: - PROTO(const std::string & server, - uint16_t port, - uint16_t localPort, - int timeout = 1); - ~PROTO(); - - bool Start(); - bool Stop(); - - const std::string GetStrError() const { return errorStr; } - - void AddUser(const USER & user, bool connect = false); - - bool Connect(uint32_t ip); - bool Disconnect(uint32_t ip); - - size_t UserCount() const { return users.size(); } - private: - BLOWFISH_CTX ctx; - struct sockaddr_in localAddr; - struct sockaddr_in serverAddr; - int timeout; - - std::list > users; - std::vector pollFds; - - bool running; - bool stopped; - - pthread_t tid; - pthread_mutex_t mutex; - - std::string errorStr; - - std::map processors; - - static void * Runner(void * data); - - void Run(); - void CheckTimeouts(); - bool RecvPacket(); - bool SendPacket(const void * buffer, size_t length, USER * user); - bool HandlePacket(const char * buffer, size_t length, USER * user); - - bool CONN_SYN_ACK_Proc(const void * buffer, USER * user); - bool ALIVE_SYN_Proc(const void * buffer, USER * user); - bool DISCONN_SYN_ACK_Proc(const void * buffer, USER * user); - bool FIN_Proc(const void * buffer, USER * user); - bool INFO_Proc(const void * buffer, USER * user); - bool ERR_Proc(const void * buffer, USER * user); - - bool Send_CONN_SYN(USER * user); - bool Send_CONN_ACK(USER * user); - bool Send_DISCONN_SYN(USER * user); - bool Send_DISCONN_ACK(USER * user); - bool Send_ALIVE_ACK(USER * user); - - bool RealConnect(USER * user); - bool RealDisconnect(USER * user); -}; - -#endif diff --git a/projects/sgauthstress/rmifs.sh b/projects/sgauthstress/rmifs.sh deleted file mode 100755 index 0663b9d9..00000000 --- a/projects/sgauthstress/rmifs.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -users=`cat users.1000` -hi=0 -lo=0 -for user in $users -do - if (( $lo > 254 )) - then - lo=0 - let hi++ - fi - let lo++ - ip="10.22.$hi.$lo/32" - ip addr del $ip dev eth0 -done diff --git a/projects/sgauthstress/settings.cpp b/projects/sgauthstress/settings.cpp deleted file mode 100644 index 62adc143..00000000 --- a/projects/sgauthstress/settings.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -#include -#include -#include - -#include "stg/dotconfpp.h" -#include "stg/module_settings.h" -#include "stg/common.h" - -#include "settings.h" - -SETTINGS::SETTINGS() - : port(0), - localPort(0), - confFile("sgauthstress.conf") -{ -} -//----------------------------------------------------------------------------- -int ParseModuleSettings(const DOTCONFDocumentNode * node, std::vector * params) -{ -assert(node && "DOTCONFDocumentNode must not be NULL!"); - -const DOTCONFDocumentNode * childNode = node->getChildNode(); -while (childNode) - { - PARAM_VALUE pv; - pv.param = childNode->getName(); - int i = 0; - const char * value; - while ((value = childNode->getValue(i++)) != NULL) - pv.value.push_back(value); - params->push_back(pv); - childNode = childNode->getNextNode(); - } - -return 0; -} -//----------------------------------------------------------------------------- -int SETTINGS::ReadSettings() -{ -const char * requiredOptions[] = { - "ModulesPath", - "StoreModule", - "Login", - "Password", - "ServerName", - "ServerPort", - NULL - }; - -DOTCONFDocument conf(DOTCONFDocument::CASEINSENSITIVE); -conf.setRequiredOptionNames(requiredOptions); - -if(conf.setContent(confFile.c_str()) != 0) - { - strError = "Cannot read file " + confFile + "."; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - -const DOTCONFDocumentNode * node = conf.getFirstNode(); - -int storeModulesCount = 0; -while (node) - { - if (strcasecmp(node->getName(), "ModulesPath") == 0) - modulesPath = node->getValue(0); - else if (strcasecmp(node->getName(), "Login") == 0) - login = node->getValue(0); - else if (strcasecmp(node->getName(), "Password") == 0) - password = node->getValue(0); - else if (strcasecmp(node->getName(), "ServerName") == 0) - serverName = node->getValue(0); - else if (strcasecmp(node->getName(), "ServerPort") == 0) - { - if (ParseIntInRange(node->getValue(0), 1, 65535, &port)) - { - strError = "Parameter 'ServerPort' is not valid."; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - } - else if (strcasecmp(node->getName(), "LocalPort") == 0) - { - if (ParseIntInRange(node->getValue(0), 0, 65535, &localPort)) - { - strError = "Parameter 'LocalPort' is not valid."; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - } - else if (strcasecmp(node->getName(), "StoreModule") == 0) - { - if (node->getValue(1)) - { - strError = "Unexpected \'" + std::string(node->getValue(1)) + "\'."; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - - if (storeModulesCount) - { - strError = "Should be only one source StoreModule."; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - ++storeModulesCount; - - storeModuleSettings.moduleName = node->getValue(0); - if (ParseModuleSettings(node, &storeModuleSettings.moduleParams)) - { - strError = "Failed to parse store module settings"; - printfd(__FILE__, "SETTINGS::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - } - - node = node->getNextNode(); - } - -return 0; -} diff --git a/projects/sgauthstress/settings.h b/projects/sgauthstress/settings.h deleted file mode 100644 index 4e4b9be1..00000000 --- a/projects/sgauthstress/settings.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -#ifndef SETTINGS_H -#define SETTINGS_H - -#include - -#include "stg/os_int.h" -#include "stg/module_settings.h" - -class DOTCONFDocumentNode; - -class SETTINGS { -public: - SETTINGS(); - ~SETTINGS() {} - int Reload() { return 0; } - void SetConfFile(const std::string & cf) { confFile = cf; } - int ReadSettings(); - - const std::string & GetStrError() const { return strError; } - - const std::string & GetServerName() const { return serverName; } - uint16_t GetServerPort() const { return port; } - uint16_t GetLocalPort() const { return localPort; } - - const std::string & GetLogin() const { return login; } - const std::string & GetPassword() const { return password; } - - const std::string & GetConfDir() const; - const std::string & GetModulesPath() const { return modulesPath; } - const MODULE_SETTINGS & GetStoreModuleSettings() const { return storeModuleSettings; } - -private: - std::string login; - std::string password; - std::string serverName; - int port; - int localPort; - - std::string confFile; - std::string strError; - std::string modulesPath; - - MODULE_SETTINGS storeModuleSettings; -}; - -#endif diff --git a/projects/sgauthstress/sgauthstress.conf b/projects/sgauthstress/sgauthstress.conf deleted file mode 100644 index e895c1d0..00000000 --- a/projects/sgauthstress/sgauthstress.conf +++ /dev/null @@ -1,34 +0,0 @@ -#Stargazer server ip -ServerName=10.21.5.4 - -#Stargazer server port -#Default value 5555 -ServerPort=5555 - -#User's login -Login=test - -# -# -LocalPort=12345 - -#User's password -Password=1234567 - -ModulesPath=../stargazer/modules - - - WorkDir = /var/stargazer - - ConfOwner = root - ConfGroup = root - ConfMode = 600 - - StatOwner = root - StatGroup = root - StatMode = 640 - - UserLogOwner = root - UserLogGroup = root - UserLogMode = 640 - diff --git a/projects/sgauthstress/store_loader.cpp b/projects/sgauthstress/store_loader.cpp deleted file mode 100644 index a545da35..00000000 --- a/projects/sgauthstress/store_loader.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -/* - $Revision: 1.6 $ - $Date: 2010/03/04 12:24:19 $ - $Author: faust $ - */ - -/* - * An implementation of RAII store plugin loader - */ - -#include - -#include "stg/common.h" -#include "stg/module_settings.h" -#include "stg/store.h" -#include "store_loader.h" - -STORE_LOADER::STORE_LOADER(const std::string & modulesPath, - const MODULE_SETTINGS & settings) - : isLoaded(false), - handle(NULL), - plugin(NULL), - errorStr(), - storeSettings(settings), - pluginFileName(modulesPath + "/mod_" + storeSettings.moduleName + ".so") -{ -} - -STORE_LOADER::~STORE_LOADER() -{ -Unload(); -} - -bool STORE_LOADER::Load() -{ -if (isLoaded) - { - errorStr = "Store plugin '" + pluginFileName + "' was already loaded!"; - printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str()); - return false; - } - -if (pluginFileName.empty()) - { - errorStr = "Empty store plugin filename"; - printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str()); - return true; - } - -handle = dlopen(pluginFileName.c_str(), RTLD_NOW); - -if (!handle) - { - errorStr = "Error loading plugin '" - + pluginFileName + "': '" + dlerror() + "'"; - printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str()); - return true; - } - -isLoaded = true; - -STORE * (*GetStore)(); -GetStore = (STORE * (*)())dlsym(handle, "GetStore"); -if (!GetStore) - { - errorStr = std::string("GetStore() not found! ") + dlerror(); - printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str()); - return true; - } - -plugin = GetStore(); - -if (!plugin) - { - errorStr = "Plugin was not created!"; - printfd(__FILE__, "STORE_LOADER::Load() - %s\n"); - return true; - } - -plugin->SetSettings(storeSettings); -if (plugin->ParseSettings()) - { - errorStr = plugin->GetStrError(); - printfd(__FILE__, "STORE_LOADER::Load() - Failed to parse settings. Plugin reports: '%s'\n", errorStr.c_str()); - return true; - } - -return false; -} - -bool STORE_LOADER::Unload() -{ -if (!isLoaded) - { - return true; - } - -printfd(__FILE__, "STORE_LOADER::Unload()\n"); - -if (dlclose(handle)) - { - errorStr = "Failed to unload plugin '"; - errorStr += pluginFileName + "': "; - errorStr += dlerror(); - printfd(__FILE__, "STORE_LOADER::Unload() - %s\n", errorStr.c_str()); - return true; - } - -isLoaded = false; - -return false; -} diff --git a/projects/sgauthstress/store_loader.h b/projects/sgauthstress/store_loader.h deleted file mode 100644 index 91d6e7cf..00000000 --- a/projects/sgauthstress/store_loader.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - -/* - $Revision: 1.3 $ - $Date: 2010/03/04 12:24:19 $ - $Author: faust $ - */ - -/* - * Header file for RAII store plugin loader - */ - -#ifndef __STORE_LOADER_H__ -#define __STORE_LOADER_H__ - -#include - -#include "stg/module_settings.h" -#include "stg/noncopyable.h" - -class STORE; -class MODULE_SETTINGS; - -class STORE_LOADER : private NONCOPYABLE { -public: - STORE_LOADER(const std::string & modulesPath, - const MODULE_SETTINGS & settings); - ~STORE_LOADER(); - - bool Load(); - bool Unload(); - - STORE * GetStore() { return plugin; } - - const std::string & GetStrError() const { return errorStr; } -private: - bool isLoaded; - void * handle; - STORE * plugin; - std::string errorStr; - MODULE_SETTINGS storeSettings; - std::string pluginFileName; -}; - -#endif diff --git a/projects/sgauthstress/user.cpp b/projects/sgauthstress/user.cpp deleted file mode 100644 index 944907fe..00000000 --- a/projects/sgauthstress/user.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include -#include -#include // close - -#include -#include -#include - -#include "user.h" -#include "stg/ia_packets.h" -#include "stg/common.h" - -USER::USER(const std::string & l, - const std::string & pwd, - uint32_t i) - : login(l), - password(pwd), - ip(i), - aliveTimeout(5), - userTimeout(60), - phase(1), - phaseChangeTime(0), - rnd(0), - sock(-1) -{ -unsigned char key[IA_PASSWD_LEN]; -memset(key, 0, IA_PASSWD_LEN); -strncpy((char *)key, password.c_str(), IA_PASSWD_LEN); -Blowfish_Init(&ctx, key, IA_PASSWD_LEN); -} - -USER::USER(const USER & rvalue) - : login(rvalue.login), - password(rvalue.password), - ip(rvalue.ip), - aliveTimeout(rvalue.aliveTimeout), - userTimeout(rvalue.userTimeout), - phase(1), - phaseChangeTime(0), - rnd(0), - sock(-1) -{ -unsigned char key[IA_PASSWD_LEN]; -memset(key, 0, IA_PASSWD_LEN); -strncpy((char *)key, password.c_str(), IA_PASSWD_LEN); -Blowfish_Init(&ctx, key, IA_PASSWD_LEN); -} - -USER::~USER() -{ -if (sock > 0) - close(sock); -} - -USER & USER::operator=(const USER & rvalue) -{ -login = rvalue.login; -password = rvalue.password; -ip = rvalue.ip; -aliveTimeout = rvalue.aliveTimeout; -userTimeout = rvalue.userTimeout; -phase = 1; -phaseChangeTime = 0; -rnd = 0; -sock = -1; - -unsigned char key[IA_PASSWD_LEN]; -memset(key, 0, IA_PASSWD_LEN); -strncpy((char *)key, password.c_str(), IA_PASSWD_LEN); -Blowfish_Init(&ctx, key, IA_PASSWD_LEN); - -return *this; -} - -bool USER::InitNetwork() -{ -sock = socket(AF_INET, SOCK_DGRAM, 0); - -if (sock < 0) - { - throw std::runtime_error(std::string("USER::USER() - socket creation error: '") + strerror(errno) + "', ip: " + inet_ntostring(ip) + ", login: " + login); - } - -struct sockaddr_in addr; - -addr.sin_family = AF_INET; -addr.sin_addr.s_addr = ip; -addr.sin_port = htons(5554); // :( - -int res = bind(sock, (struct sockaddr *)&addr, sizeof(addr)); -if (res == -1) - { - throw std::runtime_error(std::string("USER::USER() - bind error: '") + strerror(errno) + "', ip: " + inet_ntostring(ip) + ", login: " + login); - } - -return true; -} diff --git a/projects/sgauthstress/user.h b/projects/sgauthstress/user.h deleted file mode 100644 index ef63a907..00000000 --- a/projects/sgauthstress/user.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __USER_H__ -#define __USER_H__ - -#include -#include - -#include "stg/os_int.h" -#include "stg/blowfish.h" - -class USER { - public: - USER(const std::string & login, - const std::string & password, - uint32_t ip); - USER(const USER & rvalue); - ~USER(); - - USER & operator=(const USER & rvalue); - - bool InitNetwork(); - - const std::string & GetLogin() const { return login; } - uint32_t GetIP() const { return ip; } - uint32_t GetAliveTimeout() const { return aliveTimeout; } - uint32_t GetUserTimeout() const { return userTimeout; } - int GetPhase() const { return phase; } - uint32_t GetRnd() const { return rnd; } - int GetSocket() const { return sock; } - time_t GetPhaseChangeTime() const { return phaseChangeTime; } - - BLOWFISH_CTX * GetCtx() { return &ctx; } - - void SetPhase(int p) { phase = p; time(&phaseChangeTime); } - void SetRnd(uint32_t r) { rnd = r; } - uint32_t IncRnd() { return ++rnd; } - void SetAliveTimeout(uint32_t timeout) { aliveTimeout = timeout; } - void SetUserTimeout(uint32_t timeout) { userTimeout = timeout; } - - private: - std::string login; - std::string password; - uint32_t ip; - uint32_t aliveTimeout; - uint32_t userTimeout; - int phase; - time_t phaseChangeTime; - uint32_t rnd; - int sock; - BLOWFISH_CTX ctx; -}; - -#endif diff --git a/projects/sgauthstress/users.1000 b/projects/sgauthstress/users.1000 deleted file mode 100644 index 36ff71e9..00000000 --- a/projects/sgauthstress/users.1000 +++ /dev/null @@ -1,1000 +0,0 @@ - -A -A's -AOL -AOL's -Aachen -Aachen's -Aaliyah -Aaliyah's -Aaron -Aaron's -Abbas -Abbasid -Abbasid's -Abbott -Abbott's -Abby -Abby's -Abdul -Abdul's -Abe -Abe's -Abel -Abel's -Abelard -Abelard's -Abelson -Abelson's -Aberdeen -Aberdeen's -Abernathy -Abernathy's -Abidjan -Abidjan's -Abigail -Abigail's -Abilene -Abilene's -Abner -Abner's -Abraham -Abraham's -Abram -Abram's -Abrams -Absalom -Absalom's -Abuja -Abyssinia -Abyssinia's -Abyssinian -Ac -Ac's -Acadia -Acadia's -Acapulco -Acapulco's -Accra -Accra's -Acevedo -Acevedo's -Achaean -Achaean's -Achebe -Achebe's -Achernar -Achernar's -Acheson -Acheson's -Achilles -Aconcagua -Aconcagua's -Acosta -Acosta's -Acropolis -Acropolis's -Acrux -Acrux's -Actaeon -Actaeon's -Acton -Acton's -Acts -Acuff -Acuff's -Ada -Ada's -Adam -Adam's -Adams -Adan -Adan's -Adana -Adana's -Adar -Adar's -Addams -Adderley -Adderley's -Addie -Addie's -Addison -Addison's -Adela -Adela's -Adelaide -Adelaide's -Adele -Adele's -Adeline -Adeline's -Aden -Aden's -Adenauer -Adenauer's -Adhara -Adhara's -Adidas -Adidas's -Adirondack -Adirondack's -Adirondacks -Adkins -Adkins's -Adler -Adler's -Adolf -Adolf's -Adolfo -Adolfo's -Adolph -Adolph's -Adonis -Adonis's -Adonises -Adrian -Adrian's -Adriana -Adriana's -Adriatic -Adrienne -Adrienne's -Advent -Advent's -Adventist -Adventist's -Advents -Advil -Advil's -Aegean -Aelfric -Aelfric's -Aeneas -Aeneid -Aeneid's -Aeolus -Aeolus's -Aeroflot -Aeroflot's -Aeschylus -Aeschylus's -Aesculapius -Aesculapius's -Aesop -Aesop's -Afghan -Afghan's -Afghanistan -Afghanistan's -Afghans -Africa -Africa's -African -Africans -Afrikaans -Afrikaans's -Afrikaner -Afrikaner's -Afrikaners -Afro -Afro's -Afrocentrism -Afros -Ag -Ag's -Agamemnon -Agamemnon's -Agassi -Agassi's -Agassiz -Agassiz's -Agatha -Agatha's -Aggie -Aggie's -Aglaia -Aglaia's -Agnes -Agnes's -Agnew -Agnew's -Agni -Agni's -Agra -Agra's -Agricola -Agricola's -Agrippa -Agrippa's -Agrippina -Agrippina's -Aguilar -Aguilar's -Aguinaldo -Aguinaldo's -Aguirre -Aguirre's -Agustin -Agustin's -Ahab -Ahab's -Ahmad -Ahmad's -Ahmadabad -Ahmed -Ahmed's -Ahriman -Ahriman's -Aida -Aida's -Aiken -Aiken's -Aileen -Aileen's -Aimee -Aimee's -Ainu -Ainu's -Airedale -Airedale's -Airedales -Aisha -Aisha's -Ajax -Ajax's -Akbar -Akbar's -Akhmatova -Akhmatova's -Akihito -Akihito's -Akita -Akita's -Akkad -Akkad's -Akron -Akron's -Al -Al's -Ala -Ala's -Alabama -Alabama's -Alabaman -Alabamans -Alabamian -Alabamians -Aladdin -Aladdin's -Alamo -Alamo's -Alamogordo -Alamogordo's -Alan -Alan's -Alana -Alana's -Alar -Alaric -Alaric's -Alaska -Alaska's -Alaskan -Alaskans -Alba -Alba's -Albania -Albania's -Albanian -Albanian's -Albanians -Albany -Albany's -Albee -Albee's -Alberio -Alberio's -Albert -Albert's -Alberta -Alberta's -Alberto -Alberto's -Albigensian -Albion -Albion's -Albireo -Albireo's -Albuquerque -Albuquerque's -Alcatraz -Alcatraz's -Alcestis -Alcestis's -Alcibiades -Alcibiades's -Alcmena -Alcmena's -Alcoa -Alcoa's -Alcott -Alcott's -Alcuin -Alcuin's -Alcyone -Alcyone's -Aldan -Aldan's -Aldebaran -Aldebaran's -Alden -Alden's -Alderamin -Alderamin's -Aldo -Aldo's -Aldrin -Aldrin's -Alec -Alec's -Aleichem -Aleichem's -Alejandra -Alejandra's -Alejandro -Alejandro's -Alembert -Alembert's -Aleppo -Aleppo's -Aleut -Aleut's -Aleutian -Alex -Alex's -Alexander -Alexander's -Alexandra -Alexandra's -Alexandria -Alexandria's -Alexei -Alexei's -Alexis -Alfonso -Alfonso's -Alfonzo -Alfonzo's -Alford -Alford's -Alfred -Alfred's -Alfreda -Alfreda's -Alfredo -Alfredo's -Algenib -Algenib's -Alger -Alger's -Algeria -Algeria's -Algerian -Algerians -Algieba -Algieba's -Algiers -Algiers's -Algol -Algol's -Algonquian -Algonquian's -Algonquians -Algonquin -Algonquin's -Alhambra -Alhambra's -Alhena -Alhena's -Ali -Ali's -Alice -Alice's -Alicia -Alicia's -Alighieri -Alighieri's -Aline -Aline's -Alioth -Alioth's -Alisa -Alisa's -Alisha -Alisha's -Alison -Alison's -Alissa -Alissa's -Alistair -Alistair's -Alkaid -Alkaid's -Allah -Allah's -Allahabad -Allahabad's -Allan -Allan's -Alleghenies -Allegheny -Allegheny's -Allegra -Allegra's -Allen -Allen's -Allende -Allende's -Allentown -Allentown's -Allie -Allie's -Allison -Allison's -Allstate -Allstate's -Allyson -Allyson's -Alma -Alma's -Almach -Almach's -Almaty -Almighty -Almighty's -Almohad -Almohad's -Almoravid -Almoravid's -Alnilam -Alnilam's -Alnitak -Alnitak's -Alonzo -Alonzo's -Alpert -Alpert's -Alphard -Alphard's -Alphecca -Alphecca's -Alpheratz -Alpheratz's -Alphonse -Alphonse's -Alphonso -Alphonso's -Alpine -Alpo -Alpo's -Alps -Alsace -Alsace's -Alsatian -Alsatian's -Alsop -Alsop's -Alston -Alston's -Alta -Alta's -Altai -Altai's -Altaic -Altaic's -Altair -Altair's -Altamira -Altamira's -Althea -Althea's -Altiplano -Altiplano's -Altman -Altman's -Altoids -Altoids's -Alton -Alton's -Aludra -Aludra's -Alva -Alva's -Alvarado -Alvarado's -Alvarez -Alvarez's -Alvaro -Alvaro's -Alvin -Alvin's -Alyce -Alyce's -Alyson -Alyson's -Alyssa -Alyssa's -Alzheimer -Alzheimer's -Am -Am's -Amadeus -Amadeus's -Amado -Amado's -Amalia -Amalia's -Amanda -Amanda's -Amarillo -Amarillo's -Amaru -Amaru's -Amaterasu -Amaterasu's -Amati -Amati's -Amazon -Amazon's -Amazons -Amber -Amber's -Amelia -Amelia's -Amenhotep -Amenhotep's -Amerasian -Amerasians -America -America's -American -Americana -Americana's -Americanism -Americanism's -Americanisms -Americanization -Americanization's -Americanizations -Americanize -Americanized -Americanizes -Americanizing -Americans -Americas -Amerind -Amerind's -Amerindian -Amerindian's -Amerindians -Amerinds -Ameslan -Ameslan's -Amharic -Amharic's -Amherst -Amherst's -Amie -Amie's -Amiga -Amiga's -Amish -Amman -Amman's -Amoco -Amoco's -Amos -Amparo -Amparo's -Ampere -Ampere's -Amritsar -Amritsar's -Amsterdam -Amsterdam's -Amtrak -Amundsen -Amundsen's -Amur -Amur's -Amway -Amway's -Amy -Amy's -Ana -Ana's -Anabaptist -Anabaptist's -Anabel -Anabel's -Anacin -Anacin's -Anacreon -Anacreon's -Anaheim -Anaheim's -Analects -Analects's -Ananias -Ananias's -Anasazi -Anasazi's -Anastasia -Anastasia's -Anatole -Anatole's -Anatolia -Anatolia's -Anatolian -Anaxagoras -Anaxagoras's -Anchorage -Anchorage's -Andalusia -Andalusia's -Andalusian -Andaman -Andean -Andersen -Andersen's -Anderson -Anderson's -Andes -Andorra -Andorra's -Andre -Andre's -Andrea -Andrea's -Andrei -Andrei's -Andres -Andrew -Andrew's -Andrews -Andrianampoinimerina -Andrianampoinimerina's -Andromache -Andromache's -Andromeda -Andromeda's -Andropov -Andy -Andy's -Angara -Angara's -Angel -Angel's -Angela -Angela's -Angelia -Angelia's -Angelica -Angelica's -Angelico -Angelico's -Angelina -Angelina's -Angeline -Angeline's -Angelique -Angelique's -Angelita -Angelita's -Angelo -Angelo's -Angelou -Angevin -Angevin's -Angie -Angie's -Angkor -Angkor's -Anglia -Anglia's -Anglican -Anglicanism -Anglicanism's -Anglicanisms -Anglicans -Anglicize -Anglicized -Anglicizes -Anglicizing -Anglo -Anglo's -Anglophile -Anglophile's -Anglophiles -Anglos -Angola -Angola's -Angolan -Angolans -Angora -Angora's -Angoras -Anguilla -Anguilla's -Angus -Angus's -Aniakchak -Aniakchak's -Anibal -Anibal's -Anita -Anita's -Ankara -Ankara's -Ann -Ann's -Anna -Anna's -Annabel -Annabel's -Annabelle -Annabelle's -Annam -Annam's -Annapolis -Annapolis's -Annapurna -Annapurna's -Anne -Anne's -Annette -Annette's -Annie -Annie's -Annmarie -Annmarie's -Anouilh -Anouilh's -Anselm -Anselm's -Anselmo -Anselmo's -Anshan -Anshan's -Antaeus -Antaeus's -Antananarivo -Antananarivo's -Antarctic -Antarctic's -Antarctica -Antarctica's -Antares -Anthony -Anthony's -Antichrist -Antichrist's -Antichrists -Antietam -Antietam's -Antigone -Antigone's -Antigua -Antigua's -Antilles -Antioch -Antioch's -Antipas -Antipas's -Antofagasta -Antofagasta's -Antoine -Antoine's -Antoinette -Antoinette's -Anton -Anton's -Antone -Antone's -Antonia -Antonia's -Antoninus -Antoninus's -Antonio -Antonio's -Antonius -Antonius's -Antony -Antony's -Antwan -Antwan's -Antwerp -Antwerp's -Anubis -Anubis's -Anzac -Anzac's -Apache -Apache's -Apaches -Apalachicola -Apalachicola's -Apennines -Aphrodite -Aphrodite's -Apia -Apia's -Apocrypha -Apocrypha's -Apollinaire -Apollinaire's -Apollo -Apollo's -Apollonian -Apollos -Appalachia -Appalachia's -Appalachian -Appalachians -Appaloosa -Appaloosa's -Apple -Apple's -Appleseed -Appleseed's -Appleton -Appleton's -Appomattox -Appomattox's -Apr -Apr's -April -April's -Aprils -Apuleius -Apuleius's -Aquafresh -Aquafresh's -Aquarius -Aquarius's -Aquariuses -Aquila -Aquila's -Aquinas -Aquinas's -Aquino -Aquino's -Aquitaine -Aquitaine's -Ar -Ar's -Ara -Ara's -Arab -Arab's -Arabia -Arabia's -Arabian -Arabians -Arabic -Arabic's -Arabs -Araby -Araby's -Araceli -Araceli's -Arafat -Arafat's -Araguaya -Araguaya's -Aral -Aral's -Aramaic -Aramaic's -Aramco -Aramco's -Arapaho -Arapaho's -Ararat -Ararat's -Araucanian -Araucanian's -Arawak -Arawak's -Arawakan -Arawakan's -Arbitron -Arbitron's -Arcadia -Arcadia's -Arcadian -Archean -Archibald -Archibald's -Archie -Archie's -Archimedes -Archimedes's -Arctic -Arctic's -Arcturus -Arcturus's -Arden -Arden's -Arequipa -Arequipa's -Ares -Argentina -Argentina's -Argentine -Argentine's -Argentines -Argentinian -Argentinians -Argo -Argo's -Argonaut -Argonaut's -Argonne -Argonne's -Argos -Argus -Argus's -Ariadne -Ariadne's -Arianism -Arianism's -Ariel -Ariel's -Aries -Arieses -Ariosto -Ariosto's -Aristarchus -Aristarchus's -Aristides -Aristophanes -Aristophanes's -Aristotelian -Aristotle -Aristotle's -Arius -Arius's -Ariz -Ariz's -Arizona -Arizona's -Arizonan -Arizonans -Arizonian -Arizonians -Arjuna -Arjuna's -Ark -Ark's -Arkansan -Arkansan's -Arkansas -Arkansas's -Arkhangelsk -Arkhangelsk's -Arkwright -Arkwright's -Arlene -Arlene's -Arline -Arline's -Arlington -Arlington's -Armageddon -Armageddon's -Armageddons -Armagnac -Armagnac's -Armand diff --git a/projects/sgconf_xml/Makefile b/projects/sgconf_xml/Makefile deleted file mode 100644 index a7058b89..00000000 --- a/projects/sgconf_xml/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.3 2008/05/11 09:30:43 nobunaga Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = sgconf_xml - -SRCS = ./main.cpp \ - ./parser.cpp - -STGLIBS = conffiles \ - srvconf \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) -lexpat $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -else -LIBS += -lc -endif - -SEARCH_DIRS = -I ../../include - -ifeq ($(OS),bsd) -SEARCH_DIRS += -I/usr/local/include -CXXFLAGS += -DHAVE_DECL_GETOPT=1 -endif - -ifeq ($(OS),bsd5) -SEARCH_DIRS += -I/usr/local/include -CXXFLAGS += -DHAVE_DECL_GETOPT=1 -endif - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -LDFLAGS += -Wl,-E $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs install uninstall install-bin install-data uninstall-bin uninstall-data -all: libs $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -$(PROG): $(OBJS) - $(CXX) $^ $(LIBS) $(LDFLAGS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f .store - rm -f .db.sql - rm -f core* - $(MAKE) -C $(DIR_LIBSRC) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin install-data - -install-bin: -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/sbin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/sbin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/sbin/$(PROG) -endif - $(MAKE) -C $(DIR_LIBSRC) install - -uninstall: uninstall-bin uninstall-data - -uninstall-bin: - rm -f $(PREFIX)/usr/sbin/$(PROG) - - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/projects/sgconf_xml/README.txt b/projects/sgconf_xml/README.txt deleted file mode 100644 index cbdf9aca..00000000 --- a/projects/sgconf_xml/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -Compiling: -> ./build - diff --git a/projects/sgconf_xml/build b/projects/sgconf_xml/build deleted file mode 100755 index a1084554..00000000 --- a/projects/sgconf_xml/build +++ /dev/null @@ -1,218 +0,0 @@ -#!/bin/sh - -# $Author: nobunaga $ -# $Revision: 1.2 $ -# $Date: 2008/01/05 12:11:02 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but sgconf_xml is currently supported by Linux, FreeBSD and Darwin.#\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building sgconf_xml for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="conffiles.lib - crypto.lib - common.lib - srvconf.lib" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - else - DEFS="$DEFS -DFREE_BSD5" - if [ "$OS" = "bsd7" ] - then - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for -lexpat... " -printf "int main() { return 0; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS build_check.c -lexpat -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - CHECK_EXPAT=no - printf "no\n" -else - CHECK_EXPAT=yes - printf "yes\n" -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -rm -f build_check.c - -if [ "$CHECK_EXPAT" != "yes" ] -then - printf "-lexpat not found!\n" - exit 1 -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_EXPAT=$CHECK_EXPAT\n" >> $CONFFILE -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/projects/sgconf_xml/main.cpp b/projects/sgconf_xml/main.cpp deleted file mode 100644 index d43efea4..00000000 --- a/projects/sgconf_xml/main.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Boris Mikhailenko - */ - -/* -$Revision: 1.2 $ -$Author: nobunaga $ -$Date: 2008/01/05 12:11:34 $ -*/ - -#include "stg/common.h" -#include "stg/netunit.h" -#include "request.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#define FN_LEN (512) -#define REQ_STR_LEN (300) -char fileName[FN_LEN]; -char strReq[2048]; - -int ParseReply(void * data, list * ans); - -struct option long_options[] = { -{"server", 1, 0, 's'}, //Server -{"port", 1, 0, 'p'}, //Port -{"admin", 1, 0, 'a'}, //Admin -{"admin_pass", 1, 0, 'w'}, //passWord -{"file", 1, 0, 'f'}, //File -{"strreq", 1, 0, 'r'}, //String request -{0, 0, 0, 0}}; - -//----------------------------------------------------------------------------- -int CheckLogin(const char * login) -{ -for (int i = 0; i < (int)strlen(login); i++) - { - if (!(( login[i] >= 'a' && login[i] <= 'z') - || (login[i] >= 'A' && login[i] <= 'Z') - || (login[i] >= '0' && login[i] <= '9') - || login[i] == '_' - || login[i] == '-')) - { - return 1; - } - } -return 0; -} -//----------------------------------------------------------------------------- -short int ParseServerPort(const char * p) -{ -int port; -if (str2x(p, port) != 0) - { - printf("Incorresct server port %s\n", p); - exit(NETWORK_ERR_CODE); - } -return(short)port; -} -//----------------------------------------------------------------------------- -char * ParseAdminLogin(char * adm) -{ -if (CheckLogin(adm)) - { - printf("Incorrect admin login %s\n", adm); - exit(PARAMETER_PARSING_ERR_CODE); - } -return adm; -} -//----------------------------------------------------------------------------- -char * ParsePassword(char * pass) -{ -if (strlen(pass) >= ADM_PASSWD_LEN) - { - printf("Password too big %s\n", pass); - exit(PARAMETER_PARSING_ERR_CODE); - } - -return pass; -} -//----------------------------------------------------------------------------- -void CreateRequest(REQUEST * req, char * r) -{ -r[0] = 0; - -if (!req->strReq.empty()) - { - char str[10024]; - sprintf(str, "%s", req->strReq.const_data().c_str()); - strcat(r, str); - return; - } else - { - FILE *f = fopen(fileName, "rt"); - if (!f) - { - printf("Can't open request file\n"); - exit(PARAMETER_PARSING_ERR_CODE); - } - - char ts[REQ_STR_LEN]; - while (fgets(ts, REQ_STR_LEN, f)) - { - strncat(r, ts, REQ_STR_LEN); - } - fclose(f); - } -} -//----------------------------------------------------------------------------- -int Process(REQUEST * r) -{ -int ret; -char str[2048]; - -NETTRANSACT nt; -nt.SetServer(r->server.const_data().c_str()); -nt.SetServerPort(r->port.const_data()); -nt.SetLogin(r->admLogin.const_data().c_str()); -nt.SetPassword(r->admPasswd.const_data().c_str()); -nt.SetRxCallback(NULL, ParseReply); - -CreateRequest(r, str); - -if ((ret = nt.Connect()) != st_ok) - { - printf("%s\n", nt.GetError().c_str()); - return ret; - } -if ((ret = nt.Transact(str)) != st_ok) - { - printf("%s\n", nt.GetError().c_str()); - return ret; - } -if ((ret = nt.Disconnect()) != st_ok) - { - printf("%s\n", nt.GetError().c_str()); - return ret; - } - -printf("\n"); -return 0; -} -//----------------------------------------------------------------------------- -int CheckParameters(REQUEST * req) -{ -int a = !req->admLogin.empty() - && !req->admPasswd.empty() - && !req->server.empty() - && !req->port.empty(); - -int b = !req->fileReq.empty() - || !req->strReq.empty(); - -return a && b; -} -//----------------------------------------------------------------------------- -void Usage() -{ -printf("Sgconf version: 1.05.9_XML\n\n"); - -printf("Use: sgconf -s -p -a -w -r \n"); -printf("Use: sgconf -s -p -a -w -f \n\n"); - -printf("Request file or string content:\n\n"); - -printf(" \n\n"); - -printf(" \n"); -printf(" \n"); -printf(" \n\n"); - -printf(" \n"); -printf(" Day-Night time for each DIR\n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" New TraffType value: [up|down|up+down|max]\n"); -printf(" \n\n"); - -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n\n"); - -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" Checking login and password in database. Return Ok or Err.\n\n"); - -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" delayed - change tariff from 1st day of new month; now - change tariff NOW.\n"); -printf(" Encode12() -> value\n"); -printf(" Encode12() -> value\n"); -printf("
Encode12() -> value\n"); -printf(" Encode12() -> value\n"); -printf(" Encode12() -> value\n"); -printf(" Encode12() -> value\n"); -printf(" Encode12() -> value\n"); -printf(" add - add money on account; set - set money on account; Message - message for log\n"); -printf(" \n"); -printf(" \n"); -printf(" \n"); -printf(" 1 - turn ON AlwaysOnline; 0 - turn OFF AlwaysOnline\n"); -printf(" 1 - turn ON Down; 0 - turn OFF Down\n"); -printf(" 1 - turn ON Passive; 0 - turn OFF Passive\n"); -printf(" MU[0...9] - Set upload traffic value; MU[0...9] - Set download traffic value; \n"); -printf(" \n\n"); - -printf(" \n"); -} -//--------------------------------------------------------------------------- -int main(int argc, char **argv) -{ -REQUEST req; - -while (1) - { - int option_index = -1; - - int c = getopt_long(argc, argv, "s:p:a:w:f:r:", long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 's': //server - req.server = optarg; - break; - - case 'p': //port - req.port = ParseServerPort(optarg); - break; - - case 'a': //admin - req.admLogin = ParseAdminLogin(optarg); - break; - - case 'w': //admin password - req.admPasswd = ParsePassword(optarg); - break; - - case 'f': //file - strcpy(fileName,optarg); - req.fileReq = 1; - break; - - case 'r': //string request - req.strReq = optarg; - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - -if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - exit(PARAMETER_PARSING_ERR_CODE); - } - -if (CheckParameters(&req) == 0) - { - Usage(); - exit(PARAMETER_PARSING_ERR_CODE); - } - -Process(&req); - -return 0; -} -//----------------------------------------------------------------------------- - diff --git a/projects/sgconf_xml/parser.cpp b/projects/sgconf_xml/parser.cpp deleted file mode 100644 index 23ec776a..00000000 --- a/projects/sgconf_xml/parser.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include "stg/common.h" -#include "stg/netunit.h" -#include "request.h" - -#include -#include -#include -#include - -int parse_depth = 0; -XML_Parser parser; -//--------------------------------------------------------------------------- -int ParseAns(void *, const char *el, const char **attr) -{ -if (strcasecmp(el, "ServerInfo") == 0 || strcasecmp(el, "Tariffs") == 0 || strcasecmp(el, "Admins") == 0 || strcasecmp(el, "Users") == 0 || strcasecmp(el, "user") == 0) - { - return 0; - } -if (strcasecmp(attr[1], "ok") == 0) - { - return 0; - } -if (strcasecmp(attr[1], "error") == 0) - { - return 1; - } -if (strcasecmp(attr[1], "err") == 0) - { - return 1; - } -return -1; -} -//--------------------------------------------------------------------------- -void StartElement(void *data, const char *el, const char **attr) -{ -if (strcasecmp(el, "ServerInfo") == 0 || strcasecmp(el, "Tariffs") == 0 || strcasecmp(el, "Admins") == 0 || strcasecmp(el, "Users") == 0) - { - printf ("<%s>\n", el); - return; - } - -if (strcasecmp(el, "tariff") == 0) - { - if (strcasecmp(attr[0], "name") == 0) - { - printf ("<%s %s=\"%s\">\n", el, attr[0], attr[1]); - printf ("<%s>%s\n", attr[0], attr[1], attr[0]); - } - else - { - printf ("<%s>%s", el, attr[1]); - } - return; - } - -if (strcasecmp(el, "admin") == 0) - { - printf ("<%s %s=\"%s\">\n", el, attr[0], attr[1]); - int i = 0; - while (attr[i]) - { - printf ("<%s>%s\n", attr[i], attr[i+1], attr[i]); - i+=2; - } - printf ("\n"); - return; - } - -if (strcasecmp(el, "user") == 0) - { - if (strcasecmp(attr[0], "login") == 0) - { - printf ("<%s %s=\"%s\">\n", el, attr[0], attr[1]); - printf ("<%s>%s\n", attr[0], attr[1], attr[0]); - } - else - { - printf ("<%s>\n", el); - } - return; - } - -if (strncasecmp(el, "dir_name_", 9) == 0 || strcasecmp(el, "address") == 0 || strcasecmp(el, "email") == 0 || strcasecmp(el, "group") == 0 || strcasecmp(el, "note") == 0 || strcasecmp(el, "phone") == 0 || strcasecmp(el, "name") == 0 || strncasecmp(el, "UserData", 8) == 0) - { - char * str_tmp; - str_tmp = new char[strlen(attr[1]) + 1]; - Decode21(str_tmp, attr[1]); - printf ("<%s>%s\n", el, str_tmp, el); - delete[] str_tmp; - return; - } - -if (strcasecmp(el, "traff") == 0) - { - int j = 0; - while (attr[j]) - { - uint64_t t; - str2x(attr[j+1], t); - printf ("<%s>%lld\n", attr[j], t, attr[j]); - j+=2; - } - return; - } -else - { - printf ("<%s>%s\n", el, attr[1], el); - return; - } -parse_depth++; -if (parse_depth == 1) - { - if (ParseAns(data, el, attr) < 0) - { - printf("Unexpected token\n"); - exit(UNKNOWN_ERR_CODE); - } - if (ParseAns(data, el, attr) == 1) - { - printf("User not found\n"); - exit(USER_NOT_FOUND_ERR_CODE); - } - return; - } -} -//----------------------------------------------------------------------------- -void EndElement(void *, const char *el) -{ -parse_depth--; -if (strcasecmp(el, "ServerInfo") == 0 || - strcasecmp(el, "Tariffs") == 0 || - strcasecmp(el, "Admins") == 0 || - strcasecmp(el, "Users") == 0 || - strcasecmp(el, "tariff") == 0 || - strcasecmp(el, "user") == 0) - printf ("\n", el); -} -//--------------------------------------------------------------------------- -int ParseReply(void *, list * ans) -{ -int done = 0; - -parse_depth = 0; -parser = XML_ParserCreate(NULL); - -if (!parser) - { - printf("Couldn't allocate memory for parser\n"); - exit(UNKNOWN_ERR_CODE); - } - -XML_ParserReset(parser, NULL); -XML_SetElementHandler(parser, StartElement, EndElement); - -list::iterator n = ans->begin(); -while (n != ans->end()) - { - int len = strlen(n->c_str()); - - if (++n == ans->end()) - done = 1; - --n; - - if (XML_Parse(parser, n->c_str(), len, done) == XML_STATUS_ERROR) - { - printf("Parse error at line %d: %s", - XML_GetCurrentLineNumber(parser), - XML_ErrorString(XML_GetErrorCode(parser))); - return st_xml_parse_error; - } - - ++n; - } -XML_ParserFree(parser); -return 0; -} -//----------------------------------------------------------------------------- diff --git a/projects/sgconf_xml/request.h b/projects/sgconf_xml/request.h deleted file mode 100644 index 004f89b0..00000000 --- a/projects/sgconf_xml/request.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 27.10.2002 - */ - -/* - * Author : Boris Mikhailenko - */ - - /* - $Revision: 1.1 $ - $Date: 2007/12/29 17:24:07 $ - */ - -#ifndef request_h -#define request_h - -#include - -#include "stg/resetable.h" -#include "stg/os_int.h" -#include "stg/const.h" - -#ifndef ENODATA -#define ENODATA 61 -#endif - -#ifndef EBADMSG -#define EBADMSG 74 -#endif - -#define NETWORK_ERR_CODE (1) -#define LOGIN_OR_PASS_ERR_CODE (2) -#define USER_NOT_FOUND_ERR_CODE (3) -#define TARIFF_NOT_FOUND_ERR_CODE (4) -#define PARAMETER_PARSING_ERR_CODE (5) -#define UNKNOWN_ERR_CODE (6) - -using namespace std; -//----------------------------------------------------------------------------- -struct REQUEST -{ -RESETABLE server; -RESETABLE port; -RESETABLE admLogin; -RESETABLE admPasswd; -RESETABLE fileReq; -RESETABLE strReq; -}; -//----------------------------------------------------------------------------- - -#endif diff --git a/projects/sgconf_xml/stg_req b/projects/sgconf_xml/stg_req deleted file mode 100644 index 8c1f8ae7..00000000 --- a/projects/sgconf_xml/stg_req +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/sgconv/Makefile b/projects/sgconv/Makefile deleted file mode 100644 index b463f175..00000000 --- a/projects/sgconv/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.12 2009/03/03 15:49:34 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = sgconv - -SRCS = ./main.cpp \ - ./settings_impl.cpp - -STGLIBS = dotconfpp \ - conffiles \ - logger \ - crypto \ - common - -STGLIBS_INCS = $(addprefix -I ../../stglibs/,$(addsuffix .lib/include,$(STGLIBS))) -STGLIBS_LIBS = $(addprefix -L ../../stglibs/,$(addsuffix .lib,$(STGLIBS))) - -LIBS += $(addprefix -lstg,$(STGLIBS)) $(LIB_THREAD) $(LIBICONV) - -ifeq ($(OS),linux) -LIBS += -ldl -else -LIBS += -lc -endif - -SEARCH_DIRS = -I ../../include - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) -CFLAGS += $(DEFS) $(STGLIBS_INCS) $(SEARCH_DIRS) - -ifneq ($(OS),darwin) -LDFLAGS += -Wl,-E -endif - -LDFLAGS += $(STGLIBS_LIBS) - -.PHONY: all clean distclean libs plugins install uninstall -all: libs plugins $(PROG) ../../Makefile.conf - -libs: - $(MAKE) -C $(DIR_LIBSRC) - -plugins: libs - $(MAKE) -C $(DIR_PLUGINS) - -$(PROG): $(OBJS) - $(CXX) $^ $(LDFLAGS) $(LIBS) -o $(PROG) - -clean: - rm -f deps $(PROG) *.o tags *.*~ .OS - rm -f .OS - rm -f .store - rm -f .db.sql - rm -f core* - $(MAKE) -C $(DIR_LIBSRC) clean - $(MAKE) -C $(DIR_PLUGINS) clean - -distclean: clean - rm -f ../../Makefile.conf - -install: install-bin - -install-bin: -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/bin - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/bin/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/bin - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/bin/$(PROG) -endif - $(MAKE) -C $(DIR_PLUGINS) install - -uninstall: uninstall-bin - -uninstall-bin: - rm -f $(PREFIX)/usr/bin/$(PROG) - -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - $(MAKE) -C $(DIR_LIBSRC) - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/projects/sgconv/build b/projects/sgconv/build deleted file mode 100755 index 676bf74e..00000000 --- a/projects/sgconv/build +++ /dev/null @@ -1,381 +0,0 @@ -#!/bin/sh - -# $Revision: 1.20 $ -# $Author: faust $ -# $Date: 2010/04/14 08:58:43 $ -###################################################### - -OS=unknown -sys=`uname -s` -release=`uname -r` -major=`printf "%s" "$release" | cut -d. -f1` -BUILD_DIR=`pwd` -CONFFILE="../../Makefile.conf" -PREFIX="/" -BIN_MODE=0755 -DATA_MODE=0644 -DIR_MODE=0755 -OWNER=root -VAR_DIR="./inst/var/stargazer" - -if [ "$1" = "debug" ] -then - DEFS="$DEFS -DDEBUG" - MAKEOPTS="$MAKEOPTS -j1" - CFLAGS="$CFLAGS -ggdb3 -W -Wall -Wextra" - CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -Wextra" - DEBUG="yes" -else - DEFS="$DEFS -DNDEBUG" - DEBUG="no" -fi - -CFLAGS="$CFLAGS -ggdb3 -W -Wall -I/usr/local/include" -CXXFLAGS="$CXXFLAGS -ggdb3 -W -Wall -I/usr/local/include" -LDFLAGS="$LDFLAGS -L/usr/local/lib" - -if [ "$sys" = "Linux" ] -then - OS=linux - MAKE="make" -fi - -if [ "$sys" = "FreeBSD" ] -then - case $major in - 4) OS=bsd;; - 5) OS=bsd5;; - 6) OS=bsd5;; - 7) OS=bsd7;; - *) OS=bsd7;; - esac - MAKE="gmake" -fi - -if [ "$sys" = "Darwin" ] -then - OS=darwin - ETC_DIR="./inst/freebsd/etc/stargazer" - MAKE="gmake" -fi - -if [ "$OS" = "unknown" ] -then - printf "#############################################################################\n" - printf "# Sorry, but sgconv is currently supported by Linux, FreeBSD and Darwin. #\n" - printf "#############################################################################\n" - exit 1 -fi - -printf "#############################################################################\n" -printf " Building sgconv for $sys $release\n" -printf "#############################################################################\n" - -STG_LIBS="logger.lib - crypto.lib - common.lib - conffiles.lib - dotconfpp.lib" - -PLUGINS="store/files" - -if [ "$OS" = "linux" ] -then - DEFS="$DEFS -DLINUX" - LIB_THREAD=-lpthread -else - LIBICONV="-liconv" - if [ "$OS" = "bsd" ] - then - DEFS="$DEFS -DFREE_BSD" - LIB_THREAD=-lc_r - else - if [ "$OS" = "bsd7" ] - then - DEFS="$DEFS -DFREE_BSD5" - LIB_THREAD=-lpthread - else - if [ "$OS" == "darwin" ] - then - DEFS="$DEFS -DDARWIN" - LIB_THREAD=-lpthread - else - LIB_THREAD=-lc_r - fi - fi - fi -fi - -if [ -z "$CC" ] -then - CC=gcc -fi - -if [ -z "$CXX" ] -then - CXX=g++ -fi - -printf "Checking CC... " -$CC --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CC not found\n" - exit; -fi -printf "found\n" -printf "Checking CXX... " -$CXX --version > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "$CXX not found\n" - exit; -fi -printf "found\n" - -printf "Checking endianess... " -printf "int main() { int probe = 0x00000001; return *(char *)&probe; }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -L/usr/lib/mysql -L/usr/local/lib/mysql build_check.c -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "FAIL!\n" - printf "Endianess checking failed\n" - exit; -else - ./fake - if [ $? = 1 ] - then - ARCH=le - CXXFLAGS="$CXXFLAGS -DARCH_LE" - CFLAGS="$CFLAGS -DARCH_LE" - printf "Little Endian\n" - else - ARCH=be - CXXFLAGS="$CXXFLAGS -DARCH_BE" - CFLAGS="$CFLAGS -DARCH_BE" - printf "Big Endian\n" - fi -fi -rm -f fake - -printf "Checking for iconv 2nd argument... " -printf "#include \nint main(){ const char** src = 0; iconv(0, src, 0, 0, 0); }\n" > build_check.c -$CC $CFLAGS $LDFLAGS -Werror build_check.c $LIBICONV -o fake > /dev/null 2> /dev/null -if [ $? != 0 ] -then - printf "non-const\n" -else - DEFS="$DEFS -DCONST_ICONV" - printf "const\n" -fi -rm -f fake - -printf "Checking for fb_config... " -FB_VERSION=`fb_config --version 2> /dev/null` -if [ "$?" != "0" ] -then - printf "no\n" - printf "Checking for -lfbclient... " - printf "int main() { return 0; }\n" > build_check.c - $CC $CFLAGS $LDFLAGS build_check.c -lfbclient $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - FB_CFLAGS="" - FB_LDFLAGS="-lfbclient" - CHECK_FBCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for fb_config --cflags... " - FB_CFLAGS=`fb_config --cflags` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - printf "[$FB_CFLAGS]\n" - printf "Checking for fb_config --libs " - FB_LDFLAGS=`fb_config --libs` - if [ "$?" != "0" ] - then - CHECK_FBCLIENT=no - printf "no\n" - else - CHECK_FBCLIENT=yes - printf "[$FB_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for mysql_config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -MYSQL_VERSION=`mysql_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lmysqlclient... " - $CC $CFLAGS $LDFLAGS build_check.c -lmysqlclient_r $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n" - printf "Checking for mysql_config --cflags... " - MYSQL_CFLAGS=`mysql_config --cflags 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - printf "[$MYSQL_CFLAGS]\n" - printf "Checking for mysql_config --libs_r... " - MYSQL_LDFLAGS=`mysql_config --libs_r 2> /dev/null` - if [ $? != 0 ] - then - CHECK_MYSQLCLIENT=no - printf "no\n" - else - CHECK_MYSQLCLIENT=yes - printf "[$MYSQL_LDFLAGS]\n" - fi - fi -fi - -printf "Checking for pg_config... " -printf "#include \nint main() { return 0; }\n" > build_check.c -PG_VERSION=`pg_config --version 2> /dev/null` -if [ $? != 0 ] -then - printf "no\n"; - printf "Checking for -lpq... " - $CC $CFLAGS $LDFLAGS build_check.c -lpq $LIB_THREAD -o fake > /dev/null 2> /dev/null - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "yes\n" - fi - rm -f fake -else - printf "yes\n"; - printf "Checking for pg_config --includedir... " - PG_CFLAGS="-I"`pg_config --includedir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - printf "[$PG_CFLAGS]\n" - printf "Checking for pg_config --libdir... " - PG_LDFLAGS="-L"`pg_config --libdir 2> /dev/null` - if [ $? != 0 ] - then - CHECK_PQ=no - printf "no\n" - else - CHECK_PQ=yes - printf "[$PG_LDFLAGS]\n" - fi - fi -fi - -rm -f build_check.c - -if [ "$CHECK_FBCLIENT" = "yes" ] -then - STG_LIBS="$STG_LIBS - ibpp.lib" - PLUGINS="$PLUGINS - store/firebird" -fi - -if [ "$CHECK_PQ" = "yes" ] -then - PLUGINS="$PLUGINS - store/postgresql" -fi - -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - PLUGINS="$PLUGINS - store/mysql" -fi - -printf "OS=$OS\n" > $CONFFILE -printf "STG_TIME=yes\n" >> $CONFFILE -printf "DEBUG=$DEBUG\n" >> $CONFFILE -printf "DIR_BUILD=$BUILD_DIR\n" >> $CONFFILE -printf "DIR_LIB=\$(DIR_BUILD)/../../lib\n" >> $CONFFILE -printf "DIR_LIBSRC=\$(DIR_BUILD)/../../stglibs\n" >> $CONFFILE -printf "DIR_INCLUDE=\$(DIR_BUILD)/../../include\n" >> $CONFFILE -printf "DIR_MOD=\$(DIR_BUILD)/../stargazer/modules\n" >> $CONFFILE -printf "DIR_PLUGINS=\$(DIR_BUILD)/../stargazer/plugins\n" >> $CONFFILE -printf "ARCH=$ARCH\n" >> $CONFFILE -printf "CHECK_FBCLIENT=$CHECK_FBCLIENT\n" >> $CONFFILE -if [ "$CHECK_FBCLIENT" = "yes" ] -then - printf "FB_CFLAGS=$FB_CFLAGS\n" >> $CONFFILE - printf "FB_LDFLAGS=$FB_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_MYSQLCLIENT=$CHECK_MYSQLCLIENT\n" >> $CONFFILE -if [ "$CHECK_MYSQLCLIENT" = "yes" ] -then - printf "MYSQL_CFLAGS=$MYSQL_CFLAGS\n" >> $CONFFILE - printf "MYSQL_LDFLAGS=$MYSQL_LDFLAGS\n" >> $CONFFILE -fi -printf "CHECK_PQ=$CHECK_PQ\n" >> $CONFFILE -if [ "$CHECK_PQ" = "yes" ] -then - printf "PG_CFLAGS=$PG_CFLAGS\n" >> $CONFFILE - printf "PG_LDFLAGS=$PG_LDFLAGS\n" >> $CONFFILE -fi -printf "DEFS=$DEFS\n" >> $CONFFILE -printf "STG_LIBS=" >> $CONFFILE -for lib in $STG_LIBS -do - printf "$lib " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "PLUGINS=" >> $CONFFILE -for plugin in $PLUGINS -do - printf "$plugin " >> $CONFFILE -done -printf "\n" >> $CONFFILE -printf "CC=$CC\n" >> $CONFFILE -printf "CXX=$CXX\n" >> $CONFFILE -printf "CXXFLAGS=$CXXFLAGS\n" >> $CONFFILE -printf "CFLAGS=$CFLAGS\n" >> $CONFFILE -printf "LDFLAGS=$LDFLAGS\n" >> $CONFFILE -printf "LIB_THREAD=$LIB_THREAD\n" >> $CONFFILE -printf "LIBICONV=$LIBICONV\n" >> $CONFFILE -printf "PREFIX=$PREFIX\n" >> $CONFFILE -printf "BIN_MODE=$BIN_MODE\n" >> $CONFFILE -printf "DATA_MODE=$DATA_MODE\n" >> $CONFFILE -printf "DIR_MODE=$DIR_MODE\n" >> $CONFFILE -printf "OWNER=$OWNER\n" >> $CONFFILE -printf "VAR_DIR=$VAR_DIR\n" >> $CONFFILE - -mkdir -p ../stargazer/modules - -if [ "$1" != "debug" ] -then - $MAKE $MAKEOPTS -else - printf "\n\n\nDebug build. Type $MAKE explicitly\n" -fi diff --git a/projects/sgconv/main.cpp b/projects/sgconv/main.cpp deleted file mode 100644 index 63e83e9d..00000000 --- a/projects/sgconv/main.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Maxim Mamontov - */ - - /* - $Revision: 1.11 $ - $Date: 2010/03/25 12:32:30 $ - $Author: faust $ - */ - -#include - -#include -#include -#include -#include -#include - -#include "stg/common.h" -#include "stg/store.h" -#include "stg/conffiles.h" - -#include "stg/user_stat.h" -#include "stg/user_conf.h" -#include "stg/corp_conf.h" -#include "stg/service_conf.h" -#include "stg/admin_conf.h" -#include "stg/tariff_conf.h" -#include "stg/settings.h" -#include "stg/message.h" - -#include "settings_impl.h" - -volatile time_t stgTime = time(NULL); - -int main(int argc, char **argv) -{ -printfd(__FILE__, "Start\n"); - -STORE * fromStore = NULL; -STORE * toStore = NULL; - -SETTINGS_IMPL * settings = NULL; - -std::string modulePath; - -MODULE_SETTINGS fromStoreSettings; -MODULE_SETTINGS toStoreSettings; - -ADMIN_CONF ac; -USER_CONF uc; -USER_STAT us; -STG_MSG msg; -TARIFF_DATA td; -CORP_CONF cc; -SERVICE_CONF sc; -std::vector hdrs; - -if (argc == 2) - settings = new SETTINGS_IMPL(argv[1]); -else - settings = new SETTINGS_IMPL(); - -if (settings->ReadSettings()) - { - printfd(__FILE__, "Error reading settings\n"); - delete settings; - return -1; - } - -fromStoreSettings = settings->GetSourceStoreModuleSettings(); -toStoreSettings = settings->GetDestStoreModuleSettings(); -modulePath = settings->GetModulesPath(); - -std::string sourcePlugin(modulePath + "/mod_" + fromStoreSettings.moduleName + ".so"); -std::string destPlugin(modulePath + "/mod_" + toStoreSettings.moduleName + ".so"); - -void * src_lh = dlopen(sourcePlugin.c_str(), RTLD_NOW); -if (!src_lh) - { - printfd(__FILE__, "Source storage plugin loading failed: %s\n", dlerror()); - delete settings; - return -1; - } - -void * dst_lh = dlopen(destPlugin.c_str(), RTLD_NOW); -if (!dst_lh) - { - printfd(__FILE__, "Destination storage plugin loading failed: %s\n", dlerror()); - delete settings; - return -1; - } - -STORE * (*GetSourceStore)(); -STORE * (*GetDestStore)(); -GetSourceStore = (STORE * (*)())dlsym(src_lh, "GetStore"); -if (!GetSourceStore) - { - printfd(__FILE__, "Source storage plugin loading failed. GetStore not found: %s\n", dlerror()); - delete settings; - return -1; - } -GetDestStore = (STORE * (*)())dlsym(dst_lh, "GetStore"); -if (!GetDestStore) - { - printfd(__FILE__, "Storage plugin (firebird) loading failed. GetStore not found: %s\n", dlerror()); - delete settings; - return -1; - } - -fromStore = GetSourceStore(); -toStore = GetDestStore(); - -std::vector entities; -std::vector ready; -fromStore->SetSettings(fromStoreSettings); -fromStore->ParseSettings(); -toStore->SetSettings(toStoreSettings); -toStore->ParseSettings(); - -printfd(__FILE__, "Importing admins:\n"); -entities.erase(entities.begin(), entities.end()); -ready.erase(ready.begin(), ready.end()); -if (fromStore->GetAdminsList(&entities)) - { - printfd(__FILE__, "Error getting admins list: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } -if (toStore->GetAdminsList(&ready)) - { - printfd(__FILE__, "Error getting admins list: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - -std::vector::const_iterator it; -for (it = entities.begin(); it != entities.end(); ++it) - { - printfd(__FILE__, "\t - %s\n", it->c_str()); - if (find(ready.begin(), ready.end(), *it) == ready.end()) - if (toStore->AddAdmin(*it)) - { - printfd(__FILE__, "Error adding admin: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (fromStore->RestoreAdmin(&ac, *it)) - { - printfd(__FILE__, "Error getting admin's confi: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - ac.login = *it; - if (toStore->SaveAdmin(ac)) - { - printfd(__FILE__, "Error saving admin's conf: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } - -printfd(__FILE__, "Importing tariffs:\n"); -entities.erase(entities.begin(), entities.end()); -ready.erase(ready.begin(), ready.end()); -if (fromStore->GetTariffsList(&entities)) - { - printfd(__FILE__, "Error getting tariffs list: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } -if (toStore->GetTariffsList(&ready)) - { - printfd(__FILE__, "Error getting tariffs list: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - -for (it = entities.begin(); it != entities.end(); ++it) - { - printfd(__FILE__, "\t - %s\n", it->c_str()); - if (find(ready.begin(), ready.end(), *it) == ready.end()) - if (toStore->AddTariff(*it)) - { - printfd(__FILE__, "Error adding tariff: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (fromStore->RestoreTariff(&td, *it)) - { - printfd(__FILE__, "Error getting tariff's data: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (toStore->SaveTariff(td, *it)) - { - printfd(__FILE__, "Error saving tariff's data: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } - -printfd(__FILE__, "Importing services:\n"); -entities.erase(entities.begin(), entities.end()); -ready.erase(ready.begin(), ready.end()); -if (fromStore->GetServicesList(&entities)) - { - printfd(__FILE__, "Error getting service list: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } -if (toStore->GetServicesList(&ready)) - { - printfd(__FILE__, "Error getting service list: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - -for (it = entities.begin(); it != entities.end(); ++it) - { - printfd(__FILE__, "\t - %s\n", it->c_str()); - if (find(ready.begin(), ready.end(), *it) == ready.end()) - if (toStore->AddService(*it)) - { - printfd(__FILE__, "Error adding service: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (fromStore->RestoreService(&sc, *it)) - { - printfd(__FILE__, "Error getting service's data: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (toStore->SaveService(sc)) - { - printfd(__FILE__, "Error saving service's data: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } - -printfd(__FILE__, "Importing corporations:\n"); -entities.erase(entities.begin(), entities.end()); -ready.erase(ready.begin(), ready.end()); -if (fromStore->GetCorpsList(&entities)) - { - printfd(__FILE__, "Error getting corporations list: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } -if (toStore->GetCorpsList(&ready)) - { - printfd(__FILE__, "Error getting corporations list: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - -for (it = entities.begin(); it != entities.end(); ++it) - { - printfd(__FILE__, "\t - %s\n", it->c_str()); - if (find(ready.begin(), ready.end(), *it) == ready.end()) - if (toStore->AddCorp(*it)) - { - printfd(__FILE__, "Error adding corporation: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (fromStore->RestoreCorp(&cc, *it)) - { - printfd(__FILE__, "Error getting corporation's data: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (toStore->SaveCorp(cc)) - { - printfd(__FILE__, "Error saving corporation's data: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } - -printfd(__FILE__, "Importing users:\n"); -entities.erase(entities.begin(), entities.end()); -ready.erase(ready.begin(), ready.end()); -if (fromStore->GetUsersList(&entities)) - { - printfd(__FILE__, "Error getting users list: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } -if (toStore->GetUsersList(&ready)) - { - printfd(__FILE__, "Error getting users list: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - -sort(ready.begin(), ready.end()); -for (it = entities.begin(); it != entities.end(); ++it) - { - printfd(__FILE__, "\t - %s\n", it->c_str()); - if (!binary_search(ready.begin(), ready.end(), *it)) { - if (toStore->AddUser(*it)) - { - printfd(__FILE__, "Error adding user: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } else { - printfd(__FILE__, "\t\t(adding passed)\n"); - } - if (fromStore->RestoreUserConf(&uc, *it)) - { - printfd(__FILE__, "Error getting user's conf: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (fromStore->RestoreUserStat(&us, *it)) - { - printfd(__FILE__, "Error getting user's stat: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (toStore->SaveUserConf(uc, *it)) - { - printfd(__FILE__, "Error saving user's conf: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - if (toStore->SaveUserStat(us, *it)) - { - printfd(__FILE__, "Error saving user's stat: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - hdrs.erase(hdrs.begin(), hdrs.end()); - if (fromStore->GetMessageHdrs(&hdrs, *it)) - { - printfd(__FILE__, "Error getting user's messages: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - std::vector::iterator mit; - for (mit = hdrs.begin(); mit != hdrs.end(); ++mit) - { - if (fromStore->GetMessage(mit->id, &msg, *it)) - { - printfd(__FILE__, "Error getting message for a user: %s\n", fromStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - printfd(__FILE__, "\t\t * %s\n", msg.text.c_str()); - if (toStore->AddMessage(&msg, *it)) - { - printfd(__FILE__, "Error adding message to a user: %s\n", toStore->GetStrError().c_str()); - dlclose(src_lh); - dlclose(dst_lh); - delete settings; - return -1; - } - } - } - -dlclose(src_lh); -dlclose(dst_lh); -printfd(__FILE__, "Done\n"); -delete settings; -return 0; -} diff --git a/projects/sgconv/settings_impl.cpp b/projects/sgconv/settings_impl.cpp deleted file mode 100644 index 645865cb..00000000 --- a/projects/sgconv/settings_impl.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 27.10.2002 - */ - -/* - * Author : Boris Mikhailenko - */ - -/* -$Revision: 1.6 $ -$Date: 2009/06/22 16:26:54 $ -*/ - -#include "stg/dotconfpp.h" -#include "stg/module_settings.h" -#include "stg/common.h" - -#include "settings_impl.h" - -int SETTINGS_IMPL::ParseModuleSettings(const DOTCONFDocumentNode * node, std::vector * params) -{ -if (!node) - return 0; - -PARAM_VALUE pv; - -pv.param = node->getName(); - -if (node->getValue(1)) - { - strError = "Unexpected value \'" + std::string(node->getValue(1)) + "\'."; - printfd(__FILE__, "SETTINGS_IMPL::ParseModuleSettings() - %s\n", strError.c_str()); - return -1; - } - -const char * value = node->getValue(0); - -if (!value) - { - strError = "Module name expected."; - printfd(__FILE__, "SETTINGS_IMPL::ParseModuleSettings() - %s\n", strError.c_str()); - return -1; - } - -const DOTCONFDocumentNode * childNode = node->getChildNode(); -while (childNode) - { - pv.param = childNode->getName(); - int i = 0; - while ((value = childNode->getValue(i)) != NULL) - { - pv.value.push_back(value); - ++i; - } - params->push_back(pv); - pv.value.clear(); - childNode = childNode->getNextNode(); - } - -return 0; -} -//----------------------------------------------------------------------------- -int SETTINGS_IMPL::ReadSettings() -{ -const char * requiredOptions[] = { - "ModulesPath", - "SourceStoreModule", - "DestStoreModule", - NULL - }; -int sourceStoreModulesCount = 0; -int destStoreModulesCount = 0; - -DOTCONFDocument conf(DOTCONFDocument::CASEINSENSITIVE); -conf.setRequiredOptionNames(requiredOptions); - -if(conf.setContent(confFile.c_str()) != 0) - { - strError = "Cannot read file " + confFile + "."; - printfd(__FILE__, "SETTINGS_IMPL::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - -const DOTCONFDocumentNode * node = conf.getFirstNode(); - -while (node) - { - if (strcasecmp(node->getName(), "ModulesPath") == 0) - { - modulesPath = node->getValue(0); - } - - if (strcasecmp(node->getName(), "SourceStoreModule") == 0) - { - if (node->getValue(1)) - { - strError = "Unexpected \'" + std::string(node->getValue(1)) + "\'."; - printfd(__FILE__, "SETTINGS_IMPL::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - - if (sourceStoreModulesCount) - { - strError = "Should be only one source StoreModule."; - printfd(__FILE__, "SETTINGS_IMPL::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - ++sourceStoreModulesCount; - - sourceStoreModuleSettings.moduleName = node->getValue(0); - ParseModuleSettings(node, &sourceStoreModuleSettings.moduleParams); - } - - if (strcasecmp(node->getName(), "DestStoreModule") == 0) - { - if (node->getValue(1)) - { - strError = "Unexpected \'" + std::string(node->getValue(1)) + "\'."; - printfd(__FILE__, "SETTINGS_IMPL::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - - if (destStoreModulesCount) - { - strError = "Should be only one dest StoreModule."; - printfd(__FILE__, "SETTINGS_IMPL::ReadSettings() - %s\n", strError.c_str()); - return -1; - } - ++destStoreModulesCount; - - destStoreModuleSettings.moduleName = node->getValue(0); - ParseModuleSettings(node, &destStoreModuleSettings.moduleParams); - } - - node = node->getNextNode(); - } - -return 0; -} -//----------------------------------------------------------------------------- diff --git a/projects/sgconv/settings_impl.h b/projects/sgconv/settings_impl.h deleted file mode 100644 index 0a0b5d1a..00000000 --- a/projects/sgconv/settings_impl.h +++ /dev/null @@ -1,65 +0,0 @@ - /* - $Revision: 1.6 $ - $Date: 2009/06/22 16:26:54 $ - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Date: 27.10.2002 - */ - -/* - * Author : Boris Mikhailenko - */ - -#ifndef SETTINGS_IMPL_H -#define SETTINGS_IMPL_H - -#include -#include - -struct MODULE_SETTINGS; -class DOTCONFDocumentNode; - -class SETTINGS_IMPL { -public: - SETTINGS_IMPL() : confFile("./sgconv.conf") {} - explicit SETTINGS_IMPL(const std::string & cf) : confFile(cf) {} - ~SETTINGS_IMPL() {} - int ReadSettings(); - - std::string GetStrError() const { return strError; } - - const std::string & GetConfDir() const; - - const std::string & GetModulesPath() const { return modulesPath; } - const MODULE_SETTINGS & GetSourceStoreModuleSettings() const { return sourceStoreModuleSettings; } - const MODULE_SETTINGS & GetDestStoreModuleSettings() const { return destStoreModuleSettings; } - -private: - int ParseModuleSettings(const DOTCONFDocumentNode * dirNameNode, std::vector * params); - - std::string strError; - std::string modulesPath; - std::string confFile; - - MODULE_SETTINGS sourceStoreModuleSettings; - MODULE_SETTINGS destStoreModuleSettings; -}; - -#endif diff --git a/projects/sgconv/sgconv.conf b/projects/sgconv/sgconv.conf deleted file mode 100644 index 25298b0b..00000000 --- a/projects/sgconv/sgconv.conf +++ /dev/null @@ -1,124 +0,0 @@ -################################################################################ -# Stargazer Convertor Configuration file # -################################################################################ - -# The path to directory with server modules -# Parameter: required -# Value: directory path -# Default: /usr/lib/stg -ModulesPath = /usr/lib/stg - -################################################################################# -Store module -# Configure the module that works with the database server -# Option - the name of the module without 'mod_' at the beginning and '.so' -# in the end ie full name of the module mod_store_files.so - - - # Working server directory, provides data on tariffs, users, administrators. - # Parameter: required - # Value: directory path - WorkDir = /var/stargazer - - # Owner, group and permissions of the files of user statistics (stat) - # Parameter: required - # Values: any, supported by OS - ConfOwner = root - ConfGroup = root - ConfMode = 600 - - # Owner, group and permissions on user configuration files (conf) - # Parameter: required - # Values: any, supported by OS - StatOwner = root - StatGroup = root - StatMode = 640 - - # Owner, group and permissions for user log files (log) - # Parameter: required - # Values: any, supported by OS - UserLogOwner = root - UserLogGroup = root - UserLogMode = 640 - - - -# - # Database server address - # Parameter: required - # Value: IP address or DNS name - # Default: localhost - # Server = localhost - - # Path to the database on the server or its alias - # Parameter: required - # Value: file path - # Default: /var/stg/stargazer.fdb - # Database = /var/stg/stargazer.fdb - - # Database username - # Parameter: required - # Value: any, supported by database - # Default: stg - # User = stg - - # Database password - # Parameter: required - # Value: any, supported by database - # Default: 123456 - # Password = 123456 -# - - - # Database server address - # Parameter: required - # Value: IP address or DNS name - # Default: localhost - Server = localhost - - # Database name - # Parameter: required - # Value: any, supported by database - # Default: stargazer - Database = stargazer - - # Database username - # Parameter: required - # Value: any, supported by database - # Default: stg - User = stg - - # Database password - # Parameter: required - # Value: any, supported by database - # Default: 123456 - Password = 123456 - - - -# - # Database server address - # Parameter: required - # Value: IP address or DNS name - # Default: localhost - # Server = localhost - - # Database name - # Parameter: required - # Value: any, supported by database - # Default: stg - # Database = stg - - # Database username - # Parameter: required - # Value: any, supported by database - # Default: stg - # User = stg - - # Database password - # Parameter: required - # Value: any, supported by database - # Default: 123456 - # Password = 123456 - -# diff --git a/projects/stargazer/CHANGES b/projects/stargazer/CHANGES deleted file mode 100644 index e69de29b..00000000 diff --git a/projects/stargazer/modules/.placeholder b/projects/stargazer/modules/.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/projects/stargazer/plugins/authorization/stress/Makefile b/projects/stargazer/plugins/authorization/stress/Makefile deleted file mode 100644 index 31283244..00000000 --- a/projects/stargazer/plugins/authorization/stress/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.4 2008/12/04 17:01:28 faust Exp $ -############################################################################### - -include ../../../../../Makefile.conf - -PROG = mod_auth_stress.so - -SRCS = ./stress.cpp - -LIBS += $(LIB_THREAD) - -STGLIBS = common \ - logger \ - scriptexecuter - -include ../../Makefile.in - diff --git a/projects/stargazer/plugins/authorization/stress/stress.cpp b/projects/stargazer/plugins/authorization/stress/stress.cpp deleted file mode 100644 index 6473b57e..00000000 --- a/projects/stargazer/plugins/authorization/stress/stress.cpp +++ /dev/null @@ -1,390 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Boris Mikhailenko - */ - -/* - $Revision: 1.5 $ - $Date: 2009/06/19 12:50:32 $ - $Author: faust $ - */ - -#include -#include - -#include -#include - -#include "stg/user.h" -#include "stg/common.h" -#include "stg/user_property.h" -#include "stg/plugin_creator.h" - -#include "stress.h" - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -PLUGIN_CREATOR stressc; -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// ëÌÁÓÓ ÄÌÑ ÐÏÉÓËÁ ÀÚÅÒÁ × ÓÐÉÓËÅ ÎÏÔÉÆÉËÁÔÏÒÏ× -template -class IS_CONTAINS_USER: public binary_function -{ -public: - bool operator()(varType notifier, USER_PTR user) const - { - return notifier.GetUser() == user; - }; -}; -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -PLUGIN * GetPlugin() -{ -//printf("BASE_CAPTURER * GetCapturer()\n"); -return stressc.GetPlugin(); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -AUTH_STRESS_SETTINGS::AUTH_STRESS_SETTINGS() - : averageOnlineTime(0) -{ -} -//----------------------------------------------------------------------------- -int AUTH_STRESS_SETTINGS::ParseSettings(const MODULE_SETTINGS & s) -{ -PARAM_VALUE pv; -vector::const_iterator pvi; - -pv.param = "AverageOnlineTime"; -pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv); -if (pvi == s.moduleParams.end()) - { - errorStr = "Parameter \'" + pv.param + "\' not found."; - return -1; - } - -if (ParseIntInRange(pvi->value[0], 5, 10*3600, &averageOnlineTime)) - { - errorStr = "Cannot parse parameter \'" + pv.param + "\': " + errorStr; - return -1; - } - -return 0; -} -//----------------------------------------------------------------------------- -int AUTH_STRESS_SETTINGS::GetAverageOnlineTime() const -{ -return averageOnlineTime; -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -const string AUTH_STRESS::GetVersion() const -{ -return "Stress authorizator v.0.1"; -} -//----------------------------------------------------------------------------- -AUTH_STRESS::AUTH_STRESS() -{ -pthread_mutex_init(&mutex, NULL); -isRunning = false; -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::SetUsers(USERS * u) -{ -users = u; -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::SetSettings(const MODULE_SETTINGS & s) -{ -settings = s; -} -//----------------------------------------------------------------------------- -int AUTH_STRESS::ParseSettings() -{ -int ret = stressSettings.ParseSettings(settings); -if (ret) - errorStr = stressSettings.GetStrError(); -return ret; -} -//----------------------------------------------------------------------------- -const string & AUTH_STRESS::GetStrError() const -{ -return errorStr; -} -//----------------------------------------------------------------------------- -int AUTH_STRESS::Start() -{ -GetUsers(); -nonstop = true; - -list::iterator users_iter; - -onAddUserNotifier.SetAuthorizator(this); -onDelUserNotifier.SetAuthorizator(this); -users->AddNotifierUserAdd(&onAddUserNotifier); -users->AddNotifierUserDel(&onDelUserNotifier); - -if (!isRunning) - { - if (pthread_create(&thread, NULL, Run, this)) - { - errorStr = "Cannot create thread."; - return -1; - } - } - -users_iter = usersList.begin(); -while (users_iter != usersList.end()) - { - Authorize(*users_iter); - ++users_iter; - } - -//isRunning = true; -return 0; -} -//----------------------------------------------------------------------------- -int AUTH_STRESS::Stop() -{ -nonstop = false; -if (isRunning) - { - //5 seconds to thread stops itself - int i; - for (i = 0; i < 25; i++) - { - if (!isRunning) - break; - struct timespec ts = {0, 200000000}; - nanosleep(&ts, NULL); - } - - //after 5 seconds waiting thread still running. now killing it - if (isRunning) - { - if (pthread_kill(thread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - printfd(__FILE__, "AUTH_STRESS killed Run\n"); - } - } - -users->DelNotifierUserAdd(&onAddUserNotifier); -users->DelNotifierUserDel(&onDelUserNotifier); - -return 0; -} -//----------------------------------------------------------------------------- -bool AUTH_STRESS::IsRunning() -{ -return isRunning; -} -//----------------------------------------------------------------------------- -uint16_t AUTH_STRESS::GetStartPosition() const -{ -return 30; -} -//----------------------------------------------------------------------------- -uint16_t AUTH_STRESS::GetStopPosition() const -{ -return 30; -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::SetUserNotifiers(USER_PTR u) -{ -// ---------- IP ------------------- -CHG_BEFORE_NOTIFIER BeforeChgIPNotifier; -CHG_AFTER_NOTIFIER AfterChgIPNotifier; - -BeforeChgIPNotifier.SetAuthorizator(this); -BeforeChgIPNotifier.SetUser(u); -BeforeChgIPNotifierList.push_front(BeforeChgIPNotifier); - -AfterChgIPNotifier.SetAuthorizator(this); -AfterChgIPNotifier.SetUser(u); -AfterChgIPNotifierList.push_front(AfterChgIPNotifier); - -u->GetProperty().ips.AddBeforeNotifier(&(*BeforeChgIPNotifierList.begin())); -u->GetProperty().ips.AddAfterNotifier(&(*AfterChgIPNotifierList.begin())); -// ---------- IP end --------------- -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::UnSetUserNotifiers(USER_PTR u) -{ -// --- IP --- -IS_CONTAINS_USER > IsContainsUserIPB; -IS_CONTAINS_USER > IsContainsUserIPA; - -list >::iterator ipBIter; -list >::iterator ipAIter; - -ipBIter = find_if(BeforeChgIPNotifierList.begin(), - BeforeChgIPNotifierList.end(), - bind2nd(IsContainsUserIPB, u)); - -if (ipBIter != BeforeChgIPNotifierList.end()) - { - ipBIter->GetUser()->GetProperty().ips.DelBeforeNotifier(&(*ipBIter)); - BeforeChgIPNotifierList.erase(ipBIter); - } - -ipAIter = find_if(AfterChgIPNotifierList.begin(), - AfterChgIPNotifierList.end(), - bind2nd(IsContainsUserIPA, u)); - -if (ipAIter != AfterChgIPNotifierList.end()) - { - ipAIter->GetUser()->GetProperty().ips.DelAfterNotifier(&(*ipAIter)); - AfterChgIPNotifierList.erase(ipAIter); - } -// --- IP end --- -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::GetUsers() -{ -USER_PTR u; -printfd(__FILE__, "users->OpenSearch() usernum=%d\n", users->GetUserNum()); -int h = users->OpenSearch(); -if (!h) - { - printfd(__FILE__, "users->OpenSearch() error\n"); - return; - } - -while (1) - { - if (users->SearchNext(h, &u)) - { - break; - } - usersList.push_back(u); - SetUserNotifiers(u); - } - -users->CloseSearch(h); -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::Unauthorize(USER_PTR u) const -{ -if (!u->IsAuthorizedBy(this)) - return; - -printfd(__FILE__, "Unauthorized user %s\n", u->GetLogin().c_str()); -u->Unauthorize(this); -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::Authorize(USER_PTR u) const -{ -USER_IPS ips = u->GetProperty().ips; -if (ips.OnlyOneIP() && !u->IsAuthorizedBy(this)) - { - if (u->Authorize(ips[0].ip, 0xFFffFFff, this) == 0) - { - printfd(__FILE__, "Authorized user %s\n", u->GetLogin().c_str()); - } - } -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::AddUser(USER_PTR u) -{ -//printfd(__FILE__, "User added to list %s\n", u->GetLogin().c_str()); -SetUserNotifiers(u); -usersList.push_back(u); -} -//----------------------------------------------------------------------------- -void AUTH_STRESS::DelUser(USER_PTR u) -{ -Unauthorize(u); -UnSetUserNotifiers(u); - -list::iterator users_iter; -users_iter = usersList.begin(); - -while (users_iter != usersList.end()) - { - if (u == *users_iter) - { - usersList.erase(users_iter); - printfd(__FILE__, "User removed from list %s\n", u->GetLogin().c_str()); - break; - } - ++users_iter; - } -} -//----------------------------------------------------------------------------- -int AUTH_STRESS::SendMessage(const STG_MSG &, uint32_t) const -{ -errorStr = "Authorization modele \'AUTH_STRESS\' does not support sending messages"; -return -1; -} -//----------------------------------------------------------------------------- -void * AUTH_STRESS::Run(void * d) -{ -AUTH_STRESS * ia = static_cast(d); - -ia->isRunning = true; - -while (ia->nonstop) - { - printfd(__FILE__, "AUTH_STRESS::Run - averageTime: %d\n", random() % (2*ia->stressSettings.GetAverageOnlineTime())); - - list::iterator users_iter; - users_iter = ia->usersList.begin(); - while (users_iter != ia->usersList.end()) - { - if (random() % (2*ia->stressSettings.GetAverageOnlineTime()) == 1) - { - ia->Authorize(*users_iter); - printfd(__FILE__, "AUTH_STRESS::Authorize - user: '%s'\n", (*users_iter)->GetLogin().c_str()); - } - if (random() % (2*ia->stressSettings.GetAverageOnlineTime()) == 2) - { - ia->Unauthorize(*users_iter); - printfd(__FILE__, "AUTH_STRESS::Unauthorize - user: '%s'\n", (*users_iter)->GetLogin().c_str()); - } - - ++users_iter; - } - - sleep(1); - } - -ia->isRunning = false; -return NULL; -} -//----------------------------------------------------------------------------- -template -void CHG_BEFORE_NOTIFIER::Notify(const varParamType &, const varParamType &) -{ -auth->Unauthorize(user); -} -//----------------------------------------------------------------------------- -template -void CHG_AFTER_NOTIFIER::Notify(const varParamType &, const varParamType &) -{ -auth->Authorize(user); -} -//----------------------------------------------------------------------------- diff --git a/projects/stargazer/plugins/authorization/stress/stress.h b/projects/stargazer/plugins/authorization/stress/stress.h deleted file mode 100644 index 6ead8f33..00000000 --- a/projects/stargazer/plugins/authorization/stress/stress.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Author : Boris Mikhailenko - */ - -/* - $Revision: 1.3 $ - $Date: 2009/06/19 12:50:32 $ - $Author: faust $ - */ - - -#ifndef STRESS_H -#define STRESS_H - -#include - -#include -#include - -#include "stg/auth.h" -#include "stg/notifer.h" -#include "stg/user_ips.h" -#include "stg/users.h" -#include "stg/module_settings.h" - -extern "C" PLUGIN * GetPlugin(); - -class AUTH_STRESS; -//----------------------------------------------------------------------------- -template -class CHG_BEFORE_NOTIFIER: public PROPERTY_NOTIFIER_BASE { -public: - CHG_BEFORE_NOTIFIER() : auth(NULL) {} - void Notify(const varParamType & oldValue, const varParamType & newValue); - void SetUser(USER_PTR u) { user = u; } - USER_PTR GetUser() {return user; } - void SetAuthorizator(const AUTH_STRESS * a) { auth = a; } - -private: - USER_PTR user; - const AUTH_STRESS * auth; -}; -//----------------------------------------------------------------------------- -template -class CHG_AFTER_NOTIFIER: public PROPERTY_NOTIFIER_BASE { -public: - CHG_AFTER_NOTIFIER() : auth(NULL) {} - void Notify(const varParamType & oldValue, const varParamType & newValue); - void SetUser(USER_PTR u) { user = u; } - USER_PTR GetUser() {return user; } - void SetAuthorizator(const AUTH_STRESS * a) { auth = a; } - -private: - USER_PTR user; - const AUTH_STRESS * auth; -}; -//----------------------------------------------------------------------------- -class AUTH_STRESS_SETTINGS { -public: - AUTH_STRESS_SETTINGS(); - const std::string & GetStrError() const { return errorStr; } - int ParseSettings(const MODULE_SETTINGS & s); - int GetAverageOnlineTime() const; -private: - int averageOnlineTime; - std::string errorStr; -}; -//----------------------------------------------------------------------------- -class AUTH_STRESS :public AUTH { -friend class CHG_BEFORE_NOTIFIER; -friend class CHG_AFTER_NOTIFIER; -public: - AUTH_STRESS(); - virtual ~AUTH_STRESS() {} - - void SetUsers(USERS * u); - - int Start(); - int Stop(); - int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; } - bool IsRunning(); - void SetSettings(const MODULE_SETTINGS & s); - int ParseSettings(); - const std::string & GetStrError() const; - const std::string GetVersion() const; - uint16_t GetStartPosition() const; - uint16_t GetStopPosition() const; - - int SendMessage(const STG_MSG & msg, uint32_t ip) const; - -private: - void GetUsers(); - void SetUserNotifiers(USER_PTR u); - void UnSetUserNotifiers(USER_PTR u); - - void AddUser(USER_PTR u); - void DelUser(USER_PTR u); - - void Authorize(USER_PTR u) const; - void Unauthorize(USER_PTR u) const; - - static void * Run(void *); - - bool nonstop; - - mutable std::string errorStr; - AUTH_STRESS_SETTINGS stressSettings; - USERS * users; - std::list usersList; - bool isRunning; - MODULE_SETTINGS settings; - - pthread_t thread; - pthread_mutex_t mutex; - - std::list > BeforeChgIPNotifierList; - std::list > AfterChgIPNotifierList; - - class ADD_USER_NONIFIER: public NOTIFIER_BASE { - public: - ADD_USER_NONIFIER() : auth(NULL) {} - virtual ~ADD_USER_NONIFIER() {} - - void SetAuthorizator(AUTH_STRESS * a) { auth = a; } - void Notify(const USER_PTR & user) - { - auth->AddUser(user); - } - - private: - AUTH_STRESS * auth; - } onAddUserNotifier; - - class DEL_USER_NONIFIER: public NOTIFIER_BASE { - public: - DEL_USER_NONIFIER() : auth(NULL) {} - virtual ~DEL_USER_NONIFIER() {} - - void SetAuthorizator(AUTH_STRESS * a) { auth = a; } - void Notify(const USER_PTR & user) - { - auth->DelUser(user); - } - - private: - AUTH_STRESS * auth; - } onDelUserNotifier; - -}; -//----------------------------------------------------------------------------- - -#endif diff --git a/projects/stargazer/plugins/capture/cap_debug/Makefile b/projects/stargazer/plugins/capture/cap_debug/Makefile deleted file mode 100644 index e96d69bc..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.10 2008/12/04 17:03:25 faust Exp $ -############################################################################### - -include ../../../../../Makefile.conf - -PROG = mod_cap_debug.so - -SRCS = ./debug_cap.cpp \ - ./checksum.c \ - ./ip.c \ - ./packet.c \ - ./tcp.c - -STGLIBS = common - -LIBS += $(LIB_THREAD) - -include ../../Makefile.in - diff --git a/projects/stargazer/plugins/capture/cap_debug/checksum.c b/projects/stargazer/plugins/capture/cap_debug/checksum.c deleted file mode 100644 index 28cef341..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/checksum.c +++ /dev/null @@ -1,47 +0,0 @@ -/*$Id: checksum.c,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -unsigned short -in_cksum(unsigned short *addr, int len) -{ - int nleft = len; - int sum = 0; - unsigned short *w = addr; - unsigned short answer = 0; - - /* - * Our algorithm is simple, using a 32 bit accumulator (sum), we add - * sequential 16 bit words to it, and at the end, fold back all the - * carry bits from the top 16 bits into the lower 16 bits. - */ - while (nleft > 1) { - sum += *w++; - nleft -= 2; - } - - /* mop up an odd byte, if necessary */ - if (nleft == 1) { - *(unsigned char *)(&answer) = *(unsigned char *)w ; - sum += answer; - } - - /* add back carry outs from top 16 bits to low 16 bits */ - sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ - sum += (sum >> 16); /* add carry */ - answer = ~sum; /* truncate to 16 bits */ - return(answer); -} diff --git a/projects/stargazer/plugins/capture/cap_debug/checksum.h b/projects/stargazer/plugins/capture/cap_debug/checksum.h deleted file mode 100644 index 2698a526..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/checksum.h +++ /dev/null @@ -1,20 +0,0 @@ -/* $Id: checksum.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -unsigned short in_cksum(unsigned short *addr, int len); diff --git a/projects/stargazer/plugins/capture/cap_debug/constants.h b/projects/stargazer/plugins/capture/cap_debug/constants.h deleted file mode 100644 index e845a44c..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/constants.h +++ /dev/null @@ -1,106 +0,0 @@ -/* $Id: constants.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* -* socket types -*/ -#define PKT_RAW SOCK_RAW -#define PKT_STREAM SOCK_STREAM -#define PKT_DGRAM SOCK_DGRAM - -/* -* Link Layer -*/ -#define PKT_LINK_ARP 0x01 -#define PKT_LINK_RARP 0x02 - -/* -* Network Layer -*/ -#define PKT_NET_IP 0x01 -#define PKT_NET_ICMP 0x02 -#define PKT_NET_IGMP 0x04 - -/* -* Transport layer -*/ -#define PKT_TRANS_TCP 0x01 -#define PKT_TRANS_UDP 0x02 - -/* --- [ IP ] ------------------------ */ -/* IP options */ -#define PKT_IP_OPT_EOL 0 /* end of option list */ -#define PKT_IP_OPT_END PKT_IP_OPT_EOL -#define PKT_IP_OPT_NOP 1 /* no operation */ -#define PKT_IP_OPT_NOOP PKT_IP_OPT_NOP - -#define PKT_IP_OPT_RR 7 /* record packet route */ -#define PKT_IP_OPT_TS 68 /* timestamp */ -#define PKT_IP_OPT_TIMESTAMP PKT_IP_OPT_TS -#define PKT_IP_OPT_SECURITY 130 /* provide s,c,h,tcc */ -#define PKT_IP_OPT_SEC PKT_IP_OPT_SECURITY -#define PKT_IP_OPT_LSRR 131 /* loose source route */ -#define PKT_IP_OPT_SATID 136 /* satnet id */ -#define PKT_IP_OPT_SID PKT_IP_OPT_SATID -#define PKT_IP_OPT_SSRR 137 /* strict source route */ -#define PKT_IP_OPT_RA 148 /* router alert */ - -/* flag bits for ipt_flg */ -#define PKT_IP_OPT_TS_TSONLY 0 /* timestamps only */ -#define PKT_IP_OPT_TS_TSANDADDR 1 /* timestamps and addresses */ -#define PKT_IP_OPT_TS_PRESPEC 3 /* specified modules only */ - -/* --- [ TCP ] ------------------------ */ -/* tcp flags */ -#ifndef __FAVOUR_BSD -#define TH_FIN 0x01 -#define TH_SYN 0x02 -#define TH_RST 0x04 -#define TH_PUSH 0x08 -#define TH_ACK 0x10 -#define TH_URG 0x20 -#endif -/* additional flags */ -#define TH_XMAS 0x40 -#define TH_YMAS 0x80 - -/* tcp options */ -#define PKT_TCP_OPT_END 0x00 -#define PKT_TCP_OPT_NOP 0x01 -#define PKT_TCP_OPT_MSS 0x02 -#define PKT_TCP_OPT_WSF 0x03 /*window scale factor*/ -#define PKT_TCP_OPT_SACK_PERM 0x04 -#define PKT_TCP_OPT_SACK 0x05 -#define PKT_TCP_OPT_TIME 0x08 /* timestamp option */ - -/* tcp option lenghts */ -#define PKT_TCP_OPT_END_LEN 0x01 -#define PKT_TCP_OPT_NOP_LEN 0x01 -#define PKT_TCP_OPT_MSS_LEN 0x04 -#define PKT_TCP_OPT_WSF_LEN 0x03 /*window scale factor*/ -#define PKT_TCP_OPT_SACK_PERM_LEN 0x02 -#define PKT_TCP_OPT_SACK_LEN 0x01 -#define PKT_TCP_OPT_TIME_LEN 0x0a /* timestamp option */ - -/* return values and errors */ -#define PKTOK 0 -#define EPKTRANGE -64 -#define EERRNO -63 /* errno has been set */ -#define EPKTINVALPTR -62 -#define EPKTUNKNOWNTYPE -61 diff --git a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp b/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp deleted file mode 100644 index 0ba91bbb..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp +++ /dev/null @@ -1,504 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* -Date: 18.09.2002 -*/ - -/* -* Author : Boris Mikhailenko -*/ - -/* -$Revision: 1.21 $ -$Date: 2009/03/19 20:03:35 $ -$Author: faust $ -*/ - -#include "debug_cap.h" - -#include "libpal.h" - -#include "stg/plugin_creator.h" -#include "stg/traffcounter.h" -#include "stg/common.h" - -#include -#include - -#include -#include -#include -#include -#include - -extern volatile time_t stgTime; - -//----------------------------------------------------------------------------- -void WriteStat(uint32_t u, uint32_t d) -{ -FILE * f; -f = fopen("/tmp/cap.stat", "at"); -fprintf(f, "up %5.2f Mbit, down %5.2f Mbit, sum %5.2f Mbit\n", - u / (1000000*8.0), - d / (1000000*8.0), - (u + d) / (1000000*8.0)); -fclose(f); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -namespace -{ -PLUGIN_CREATOR cdc; -} - -extern "C" PLUGIN * GetPlugin(); -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -PLUGIN * GetPlugin() -{ -return cdc.GetPlugin(); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -RAW_PACKET MakeTCPPacket(const char * src, - const char * dst, - uint16_t sport, - uint16_t dport, - uint16_t len); -std::string DEBUG_CAP::GetVersion() const -{ -return "cap_debug v.0.01a"; -} -//----------------------------------------------------------------------------- -DEBUG_CAP::DEBUG_CAP() - : nonstop(false), - isRunning(false), - traffCnt(NULL) -{ -} -//----------------------------------------------------------------------------- -void DEBUG_CAP::SetTraffcounter(TRAFFCOUNTER * tc) -{ -traffCnt = tc; -} -//----------------------------------------------------------------------------- -const std::string & DEBUG_CAP::GetStrError() const -{ -return errorStr; -} -//----------------------------------------------------------------------------- -int DEBUG_CAP::Start() -{ -if (isRunning) - return 0; - -printfd(__FILE__, "DEBUG_CAP::Start()\n"); - -nonstop = true; - -if (pthread_create(&thread, NULL, Run1, this) == 0) - { - return 0; - } - -errorStr = "Cannot create thread."; -return -1; -} -//----------------------------------------------------------------------------- -int DEBUG_CAP::Stop() -{ -if (!isRunning) - return 0; - -nonstop = false; - -//5 seconds to thread stops itself -int i; -for (i = 0; i < 25; i++) - { - if (!isRunning) - break; - - usleep(200000); - //printf("."); - } - -/*if (i) - printf("\n");*/ - -//after 5 seconds waiting thread still running. now killing it -if (isRunning) - { - //TODO pthread_cancel() - if (pthread_kill(thread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - } - -return 0; -} -//----------------------------------------------------------------------------- -bool DEBUG_CAP::IsRunning() -{ -return nonstop; -} -//----------------------------------------------------------------------------- -void * DEBUG_CAP::Run1(void * data) -{ -printfd(__FILE__, "=====================| pid: %d |===================== \n", getpid()); - -DEBUG_CAP * dc = static_cast(data); -dc->isRunning = true; - -RAW_PACKET rp; -rp = MakeTCPPacket("192.168.1.1", "192.168.1.21", 255, 255, 200); -int a = 0; -sleep(3); - -struct tm * tm; -time_t t; -uint32_t u = 0; -uint32_t d = 0; - -//2 upload : 3 download - -int usize; -int dsize; - -t = stgTime; -tm = localtime(&t); -int min = tm->tm_min; - -char cliIP[20]; -char srvIP[20]; - -while (dc->nonstop) - { - for (int i = 8; i <= 252; i++) - { - usize = random()%100 + 100; - dsize = random()%500 + 900; - - for (int j = 2; j < 11; j++) - { - sprintf(cliIP, "192.168.%d.%d", j, i); - sprintf(srvIP, "10.1.%d.%d", random()%8, 1); - - rp = MakeTCPPacket(srvIP, cliIP, 80, random()%2 + 2000, dsize); - d += dsize; - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(cliIP, srvIP, random()%2 + 2000, 80, usize); - u += usize; - dc->traffCnt->Process(rp); - } - } - - usleep(100000); - t = stgTime; - - if (min != localtime(&t)->tm_min) - { - min = localtime(&t)->tm_min; - WriteStat(u, d); - u = d = 0; - } - - a++; - - } - -dc->isRunning = false; -return NULL; -} -//----------------------------------------------------------------------------- -void * DEBUG_CAP::Run2(void * data) -{ -printfd(__FILE__, "=====================| pid: %d |===================== \n", getpid()); - -DEBUG_CAP * dc = static_cast(data); -dc->isRunning = true; - -RAW_PACKET rp; -rp = MakeTCPPacket("192.168.1.1", "192.168.1.21", 255, 255, 200); -int a = 0; -sleep(3); - -struct tm * tm; -time_t t; -uint32_t u = 0; -uint32_t d = 0; - -//2 upload : 3 download - -int usize = 200; -int dsize = 1500; - -t = stgTime; -tm = localtime(&t); -int min = tm->tm_min; - -char cliIP[20]; -char srvIP[20]; - -while (dc->nonstop) - { - for (int i = 101; i <= 150; i++) - { - sprintf(cliIP, "192.168.1.%d", i); - for (int dp = 0; dp < 1; dp++) - { - //sprintf(srvIP, "10.1.%d.%d", i, 10 + dp); - sprintf(srvIP, "10.1.%d.%d", i, 10 + dp); - - rp = MakeTCPPacket(srvIP, cliIP, 80, 10000 + i + dp, dsize); - d += dsize; - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(srvIP, cliIP, 80, 10000 + i + dp, dsize); - d += dsize; - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(srvIP, cliIP, 80, 10000 + i + dp, dsize); - dc->traffCnt->Process(rp); - d += dsize; - - - rp = MakeTCPPacket(cliIP, srvIP, 10000 + i + dp, 80, usize); - u += usize; - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(cliIP, srvIP, 10000 + i + dp, 80, usize); - u += usize; - dc->traffCnt->Process(rp); - } - } - - //usleep(20000); - t = stgTime; - - if (min != localtime(&t)->tm_min) - { - min = localtime(&t)->tm_min; - WriteStat(u, d); - u = d = 0; - } - - a++; - - } - -dc->isRunning = false; -return NULL; -} -//----------------------------------------------------------------------------- -void * DEBUG_CAP::Run3(void * data) -{ -printfd(__FILE__, "=====================| pid: %d |===================== \n", getpid()); - -DEBUG_CAP * dc = static_cast(data); -dc->isRunning = true; - -RAW_PACKET rp; -rp = MakeTCPPacket("192.168.1.1", "192.168.1.21", 255, 255, 200); -int a = 0; -sleep(3); - -time_t t; -uint32_t u = 0; -uint32_t d = 0; - -//2 upload : 3 download - -int usize = 200; -int dsize = 1500; - -t = stgTime; - -char cliIP[20]; -char srvIP1[20]; -char srvIP2[20]; -char srvIP3[20]; - -int firstTime = true; - -while (dc->nonstop) - { - if (firstTime) - { - sprintf(srvIP1, "10.1.%d.%d", random() % 14 + 153, random() % 11 + 35); - - sprintf(srvIP2, "%d.%d.%d.%d", - random() % 20 + 81, - random() % 28 + 153, - random() % 28 + 37, - random() % 28 + 13); - - sprintf(srvIP3, "%d.%d.%d.%d", - random() % 20 + 81, - random() % 28 + 153, - random() % 28 + 37, - random() % 28 + 13); - - printfd(__FILE__, "firstTime=false\n"); - firstTime = false; - } - - int rnd = random() % 400; - if (rnd < 5) - { - sprintf(srvIP1, "10.1.%d.%d", random() % 14 + 153, random() % 11 + 35); - printfd(__FILE__, "srvIP1=%s\n", srvIP1); - } - if (rnd == 9) - { - sprintf(srvIP2, "%d.%d.%d.%d", - random() % 20 + 81, - random() % 28 + 153, - random() % 28 + 37, - random() % 28 + 13); - printfd(__FILE__, "srvIP2=%s\n", srvIP2); - } - if (rnd == 5) - { - sprintf(srvIP2, "%d.%d.%d.%d", - random() % 20 + 81, - random() % 28 + 153, - random() % 28 + 37, - random() % 28 + 13); - printfd(__FILE__, "srvIP3=%s\n", srvIP3); - } - - for (int i = 2; i < 52; i++) - { - sprintf(cliIP, "192.168.1.%d", i); - for (int dp = 0; dp < 1; dp++) - { - usize = 50 + random() % 100; - dsize = 1000 + random() % 400; - - rp = MakeTCPPacket(srvIP1, cliIP, 80, 10000 + i + dp, dsize); - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(srvIP2, cliIP, 80, 10000 + i + dp, dsize); - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(srvIP3, cliIP, 80, 10000 + i + dp, dsize); - dc->traffCnt->Process(rp); - - - rp = MakeTCPPacket(cliIP, srvIP1, 10000 + i + dp, 80, usize); - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(cliIP, srvIP2, 10000 + i + dp, 80, usize); - dc->traffCnt->Process(rp); - - rp = MakeTCPPacket(cliIP, srvIP3, 10000 + i + dp, 80, usize); - dc->traffCnt->Process(rp); - } - } - - usleep(300000); - /*t = stgTime; - - if (min != localtime(&t)->tm_min) - { - min = localtime(&t)->tm_min; - WriteStat(u, d); - u = d = 0; - }*/ - - a++; - - } - -dc->isRunning = false; -return NULL; -} -//----------------------------------------------------------------------------- -uint16_t DEBUG_CAP::GetStartPosition() const -{ -return 40; -} -//----------------------------------------------------------------------------- -uint16_t DEBUG_CAP::GetStopPosition() const -{ -return 40; -} -//----------------------------------------------------------------------------- -RAW_PACKET MakeTCPPacket(const char * src, - const char * dst, - uint16_t sport, - uint16_t dport, - uint16_t len) -{ -struct packet pkt; -if (pkt_init(&pkt, 0, 100)) - { - printfd(__FILE__, "pkt_init error!\n"); - } - -in_addr_t sip = inet_addr(src); -in_addr_t dip = inet_addr(dst); - -pkt_ip_header(&pkt, - 5, //header len - 4, - 0, - len, //total len - 0, - 0, - 64, //ttl - 6, //TCP - 0, - *(uint32_t*)&sip, - *(uint32_t*)&dip); - -pkt_move_actptr(&pkt, 20); - -pkt_tcp_header(&pkt, - sport, - dport, - 1, // seq, - 1, // ackseq, - 5, // headerlen, - 0, // reserved, - 0, // flags, - 0, // window, - 0, // checksum, - 0); // urgent - -RAW_PACKET rp; -memcpy(&rp, pkt.pkt, sizeof(rp)); - -if (pkt_free(&pkt)) - { - printfd(__FILE__, "pkt_free error!\n"); - } -rp.dataLen = -1; -return rp; -} -//----------------------------------------------------------------------------- - - diff --git a/projects/stargazer/plugins/capture/cap_debug/debug_cap.h b/projects/stargazer/plugins/capture/cap_debug/debug_cap.h deleted file mode 100644 index 8b1ccb92..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/debug_cap.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* -Date: 18.09.2002 -*/ - -/* -* Author : Boris Mikhailenko -*/ - -/* -$Revision: 1.12 $ -$Date: 2009/06/23 11:32:27 $ -$Author: faust $ -*/ - -#include - -#include - -#include "stg/os_int.h" -#include "stg/plugin.h" -#include "stg/module_settings.h" - -//----------------------------------------------------------------------------- -struct iphdr_eth { - uint8_t ihl:4, - version:4; - uint8_t tos; - uint16_t tot_len; - uint16_t id; - uint16_t frag_off; - uint8_t ttl; - uint8_t protocol; - uint16_t check; - uint32_t saddr; - uint32_t daddr; - int32_t len; - char iface[10]; -}; -//----------------------------------------------------------------------------- -class CAP_SETTINGS { -public: - const std::string & GetStrError() const { static std::string s; return s; } - int ParseSettings(const MODULE_SETTINGS & s) { return 0; } -}; -//----------------------------------------------------------------------------- -class DEBUG_CAP :public PLUGIN -{ -public: - DEBUG_CAP(); - virtual ~DEBUG_CAP() {} - - void SetTraffcounter(TRAFFCOUNTER * tc); - - int Start(); - int Stop(); - int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; } - int ParseSettings() { return 0; } - bool IsRunning(); - const std::string & GetStrError() const; - std::string GetVersion() const; - uint16_t GetStartPosition() const; - uint16_t GetStopPosition() const; -private: - static void * Run1(void *); - static void * Run2(void *); - static void * Run3(void *); - mutable std::string errorStr; - CAP_SETTINGS capSettings; - pthread_t thread; - bool nonstop; - bool isRunning; - - TRAFFCOUNTER * traffCnt; -}; -//----------------------------------------------------------------------------- diff --git a/projects/stargazer/plugins/capture/cap_debug/ip.c b/projects/stargazer/plugins/capture/cap_debug/ip.c deleted file mode 100644 index a2627177..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/ip.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id: ip.c,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "libpal.h" - -int -pkt_ip_header(struct packet *pkt, - unsigned int iphdr_len, - unsigned int version, - unsigned char tos, - unsigned short int total_len, - unsigned short int id, - unsigned short int frag_off, - unsigned char ttl, - unsigned char protocol, - unsigned short int cksum, - unsigned int saddr, - unsigned int daddr) -{ - struct ip *ip; - - if (!pkt) - return EPKTINVALPTR; - - ip = (struct ip *) pkt->pkt_ptr; - - ip->ip_hl = iphdr_len; - ip->ip_v = version; - ip->ip_tos = tos; - ip->ip_len = htons(total_len); - ip->ip_id = htons(id); - ip->ip_off = htons(frag_off); - ip->ip_ttl = ttl; - ip->ip_p = protocol; - ip->ip_src.s_addr = saddr; - ip->ip_dst.s_addr = daddr; - - return 0; -} diff --git a/projects/stargazer/plugins/capture/cap_debug/libpal.h b/projects/stargazer/plugins/capture/cap_debug/libpal.h deleted file mode 100644 index fa28d8e8..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/libpal.h +++ /dev/null @@ -1,99 +0,0 @@ -/* $Id: libpal.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _LIBPAL_H_ -#define _LIBPAL_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "checksum.h" -#include "constants.h" - -/* -* generic packet structure -* -* we maintain a so called "active ptr" inside the packet. Most operations -* on the packet will take place at the position the pointer points at. -* The pointer should never be moved directly, instead the functions -* pkt_set_actpr() and pkt_move_actptr() are provided. -* Using this approach we can perform bounds checking and make sure our -* library functions won't segfault. -* pkt_type is not really being used at the moment. I don't know if it -* ever will be. It might just be left out one day, so keep your fingers -* off. Use pkt_init() to set it. And dont even think of messing with the -* packet payload pointer pkt. You do NOT want to do that. Use the provided -* library functions. -* To be clear: don't do _anything_ with this struct. Just pass it as a -* parameter, be happy and your programs will (hopefully) work. -*/ -struct packet { - unsigned long pkt_type; - unsigned char *pkt; - unsigned int pkt_size; - unsigned char *pkt_ptr; /* active ptr inside packet */ - unsigned int pkt_pos; /* pkt_ptr position, starting at 0 */ -}; - -/* -* our socket structure -* -* same as above. Use the provided library fuctions to change its values. -* Do not do it on your own. Live and let die. You have been warned. -*/ -struct pkt_socket { - int rawfd; - struct sockaddr_in *sckad; - /*struct sockaddr_ll *sckll;*/ - socklen_t sckad_len; -}; - -/* memory management */ -int pkt_init(struct packet *pkt, unsigned long type, unsigned int size); -int pkt_free(struct packet *pkt); - -/* pointer movement */ -int pkt_move_actptr(struct packet *pkt, int relmov); - -/* IP */ -int pkt_ip_header(struct packet *pkt, unsigned int iphdr_len, unsigned int version, unsigned char tos, unsigned short int total_len, unsigned short int id, unsigned short int frag_off /* 3bit flag, 13bit offset */, unsigned char ttl, unsigned char protocol, unsigned short int cksum, unsigned int saddr, unsigned int daddr); - -/* TCP */ -int pkt_tcp_header(struct packet *pkt, unsigned short int sport, unsigned short int dport, unsigned int seq, unsigned int ackseq, unsigned char headerlen, unsigned char reserved, unsigned char flags, unsigned short window, unsigned short int checksum, unsigned short int urgent); -int pkt_tcp_cksum(struct packet *pkt, char *saddr, char *daddr, unsigned int tcp_pkt_size); -int pkt_tcp_option(struct packet *pkt, unsigned char kind, unsigned char len, void *optval, size_t optlen); - -/* functions that might be useful and might be added some day ... -int pkt_shift_data(struct packet *pkt, unsigned int from, unsigned int to, unsigned int len); -int pkt_tcp_change_seqno(int rel_seq, int rel_ackseq); -int pkt_tcp_set_seqno(unsigned int seq, unsigned int ackseq); -int pkt_ip_option(struct packet *pkt, unsigned char code, unsigned char len, unsigned char ptr); -int pkt_ip_option_addval(struct *pkt, unsigned char posptr, unsigned int optval); -*/ - -#endif diff --git a/projects/stargazer/plugins/capture/cap_debug/packet.c b/projects/stargazer/plugins/capture/cap_debug/packet.c deleted file mode 100644 index 9405818e..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/packet.c +++ /dev/null @@ -1,88 +0,0 @@ -/* $Id: packet.c,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "libpal.h" - -/* -<++doc++> -@name int pkt_init(struct packet *pkt, unsigned long type, unsigned int size) -@desc Allocates memory for a new packet and initializes its internal variables -@param pkt pointer to the new packet -@param type type of the packet. Its setting is currently ignored, but this is likely to change. Possible values are e.g. PKT_NET_IP|PKT_TRANS_TCP. See packet.h for other values -@param size overall size if the packet not including ethernet headers or trailers. -<--doc--> -*/ -int -pkt_init(struct packet *pkt, unsigned long type, unsigned int size) -{ - if ((pkt->pkt = (unsigned char *) malloc(size)) == NULL) { - /* no mem, we assume errno will be set */ - return -1; - } else { - /* clear mem out */ - memset(pkt->pkt, 0, size); - /* init vars */ - pkt->pkt_type = type; - pkt->pkt_size = size; - /* set active ptr to beginning of mem */ - pkt->pkt_ptr = pkt->pkt; - pkt->pkt_pos = 0; - return 0; - } -} - -/* -<++doc++> -@name int pkt_free(struct packet *pkt) -@desc Used to destroy a packet and to free used memory -@param pkt the packet to destroy -<--doc--> -*/ -int -pkt_free(struct packet *pkt) -{ - if (pkt) { - free(pkt->pkt); - pkt->pkt=NULL; - return 0; - } - return EPKTINVALPTR; -} - -/* -<++doc++> -@name int pkt_move_actptr(struct packet *pkt, int relmov) -@desc This function moves the active pointer inside the packet. -@param pkt the packet whose active ptr is to be moved -@param relmov number of bytes the active ptr shall be moved. To move it backward, negative values may be used. -<--doc--> -*/ -int -pkt_move_actptr(struct packet *pkt, int relmov) -{ - if (!pkt) - return EPKTINVALPTR; - if ((pkt->pkt_pos + relmov > pkt->pkt_size) || - (pkt->pkt_pos + relmov < 0)) { - return EPKTRANGE; - } else { - pkt->pkt_ptr += relmov; - return PKTOK; - } -} diff --git a/projects/stargazer/plugins/capture/cap_debug/tcp.c b/projects/stargazer/plugins/capture/cap_debug/tcp.c deleted file mode 100644 index ad39931d..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/tcp.c +++ /dev/null @@ -1,154 +0,0 @@ -/* $Id: tcp.c,v 1.2 2009/06/19 12:50:47 faust Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "libpal.h" -#include "types.h" /* internal types */ - -int -pkt_tcp_header(struct packet *pkt, - unsigned short int sport, - unsigned short int dport, - unsigned int seq, - unsigned int ackseq, - unsigned char headerlen, - unsigned char reserved, - unsigned char flags, - unsigned short window, - unsigned short int checksum, - unsigned short int urgent) -{ - struct tcphdr *tcp; - - if (!pkt) - return EPKTINVALPTR; - - tcp = (struct tcphdr *) pkt->pkt_ptr; - tcp->source = htons(sport); - tcp->dest = htons(dport); - tcp->seq = htonl(seq); - tcp->ack_seq = htonl(ackseq); - tcp->window = htons(window); - tcp->urg_ptr = htons(urgent); - - tcp->doff = headerlen; - tcp->res1 = reserved; - if (flags) { - tcp->fin = ((flags & TH_FIN) != 0); - tcp->syn = ((flags & TH_SYN) != 0); - tcp->rst = ((flags & TH_RST) != 0); - tcp->psh = ((flags & TH_RST) != 0); - tcp->ack = ((flags & TH_ACK) != 0); - tcp->urg = ((flags & TH_URG) != 0); -# if __BYTE_ORDER == __LITTLE_ENDIAN - tcp->res2 = (flags & (TH_XMAS | TH_YMAS)) >> 6; -# elif __BYTE_ORDER == __BIG_ENDIAN - tcp->res2 = (flags & (TH_XMAS | TH_YMAS)); -# else -# error "Adjust your defines" -# endif - } else { - tcp->fin = 0; - tcp->syn = 0; - tcp->rst = 0; - tcp->psh = 0; - tcp->ack = 0; - tcp->urg = 0; - tcp->res2 = 0; - } - tcp->check = htons(checksum); - return 0; -} - -int -pkt_tcp_cksum(struct packet *pkt, char *saddr, char *daddr, - unsigned int tcp_pkt_size) -{ - char *tosum; - struct pseudohdr *psh; - struct tcphdr *tcp; - struct in_addr addr; - - if (!pkt || !saddr || !daddr) - return EPKTINVALPTR; - - if ((tcp_pkt_size + pkt->pkt_pos) > pkt->pkt_size -1) - return EPKTRANGE; - - if ((tosum = (char *) malloc(tcp_pkt_size+sizeof(struct pseudohdr))) != NULL) { - memset(tosum, 0, tcp_pkt_size+sizeof(struct pseudohdr)); - psh = (struct pseudohdr *) tosum; - tcp = (struct tcphdr *) pkt->pkt_ptr; - - tcp->check = 0; - - if (inet_pton(AF_INET, saddr, &addr) < 0) - return EERRNO; - psh->saddr = addr.s_addr; - if (inet_pton(AF_INET, daddr, &addr) < 0) - return EERRNO; - psh->daddr = addr.s_addr; - psh->zero = 0x00; - psh->protocol = IPPROTO_TCP; - psh->length = htons(tcp_pkt_size); - - memcpy(tosum + sizeof(struct pseudohdr), tcp, tcp_pkt_size); - tcp->check = in_cksum((unsigned short *)tosum, tcp_pkt_size + sizeof(struct pseudohdr)); - free(tosum); - return 0; - } else - return EERRNO; -} - -int -pkt_tcp_option(struct packet *pkt, unsigned char kind, - unsigned char len, void *optval, size_t optlen) -{ - void *vp; - unsigned short int mss; - - if (!pkt) - return EPKTINVALPTR; - - if ((pkt->pkt_size) < (pkt->pkt_pos+2+optlen)) - return EPKTRANGE; - - vp = (void *)pkt->pkt_ptr; - - memcpy(vp, &kind, 1); - char * p; - p = (char*)vp; - p++; - vp = p; - //vp++; - memcpy(vp, &len, 1); - //vp++; - p = (char*)vp; - p++; - vp = p; - if (kind == PKT_TCP_OPT_MSS) { - mss = htons(*(unsigned short int *)optval); - memcpy(vp, &mss, optlen); - } else if (kind == PKT_TCP_OPT_TIME) { - unsigned int time = htonl(*(unsigned int *)optval); - memcpy(vp, &time, optlen); - } else { - memcpy(vp, optval, optlen); - } - return 0; -} diff --git a/projects/stargazer/plugins/capture/cap_debug/types.h b/projects/stargazer/plugins/capture/cap_debug/types.h deleted file mode 100644 index 3d428fe9..00000000 --- a/projects/stargazer/plugins/capture/cap_debug/types.h +++ /dev/null @@ -1,35 +0,0 @@ -/* $Id: types.h,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ - -Copyright (C) 2002 Marc Kirchner - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#ifndef _LIBPAL_TYPES_H_ -#define _LIBPAL_TYPES_H_ - -/* -* these are types users wont need -*/ - -/* Stevens' pseudo header */ -struct pseudohdr { - u_int32_t saddr; - u_int32_t daddr; - u_int8_t zero; - u_int8_t protocol; - u_int16_t length; -}; -#endif diff --git a/projects/stargazer/plugins/capture/ipq_linux/Makefile b/projects/stargazer/plugins/capture/ipq_linux/Makefile deleted file mode 100644 index 48dc3449..00000000 --- a/projects/stargazer/plugins/capture/ipq_linux/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.6 2008/12/04 17:08:56 faust Exp $ -############################################################################### - -include ../../../../../Makefile.conf - -PROG = mod_cap_ipq.so - -SRCS = ./ipq_cap.cpp \ - ./libipq.c - -LIBS += $(LIB_THREAD) - -STGLIBS = common \ - logger - -include ../../Makefile.in - diff --git a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp deleted file mode 100644 index 18696ec2..00000000 --- a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* -* Author : Boris Mikhailenko -*/ - -#include -#include - -#include -#include -#include - -#include "stg/raw_ip_packet.h" -#include "stg/traffcounter.h" -#include "stg/plugin_creator.h" -#include "stg/common.h" - -#include "ipq_cap.h" - -extern "C" -{ -#include "libipq.h" -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -namespace -{ -PLUGIN_CREATOR icc; -} - -extern "C" PLUGIN * GetPlugin(); -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -PLUGIN * GetPlugin() -{ -return icc.GetPlugin(); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -std::string IPQ_CAP::GetVersion() const -{ -return "cap_ipq v.1.2"; -} -//----------------------------------------------------------------------------- -IPQ_CAP::IPQ_CAP() - : ipq_h(NULL), - nonstop(false), - isRunning(false), - capSock(-1), - traffCnt(NULL), - logger(GetPluginLogger(GetStgLogger(), "cap_ipq")) -{ -memset(buf, 0, BUFSIZE); -} -//----------------------------------------------------------------------------- -int IPQ_CAP::Start() -{ -if (isRunning) - return 0; -if (IPQCapOpen() < 0) - { - errorStr = "Cannot open socket!"; - printfd(__FILE__, "Cannot open socket\n"); - return -1; - } -nonstop = true; -if (pthread_create(&thread, NULL, Run, this) == 0) - { - return 0; - } -errorStr = "Cannot create thread."; -printfd(__FILE__, "Cannot create thread\n"); -return -1; -} -//----------------------------------------------------------------------------- -int IPQ_CAP::Stop() -{ -if (!isRunning) - return 0; -nonstop = false; -//5 seconds to thread stops itself -for (int i = 0; i < 25; i++) - { - if (!isRunning) - break; - struct timespec ts = {0, 200000000}; - nanosleep(&ts, NULL); - } -//after 5 seconds waiting thread still running. now killing it -if (isRunning) - { - if (pthread_kill(thread, SIGINT)) - { - errorStr = "Cannot kill thread."; - return -1; - } - for (int i = 0; i < 25 && isRunning; ++i) - { - struct timespec ts = {0, 200000000}; - nanosleep(&ts, NULL); - } - if (isRunning) - { - printfd(__FILE__, "Thread not stopped\n"); - } - else - { - pthread_join(thread, NULL); - } - } -IPQCapClose(); -return 0; -} -//----------------------------------------------------------------------------- -void * IPQ_CAP::Run(void * d) -{ -sigset_t signalSet; -sigfillset(&signalSet); -pthread_sigmask(SIG_BLOCK, &signalSet, NULL); - -RAW_PACKET raw_packet; - -IPQ_CAP * dc = static_cast(d); -dc->isRunning = true; -memset(&raw_packet, 0, sizeof(raw_packet)); -raw_packet.dataLen = -1; -while (dc->nonstop) - { - int status = dc->IPQCapRead(&raw_packet, 68); - if (status == -1 || - status == -2 || - status == -3 || - status == -4) - continue; - dc->traffCnt->Process(raw_packet); - } -dc->isRunning = false; -return NULL; -} -//----------------------------------------------------------------------------- -int IPQ_CAP::IPQCapOpen() -{ -ipq_h = ipq_create_handle(0, PF_INET); -if (ipq_h == NULL) - { - ipq_destroy_handle(ipq_h); - logger("Cannot create IPQ handle. Error: '%s', '%s'", ipq_errstr(), strerror(errno)); - errorStr = "Cannot create ipq handle!"; - return -1; - } -int status = ipq_set_mode(ipq_h, IPQ_COPY_PACKET, PAYLOAD_LEN); -if (status < 0) - { - ipq_destroy_handle(ipq_h); - logger("Cannot set IPQ_COPY_PACKET mode."); - errorStr = "Cannot set IPQ_COPY_PACKET mode!"; - return -1; - } -return 0; -} -//----------------------------------------------------------------------------- -int IPQ_CAP::IPQCapClose() -{ -ipq_destroy_handle(ipq_h); -return 0; -} -//----------------------------------------------------------------------------- -int IPQ_CAP::IPQCapRead(void * buffer, int blen) -{ -memset(buf, 0, BUFSIZE); -int status = ipq_read(ipq_h, buf, BUFSIZE, 1); -if (status == 0) - return -4; -if (errno == EINTR) - return -3; -if (status < 0) - return -1; -if (ipq_message_type(buf) != IPQM_PACKET) - return -2; -static ipq_packet_msg_t * m = ipq_get_packet(buf); -memcpy(buffer, m->payload, blen); -ipq_set_verdict(ipq_h, m->packet_id, NF_ACCEPT, 0, NULL); -return 0; -} -//----------------------------------------------------------------------------- diff --git a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h b/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h deleted file mode 100644 index b7f76b05..00000000 --- a/projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* -* Author : Boris Mikhailenko -*/ - -#ifndef IPQ_CAP_H -#define IPQ_CAP_H - -#include - -#include "stg/plugin.h" -#include "stg/module_settings.h" -#include "stg/os_int.h" -#include "stg/logger.h" - -#define BUFSIZE (256) -#define PAYLOAD_LEN (96) - -class USERS; -class TARIFFS; -class ADMINS; -class TRAFFCOUNTER; -class SETTINGS; - -//----------------------------------------------------------------------------- -class IPQ_CAP :public PLUGIN { -public: - IPQ_CAP(); - virtual ~IPQ_CAP() {} - - void SetTraffcounter(TRAFFCOUNTER * tc) { traffCnt = tc; } - - int Start(); - int Stop(); - int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; } - bool IsRunning() { return isRunning; } - - int ParseSettings() { return 0; } - const std::string & GetStrError() const { return errorStr; } - std::string GetVersion() const; - uint16_t GetStartPosition() const { return 40; } - uint16_t GetStopPosition() const { return 40; } - -private: - IPQ_CAP(const IPQ_CAP & rvalue); - IPQ_CAP & operator=(const IPQ_CAP & rvalue); - - static void * Run(void *); - int IPQCapOpen(); - int IPQCapClose(); - int IPQCapRead(void * buffer, int blen); - - struct ipq_handle * ipq_h; - mutable std::string errorStr; - - pthread_t thread; - bool nonstop; - bool isRunning; - int capSock; - - TRAFFCOUNTER * traffCnt; - unsigned char buf[BUFSIZE]; - - PLUGIN_LOGGER logger; -}; - -#endif diff --git a/projects/stargazer/plugins/capture/ipq_linux/libipq.c b/projects/stargazer/plugins/capture/ipq_linux/libipq.c deleted file mode 100644 index d0eb33b3..00000000 --- a/projects/stargazer/plugins/capture/ipq_linux/libipq.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * libipq.c - * - * IPQ userspace library. - * - * Please note that this library is still developmental, and there may - * be some API changes. - * - * Author: James Morris - * - * 07-11-2001 Modified by Fernando Anton to add support for IPv6. - * - * Copyright (c) 2000-2001 Netfilter Core Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include -#include -#include -#include - -#include "libipq.h" - -/**************************************************************************** - * - * Private interface - * - ****************************************************************************/ - -enum - { - IPQ_ERR_NONE = 0, - IPQ_ERR_IMPL, - IPQ_ERR_HANDLE, - IPQ_ERR_SOCKET, - IPQ_ERR_BIND, - IPQ_ERR_BUFFER, - IPQ_ERR_RECV, - IPQ_ERR_NLEOF, - IPQ_ERR_ADDRLEN, - IPQ_ERR_STRUNC, - IPQ_ERR_RTRUNC, - IPQ_ERR_NLRECV, - IPQ_ERR_SEND, - IPQ_ERR_SUPP, - IPQ_ERR_RECVBUF, - IPQ_ERR_TIMEOUT, - IPQ_ERR_PROTOCOL - }; -#define IPQ_MAXERR IPQ_ERR_PROTOCOL - -struct ipq_errmap_t - { - int errcode; - char *message; - } ipq_errmap[] = { - { IPQ_ERR_NONE, "Unknown error"}, - { IPQ_ERR_IMPL, "Implementation error"}, - { IPQ_ERR_HANDLE, "Unable to create netlink handle"}, - { IPQ_ERR_SOCKET, "Unable to create netlink socket"}, - { IPQ_ERR_BIND, "Unable to bind netlink socket"}, - { IPQ_ERR_BUFFER, "Unable to allocate buffer"}, - { IPQ_ERR_RECV, "Failed to receive netlink message"}, - { IPQ_ERR_NLEOF, "Received EOF on netlink socket"}, - { IPQ_ERR_ADDRLEN, "Invalid peer address length"}, - { IPQ_ERR_STRUNC, "Sent message truncated"}, - { IPQ_ERR_RTRUNC, "Received message truncated"}, - { IPQ_ERR_NLRECV, "Received error from netlink"}, - { IPQ_ERR_SEND, "Failed to send netlink message"}, - { IPQ_ERR_SUPP, "Operation not supported"}, - { IPQ_ERR_RECVBUF, "Receive buffer size invalid"}, - { IPQ_ERR_TIMEOUT, "Timeout"}, - { IPQ_ERR_PROTOCOL, "Invalid protocol specified"} -}; - -static int ipq_errno = IPQ_ERR_NONE; - -static ssize_t ipq_netlink_sendto(const struct ipq_handle *h, - const void *msg, size_t len); - -static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h, - unsigned char *buf, size_t len, - int timeout); - -static ssize_t ipq_netlink_sendmsg(const struct ipq_handle *h, - const struct msghdr *msg, - unsigned int flags); - -//static char *ipq_strerror(int errcode); -//----------------------------------------------------------------------------- -static ssize_t ipq_netlink_sendto(const struct ipq_handle *h, - const void *msg, size_t len) -{ - int status = sendto(h->fd, msg, len, 0, - (struct sockaddr *)&h->peer, sizeof(h->peer)); - if (status < 0) - ipq_errno = IPQ_ERR_SEND; - return status; -} -//----------------------------------------------------------------------------- -static ssize_t ipq_netlink_sendmsg(const struct ipq_handle *h, - const struct msghdr *msg, - unsigned int flags) -{ - int status = sendmsg(h->fd, msg, flags); - if (status < 0) - ipq_errno = IPQ_ERR_SEND; - return status; -} -//----------------------------------------------------------------------------- -static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h, - unsigned char *buf, size_t len, - int timeout) -{ - socklen_t addrlen; - int status; - struct nlmsghdr *nlh; - - if (len < sizeof(struct nlmsgerr)) - { - ipq_errno = IPQ_ERR_RECVBUF; - return -1; - } - addrlen = sizeof(h->peer); - - if (timeout != 0) - { - int ret; - struct timeval tv; - fd_set read_fds; - - if (timeout < 0) - { - /* non-block non-timeout */ - tv.tv_sec = 0; - tv.tv_usec = 0; - } - else - { - tv.tv_sec = timeout / 1000000; - tv.tv_usec = timeout % 1000000; - } - - FD_ZERO(&read_fds); - FD_SET(h->fd, &read_fds); - ret = select(h->fd+1, &read_fds, NULL, NULL, &tv); - if (ret < 0) - { - if (errno == EINTR) - { - return 0; - } - else - { - ipq_errno = IPQ_ERR_RECV; - return -1; - } - } - if (!FD_ISSET(h->fd, &read_fds)) - { - ipq_errno = IPQ_ERR_TIMEOUT; - return 0; - } - } - status = recvfrom(h->fd, buf, len, 0, - (struct sockaddr *)&h->peer, &addrlen); - if (status < 0) - { - ipq_errno = IPQ_ERR_RECV; - return status; - } - if (addrlen != sizeof(h->peer)) - { - ipq_errno = IPQ_ERR_RECV; - return -1; - } - if (h->peer.nl_pid != 0) - { - ipq_errno = IPQ_ERR_RECV; - return -1; - } - if (status == 0) - { - ipq_errno = IPQ_ERR_NLEOF; - return -1; - } - nlh = (struct nlmsghdr *)buf; - if (nlh->nlmsg_flags & MSG_TRUNC || (int)nlh->nlmsg_len > status) - { - ipq_errno = IPQ_ERR_RTRUNC; - return -1; - } - return status; -} -//----------------------------------------------------------------------------- -static char *ipq_strerror(int errcode) -{ - if (errcode < 0 || errcode > IPQ_MAXERR) - errcode = IPQ_ERR_IMPL; - return ipq_errmap[errcode].message; -} - -/**************************************************************************** - * - * Public interface - * - ****************************************************************************/ - -/* - * Create and initialise an ipq handle. - */ -struct ipq_handle *ipq_create_handle(u_int32_t __attribute__((unused)) flags, u_int32_t protocol) - { - int status; - struct ipq_handle *h; - - h = (struct ipq_handle *)malloc(sizeof(struct ipq_handle)); - if (h == NULL) - { - ipq_errno = IPQ_ERR_HANDLE; - return NULL; - } - - memset(h, 0, sizeof(struct ipq_handle)); - - if (protocol == PF_INET) - h->fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_FIREWALL); - else if (protocol == PF_INET6) - h->fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_IP6_FW); - else - { - ipq_errno = IPQ_ERR_PROTOCOL; - free(h); - return NULL; - } - - if (h->fd == -1) - { - ipq_errno = IPQ_ERR_SOCKET; - close(h->fd); - free(h); - return NULL; - } - memset(&h->local, 0, sizeof(struct sockaddr_nl)); - h->local.nl_family = AF_NETLINK; - h->local.nl_pid = getpid(); - h->local.nl_groups = 0; - status = bind(h->fd, (struct sockaddr *)&h->local, sizeof(h->local)); - if (status == -1) - { - ipq_errno = IPQ_ERR_BIND; - close(h->fd); - free(h); - return NULL; - } - memset(&h->peer, 0, sizeof(struct sockaddr_nl)); - h->peer.nl_family = AF_NETLINK; - h->peer.nl_pid = 0; - h->peer.nl_groups = 0; - return h; - } -//----------------------------------------------------------------------------- -/* - * No error condition is checked here at this stage, but it may happen - * if/when reliable messaging is implemented. - */ -int ipq_destroy_handle(struct ipq_handle *h) -{ - if (h) - { - close(h->fd); - free(h); - } - return 0; -} -//----------------------------------------------------------------------------- -int ipq_set_mode(const struct ipq_handle *h, - u_int8_t mode, size_t range) -{ - #define FAKE_ARRAY_SIZE 16 - struct - { - struct nlmsghdr nlh; - ipq_peer_msg_t pm; - char s[FAKE_ARRAY_SIZE]; - } req; - - memset(&req, 0, sizeof(req)); - req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(req)-FAKE_ARRAY_SIZE); - req.nlh.nlmsg_flags = NLM_F_REQUEST; - req.nlh.nlmsg_type = IPQM_MODE; - req.nlh.nlmsg_pid = h->local.nl_pid; - req.pm.msg.mode.value = mode; - req.pm.msg.mode.range = range; - return ipq_netlink_sendto(h, (void *)&req, req.nlh.nlmsg_len); - //return ipq_netlink_sendto(h, (void *)&req, sizeof(req)); -} -//----------------------------------------------------------------------------- -/* - * timeout is in microseconds (1 second is 1000000 (1 million) microseconds) - * - */ -ssize_t ipq_read(const struct ipq_handle *h, - unsigned char *buf, size_t len, int timeout) -{ - return ipq_netlink_recvfrom(h, buf, len, timeout); -} -//----------------------------------------------------------------------------- -int ipq_message_type(const unsigned char *buf) -{ - return((struct nlmsghdr*)buf)->nlmsg_type; -} -//----------------------------------------------------------------------------- -ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf) -{ - return(ipq_packet_msg_t *)(NLMSG_DATA((struct nlmsghdr *)(buf))); -} -//----------------------------------------------------------------------------- -int ipq_set_verdict(const struct ipq_handle *h, - ipq_id_t id, - unsigned int verdict, - size_t data_len, - unsigned char *buf) -{ - unsigned char nvecs; - size_t tlen; - struct nlmsghdr nlh; - ipq_peer_msg_t pm; - struct iovec iov[3]; - struct msghdr msg; - - memset(&nlh, 0, sizeof(nlh)); - nlh.nlmsg_flags = NLM_F_REQUEST; - nlh.nlmsg_type = IPQM_VERDICT; - nlh.nlmsg_pid = h->local.nl_pid; - memset(&pm, 0, sizeof(pm)); - pm.msg.verdict.value = verdict; - pm.msg.verdict.id = id; - pm.msg.verdict.data_len = data_len; - iov[0].iov_base = &nlh; - iov[0].iov_len = sizeof(nlh); - iov[1].iov_base = ± - iov[1].iov_len = sizeof(pm); - tlen = sizeof(nlh) + sizeof(pm); - nvecs = 2; - if (data_len && buf) - { - iov[2].iov_base = buf; - iov[2].iov_len = data_len; - tlen += data_len; - nvecs++; - } - msg.msg_name = (void *)&h->peer; - msg.msg_namelen = sizeof(h->peer); - msg.msg_iov = iov; - msg.msg_iovlen = nvecs; - msg.msg_control = NULL; - msg.msg_controllen = 0; - msg.msg_flags = 0; - nlh.nlmsg_len = tlen; - return ipq_netlink_sendmsg(h, &msg, 0); -} -//----------------------------------------------------------------------------- -char *ipq_errstr(void) -{ - return ipq_strerror(ipq_errno); -} -//----------------------------------------------------------------------------- -/*void ipq_perror(const char *s) -{ - if (s) - fputs(s, stderr); - else - fputs("ERROR", stderr); - if (ipq_errno) - fprintf(stderr, ": %s", ipq_errstr()); - if (errno) - fprintf(stderr, ": %s", strerror(errno)); - fputc('\n', stderr); -}*/ -//----------------------------------------------------------------------------- - - diff --git a/projects/stargazer/plugins/capture/ipq_linux/libipq.h b/projects/stargazer/plugins/capture/ipq_linux/libipq.h deleted file mode 100644 index 17d4c9cb..00000000 --- a/projects/stargazer/plugins/capture/ipq_linux/libipq.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * libipq.h - * - * IPQ library for userspace. - * - * Author: James Morris - * - * Copyright (c) 2000-2001 Netfilter Core Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef _LIBIPQ_H -#define _LIBIPQ_H - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#ifdef KERNEL_64_USERSPACE_32 -typedef u_int64_t ipq_id_t; -#else -typedef unsigned long ipq_id_t; -#endif - -#ifdef DEBUG_LIBIPQ -#include -#define LDEBUG(x...) fprintf(stderr, ## x) -#else -#define LDEBUG(x...) -#endif /* DEBUG_LIBIPQ */ - -/* FIXME: glibc sucks */ -#ifndef MSG_TRUNC -#define MSG_TRUNC 0x20 -#endif - -struct ipq_handle -{ - int fd; - u_int8_t blocking; - struct sockaddr_nl local; - struct sockaddr_nl peer; -}; - -struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol); - -int ipq_destroy_handle(struct ipq_handle *h); - -ssize_t ipq_read(const struct ipq_handle *h, - unsigned char *buf, size_t len, int timeout); - -int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len); - -ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf); - -int ipq_message_type(const unsigned char *buf); - -int ipq_set_verdict(const struct ipq_handle *h, - ipq_id_t id, - unsigned int verdict, - size_t data_len, - unsigned char *buf); - -char *ipq_errstr(void); -//void ipq_perror(const char *s); - -#endif /* _LIBIPQ_H */ - diff --git a/rlm_stg/CMakeLists.txt b/rlm_stg/CMakeLists.txt new file mode 100644 index 00000000..70291038 --- /dev/null +++ b/rlm_stg/CMakeLists.txt @@ -0,0 +1,13 @@ +find_package ( YAJL REQUIRED ) + +set ( CPP_FILES conn.cpp iface.cpp stg_client.cpp ) +set ( C_FILES rlm_stg.c radlog.c ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_library ( rlm_stg MODULE ${CPP_FILES} ${C_FILES} ) + +target_link_libraries ( rlm_stg crypto common json dl YAJL::YAJL ) + +# TODO: install diff --git a/projects/rlm_stg/Makefile b/rlm_stg/Makefile similarity index 100% rename from projects/rlm_stg/Makefile rename to rlm_stg/Makefile diff --git a/projects/rlm_stg/build b/rlm_stg/build similarity index 100% rename from projects/rlm_stg/build rename to rlm_stg/build diff --git a/projects/rlm_stg/conn.cpp b/rlm_stg/conn.cpp similarity index 100% rename from projects/rlm_stg/conn.cpp rename to rlm_stg/conn.cpp diff --git a/projects/rlm_stg/conn.h b/rlm_stg/conn.h similarity index 98% rename from projects/rlm_stg/conn.h rename to rlm_stg/conn.h index 6233b154..6b6fd261 100644 --- a/projects/rlm_stg/conn.h +++ b/rlm_stg/conn.h @@ -23,12 +23,11 @@ #include "types.h" -#include "stg/os_int.h" - #include #include #include +#include namespace STG { diff --git a/projects/rlm_stg/iface.cpp b/rlm_stg/iface.cpp similarity index 100% rename from projects/rlm_stg/iface.cpp rename to rlm_stg/iface.cpp diff --git a/projects/rlm_stg/iface.h b/rlm_stg/iface.h similarity index 100% rename from projects/rlm_stg/iface.h rename to rlm_stg/iface.h diff --git a/projects/rlm_stg/radlog.c b/rlm_stg/radlog.c similarity index 100% rename from projects/rlm_stg/radlog.c rename to rlm_stg/radlog.c diff --git a/projects/rlm_stg/radlog.h b/rlm_stg/radlog.h similarity index 100% rename from projects/rlm_stg/radlog.h rename to rlm_stg/radlog.h diff --git a/projects/rlm_stg/rlm_stg.c b/rlm_stg/rlm_stg.c similarity index 100% rename from projects/rlm_stg/rlm_stg.c rename to rlm_stg/rlm_stg.c diff --git a/projects/rlm_stg/stg_client.cpp b/rlm_stg/stg_client.cpp similarity index 100% rename from projects/rlm_stg/stg_client.cpp rename to rlm_stg/stg_client.cpp diff --git a/projects/rlm_stg/stg_client.h b/rlm_stg/stg_client.h similarity index 98% rename from projects/rlm_stg/stg_client.h rename to rlm_stg/stg_client.h index 917d0e51..4d4c582b 100644 --- a/projects/rlm_stg/stg_client.h +++ b/rlm_stg/stg_client.h @@ -23,11 +23,10 @@ #include "types.h" -#include "stg/os_int.h" - #include #include +#include namespace STG { diff --git a/projects/rlm_stg/stgpair.h b/rlm_stg/stgpair.h similarity index 100% rename from projects/rlm_stg/stgpair.h rename to rlm_stg/stgpair.h diff --git a/projects/rlm_stg/types.h b/rlm_stg/types.h similarity index 100% rename from projects/rlm_stg/types.h rename to rlm_stg/types.h diff --git a/rscriptd/CMakeLists.txt b/rscriptd/CMakeLists.txt new file mode 100644 index 00000000..9228b370 --- /dev/null +++ b/rscriptd/CMakeLists.txt @@ -0,0 +1,10 @@ +set ( CPP_FILES main.cpp listener.cpp pidfile.cpp ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_executable ( rscriptd ${CPP_FILES} ) + +target_link_libraries ( rscriptd scriptexecuter conffiles logger crypto common Threads::Threads ) + +# TODO: install diff --git a/projects/rscriptd/Makefile b/rscriptd/Makefile similarity index 100% rename from projects/rscriptd/Makefile rename to rscriptd/Makefile diff --git a/projects/rscriptd/build b/rscriptd/build similarity index 100% rename from projects/rscriptd/build rename to rscriptd/build diff --git a/projects/rscriptd/listener.cpp b/rscriptd/listener.cpp similarity index 99% rename from projects/rscriptd/listener.cpp rename to rscriptd/listener.cpp index 0b626afd..e17babb0 100644 --- a/projects/rscriptd/listener.cpp +++ b/rscriptd/listener.cpp @@ -36,6 +36,7 @@ #include "stg/scriptexecuter.h" #include "stg/locker.h" #include "stg/common.h" +#include "stg/const.h" #include "listener.h" void InitEncrypt(BLOWFISH_CTX * ctx, const std::string & password); diff --git a/projects/rscriptd/listener.h b/rscriptd/listener.h similarity index 99% rename from projects/rscriptd/listener.h rename to rscriptd/listener.h index 22b029b6..b400ebbc 100644 --- a/projects/rscriptd/listener.h +++ b/rscriptd/listener.h @@ -25,8 +25,8 @@ #include #include #include +#include -#include "stg/os_int.h" #include "stg/blowfish.h" #include "stg/rs_packets.h" #include "stg/logger.h" diff --git a/projects/rscriptd/main.cpp b/rscriptd/main.cpp similarity index 100% rename from projects/rscriptd/main.cpp rename to rscriptd/main.cpp diff --git a/projects/rscriptd/pidfile.cpp b/rscriptd/pidfile.cpp similarity index 100% rename from projects/rscriptd/pidfile.cpp rename to rscriptd/pidfile.cpp diff --git a/projects/rscriptd/pidfile.h b/rscriptd/pidfile.h similarity index 100% rename from projects/rscriptd/pidfile.h rename to rscriptd/pidfile.h diff --git a/projects/rscriptd/rscriptd.conf b/rscriptd/rscriptd.conf similarity index 100% rename from projects/rscriptd/rscriptd.conf rename to rscriptd/rscriptd.conf diff --git a/projects/sgauth/.gitignore b/sgauth/.gitignore similarity index 100% rename from projects/sgauth/.gitignore rename to sgauth/.gitignore diff --git a/sgauth/CMakeLists.txt b/sgauth/CMakeLists.txt new file mode 100644 index 00000000..fc41d499 --- /dev/null +++ b/sgauth/CMakeLists.txt @@ -0,0 +1,10 @@ +set ( CPP_FILES main.cpp settings_impl.cpp web.cpp ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_executable ( sgauth ${CPP_FILES} ) + +target_link_libraries ( sgauth conffiles ia crypto common Threads::Threads ) + +# TODO: install diff --git a/projects/sgauth/Makefile b/sgauth/Makefile similarity index 100% rename from projects/sgauth/Makefile rename to sgauth/Makefile diff --git a/projects/sgauth/build b/sgauth/build similarity index 100% rename from projects/sgauth/build rename to sgauth/build diff --git a/projects/sgauth/main.cpp b/sgauth/main.cpp similarity index 100% rename from projects/sgauth/main.cpp rename to sgauth/main.cpp diff --git a/projects/sgauth/make_css.sh b/sgauth/make_css.sh similarity index 100% rename from projects/sgauth/make_css.sh rename to sgauth/make_css.sh diff --git a/projects/sgauth/settings_impl.cpp b/sgauth/settings_impl.cpp similarity index 100% rename from projects/sgauth/settings_impl.cpp rename to sgauth/settings_impl.cpp diff --git a/projects/sgauth/settings_impl.h b/sgauth/settings_impl.h similarity index 98% rename from projects/sgauth/settings_impl.h rename to sgauth/settings_impl.h index 253b69ea..c5305b89 100644 --- a/projects/sgauth/settings_impl.h +++ b/sgauth/settings_impl.h @@ -22,8 +22,7 @@ #define SETTINGS_IMPL_H #include - -#include "stg/os_int.h" +#include class SETTINGS_IMPL { public: diff --git a/projects/sgauth/sgauth.conf b/sgauth/sgauth.conf similarity index 100% rename from projects/sgauth/sgauth.conf rename to sgauth/sgauth.conf diff --git a/projects/sgauth/sgauth.css b/sgauth/sgauth.css similarity index 100% rename from projects/sgauth/sgauth.css rename to sgauth/sgauth.css diff --git a/projects/sgauth/web.cpp b/sgauth/web.cpp similarity index 100% rename from projects/sgauth/web.cpp rename to sgauth/web.cpp diff --git a/projects/sgauth/web.h b/sgauth/web.h similarity index 100% rename from projects/sgauth/web.h rename to sgauth/web.h diff --git a/projects/sgconf/CHANGES b/sgconf/CHANGES similarity index 100% rename from projects/sgconf/CHANGES rename to sgconf/CHANGES diff --git a/sgconf/CMakeLists.txt b/sgconf/CMakeLists.txt new file mode 100644 index 00000000..c2666b80 --- /dev/null +++ b/sgconf/CMakeLists.txt @@ -0,0 +1,12 @@ +find_package ( EXPAT REQUIRED ) + +set ( CPP_FILES main.cpp options.cpp api_action.cpp actions.cpp admins.cpp tariffs.cpp users.cpp services.cpp corps.cpp info.cpp xml.cpp ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_executable ( sgconf ${CPP_FILES} ) + +target_link_libraries ( sgconf srvconf crypto common EXPAT::EXPAT ) + +# TODO: install diff --git a/projects/sgconf/Makefile b/sgconf/Makefile similarity index 100% rename from projects/sgconf/Makefile rename to sgconf/Makefile diff --git a/projects/sgconf/README.txt b/sgconf/README.txt similarity index 100% rename from projects/sgconf/README.txt rename to sgconf/README.txt diff --git a/projects/sgconf/TODO b/sgconf/TODO similarity index 100% rename from projects/sgconf/TODO rename to sgconf/TODO diff --git a/projects/sgconf/action.h b/sgconf/action.h similarity index 100% rename from projects/sgconf/action.h rename to sgconf/action.h diff --git a/projects/sgconf/actions.cpp b/sgconf/actions.cpp similarity index 100% rename from projects/sgconf/actions.cpp rename to sgconf/actions.cpp diff --git a/projects/sgconf/actions.h b/sgconf/actions.h similarity index 100% rename from projects/sgconf/actions.h rename to sgconf/actions.h diff --git a/projects/sgconf/admins.cpp b/sgconf/admins.cpp similarity index 99% rename from projects/sgconf/admins.cpp rename to sgconf/admins.cpp index c16e6e2b..3bacb354 100644 --- a/projects/sgconf/admins.cpp +++ b/sgconf/admins.cpp @@ -7,11 +7,11 @@ #include "stg/servconf.h" #include "stg/servconf_types.h" -#include "stg/os_int.h" #include #include #include +#include #include namespace diff --git a/projects/sgconf/admins.h b/sgconf/admins.h similarity index 100% rename from projects/sgconf/admins.h rename to sgconf/admins.h diff --git a/projects/sgconf/api_action.cpp b/sgconf/api_action.cpp similarity index 100% rename from projects/sgconf/api_action.cpp rename to sgconf/api_action.cpp diff --git a/projects/sgconf/api_action.h b/sgconf/api_action.h similarity index 100% rename from projects/sgconf/api_action.h rename to sgconf/api_action.h diff --git a/projects/sgconf/build b/sgconf/build similarity index 100% rename from projects/sgconf/build rename to sgconf/build diff --git a/projects/sgconf/config.h b/sgconf/config.h similarity index 99% rename from projects/sgconf/config.h rename to sgconf/config.h index d3659a1d..271837cc 100644 --- a/projects/sgconf/config.h +++ b/sgconf/config.h @@ -23,9 +23,9 @@ #include "stg/common.h" #include "stg/resetable.h" -#include "stg/os_int.h" #include +#include namespace SGCONF { diff --git a/projects/sgconf/corps.cpp b/sgconf/corps.cpp similarity index 100% rename from projects/sgconf/corps.cpp rename to sgconf/corps.cpp diff --git a/projects/sgconf/corps.h b/sgconf/corps.h similarity index 100% rename from projects/sgconf/corps.h rename to sgconf/corps.h diff --git a/projects/sgconf/info.cpp b/sgconf/info.cpp similarity index 100% rename from projects/sgconf/info.cpp rename to sgconf/info.cpp diff --git a/projects/sgconf/info.h b/sgconf/info.h similarity index 100% rename from projects/sgconf/info.h rename to sgconf/info.h diff --git a/projects/sgconf/main.cpp b/sgconf/main.cpp similarity index 100% rename from projects/sgconf/main.cpp rename to sgconf/main.cpp diff --git a/projects/sgconf/options.cpp b/sgconf/options.cpp similarity index 100% rename from projects/sgconf/options.cpp rename to sgconf/options.cpp diff --git a/projects/sgconf/options.h b/sgconf/options.h similarity index 100% rename from projects/sgconf/options.h rename to sgconf/options.h diff --git a/projects/sgconf/parser_state.h b/sgconf/parser_state.h similarity index 100% rename from projects/sgconf/parser_state.h rename to sgconf/parser_state.h diff --git a/projects/sgconf/services.cpp b/sgconf/services.cpp similarity index 100% rename from projects/sgconf/services.cpp rename to sgconf/services.cpp diff --git a/projects/sgconf/services.h b/sgconf/services.h similarity index 100% rename from projects/sgconf/services.h rename to sgconf/services.h diff --git a/projects/sgconf/tariffs.cpp b/sgconf/tariffs.cpp similarity index 99% rename from projects/sgconf/tariffs.cpp rename to sgconf/tariffs.cpp index 6ab4e871..7ff7e711 100644 --- a/projects/sgconf/tariffs.cpp +++ b/sgconf/tariffs.cpp @@ -9,13 +9,13 @@ #include "stg/servconf_types.h" #include "stg/tariff_conf.h" #include "stg/common.h" -#include "stg/os_int.h" #include #include #include #include #include +#include #include namespace diff --git a/projects/sgconf/tariffs.h b/sgconf/tariffs.h similarity index 100% rename from projects/sgconf/tariffs.h rename to sgconf/tariffs.h diff --git a/projects/sgconf/users.cpp b/sgconf/users.cpp similarity index 100% rename from projects/sgconf/users.cpp rename to sgconf/users.cpp diff --git a/projects/sgconf/users.h b/sgconf/users.h similarity index 100% rename from projects/sgconf/users.h rename to sgconf/users.h diff --git a/projects/sgconf/utils.h b/sgconf/utils.h similarity index 100% rename from projects/sgconf/utils.h rename to sgconf/utils.h diff --git a/projects/sgconf/xml.cpp b/sgconf/xml.cpp similarity index 100% rename from projects/sgconf/xml.cpp rename to sgconf/xml.cpp diff --git a/projects/sgconf/xml.h b/sgconf/xml.h similarity index 100% rename from projects/sgconf/xml.h rename to sgconf/xml.h diff --git a/projects/stargazer/BUGS b/stargazer/BUGS similarity index 100% rename from projects/stargazer/BUGS rename to stargazer/BUGS diff --git a/projects/sgconf_xml/CHANGES b/stargazer/CHANGES similarity index 100% rename from projects/sgconf_xml/CHANGES rename to stargazer/CHANGES diff --git a/stargazer/CMakeLists.txt b/stargazer/CMakeLists.txt new file mode 100644 index 00000000..43c8e91a --- /dev/null +++ b/stargazer/CMakeLists.txt @@ -0,0 +1,29 @@ +set ( CPP_FILES main.cpp + admins_impl.cpp + users_impl.cpp + tariffs_impl.cpp + corps_impl.cpp + services_impl.cpp + admin_impl.cpp + user_impl.cpp + tariff_impl.cpp + eventloop.cpp + pidfile.cpp + plugin_runner.cpp + plugin_mgr.cpp + settings_impl.cpp + stg_timer.cpp + store_loader.cpp + traffcounter_impl.cpp + user_property.cpp ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_executable ( stargazer ${CPP_FILES} ) + +target_link_libraries ( stargazer scriptexecuter dotconfpp logger common Threads::Threads dl ) + +add_subdirectory ( plugins ) + +# TODO: install diff --git a/projects/stargazer/Makefile b/stargazer/Makefile similarity index 100% rename from projects/stargazer/Makefile rename to stargazer/Makefile diff --git a/projects/stargazer/README b/stargazer/README similarity index 100% rename from projects/stargazer/README rename to stargazer/README diff --git a/projects/stargazer/TODO b/stargazer/TODO similarity index 100% rename from projects/stargazer/TODO rename to stargazer/TODO diff --git a/projects/stargazer/actions.h b/stargazer/actions.h similarity index 100% rename from projects/stargazer/actions.h rename to stargazer/actions.h diff --git a/projects/stargazer/actions.inl.h b/stargazer/actions.inl.h similarity index 100% rename from projects/stargazer/actions.inl.h rename to stargazer/actions.inl.h diff --git a/projects/stargazer/admin_impl.cpp b/stargazer/admin_impl.cpp similarity index 100% rename from projects/stargazer/admin_impl.cpp rename to stargazer/admin_impl.cpp diff --git a/projects/stargazer/admin_impl.h b/stargazer/admin_impl.h similarity index 98% rename from projects/stargazer/admin_impl.h rename to stargazer/admin_impl.h index 22ffa071..cfeabf65 100644 --- a/projects/stargazer/admin_impl.h +++ b/stargazer/admin_impl.h @@ -32,10 +32,10 @@ #define ADMIN_IMPL_H #include "stg/admin.h" -#include "stg/os_int.h" #include "stg/admin_conf.h" #include +#include class ADMIN_IMPL : public ADMIN { public: diff --git a/projects/stargazer/admins_impl.cpp b/stargazer/admins_impl.cpp similarity index 100% rename from projects/stargazer/admins_impl.cpp rename to stargazer/admins_impl.cpp diff --git a/projects/stargazer/admins_impl.h b/stargazer/admins_impl.h similarity index 100% rename from projects/stargazer/admins_impl.h rename to stargazer/admins_impl.h diff --git a/projects/stargazer/build b/stargazer/build similarity index 100% rename from projects/stargazer/build rename to stargazer/build diff --git a/projects/stargazer/corps_impl.cpp b/stargazer/corps_impl.cpp similarity index 100% rename from projects/stargazer/corps_impl.cpp rename to stargazer/corps_impl.cpp diff --git a/projects/stargazer/corps_impl.h b/stargazer/corps_impl.h similarity index 100% rename from projects/stargazer/corps_impl.h rename to stargazer/corps_impl.h diff --git a/projects/stargazer/eventloop.cpp b/stargazer/eventloop.cpp similarity index 100% rename from projects/stargazer/eventloop.cpp rename to stargazer/eventloop.cpp diff --git a/projects/stargazer/eventloop.h b/stargazer/eventloop.h similarity index 100% rename from projects/stargazer/eventloop.h rename to stargazer/eventloop.h diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/OnChange b/stargazer/inst/freebsd/etc/stargazer/OnChange similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/OnChange rename to stargazer/inst/freebsd/etc/stargazer/OnChange diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/OnConnect b/stargazer/inst/freebsd/etc/stargazer/OnConnect similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/OnConnect rename to stargazer/inst/freebsd/etc/stargazer/OnConnect diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/OnDisconnect b/stargazer/inst/freebsd/etc/stargazer/OnDisconnect similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/OnDisconnect rename to stargazer/inst/freebsd/etc/stargazer/OnDisconnect diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/OnUserAdd b/stargazer/inst/freebsd/etc/stargazer/OnUserAdd similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/OnUserAdd rename to stargazer/inst/freebsd/etc/stargazer/OnUserAdd diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/OnUserDel b/stargazer/inst/freebsd/etc/stargazer/OnUserDel similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/OnUserDel rename to stargazer/inst/freebsd/etc/stargazer/OnUserDel diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf b/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf b/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf rename to stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/rules b/stargazer/inst/freebsd/etc/stargazer/rules similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/rules rename to stargazer/inst/freebsd/etc/stargazer/rules diff --git a/projects/stargazer/inst/freebsd/etc/stargazer/stargazer.conf b/stargazer/inst/freebsd/etc/stargazer/stargazer.conf similarity index 100% rename from projects/stargazer/inst/freebsd/etc/stargazer/stargazer.conf rename to stargazer/inst/freebsd/etc/stargazer/stargazer.conf diff --git a/projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo b/stargazer/inst/linux/etc/init.d/stargazer.gentoo similarity index 100% rename from projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo rename to stargazer/inst/linux/etc/init.d/stargazer.gentoo diff --git a/projects/stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 b/stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 similarity index 100% rename from projects/stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 rename to stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 diff --git a/projects/stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 b/stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 similarity index 100% rename from projects/stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 rename to stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 diff --git a/projects/stargazer/inst/linux/etc/stargazer/OnChange b/stargazer/inst/linux/etc/stargazer/OnChange similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/OnChange rename to stargazer/inst/linux/etc/stargazer/OnChange diff --git a/projects/stargazer/inst/linux/etc/stargazer/OnConnect b/stargazer/inst/linux/etc/stargazer/OnConnect similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/OnConnect rename to stargazer/inst/linux/etc/stargazer/OnConnect diff --git a/projects/stargazer/inst/linux/etc/stargazer/OnDisconnect b/stargazer/inst/linux/etc/stargazer/OnDisconnect similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/OnDisconnect rename to stargazer/inst/linux/etc/stargazer/OnDisconnect diff --git a/projects/stargazer/inst/linux/etc/stargazer/OnUserAdd b/stargazer/inst/linux/etc/stargazer/OnUserAdd similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/OnUserAdd rename to stargazer/inst/linux/etc/stargazer/OnUserAdd diff --git a/projects/stargazer/inst/linux/etc/stargazer/OnUserDel b/stargazer/inst/linux/etc/stargazer/OnUserDel similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/OnUserDel rename to stargazer/inst/linux/etc/stargazer/OnUserDel diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf b/stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf rename to stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf b/stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf rename to stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf diff --git a/projects/stargazer/inst/linux/etc/stargazer/rules b/stargazer/inst/linux/etc/stargazer/rules similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/rules rename to stargazer/inst/linux/etc/stargazer/rules diff --git a/projects/stargazer/inst/linux/etc/stargazer/stargazer.conf b/stargazer/inst/linux/etc/stargazer/stargazer.conf similarity index 100% rename from projects/stargazer/inst/linux/etc/stargazer/stargazer.conf rename to stargazer/inst/linux/etc/stargazer/stargazer.conf diff --git a/projects/stargazer/inst/var/00-alter-01.postgresql.sql b/stargazer/inst/var/00-alter-01.postgresql.sql similarity index 100% rename from projects/stargazer/inst/var/00-alter-01.postgresql.sql rename to stargazer/inst/var/00-alter-01.postgresql.sql diff --git a/projects/stargazer/inst/var/00-alter-01.sql b/stargazer/inst/var/00-alter-01.sql similarity index 100% rename from projects/stargazer/inst/var/00-alter-01.sql rename to stargazer/inst/var/00-alter-01.sql diff --git a/projects/stargazer/inst/var/00-base-00.postgresql.sql b/stargazer/inst/var/00-base-00.postgresql.sql similarity index 100% rename from projects/stargazer/inst/var/00-base-00.postgresql.sql rename to stargazer/inst/var/00-base-00.postgresql.sql diff --git a/projects/stargazer/inst/var/00-base-00.sql b/stargazer/inst/var/00-base-00.sql similarity index 100% rename from projects/stargazer/inst/var/00-base-00.sql rename to stargazer/inst/var/00-base-00.sql diff --git a/projects/stargazer/inst/var/00-mysql-01.sql b/stargazer/inst/var/00-mysql-01.sql similarity index 100% rename from projects/stargazer/inst/var/00-mysql-01.sql rename to stargazer/inst/var/00-mysql-01.sql diff --git a/projects/stargazer/inst/var/01-alter-02.mysql.sql b/stargazer/inst/var/01-alter-02.mysql.sql similarity index 100% rename from projects/stargazer/inst/var/01-alter-02.mysql.sql rename to stargazer/inst/var/01-alter-02.mysql.sql diff --git a/projects/stargazer/inst/var/01-alter-02.postgresql.sql b/stargazer/inst/var/01-alter-02.postgresql.sql similarity index 100% rename from projects/stargazer/inst/var/01-alter-02.postgresql.sql rename to stargazer/inst/var/01-alter-02.postgresql.sql diff --git a/projects/stargazer/inst/var/01-alter-02.sql b/stargazer/inst/var/01-alter-02.sql similarity index 100% rename from projects/stargazer/inst/var/01-alter-02.sql rename to stargazer/inst/var/01-alter-02.sql diff --git a/projects/stargazer/inst/var/02-alter-03.postgresql.sql b/stargazer/inst/var/02-alter-03.postgresql.sql similarity index 100% rename from projects/stargazer/inst/var/02-alter-03.postgresql.sql rename to stargazer/inst/var/02-alter-03.postgresql.sql diff --git a/projects/stargazer/inst/var/02-alter-03.sql b/stargazer/inst/var/02-alter-03.sql similarity index 100% rename from projects/stargazer/inst/var/02-alter-03.sql rename to stargazer/inst/var/02-alter-03.sql diff --git a/projects/stargazer/inst/var/base.dia b/stargazer/inst/var/base.dia similarity index 100% rename from projects/stargazer/inst/var/base.dia rename to stargazer/inst/var/base.dia diff --git a/projects/stargazer/inst/var/stargazer/admins/admin.adm b/stargazer/inst/var/stargazer/admins/admin.adm similarity index 100% rename from projects/stargazer/inst/var/stargazer/admins/admin.adm rename to stargazer/inst/var/stargazer/admins/admin.adm diff --git a/projects/stargazer/inst/var/stargazer/tariffs/tariff.tf b/stargazer/inst/var/stargazer/tariffs/tariff.tf similarity index 100% rename from projects/stargazer/inst/var/stargazer/tariffs/tariff.tf rename to stargazer/inst/var/stargazer/tariffs/tariff.tf diff --git a/projects/stargazer/inst/var/stargazer/users/test/conf b/stargazer/inst/var/stargazer/users/test/conf similarity index 100% rename from projects/stargazer/inst/var/stargazer/users/test/conf rename to stargazer/inst/var/stargazer/users/test/conf diff --git a/projects/stargazer/inst/var/stargazer/users/test/stat b/stargazer/inst/var/stargazer/users/test/stat similarity index 100% rename from projects/stargazer/inst/var/stargazer/users/test/stat rename to stargazer/inst/var/stargazer/users/test/stat diff --git a/projects/stargazer/main.cpp b/stargazer/main.cpp similarity index 100% rename from projects/stargazer/main.cpp rename to stargazer/main.cpp diff --git a/projects/stargazer/pidfile.cpp b/stargazer/pidfile.cpp similarity index 100% rename from projects/stargazer/pidfile.cpp rename to stargazer/pidfile.cpp diff --git a/projects/stargazer/pidfile.h b/stargazer/pidfile.h similarity index 100% rename from projects/stargazer/pidfile.h rename to stargazer/pidfile.h diff --git a/projects/stargazer/plugin_mgr.cpp b/stargazer/plugin_mgr.cpp similarity index 100% rename from projects/stargazer/plugin_mgr.cpp rename to stargazer/plugin_mgr.cpp diff --git a/projects/stargazer/plugin_mgr.h b/stargazer/plugin_mgr.h similarity index 100% rename from projects/stargazer/plugin_mgr.h rename to stargazer/plugin_mgr.h diff --git a/projects/stargazer/plugin_runner.cpp b/stargazer/plugin_runner.cpp similarity index 100% rename from projects/stargazer/plugin_runner.cpp rename to stargazer/plugin_runner.cpp diff --git a/projects/stargazer/plugin_runner.h b/stargazer/plugin_runner.h similarity index 99% rename from projects/stargazer/plugin_runner.h rename to stargazer/plugin_runner.h index a30b6940..1d6ac8f2 100644 --- a/projects/stargazer/plugin_runner.h +++ b/stargazer/plugin_runner.h @@ -24,10 +24,10 @@ #include "stg/plugin.h" #include "stg/module_settings.h" -#include "stg/os_int.h" #include #include +#include class SETTINGS; class ADMINS; diff --git a/stargazer/plugins/CMakeLists.txt b/stargazer/plugins/CMakeLists.txt new file mode 100644 index 00000000..a680df6f --- /dev/null +++ b/stargazer/plugins/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory ( authorization ) +add_subdirectory ( capture ) +add_subdirectory ( configuration ) +add_subdirectory ( other ) +add_subdirectory ( store ) diff --git a/projects/stargazer/plugins/Makefile b/stargazer/plugins/Makefile similarity index 100% rename from projects/stargazer/plugins/Makefile rename to stargazer/plugins/Makefile diff --git a/projects/stargazer/plugins/Makefile.in b/stargazer/plugins/Makefile.in similarity index 100% rename from projects/stargazer/plugins/Makefile.in rename to stargazer/plugins/Makefile.in diff --git a/stargazer/plugins/authorization/CMakeLists.txt b/stargazer/plugins/authorization/CMakeLists.txt new file mode 100644 index 00000000..b94841a3 --- /dev/null +++ b/stargazer/plugins/authorization/CMakeLists.txt @@ -0,0 +1,7 @@ +if ( BUILD_MOD_AO ) + add_subdirectory ( ao ) +endif ( BUILD_MOD_AO ) + +if ( BUILD_MOD_IA ) + add_subdirectory ( inetaccess ) +endif ( BUILD_MOD_IA ) diff --git a/stargazer/plugins/authorization/ao/CMakeLists.txt b/stargazer/plugins/authorization/ao/CMakeLists.txt new file mode 100644 index 00000000..9acccf14 --- /dev/null +++ b/stargazer/plugins/authorization/ao/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES ao.cpp ) + +add_library ( mod_auth_ao MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_auth_ao scriptexecuter logger common ) diff --git a/projects/stargazer/plugins/authorization/ao/Makefile b/stargazer/plugins/authorization/ao/Makefile similarity index 100% rename from projects/stargazer/plugins/authorization/ao/Makefile rename to stargazer/plugins/authorization/ao/Makefile diff --git a/projects/stargazer/plugins/authorization/ao/ao.cpp b/stargazer/plugins/authorization/ao/ao.cpp similarity index 100% rename from projects/stargazer/plugins/authorization/ao/ao.cpp rename to stargazer/plugins/authorization/ao/ao.cpp diff --git a/projects/stargazer/plugins/authorization/ao/ao.h b/stargazer/plugins/authorization/ao/ao.h similarity index 100% rename from projects/stargazer/plugins/authorization/ao/ao.h rename to stargazer/plugins/authorization/ao/ao.h diff --git a/stargazer/plugins/authorization/inetaccess/CMakeLists.txt b/stargazer/plugins/authorization/inetaccess/CMakeLists.txt new file mode 100644 index 00000000..8b25baf6 --- /dev/null +++ b/stargazer/plugins/authorization/inetaccess/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES inetaccess.cpp ) + +add_library ( mod_auth_ia MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_auth_ia scriptexecuter crypto logger common ) diff --git a/projects/stargazer/plugins/authorization/inetaccess/Makefile b/stargazer/plugins/authorization/inetaccess/Makefile similarity index 100% rename from projects/stargazer/plugins/authorization/inetaccess/Makefile rename to stargazer/plugins/authorization/inetaccess/Makefile diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp b/stargazer/plugins/authorization/inetaccess/inetaccess.cpp similarity index 100% rename from projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp rename to stargazer/plugins/authorization/inetaccess/inetaccess.cpp diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h b/stargazer/plugins/authorization/inetaccess/inetaccess.h similarity index 99% rename from projects/stargazer/plugins/authorization/inetaccess/inetaccess.h rename to stargazer/plugins/authorization/inetaccess/inetaccess.h index fb851f52..73c435ae 100644 --- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.h +++ b/stargazer/plugins/authorization/inetaccess/inetaccess.h @@ -27,7 +27,6 @@ #ifndef INETACCESS_H #define INETACCESS_H -#include "stg/os_int.h" #include "stg/auth.h" #include "stg/store.h" #include "stg/notifer.h" @@ -42,6 +41,7 @@ #include #include +#include #include #include #include diff --git a/stargazer/plugins/capture/CMakeLists.txt b/stargazer/plugins/capture/CMakeLists.txt new file mode 100644 index 00000000..95e09d1c --- /dev/null +++ b/stargazer/plugins/capture/CMakeLists.txt @@ -0,0 +1,23 @@ +if ( BUILD_MOD_CAP_NF ) + add_subdirectory ( cap_nf ) +endif ( BUILD_MOD_CAP_NF ) + +if ( BUILD_MOD_CAP_ETHER_LINUX ) + add_subdirectory ( ether_linux ) +endif ( BUILD_MOD_CAP_ETHER_LINUX ) + +if ( BUILD_MOD_CAP_ETHER_FREEBSD ) + add_subdirectory ( ether_freebsd ) +endif ( BUILD_MOD_CAP_ETHER_FREEBSD ) + +if ( BUILD_MOD_CAP_DIVERT ) + add_subdirectory ( divert_freebsd ) +endif ( BUILD_MOD_CAP_DIVERT ) + +if ( BUILD_MOD_CAP_PCAP ) + add_subdirectory ( pcap ) +endif ( BUILD_MOD_CAP_PCAP ) + +if ( BUILD_MOD_CAP_NFQUEUE ) + add_subdirectory ( nfqueue ) +endif ( BUILD_MOD_CAP_NFQUEUE ) diff --git a/stargazer/plugins/capture/cap_nf/CMakeLists.txt b/stargazer/plugins/capture/cap_nf/CMakeLists.txt new file mode 100644 index 00000000..463b2ce0 --- /dev/null +++ b/stargazer/plugins/capture/cap_nf/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES cap_nf.cpp ) + +add_library ( mod_cap_nf MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_nf logger common ) diff --git a/projects/stargazer/plugins/capture/cap_nf/Makefile b/stargazer/plugins/capture/cap_nf/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/cap_nf/Makefile rename to stargazer/plugins/capture/cap_nf/Makefile diff --git a/projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp b/stargazer/plugins/capture/cap_nf/cap_nf.cpp similarity index 100% rename from projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp rename to stargazer/plugins/capture/cap_nf/cap_nf.cpp diff --git a/projects/stargazer/plugins/capture/cap_nf/cap_nf.h b/stargazer/plugins/capture/cap_nf/cap_nf.h similarity index 99% rename from projects/stargazer/plugins/capture/cap_nf/cap_nf.h rename to stargazer/plugins/capture/cap_nf/cap_nf.h index 7d24403b..bfcc5929 100644 --- a/projects/stargazer/plugins/capture/cap_nf/cap_nf.h +++ b/stargazer/plugins/capture/cap_nf/cap_nf.h @@ -33,8 +33,8 @@ $Author: faust $ #include #include +#include -#include "stg/os_int.h" #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/logger.h" diff --git a/stargazer/plugins/capture/divert_freebsd/CMakeLists.txt b/stargazer/plugins/capture/divert_freebsd/CMakeLists.txt new file mode 100644 index 00000000..5a09143c --- /dev/null +++ b/stargazer/plugins/capture/divert_freebsd/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES divert_cap.cpp ) + +add_library ( mod_cap_divert MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_divert logger common ) diff --git a/projects/stargazer/plugins/capture/divert_freebsd/Makefile b/stargazer/plugins/capture/divert_freebsd/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/divert_freebsd/Makefile rename to stargazer/plugins/capture/divert_freebsd/Makefile diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp b/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp similarity index 100% rename from projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp rename to stargazer/plugins/capture/divert_freebsd/divert_cap.cpp diff --git a/projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h b/stargazer/plugins/capture/divert_freebsd/divert_cap.h similarity index 100% rename from projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h rename to stargazer/plugins/capture/divert_freebsd/divert_cap.h diff --git a/stargazer/plugins/capture/ether_freebsd/CMakeLists.txt b/stargazer/plugins/capture/ether_freebsd/CMakeLists.txt new file mode 100644 index 00000000..d8b1f7d5 --- /dev/null +++ b/stargazer/plugins/capture/ether_freebsd/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES ether_cap.cpp ) + +add_library ( mod_cap_bpf MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_bpf logger common ) diff --git a/projects/stargazer/plugins/capture/ether_freebsd/Makefile b/stargazer/plugins/capture/ether_freebsd/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/ether_freebsd/Makefile rename to stargazer/plugins/capture/ether_freebsd/Makefile diff --git a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp b/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp similarity index 100% rename from projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp rename to stargazer/plugins/capture/ether_freebsd/ether_cap.cpp diff --git a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h b/stargazer/plugins/capture/ether_freebsd/ether_cap.h similarity index 99% rename from projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h rename to stargazer/plugins/capture/ether_freebsd/ether_cap.h index b9150b8d..29ad8419 100644 --- a/projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h +++ b/stargazer/plugins/capture/ether_freebsd/ether_cap.h @@ -31,8 +31,8 @@ #include #include +#include -#include "stg/os_int.h" #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/logger.h" diff --git a/stargazer/plugins/capture/ether_linux/CMakeLists.txt b/stargazer/plugins/capture/ether_linux/CMakeLists.txt new file mode 100644 index 00000000..4b1bfef4 --- /dev/null +++ b/stargazer/plugins/capture/ether_linux/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES ether_cap.cpp ) + +add_library ( mod_cap_ether MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_ether logger common ) diff --git a/projects/stargazer/plugins/capture/ether_linux/Makefile b/stargazer/plugins/capture/ether_linux/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/ether_linux/Makefile rename to stargazer/plugins/capture/ether_linux/Makefile diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp b/stargazer/plugins/capture/ether_linux/ether_cap.cpp similarity index 100% rename from projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp rename to stargazer/plugins/capture/ether_linux/ether_cap.cpp diff --git a/projects/stargazer/plugins/capture/ether_linux/ether_cap.h b/stargazer/plugins/capture/ether_linux/ether_cap.h similarity index 100% rename from projects/stargazer/plugins/capture/ether_linux/ether_cap.h rename to stargazer/plugins/capture/ether_linux/ether_cap.h diff --git a/stargazer/plugins/capture/nfqueue/CMakeLists.txt b/stargazer/plugins/capture/nfqueue/CMakeLists.txt new file mode 100644 index 00000000..a6be1f34 --- /dev/null +++ b/stargazer/plugins/capture/nfqueue/CMakeLists.txt @@ -0,0 +1,9 @@ +find_package ( NFQueue REQUIRED ) +find_package ( NFNetLink REQUIRED ) +find_package ( MNL REQUIRED ) + +set ( CPP_FILES nfqueue.cpp ) + +add_library ( mod_cap_nfqueue MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_nfqueue logger common NF::Queue NF::NetLink MNL::MNL ) diff --git a/projects/stargazer/plugins/capture/nfqueue/Makefile b/stargazer/plugins/capture/nfqueue/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/nfqueue/Makefile rename to stargazer/plugins/capture/nfqueue/Makefile diff --git a/projects/stargazer/plugins/capture/nfqueue/nfqueue.cpp b/stargazer/plugins/capture/nfqueue/nfqueue.cpp similarity index 100% rename from projects/stargazer/plugins/capture/nfqueue/nfqueue.cpp rename to stargazer/plugins/capture/nfqueue/nfqueue.cpp diff --git a/projects/stargazer/plugins/capture/nfqueue/nfqueue.h b/stargazer/plugins/capture/nfqueue/nfqueue.h similarity index 100% rename from projects/stargazer/plugins/capture/nfqueue/nfqueue.h rename to stargazer/plugins/capture/nfqueue/nfqueue.h diff --git a/stargazer/plugins/capture/pcap/CMakeLists.txt b/stargazer/plugins/capture/pcap/CMakeLists.txt new file mode 100644 index 00000000..3d9eb01a --- /dev/null +++ b/stargazer/plugins/capture/pcap/CMakeLists.txt @@ -0,0 +1,7 @@ +find_package ( PCap REQUIRED ) + +set ( CPP_FILES pcap_cap.cpp ) + +add_library ( mod_cap_pcap MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_cap_pcap logger common PCap::PCap ) diff --git a/projects/stargazer/plugins/capture/pcap/Makefile b/stargazer/plugins/capture/pcap/Makefile similarity index 100% rename from projects/stargazer/plugins/capture/pcap/Makefile rename to stargazer/plugins/capture/pcap/Makefile diff --git a/projects/stargazer/plugins/capture/pcap/pcap_cap.cpp b/stargazer/plugins/capture/pcap/pcap_cap.cpp similarity index 100% rename from projects/stargazer/plugins/capture/pcap/pcap_cap.cpp rename to stargazer/plugins/capture/pcap/pcap_cap.cpp diff --git a/projects/stargazer/plugins/capture/pcap/pcap_cap.h b/stargazer/plugins/capture/pcap/pcap_cap.h similarity index 100% rename from projects/stargazer/plugins/capture/pcap/pcap_cap.h rename to stargazer/plugins/capture/pcap/pcap_cap.h diff --git a/stargazer/plugins/configuration/CMakeLists.txt b/stargazer/plugins/configuration/CMakeLists.txt new file mode 100644 index 00000000..a00ff38e --- /dev/null +++ b/stargazer/plugins/configuration/CMakeLists.txt @@ -0,0 +1,7 @@ +if ( BUILD_MOD_SGCONFIG ) + add_subdirectory ( sgconfig ) +endif ( BUILD_MOD_SGCONFIG ) + +if ( BUILD_MOD_RPCCONFIG ) + add_subdirectory ( rpcconfig ) +endif ( BUILD_MOD_RPCCONFIG ) diff --git a/stargazer/plugins/configuration/rpcconfig/CMakeLists.txt b/stargazer/plugins/configuration/rpcconfig/CMakeLists.txt new file mode 100644 index 00000000..49d572a6 --- /dev/null +++ b/stargazer/plugins/configuration/rpcconfig/CMakeLists.txt @@ -0,0 +1,14 @@ +find_package ( XMLRPC REQUIRED c++ abyss-server ) + +set ( CPP_FILES rpcconfig.cpp + user_helper.cpp + tariff_helper.cpp + info_methods.cpp + users_methods.cpp + tariffs_methods.cpp + admins_methods.cpp + messages_methods.cpp ) + +add_library ( mod_conf_rpc MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_conf_rpc scriptexecuter logger common xmlrpc_server_abyss++ ) diff --git a/projects/stargazer/plugins/configuration/rpcconfig/Makefile b/stargazer/plugins/configuration/rpcconfig/Makefile similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/Makefile rename to stargazer/plugins/configuration/rpcconfig/Makefile diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp b/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp rename to stargazer/plugins/configuration/rpcconfig/admins_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h b/stargazer/plugins/configuration/rpcconfig/admins_methods.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h rename to stargazer/plugins/configuration/rpcconfig/admins_methods.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp b/stargazer/plugins/configuration/rpcconfig/info_methods.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp rename to stargazer/plugins/configuration/rpcconfig/info_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/info_methods.h b/stargazer/plugins/configuration/rpcconfig/info_methods.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/info_methods.h rename to stargazer/plugins/configuration/rpcconfig/info_methods.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp b/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp rename to stargazer/plugins/configuration/rpcconfig/messages_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h b/stargazer/plugins/configuration/rpcconfig/messages_methods.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h rename to stargazer/plugins/configuration/rpcconfig/messages_methods.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp b/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp rename to stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h b/stargazer/plugins/configuration/rpcconfig/rpcconfig.h similarity index 99% rename from projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h rename to stargazer/plugins/configuration/rpcconfig/rpcconfig.h index ce295818..e45ed4f1 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h +++ b/stargazer/plugins/configuration/rpcconfig/rpcconfig.h @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -12,7 +13,6 @@ #include #include -#include "stg/os_int.h" #include "stg/plugin.h" #include "stg/admin_conf.h" #include "stg/module_settings.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp b/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp rename to stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h b/stargazer/plugins/configuration/rpcconfig/tariff_helper.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h rename to stargazer/plugins/configuration/rpcconfig/tariff_helper.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp b/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp rename to stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h b/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h rename to stargazer/plugins/configuration/rpcconfig/tariffs_methods.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp b/stargazer/plugins/configuration/rpcconfig/user_helper.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp rename to stargazer/plugins/configuration/rpcconfig/user_helper.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/user_helper.h b/stargazer/plugins/configuration/rpcconfig/user_helper.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/user_helper.h rename to stargazer/plugins/configuration/rpcconfig/user_helper.h diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp b/stargazer/plugins/configuration/rpcconfig/users_methods.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp rename to stargazer/plugins/configuration/rpcconfig/users_methods.cpp diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h b/stargazer/plugins/configuration/rpcconfig/users_methods.h similarity index 100% rename from projects/stargazer/plugins/configuration/rpcconfig/users_methods.h rename to stargazer/plugins/configuration/rpcconfig/users_methods.h diff --git a/stargazer/plugins/configuration/sgconfig/CMakeLists.txt b/stargazer/plugins/configuration/sgconfig/CMakeLists.txt new file mode 100644 index 00000000..6d50596a --- /dev/null +++ b/stargazer/plugins/configuration/sgconfig/CMakeLists.txt @@ -0,0 +1,18 @@ +find_package ( EXPAT REQUIRED ) + +set ( CPP_FILES stgconfig.cpp + conn.cpp + configproto.cpp + parser.cpp + parser_tariffs.cpp + parser_admins.cpp + parser_users.cpp + parser_services.cpp + parser_message.cpp + parser_auth_by.cpp + parser_user_info.cpp + parser_server_info.cpp ) + +add_library ( mod_conf_sg MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_conf_sg scriptexecuter crypto logger common EXPAT::EXPAT ) diff --git a/projects/stargazer/plugins/configuration/sgconfig/Makefile b/stargazer/plugins/configuration/sgconfig/Makefile similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/Makefile rename to stargazer/plugins/configuration/sgconfig/Makefile diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.cpp b/stargazer/plugins/configuration/sgconfig/configproto.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/configproto.cpp rename to stargazer/plugins/configuration/sgconfig/configproto.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/configproto.h b/stargazer/plugins/configuration/sgconfig/configproto.h similarity index 99% rename from projects/stargazer/plugins/configuration/sgconfig/configproto.h rename to stargazer/plugins/configuration/sgconfig/configproto.h index 87a5ef79..3695d7c4 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/configproto.h +++ b/stargazer/plugins/configuration/sgconfig/configproto.h @@ -25,10 +25,10 @@ #include "parser.h" #include "stg/module_settings.h" -#include "stg/os_int.h" #include #include +#include #include #include diff --git a/projects/stargazer/plugins/configuration/sgconfig/conn.cpp b/stargazer/plugins/configuration/sgconfig/conn.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/conn.cpp rename to stargazer/plugins/configuration/sgconfig/conn.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/conn.h b/stargazer/plugins/configuration/sgconfig/conn.h similarity index 99% rename from projects/stargazer/plugins/configuration/sgconfig/conn.h rename to stargazer/plugins/configuration/sgconfig/conn.h index ed2e64d1..9f56c4df 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/conn.h +++ b/stargazer/plugins/configuration/sgconfig/conn.h @@ -25,11 +25,11 @@ #include "dumphelpers.h" -#include "stg/os_int.h" #include "stg/const.h" #include #include +#include #include diff --git a/projects/stargazer/plugins/configuration/sgconfig/dumphelpers.h b/stargazer/plugins/configuration/sgconfig/dumphelpers.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/dumphelpers.h rename to stargazer/plugins/configuration/sgconfig/dumphelpers.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser.cpp b/stargazer/plugins/configuration/sgconfig/parser.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser.cpp rename to stargazer/plugins/configuration/sgconfig/parser.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser.h b/stargazer/plugins/configuration/sgconfig/parser.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser.h rename to stargazer/plugins/configuration/sgconfig/parser.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp b/stargazer/plugins/configuration/sgconfig/parser_admins.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp rename to stargazer/plugins/configuration/sgconfig/parser_admins.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.h b/stargazer/plugins/configuration/sgconfig/parser_admins.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_admins.h rename to stargazer/plugins/configuration/sgconfig/parser_admins.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp b/stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp rename to stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h b/stargazer/plugins/configuration/sgconfig/parser_auth_by.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h rename to stargazer/plugins/configuration/sgconfig/parser_auth_by.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp b/stargazer/plugins/configuration/sgconfig/parser_message.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp rename to stargazer/plugins/configuration/sgconfig/parser_message.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_message.h b/stargazer/plugins/configuration/sgconfig/parser_message.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_message.h rename to stargazer/plugins/configuration/sgconfig/parser_message.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_server_info.cpp b/stargazer/plugins/configuration/sgconfig/parser_server_info.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_server_info.cpp rename to stargazer/plugins/configuration/sgconfig/parser_server_info.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_server_info.h b/stargazer/plugins/configuration/sgconfig/parser_server_info.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_server_info.h rename to stargazer/plugins/configuration/sgconfig/parser_server_info.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp b/stargazer/plugins/configuration/sgconfig/parser_services.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp rename to stargazer/plugins/configuration/sgconfig/parser_services.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_services.h b/stargazer/plugins/configuration/sgconfig/parser_services.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_services.h rename to stargazer/plugins/configuration/sgconfig/parser_services.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp b/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp rename to stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h b/stargazer/plugins/configuration/sgconfig/parser_tariffs.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h rename to stargazer/plugins/configuration/sgconfig/parser_tariffs.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp b/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp rename to stargazer/plugins/configuration/sgconfig/parser_user_info.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.h b/stargazer/plugins/configuration/sgconfig/parser_user_info.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_user_info.h rename to stargazer/plugins/configuration/sgconfig/parser_user_info.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp b/stargazer/plugins/configuration/sgconfig/parser_users.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp rename to stargazer/plugins/configuration/sgconfig/parser_users.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_users.h b/stargazer/plugins/configuration/sgconfig/parser_users.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/parser_users.h rename to stargazer/plugins/configuration/sgconfig/parser_users.h diff --git a/projects/stargazer/plugins/configuration/sgconfig/stgconfig.cpp b/stargazer/plugins/configuration/sgconfig/stgconfig.cpp similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/stgconfig.cpp rename to stargazer/plugins/configuration/sgconfig/stgconfig.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/stgconfig.h b/stargazer/plugins/configuration/sgconfig/stgconfig.h similarity index 100% rename from projects/stargazer/plugins/configuration/sgconfig/stgconfig.h rename to stargazer/plugins/configuration/sgconfig/stgconfig.h diff --git a/stargazer/plugins/other/CMakeLists.txt b/stargazer/plugins/other/CMakeLists.txt new file mode 100644 index 00000000..60f942f2 --- /dev/null +++ b/stargazer/plugins/other/CMakeLists.txt @@ -0,0 +1,15 @@ +if ( BUILD_MOD_PING ) + add_subdirectory ( ping ) +endif ( BUILD_MOD_PING ) + +if ( BUILD_MOD_RADIUS ) + add_subdirectory ( radius ) +endif ( BUILD_MOD_RADIUS ) + +if ( BUILD_MOD_RSCRYPT ) + add_subdirectory ( rscript ) +endif ( BUILD_MOD_RSCRYPT ) + +if ( BUILD_MOD_SMUX ) + add_subdirectory ( smux ) +endif ( BUILD_MOD_SMUX ) diff --git a/stargazer/plugins/other/ping/CMakeLists.txt b/stargazer/plugins/other/ping/CMakeLists.txt new file mode 100644 index 00000000..386b2efb --- /dev/null +++ b/stargazer/plugins/other/ping/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES ping.cpp ) + +add_library ( mod_ping MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_ping scriptexecuter logger pinger common ) diff --git a/projects/stargazer/plugins/other/ping/Makefile b/stargazer/plugins/other/ping/Makefile similarity index 100% rename from projects/stargazer/plugins/other/ping/Makefile rename to stargazer/plugins/other/ping/Makefile diff --git a/projects/stargazer/plugins/other/ping/ping.cpp b/stargazer/plugins/other/ping/ping.cpp similarity index 100% rename from projects/stargazer/plugins/other/ping/ping.cpp rename to stargazer/plugins/other/ping/ping.cpp diff --git a/projects/stargazer/plugins/other/ping/ping.h b/stargazer/plugins/other/ping/ping.h similarity index 99% rename from projects/stargazer/plugins/other/ping/ping.h rename to stargazer/plugins/other/ping/ping.h index 8b58e7ee..877d887a 100644 --- a/projects/stargazer/plugins/other/ping/ping.h +++ b/stargazer/plugins/other/ping/ping.h @@ -7,7 +7,6 @@ #ifndef PING_H #define PING_H -#include "stg/os_int.h" #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/notifer.h" @@ -18,6 +17,7 @@ #include #include +#include #include diff --git a/stargazer/plugins/other/radius/CMakeLists.txt b/stargazer/plugins/other/radius/CMakeLists.txt new file mode 100644 index 00000000..4f6deb26 --- /dev/null +++ b/stargazer/plugins/other/radius/CMakeLists.txt @@ -0,0 +1,9 @@ +find_package ( YAJL REQUIRED ) + +set ( CPP_FILES radius.cpp + config.cpp + conn.cpp ) + +add_library ( mod_radius MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_radius logger json common YAJL::YAJL ) diff --git a/projects/stargazer/plugins/other/radius/Makefile b/stargazer/plugins/other/radius/Makefile similarity index 100% rename from projects/stargazer/plugins/other/radius/Makefile rename to stargazer/plugins/other/radius/Makefile diff --git a/projects/stargazer/plugins/other/radius/config.cpp b/stargazer/plugins/other/radius/config.cpp similarity index 100% rename from projects/stargazer/plugins/other/radius/config.cpp rename to stargazer/plugins/other/radius/config.cpp diff --git a/projects/stargazer/plugins/other/radius/config.h b/stargazer/plugins/other/radius/config.h similarity index 99% rename from projects/stargazer/plugins/other/radius/config.h rename to stargazer/plugins/other/radius/config.h index 44d5ed85..0e6547a1 100644 --- a/projects/stargazer/plugins/other/radius/config.h +++ b/stargazer/plugins/other/radius/config.h @@ -23,10 +23,9 @@ #include "stg/module_settings.h" -#include "stg/os_int.h" - #include #include +#include #include // uid_t, gid_t #include // mode_t diff --git a/projects/stargazer/plugins/other/radius/conn.cpp b/stargazer/plugins/other/radius/conn.cpp similarity index 100% rename from projects/stargazer/plugins/other/radius/conn.cpp rename to stargazer/plugins/other/radius/conn.cpp diff --git a/projects/stargazer/plugins/other/radius/conn.h b/stargazer/plugins/other/radius/conn.h similarity index 100% rename from projects/stargazer/plugins/other/radius/conn.h rename to stargazer/plugins/other/radius/conn.h diff --git a/projects/stargazer/plugins/other/radius/radius.cpp b/stargazer/plugins/other/radius/radius.cpp similarity index 100% rename from projects/stargazer/plugins/other/radius/radius.cpp rename to stargazer/plugins/other/radius/radius.cpp diff --git a/projects/stargazer/plugins/other/radius/radius.h b/stargazer/plugins/other/radius/radius.h similarity index 99% rename from projects/stargazer/plugins/other/radius/radius.h rename to stargazer/plugins/other/radius/radius.h index 52da138e..6670b907 100644 --- a/projects/stargazer/plugins/other/radius/radius.h +++ b/stargazer/plugins/other/radius/radius.h @@ -21,7 +21,6 @@ #ifndef __STG_RADIUS_H__ #define __STG_RADIUS_H__ -#include "stg/os_int.h" #include "stg/auth.h" #include "stg/module_settings.h" #include "stg/logger.h" @@ -32,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/stargazer/plugins/other/rscript/CMakeLists.txt b/stargazer/plugins/other/rscript/CMakeLists.txt new file mode 100644 index 00000000..14467f05 --- /dev/null +++ b/stargazer/plugins/other/rscript/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES rscript.cpp nrmap_parser.cpp ) + +add_library ( mod_remote_script MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_remote_script crypto scriptexecuter logger common ) diff --git a/projects/stargazer/plugins/other/rscript/Makefile b/stargazer/plugins/other/rscript/Makefile similarity index 100% rename from projects/stargazer/plugins/other/rscript/Makefile rename to stargazer/plugins/other/rscript/Makefile diff --git a/projects/stargazer/plugins/other/rscript/nrmap_parser.cpp b/stargazer/plugins/other/rscript/nrmap_parser.cpp similarity index 100% rename from projects/stargazer/plugins/other/rscript/nrmap_parser.cpp rename to stargazer/plugins/other/rscript/nrmap_parser.cpp diff --git a/projects/stargazer/plugins/other/rscript/nrmap_parser.h b/stargazer/plugins/other/rscript/nrmap_parser.h similarity index 98% rename from projects/stargazer/plugins/other/rscript/nrmap_parser.h rename to stargazer/plugins/other/rscript/nrmap_parser.h index 240ce349..82e7edb7 100644 --- a/projects/stargazer/plugins/other/rscript/nrmap_parser.h +++ b/stargazer/plugins/other/rscript/nrmap_parser.h @@ -29,8 +29,7 @@ #include #include - -#include "stg/os_int.h" +#include struct NET_ROUTER { diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/stargazer/plugins/other/rscript/rscript.cpp similarity index 100% rename from projects/stargazer/plugins/other/rscript/rscript.cpp rename to stargazer/plugins/other/rscript/rscript.cpp diff --git a/projects/stargazer/plugins/other/rscript/rscript.h b/stargazer/plugins/other/rscript/rscript.h similarity index 99% rename from projects/stargazer/plugins/other/rscript/rscript.h rename to stargazer/plugins/other/rscript/rscript.h index 4fb0ac73..03159ab8 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.h +++ b/stargazer/plugins/other/rscript/rscript.h @@ -24,7 +24,6 @@ #include "stg/plugin.h" #include "stg/module_settings.h" -#include "stg/os_int.h" #include "stg/notifer.h" #include "stg/user.h" #include "stg/blowfish.h" @@ -38,6 +37,7 @@ #include #include #include +#include #include diff --git a/projects/stargazer/plugins/other/rscript/send_functor.h b/stargazer/plugins/other/rscript/send_functor.h similarity index 98% rename from projects/stargazer/plugins/other/rscript/send_functor.h rename to stargazer/plugins/other/rscript/send_functor.h index dc8ad63a..fbe6d3b3 100644 --- a/projects/stargazer/plugins/other/rscript/send_functor.h +++ b/stargazer/plugins/other/rscript/send_functor.h @@ -27,9 +27,8 @@ #ifndef __SEND_FUNCTOR_H__ #define __SEND_FUNCTOR_H__ -#include "stg/os_int.h" - #include +#include #include #include diff --git a/projects/stargazer/plugins/other/rscript/ur_functor.h b/stargazer/plugins/other/rscript/ur_functor.h similarity index 99% rename from projects/stargazer/plugins/other/rscript/ur_functor.h rename to stargazer/plugins/other/rscript/ur_functor.h index 9ecf2bc5..95b03ea2 100644 --- a/projects/stargazer/plugins/other/rscript/ur_functor.h +++ b/stargazer/plugins/other/rscript/ur_functor.h @@ -23,12 +23,12 @@ #include "rscript.h" -#include "stg/os_int.h" #include "stg/common.h" #include #include #include +#include namespace RS { diff --git a/stargazer/plugins/other/smux/CMakeLists.txt b/stargazer/plugins/other/smux/CMakeLists.txt new file mode 100644 index 00000000..2888d384 --- /dev/null +++ b/stargazer/plugins/other/smux/CMakeLists.txt @@ -0,0 +1,10 @@ +set ( CPP_FILES smux.cpp + sensors.cpp + tables.cpp + handlers.cpp + utils.cpp + types.cpp ) + +add_library ( mod_smux MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_smux scriptexecuter logger smux common ) diff --git a/projects/stargazer/plugins/other/smux/Makefile b/stargazer/plugins/other/smux/Makefile similarity index 100% rename from projects/stargazer/plugins/other/smux/Makefile rename to stargazer/plugins/other/smux/Makefile diff --git a/projects/stargazer/plugins/other/smux/STG-MIB.mib b/stargazer/plugins/other/smux/STG-MIB.mib similarity index 100% rename from projects/stargazer/plugins/other/smux/STG-MIB.mib rename to stargazer/plugins/other/smux/STG-MIB.mib diff --git a/projects/stargazer/plugins/other/smux/TODO b/stargazer/plugins/other/smux/TODO similarity index 100% rename from projects/stargazer/plugins/other/smux/TODO rename to stargazer/plugins/other/smux/TODO diff --git a/projects/stargazer/plugins/other/smux/handlers.cpp b/stargazer/plugins/other/smux/handlers.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/handlers.cpp rename to stargazer/plugins/other/smux/handlers.cpp diff --git a/projects/stargazer/plugins/other/smux/pen.h b/stargazer/plugins/other/smux/pen.h similarity index 100% rename from projects/stargazer/plugins/other/smux/pen.h rename to stargazer/plugins/other/smux/pen.h diff --git a/projects/stargazer/plugins/other/smux/sensors.cpp b/stargazer/plugins/other/smux/sensors.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/sensors.cpp rename to stargazer/plugins/other/smux/sensors.cpp diff --git a/projects/stargazer/plugins/other/smux/sensors.h b/stargazer/plugins/other/smux/sensors.h similarity index 100% rename from projects/stargazer/plugins/other/smux/sensors.h rename to stargazer/plugins/other/smux/sensors.h diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/stargazer/plugins/other/smux/smux.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/smux.cpp rename to stargazer/plugins/other/smux/smux.cpp diff --git a/projects/stargazer/plugins/other/smux/smux.h b/stargazer/plugins/other/smux/smux.h similarity index 99% rename from projects/stargazer/plugins/other/smux/smux.h rename to stargazer/plugins/other/smux/smux.h index 721f0204..c4a9aa60 100644 --- a/projects/stargazer/plugins/other/smux/smux.h +++ b/stargazer/plugins/other/smux/smux.h @@ -6,11 +6,11 @@ #include #include #include +#include #include "stg/SMUX-PDUs.h" #include "stg/ObjectSyntax.h" -#include "stg/os_int.h" #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/notifer.h" diff --git a/projects/stargazer/plugins/other/smux/tables.cpp b/stargazer/plugins/other/smux/tables.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/tables.cpp rename to stargazer/plugins/other/smux/tables.cpp diff --git a/projects/stargazer/plugins/other/smux/tables.h b/stargazer/plugins/other/smux/tables.h similarity index 100% rename from projects/stargazer/plugins/other/smux/tables.h rename to stargazer/plugins/other/smux/tables.h diff --git a/projects/stargazer/plugins/other/smux/types.cpp b/stargazer/plugins/other/smux/types.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/types.cpp rename to stargazer/plugins/other/smux/types.cpp diff --git a/projects/stargazer/plugins/other/smux/types.h b/stargazer/plugins/other/smux/types.h similarity index 100% rename from projects/stargazer/plugins/other/smux/types.h rename to stargazer/plugins/other/smux/types.h diff --git a/projects/stargazer/plugins/other/smux/utils.cpp b/stargazer/plugins/other/smux/utils.cpp similarity index 100% rename from projects/stargazer/plugins/other/smux/utils.cpp rename to stargazer/plugins/other/smux/utils.cpp diff --git a/projects/stargazer/plugins/other/smux/utils.h b/stargazer/plugins/other/smux/utils.h similarity index 100% rename from projects/stargazer/plugins/other/smux/utils.h rename to stargazer/plugins/other/smux/utils.h diff --git a/projects/stargazer/plugins/other/smux/value2os.h b/stargazer/plugins/other/smux/value2os.h similarity index 100% rename from projects/stargazer/plugins/other/smux/value2os.h rename to stargazer/plugins/other/smux/value2os.h diff --git a/stargazer/plugins/store/CMakeLists.txt b/stargazer/plugins/store/CMakeLists.txt new file mode 100644 index 00000000..1ae96168 --- /dev/null +++ b/stargazer/plugins/store/CMakeLists.txt @@ -0,0 +1,15 @@ +if ( BUILD_MOD_STORE_FILES ) + add_subdirectory ( files ) +endif ( BUILD_MOD_STORE_FILES ) + +if ( BUILD_MOD_STORE_FIREBIRD ) + add_subdirectory ( firebird ) +endif ( BUILD_MOD_STORE_FIREBIRD ) + +if ( BUILD_MOD_STORE_MYSQL ) + add_subdirectory ( mysql ) +endif ( BUILD_MOD_STORE_MYSQL ) + +if ( BUILD_MOD_STORE_POSTGRESQL ) + add_subdirectory ( postgresql ) +endif ( BUILD_MOD_STORE_POSTGRESQL ) diff --git a/stargazer/plugins/store/files/CMakeLists.txt b/stargazer/plugins/store/files/CMakeLists.txt new file mode 100644 index 00000000..9f1e8254 --- /dev/null +++ b/stargazer/plugins/store/files/CMakeLists.txt @@ -0,0 +1,5 @@ +set ( CPP_FILES file_store.cpp ) + +add_library ( mod_store_files MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_store_files crypto conffiles logger common ) diff --git a/projects/stargazer/plugins/store/files/Makefile b/stargazer/plugins/store/files/Makefile similarity index 100% rename from projects/stargazer/plugins/store/files/Makefile rename to stargazer/plugins/store/files/Makefile diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/stargazer/plugins/store/files/file_store.cpp similarity index 100% rename from projects/stargazer/plugins/store/files/file_store.cpp rename to stargazer/plugins/store/files/file_store.cpp diff --git a/projects/stargazer/plugins/store/files/file_store.h b/stargazer/plugins/store/files/file_store.h similarity index 100% rename from projects/stargazer/plugins/store/files/file_store.h rename to stargazer/plugins/store/files/file_store.h diff --git a/stargazer/plugins/store/firebird/CMakeLists.txt b/stargazer/plugins/store/firebird/CMakeLists.txt new file mode 100644 index 00000000..d21f79a4 --- /dev/null +++ b/stargazer/plugins/store/firebird/CMakeLists.txt @@ -0,0 +1,14 @@ +find_package ( FBClient REQUIRED ) + +set ( CPP_FILES firebird_store.cpp + firebird_store_admins.cpp + firebird_store_corporations.cpp + firebird_store_messages.cpp + firebird_store_services.cpp + firebird_store_tariffs.cpp + firebird_store_users.cpp + firebird_store_utils.cpp ) + +add_library ( mod_store_firebird MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_store_firebird crypto common logger ibpp FBClient::FBClient ) diff --git a/projects/stargazer/plugins/store/firebird/Makefile b/stargazer/plugins/store/firebird/Makefile similarity index 100% rename from projects/stargazer/plugins/store/firebird/Makefile rename to stargazer/plugins/store/firebird/Makefile diff --git a/projects/stargazer/plugins/store/firebird/firebird_store.cpp b/stargazer/plugins/store/firebird/firebird_store.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store.cpp rename to stargazer/plugins/store/firebird/firebird_store.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store.h b/stargazer/plugins/store/firebird/firebird_store.h similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store.h rename to stargazer/plugins/store/firebird/firebird_store.h diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp b/stargazer/plugins/store/firebird/firebird_store_admins.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp rename to stargazer/plugins/store/firebird/firebird_store_admins.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp b/stargazer/plugins/store/firebird/firebird_store_corporations.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp rename to stargazer/plugins/store/firebird/firebird_store_corporations.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp b/stargazer/plugins/store/firebird/firebird_store_messages.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp rename to stargazer/plugins/store/firebird/firebird_store_messages.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_services.cpp b/stargazer/plugins/store/firebird/firebird_store_services.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_services.cpp rename to stargazer/plugins/store/firebird/firebird_store_services.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp b/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp rename to stargazer/plugins/store/firebird/firebird_store_tariffs.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_users.cpp b/stargazer/plugins/store/firebird/firebird_store_users.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_users.cpp rename to stargazer/plugins/store/firebird/firebird_store_users.cpp diff --git a/projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp b/stargazer/plugins/store/firebird/firebird_store_utils.cpp similarity index 100% rename from projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp rename to stargazer/plugins/store/firebird/firebird_store_utils.cpp diff --git a/stargazer/plugins/store/mysql/CMakeLists.txt b/stargazer/plugins/store/mysql/CMakeLists.txt new file mode 100644 index 00000000..9a56ef4d --- /dev/null +++ b/stargazer/plugins/store/mysql/CMakeLists.txt @@ -0,0 +1,7 @@ +find_package ( MySQLConnector REQUIRED ) + +set ( CPP_FILES mysql_store.cpp ) + +add_library ( mod_store_mysql MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_store_mysql crypto logger common MySQL::Connector ) diff --git a/projects/stargazer/plugins/store/mysql/Makefile b/stargazer/plugins/store/mysql/Makefile similarity index 100% rename from projects/stargazer/plugins/store/mysql/Makefile rename to stargazer/plugins/store/mysql/Makefile diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.cpp b/stargazer/plugins/store/mysql/mysql_store.cpp similarity index 99% rename from projects/stargazer/plugins/store/mysql/mysql_store.cpp rename to stargazer/plugins/store/mysql/mysql_store.cpp index 8108de09..adb3b895 100644 --- a/projects/stargazer/plugins/store/mysql/mysql_store.cpp +++ b/stargazer/plugins/store/mysql/mysql_store.cpp @@ -4,8 +4,7 @@ #include #include -#include -#include +#include #include "stg/common.h" #include "stg/user_ips.h" diff --git a/projects/stargazer/plugins/store/mysql/mysql_store.h b/stargazer/plugins/store/mysql/mysql_store.h similarity index 100% rename from projects/stargazer/plugins/store/mysql/mysql_store.h rename to stargazer/plugins/store/mysql/mysql_store.h diff --git a/stargazer/plugins/store/postgresql/CMakeLists.txt b/stargazer/plugins/store/postgresql/CMakeLists.txt new file mode 100644 index 00000000..3c9027ed --- /dev/null +++ b/stargazer/plugins/store/postgresql/CMakeLists.txt @@ -0,0 +1,14 @@ +find_package ( PostgreSQL REQUIRED ) + +set ( CPP_FILES postgresql_store.cpp + postgresql_store_admins.cpp + postgresql_store_corporations.cpp + postgresql_store_messages.cpp + postgresql_store_services.cpp + postgresql_store_tariffs.cpp + postgresql_store_users.cpp + postgresql_store_utils.cpp ) + +add_library ( mod_store_postgresql MODULE ${CPP_FILES} ) + +target_link_libraries ( mod_store_postgresql crypto logger common PostgreSQL::PostgreSQL ) diff --git a/projects/stargazer/plugins/store/postgresql/Makefile b/stargazer/plugins/store/postgresql/Makefile similarity index 100% rename from projects/stargazer/plugins/store/postgresql/Makefile rename to stargazer/plugins/store/postgresql/Makefile diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store.cpp b/stargazer/plugins/store/postgresql/postgresql_store.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store.cpp rename to stargazer/plugins/store/postgresql/postgresql_store.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store.h b/stargazer/plugins/store/postgresql/postgresql_store.h similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store.h rename to stargazer/plugins/store/postgresql/postgresql_store.h diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp b/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_admins.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp b/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_messages.cpp b/stargazer/plugins/store/postgresql/postgresql_store_messages.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_messages.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_messages.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp b/stargazer/plugins/store/postgresql/postgresql_store_services.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_services.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp b/stargazer/plugins/store/postgresql/postgresql_store_users.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_users.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_utils.cpp b/stargazer/plugins/store/postgresql/postgresql_store_utils.cpp similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_utils.cpp rename to stargazer/plugins/store/postgresql/postgresql_store_utils.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_utils.h b/stargazer/plugins/store/postgresql/postgresql_store_utils.h similarity index 100% rename from projects/stargazer/plugins/store/postgresql/postgresql_store_utils.h rename to stargazer/plugins/store/postgresql/postgresql_store_utils.h diff --git a/projects/stargazer/scripts/clean_db b/stargazer/scripts/clean_db similarity index 100% rename from projects/stargazer/scripts/clean_db rename to stargazer/scripts/clean_db diff --git a/projects/stargazer/scripts/monitor b/stargazer/scripts/monitor similarity index 100% rename from projects/stargazer/scripts/monitor rename to stargazer/scripts/monitor diff --git a/projects/stargazer/scripts/shaper/OnConnect b/stargazer/scripts/shaper/OnConnect similarity index 100% rename from projects/stargazer/scripts/shaper/OnConnect rename to stargazer/scripts/shaper/OnConnect diff --git a/projects/stargazer/scripts/shaper/OnDisconnect b/stargazer/scripts/shaper/OnDisconnect similarity index 100% rename from projects/stargazer/scripts/shaper/OnDisconnect rename to stargazer/scripts/shaper/OnDisconnect diff --git a/projects/stargazer/scripts/shaper/Readme.txt b/stargazer/scripts/shaper/Readme.txt similarity index 100% rename from projects/stargazer/scripts/shaper/Readme.txt rename to stargazer/scripts/shaper/Readme.txt diff --git a/projects/stargazer/scripts/shaper/shaper.sh b/stargazer/scripts/shaper/shaper.sh similarity index 100% rename from projects/stargazer/scripts/shaper/shaper.sh rename to stargazer/scripts/shaper/shaper.sh diff --git a/projects/stargazer/scripts/shaper/shaper.stop.sh b/stargazer/scripts/shaper/shaper.stop.sh similarity index 100% rename from projects/stargazer/scripts/shaper/shaper.stop.sh rename to stargazer/scripts/shaper/shaper.stop.sh diff --git a/projects/stargazer/scripts/shaper_vpn_radius/Readme b/stargazer/scripts/shaper_vpn_radius/Readme similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/Readme rename to stargazer/scripts/shaper_vpn_radius/Readme diff --git a/projects/stargazer/scripts/shaper_vpn_radius/firewall/firewall b/stargazer/scripts/shaper_vpn_radius/firewall/firewall similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/firewall/firewall rename to stargazer/scripts/shaper_vpn_radius/firewall/firewall diff --git a/projects/stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf b/stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf rename to stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf diff --git a/projects/stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf b/stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf rename to stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf diff --git a/projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg b/stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg rename to stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg diff --git a/projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg b/stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg rename to stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg diff --git a/projects/stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options b/stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options rename to stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options diff --git a/projects/stargazer/scripts/shaper_vpn_radius/pptpd.conf b/stargazer/scripts/shaper_vpn_radius/pptpd.conf similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/pptpd.conf rename to stargazer/scripts/shaper_vpn_radius/pptpd.conf diff --git a/projects/stargazer/scripts/shaper_vpn_radius/radiusclient/servers b/stargazer/scripts/shaper_vpn_radius/radiusclient/servers similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/radiusclient/servers rename to stargazer/scripts/shaper_vpn_radius/radiusclient/servers diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnChange b/stargazer/scripts/shaper_vpn_radius/stargazer/OnChange similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnChange rename to stargazer/scripts/shaper_vpn_radius/stargazer/OnChange diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect b/stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect rename to stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect b/stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect rename to stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd b/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd rename to stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel b/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel rename to stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/rules b/stargazer/scripts/shaper_vpn_radius/stargazer/rules similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/rules rename to stargazer/scripts/shaper_vpn_radius/stargazer/rules diff --git a/projects/stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf b/stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf similarity index 100% rename from projects/stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf rename to stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf diff --git a/projects/stargazer/services_impl.cpp b/stargazer/services_impl.cpp similarity index 100% rename from projects/stargazer/services_impl.cpp rename to stargazer/services_impl.cpp diff --git a/projects/stargazer/services_impl.h b/stargazer/services_impl.h similarity index 100% rename from projects/stargazer/services_impl.h rename to stargazer/services_impl.h diff --git a/projects/stargazer/settings_impl.cpp b/stargazer/settings_impl.cpp similarity index 99% rename from projects/stargazer/settings_impl.cpp rename to stargazer/settings_impl.cpp index 91258a5f..be7d66a4 100644 --- a/projects/stargazer/settings_impl.cpp +++ b/stargazer/settings_impl.cpp @@ -23,6 +23,7 @@ #include "stg/logger.h" #include "stg/dotconfpp.h" #include "stg/common.h" +#include "stg/const.h" #include #include diff --git a/projects/stargazer/settings_impl.h b/stargazer/settings_impl.h similarity index 100% rename from projects/stargazer/settings_impl.h rename to stargazer/settings_impl.h diff --git a/projects/stargazer/stg_timer.cpp b/stargazer/stg_timer.cpp similarity index 100% rename from projects/stargazer/stg_timer.cpp rename to stargazer/stg_timer.cpp diff --git a/projects/stargazer/stg_timer.h b/stargazer/stg_timer.h similarity index 100% rename from projects/stargazer/stg_timer.h rename to stargazer/stg_timer.h diff --git a/projects/stargazer/store_loader.cpp b/stargazer/store_loader.cpp similarity index 100% rename from projects/stargazer/store_loader.cpp rename to stargazer/store_loader.cpp diff --git a/projects/stargazer/store_loader.h b/stargazer/store_loader.h similarity index 100% rename from projects/stargazer/store_loader.h rename to stargazer/store_loader.h diff --git a/projects/stargazer/tariff_impl.cpp b/stargazer/tariff_impl.cpp similarity index 100% rename from projects/stargazer/tariff_impl.cpp rename to stargazer/tariff_impl.cpp diff --git a/projects/stargazer/tariff_impl.h b/stargazer/tariff_impl.h similarity index 99% rename from projects/stargazer/tariff_impl.h rename to stargazer/tariff_impl.h index f3accec9..fe043589 100644 --- a/projects/stargazer/tariff_impl.h +++ b/stargazer/tariff_impl.h @@ -32,13 +32,13 @@ #define TARIFF_IMPL_H #include "stg/tariff.h" -#include "stg/os_int.h" #include "stg/tariff_conf.h" #include #include #include +#include #define TARIFF_DAY 0 #define TARIFF_NIGHT 1 diff --git a/projects/stargazer/tariffs_impl.cpp b/stargazer/tariffs_impl.cpp similarity index 100% rename from projects/stargazer/tariffs_impl.cpp rename to stargazer/tariffs_impl.cpp diff --git a/projects/stargazer/tariffs_impl.h b/stargazer/tariffs_impl.h similarity index 100% rename from projects/stargazer/tariffs_impl.h rename to stargazer/tariffs_impl.h diff --git a/projects/stargazer/traffcounter_impl.cpp b/stargazer/traffcounter_impl.cpp similarity index 100% rename from projects/stargazer/traffcounter_impl.cpp rename to stargazer/traffcounter_impl.cpp diff --git a/projects/stargazer/traffcounter_impl.h b/stargazer/traffcounter_impl.h similarity index 99% rename from projects/stargazer/traffcounter_impl.h rename to stargazer/traffcounter_impl.h index 86d8c389..76572400 100644 --- a/projects/stargazer/traffcounter_impl.h +++ b/stargazer/traffcounter_impl.h @@ -29,7 +29,6 @@ #define TRAFFCOUNTER_IMPL_H #include "stg/traffcounter.h" -#include "stg/os_int.h" #include "stg/logger.h" #include "stg/raw_ip_packet.h" #include "stg/noncopyable.h" @@ -42,6 +41,7 @@ #include #include #include +#include #include diff --git a/projects/stargazer/user_impl.cpp b/stargazer/user_impl.cpp similarity index 100% rename from projects/stargazer/user_impl.cpp rename to stargazer/user_impl.cpp diff --git a/projects/stargazer/user_impl.h b/stargazer/user_impl.h similarity index 99% rename from projects/stargazer/user_impl.h rename to stargazer/user_impl.h index 1d4db35f..3293b56d 100644 --- a/projects/stargazer/user_impl.h +++ b/stargazer/user_impl.h @@ -35,7 +35,6 @@ #include "stg/auth.h" #include "stg/message.h" #include "stg/noncopyable.h" -#include "stg/os_int.h" #include "stg/const.h" #include @@ -44,6 +43,7 @@ #include #include +#include //----------------------------------------------------------------------------- class TARIFF; diff --git a/projects/stargazer/user_property.cpp b/stargazer/user_property.cpp similarity index 100% rename from projects/stargazer/user_property.cpp rename to stargazer/user_property.cpp diff --git a/projects/stargazer/users_impl.cpp b/stargazer/users_impl.cpp similarity index 100% rename from projects/stargazer/users_impl.cpp rename to stargazer/users_impl.cpp diff --git a/projects/stargazer/users_impl.h b/stargazer/users_impl.h similarity index 99% rename from projects/stargazer/users_impl.h rename to stargazer/users_impl.h index 0cba7893..a2e332e7 100644 --- a/projects/stargazer/users_impl.h +++ b/stargazer/users_impl.h @@ -30,13 +30,13 @@ $Author: faust $ #include -#include #include #include #include #include +#include +#include -#include "stg/os_int.h" #include "stg/store.h" #include "stg/users.h" #include "stg/user.h" diff --git a/stglibs/Makefile b/stglibs/Makefile deleted file mode 100644 index 6b9fbe40..00000000 --- a/stglibs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -############################################################################### -# $Id: Makefile,v 1.7 2008/03/10 14:00:00 faust Exp $ -############################################################################### - -include ../Makefile.conf - -.PHONY: all $(STG_LIBS) -.PHONY: clean install uninstall includes -all: $(STG_LIBS) - for LIB in $(STG_LIBS); do\ - $(MAKE) $(MAKECMDGOALS) -C $$LIB;\ - done - -includes: all - -clean: all - -install: all - -uninstall: all diff --git a/stglibs/Makefile.in b/stglibs/Makefile.in deleted file mode 100644 index 11dfcfb1..00000000 --- a/stglibs/Makefile.in +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################### -# $Id: Makefile.in,v 1.28 2009/03/03 15:50:14 faust Exp $ -############################################################################### - -include ../../Makefile.conf - -PROG = lib$(LIB_NAME).a - -SEARCH_DIRS = -I ../../include -I . -I ./include - -ifeq ($(STG_TIME), yes) -DEFS += -DSTG_TIME -endif - -ifneq ($(LIB_DEFS),) -DEFS += $(LIB_DEFS) -endif - -ifneq ($(LIB_INCS),) -SEARCH_DIRS += $(LIB_INCS) -endif - -OBJS = $(notdir $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))) - -CXXFLAGS += -fPIC $(SEARCH_DIRS) $(DEFS) -CFLAGS += -fPIC $(SEARCH_DIRS) $(DEFS) - -all: $(PROG) - -$(PROG): $(OBJS) - ar rc lib$(LIB_NAME).a $(OBJS) - ranlib lib$(LIB_NAME).a - -clean: - rm -f deps $(PROG) *.o *.a *.so tags *.*~ - -install: $(PROG) -ifeq ($(DEBUG), yes) - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg - install -m $(BIN_MODE) -o $(OWNER) $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) -else - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/lib/stg - install -m $(BIN_MODE) -o $(OWNER) -s $(PROG) $(PREFIX)/usr/lib/stg/$(PROG) -endif - mkdir -m $(DIR_MODE) -p $(PREFIX)/usr/include/stg - install -m $(DATA_MODE) -o $(OWNER) $(addprefix include/stg/,$(INCS)) $(PREFIX)/usr/include/stg/ - -uninstall: - rm -f $(PREFIX)/usr/lib/stg/$(PROG) - for file in $(INCS); do \ - rm -f $(PREFIX)/usr/include/stg/$$file; \ - done - -ifneq ($(MAKECMDGOALS),includes) -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),uninstall) --include deps -endif -endif -endif - -deps: $(SRCS) ../../Makefile.conf - @>deps ;\ - for file in $(SRCS); do\ - echo "$$file" | grep ".c$$" > /dev/null;\ - if [ $$? -eq 0 ];\ - then\ - echo "`$(CC) $(CFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\ - printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\ - else\ - echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\ - printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\ - fi;\ - done diff --git a/stglibs/common.lib/common.bpf b/stglibs/common.lib/common.bpf deleted file mode 100644 index e3c42ce0..00000000 --- a/stglibs/common.lib/common.bpf +++ /dev/null @@ -1,9 +0,0 @@ -//--------------------------------------------------------------------------- - -#include -#pragma hdrstop -#define Library - -// To add a file to the library use the Project menu 'Add to Project'. - - \ No newline at end of file diff --git a/stglibs/common.lib/common.bpr b/stglibs/common.lib/common.bpr deleted file mode 100644 index d7cb659f..00000000 --- a/stglibs/common.lib/common.bpr +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1049 -CodePage=1251 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=2 -Item0=$(BCB)\include;$(BCB)\include\vcl;..\..\include -Item1=$(BCB)\include;$(BCB)\include\vcl - -[HistoryLists\hlLibraryPath] -Count=2 -Item0=$(BCB)\lib\obj;$(BCB)\lib;..\..\lib -Item1=$(BCB)\lib\obj;$(BCB)\lib - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=2 -Item0=_DEBUG;WIN32 -Item1=_DEBUG - -[HistoryLists\hlFinalOutputDir] -Count=2 -Item0=..\..\lib\ -Item1=..\..\lib - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -[Parameters] -RunParams= -Launcher= -UseLauncher=0 -DebugCWD= -HostApplication= -RemoteHost= -RemotePath= -RemoteLauncher= -RemoteCWD= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[CORBA] -AddServerUnit=1 -AddClientUnit=1 -PrecompiledHeaders=1 - - \ No newline at end of file diff --git a/stglibs/crypto.lib/crypto.bpf b/stglibs/crypto.lib/crypto.bpf deleted file mode 100644 index f5907baa..00000000 --- a/stglibs/crypto.lib/crypto.bpf +++ /dev/null @@ -1,9 +0,0 @@ -//--------------------------------------------------------------------------- - -#include -#pragma hdrstop -#define Library - -// To add a file to the library use the Project menu 'Add to Project'. - - \ No newline at end of file diff --git a/stglibs/crypto.lib/crypto.bpr b/stglibs/crypto.lib/crypto.bpr deleted file mode 100644 index 78be7185..00000000 --- a/stglibs/crypto.lib/crypto.bpr +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1058 -CodePage=1251 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=2 -Item0=$(BCB)\include;$(BCB)\include\vcl;..\..\include -Item1=$(BCB)\include;$(BCB)\include\vcl - -[HistoryLists\hlLibraryPath] -Count=1 -Item0=$(BCB)\lib\obj;$(BCB)\lib - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=2 -Item0=_DEBUG;WIN32 -Item1=_DEBUG - -[HistoryLists\hlIntOutputDir] -Count=1 -Item0=obj - -[HistoryLists\hlFinalOutputDir] -Count=2 -Item0=..\..\lib\ -Item1=..\..\lib - -[HistoryLists\hlTlibPageSize] -Count=1 -Item0=0x0010 - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -[Parameters] -RunParams= -Launcher= -UseLauncher=0 -DebugCWD= -HostApplication= -RemoteHost= -RemotePath= -RemoteLauncher= -RemoteCWD= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[CORBA] -AddServerUnit=1 -AddClientUnit=1 -PrecompiledHeaders=1 - -[Language] -ActiveLang= -ProjectLang= -RootDir= - - \ No newline at end of file diff --git a/stglibs/ia.lib/ia.bpf b/stglibs/ia.lib/ia.bpf deleted file mode 100644 index e3c42ce0..00000000 --- a/stglibs/ia.lib/ia.bpf +++ /dev/null @@ -1,9 +0,0 @@ -//--------------------------------------------------------------------------- - -#include -#pragma hdrstop -#define Library - -// To add a file to the library use the Project menu 'Add to Project'. - - \ No newline at end of file diff --git a/stglibs/ia.lib/ia.bpr b/stglibs/ia.lib/ia.bpr deleted file mode 100644 index c80bf51c..00000000 --- a/stglibs/ia.lib/ia.bpr +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1049 -CodePage=1251 - -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= - -[HistoryLists\hlIncludePath] -Count=2 -Item0=$(BCB)\include;$(BCB)\include\vcl;..\..\include -Item1=$(BCB)\include;$(BCB)\include\vcl - -[HistoryLists\hlLibraryPath] -Count=1 -Item0=$(BCB)\lib\obj;$(BCB)\lib - -[HistoryLists\hlDebugSourcePath] -Count=1 -Item0=$(BCB)\source\vcl - -[HistoryLists\hlConditionals] -Count=2 -Item0=_DEBUG;WIN32 -Item1=_DEBUG - -[HistoryLists\hlFinalOutputDir] -Count=1 -Item0=..\..\lib - -[Debugging] -DebugSourceDirs=$(BCB)\source\vcl - -[Parameters] -RunParams= -Launcher= -UseLauncher=0 -DebugCWD= -HostApplication= -RemoteHost= -RemotePath= -RemoteLauncher= -RemoteCWD= -RemoteDebug=0 - -[Compiler] -ShowInfoMsgs=0 -LinkDebugVcl=0 -LinkCGLIB=0 - -[CORBA] -AddServerUnit=1 -AddClientUnit=1 -PrecompiledHeaders=1 - - \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..30286d2e --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,25 @@ +set ( CPP_FILES main.cpp + test_raw_ip.cpp + test_admin_conf.cpp + test_tariff.cpp + test_conffiles.cpp + test_fee_charge_rules.cpp + test_reconnect_on_tariff_change.cpp + test_disable_session_log.cpp + test_filter_params_log.cpp + test_crypto.cpp + test_bfstream.cpp + ../stargazer/tariff_impl.cpp + ../stargazer/user_impl.cpp + ../stargazer/user_property.cpp ) + +set ( THREADS_PREFER_PTHREAD_FLAG ON ) +find_package ( Threads REQUIRED ) + +add_definitions ( -DUSE_ABSTRACT_SETTINGS ) + +add_executable ( tests ${CPP_FILES} ) + +target_link_libraries ( tests conffiles crypto logger scriptexecuter common Threads::Threads ) + +target_include_directories ( tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ../stargazer ) diff --git a/tests/test_bfstream.cpp b/tests/test_bfstream.cpp index 892d5759..a3252c9e 100644 --- a/tests/test_bfstream.cpp +++ b/tests/test_bfstream.cpp @@ -3,11 +3,11 @@ #include "longstring.h" #include "stg/bfstream.h" -#include "stg/os_int.h" #include #include #include +#include namespace { diff --git a/tests/test_conffiles.cpp b/tests/test_conffiles.cpp index ef63a7a1..5936ad36 100644 --- a/tests/test_conffiles.cpp +++ b/tests/test_conffiles.cpp @@ -64,7 +64,7 @@ namespace tut { std::ofstream f("/tmp/test.cf"); - ensure("Correct construction (part 3)", f); + ensure("Correct construction (part 3)", static_cast(f)); f << "\n" << "a=a-string# a string\n" diff --git a/tests/test_raw_ip.cpp b/tests/test_raw_ip.cpp index 2f75c785..637c1b67 100644 --- a/tests/test_raw_ip.cpp +++ b/tests/test_raw_ip.cpp @@ -3,12 +3,12 @@ #include #include +#include #include #include #include "tut/tut.hpp" -#include "stg/os_int.h" #include "raw_ip_packet_old.h" #include "stg/raw_ip_packet.h" diff --git a/tests/testtariffs.h b/tests/testtariffs.h index a2b14142..f43bc22b 100644 --- a/tests/testtariffs.h +++ b/tests/testtariffs.h @@ -7,7 +7,7 @@ class TEST_TARIFFS : public TARIFFS { public: - TEST_TARIFFS() {} + TEST_TARIFFS() : testTariff("") {} int ReadTariffs () { return 0; } const TARIFF * FindByName(const std::string & /*name*/) const { return &testTariff; } -- 2.44.2