Port to CMake, get rid of os_int.h.
authorMaksym Mamontov <madf@madf.info>
Tue, 7 Jan 2020 17:35:08 +0000 (19:35 +0200)
committerMaksym Mamontov <madf@madf.info>
Tue, 7 Jan 2020 17:35:08 +0000 (19:35 +0200)
1276 files changed:
.gitignore
CMakeLists.txt [new file with mode: 0644]
cmake/modules/FindFBClient.cmake [new file with mode: 0644]
cmake/modules/FindMNL.cmake [new file with mode: 0644]
cmake/modules/FindMySQLConnector.cmake [new file with mode: 0644]
cmake/modules/FindNFNetLink.cmake [new file with mode: 0644]
cmake/modules/FindNFQueue.cmake [new file with mode: 0644]
cmake/modules/FindPCap.cmake [new file with mode: 0644]
cmake/modules/FindYAJL.cmake [new file with mode: 0644]
include/stg/admin.h
include/stg/admin_conf.h
include/stg/ia_packets.h
include/stg/message.h
include/stg/os_int.h [deleted file]
include/stg/plugin.h
include/stg/rad_packets.h
include/stg/raw_ip_packet.h
include/stg/rs_packets.h
include/stg/service_conf.h
include/stg/tariff.h
include/stg/user.h
include/stg/user_conf.h
include/stg/user_ips.h
include/stg/user_stat.h
include/stg/user_traff.h
lib/.placeholder [deleted file]
libs/CMakeLists.txt [new file with mode: 0644]
libs/common/CMakeLists.txt [new file with mode: 0644]
libs/common/Makefile [new file with mode: 0644]
libs/common/blockio.cpp [new file with mode: 0644]
libs/common/common.cpp [new file with mode: 0644]
libs/common/include/stg/blockio.h [new file with mode: 0644]
libs/common/include/stg/common.h [new file with mode: 0644]
libs/common/strptime.cpp [new file with mode: 0644]
libs/conffiles/CMakeLists.txt [new file with mode: 0644]
libs/conffiles/Makefile [new file with mode: 0644]
libs/conffiles/conffiles.cpp [new file with mode: 0644]
libs/conffiles/include/stg/conffiles.h [new file with mode: 0644]
libs/crypto/CMakeLists.txt [new file with mode: 0644]
libs/crypto/Makefile [new file with mode: 0644]
libs/crypto/ag_md5.c [new file with mode: 0644]
libs/crypto/bfstream.cpp [new file with mode: 0644]
libs/crypto/blowfish.c [new file with mode: 0644]
libs/crypto/include/stg/ag_md5.h [new file with mode: 0644]
libs/crypto/include/stg/bfstream.h [new file with mode: 0644]
libs/crypto/include/stg/blowfish.h [new file with mode: 0644]
libs/dotconfpp/CMakeLists.txt [new file with mode: 0644]
libs/dotconfpp/Makefile [new file with mode: 0644]
libs/dotconfpp/dotconfpp.cpp [new file with mode: 0644]
libs/dotconfpp/include/stg/dotconfpp.h [new file with mode: 0644]
libs/dotconfpp/mempool.cpp [new file with mode: 0644]
libs/dotconfpp/mempool.h [new file with mode: 0644]
libs/ia/CMakeLists.txt [new file with mode: 0644]
libs/ia/Makefile [new file with mode: 0644]
libs/ia/ia.cpp [new file with mode: 0644]
libs/ia/include/stg/ia.h [new file with mode: 0644]
libs/ibpp/CMakeLists.txt [new file with mode: 0644]
libs/ibpp/Makefile [new file with mode: 0644]
libs/ibpp/_dpb.cpp [new file with mode: 0644]
libs/ibpp/_ibpp.cpp [new file with mode: 0644]
libs/ibpp/_ibpp.h [new file with mode: 0644]
libs/ibpp/_ibs.cpp [new file with mode: 0644]
libs/ibpp/_rb.cpp [new file with mode: 0644]
libs/ibpp/_spb.cpp [new file with mode: 0644]
libs/ibpp/_tpb.cpp [new file with mode: 0644]
libs/ibpp/all_in_one.cpp [new file with mode: 0644]
libs/ibpp/array.cpp [new file with mode: 0644]
libs/ibpp/blob.cpp [new file with mode: 0644]
libs/ibpp/database.cpp [new file with mode: 0644]
libs/ibpp/date.cpp [new file with mode: 0644]
libs/ibpp/dbkey.cpp [new file with mode: 0644]
libs/ibpp/events.cpp [new file with mode: 0644]
libs/ibpp/exception.cpp [new file with mode: 0644]
libs/ibpp/ibase.h [new file with mode: 0644]
libs/ibpp/iberror.h [new file with mode: 0644]
libs/ibpp/include/stg/ibpp.h [new file with mode: 0644]
libs/ibpp/row.cpp [new file with mode: 0644]
libs/ibpp/service.cpp [new file with mode: 0644]
libs/ibpp/statement.cpp [new file with mode: 0644]
libs/ibpp/time.cpp [new file with mode: 0644]
libs/ibpp/transaction.cpp [new file with mode: 0644]
libs/ibpp/user.cpp [new file with mode: 0644]
libs/json/CMakeLists.txt [new file with mode: 0644]
libs/json/Makefile [new file with mode: 0644]
libs/json/generator.cpp [new file with mode: 0644]
libs/json/include/stg/json_generator.h [new file with mode: 0644]
libs/json/include/stg/json_parser.h [new file with mode: 0644]
libs/json/parser.cpp [new file with mode: 0644]
libs/logger/CMakeLists.txt [new file with mode: 0644]
libs/logger/Makefile [new file with mode: 0644]
libs/logger/include/stg/logger.h [new file with mode: 0644]
libs/logger/logger.cpp [new file with mode: 0644]
libs/pinger/CMakeLists.txt [new file with mode: 0644]
libs/pinger/Makefile [new file with mode: 0644]
libs/pinger/include/stg/pinger.h [new file with mode: 0644]
libs/pinger/pinger.cpp [new file with mode: 0644]
libs/scriptexecuter/CMakeLists.txt [new file with mode: 0644]
libs/scriptexecuter/Makefile [new file with mode: 0644]
libs/scriptexecuter/include/stg/scriptexecuter.h [new file with mode: 0644]
libs/scriptexecuter/scriptexecuter.c [new file with mode: 0644]
libs/smux/ANY.c [new file with mode: 0644]
libs/smux/ApplicationSyntax.c [new file with mode: 0644]
libs/smux/AtEntry.c [new file with mode: 0644]
libs/smux/BIT_STRING.c [new file with mode: 0644]
libs/smux/BOOLEAN.c [new file with mode: 0644]
libs/smux/CMakeLists.txt [new file with mode: 0644]
libs/smux/ClosePDU.c [new file with mode: 0644]
libs/smux/Counter.c [new file with mode: 0644]
libs/smux/DisplayString.c [new file with mode: 0644]
libs/smux/EgpNeighEntry.c [new file with mode: 0644]
libs/smux/Gauge.c [new file with mode: 0644]
libs/smux/GetNextRequest-PDU.c [new file with mode: 0644]
libs/smux/GetRequest-PDU.c [new file with mode: 0644]
libs/smux/GetResponse-PDU.c [new file with mode: 0644]
libs/smux/INTEGER.c [new file with mode: 0644]
libs/smux/IfEntry.c [new file with mode: 0644]
libs/smux/IpAddrEntry.c [new file with mode: 0644]
libs/smux/IpAddress.c [new file with mode: 0644]
libs/smux/IpNetToMediaEntry.c [new file with mode: 0644]
libs/smux/IpRouteEntry.c [new file with mode: 0644]
libs/smux/Makefile [new file with mode: 0644]
libs/smux/Message.c [new file with mode: 0644]
libs/smux/NULL.c [new file with mode: 0644]
libs/smux/NativeEnumerated.c [new file with mode: 0644]
libs/smux/NativeInteger.c [new file with mode: 0644]
libs/smux/NetworkAddress.c [new file with mode: 0644]
libs/smux/OBJECT_IDENTIFIER.c [new file with mode: 0644]
libs/smux/OCTET_STRING.c [new file with mode: 0644]
libs/smux/ObjectName.c [new file with mode: 0644]
libs/smux/ObjectSyntax.c [new file with mode: 0644]
libs/smux/Opaque.c [new file with mode: 0644]
libs/smux/OpenPDU.c [new file with mode: 0644]
libs/smux/PDU.c [new file with mode: 0644]
libs/smux/PDUs.c [new file with mode: 0644]
libs/smux/PhysAddress.c [new file with mode: 0644]
libs/smux/RFC1155-SMI.asn1 [new file with mode: 0644]
libs/smux/RFC1157-SNMP.asn1 [new file with mode: 0644]
libs/smux/RFC1213-MIB.asn1 [new file with mode: 0644]
libs/smux/RReqPDU.c [new file with mode: 0644]
libs/smux/RRspPDU.c [new file with mode: 0644]
libs/smux/SMUX-PDUs.c [new file with mode: 0644]
libs/smux/SMUX.asn1 [new file with mode: 0644]
libs/smux/SOutPDU.c [new file with mode: 0644]
libs/smux/SetRequest-PDU.c [new file with mode: 0644]
libs/smux/SimpleOpen.c [new file with mode: 0644]
libs/smux/SimpleSyntax.c [new file with mode: 0644]
libs/smux/TcpConnEntry.c [new file with mode: 0644]
libs/smux/TimeTicks.c [new file with mode: 0644]
libs/smux/Trap-PDU.c [new file with mode: 0644]
libs/smux/UdpEntry.c [new file with mode: 0644]
libs/smux/VarBind.c [new file with mode: 0644]
libs/smux/VarBindList.c [new file with mode: 0644]
libs/smux/asn_SEQUENCE_OF.c [new file with mode: 0644]
libs/smux/asn_SET_OF.c [new file with mode: 0644]
libs/smux/asn_codecs_prim.c [new file with mode: 0644]
libs/smux/ber_decoder.c [new file with mode: 0644]
libs/smux/ber_tlv_length.c [new file with mode: 0644]
libs/smux/ber_tlv_tag.c [new file with mode: 0644]
libs/smux/constr_CHOICE.c [new file with mode: 0644]
libs/smux/constr_SEQUENCE.c [new file with mode: 0644]
libs/smux/constr_SEQUENCE_OF.c [new file with mode: 0644]
libs/smux/constr_SET_OF.c [new file with mode: 0644]
libs/smux/constr_TYPE.c [new file with mode: 0644]
libs/smux/constraints.c [new file with mode: 0644]
libs/smux/der_encoder.c [new file with mode: 0644]
libs/smux/include/stg/ANY.h [new file with mode: 0644]
libs/smux/include/stg/ApplicationSyntax.h [new file with mode: 0644]
libs/smux/include/stg/AtEntry.h [new file with mode: 0644]
libs/smux/include/stg/BIT_STRING.h [new file with mode: 0644]
libs/smux/include/stg/BOOLEAN.h [new file with mode: 0644]
libs/smux/include/stg/ClosePDU.h [new file with mode: 0644]
libs/smux/include/stg/Counter.h [new file with mode: 0644]
libs/smux/include/stg/DisplayString.h [new file with mode: 0644]
libs/smux/include/stg/EgpNeighEntry.h [new file with mode: 0644]
libs/smux/include/stg/Gauge.h [new file with mode: 0644]
libs/smux/include/stg/GetNextRequest-PDU.h [new file with mode: 0644]
libs/smux/include/stg/GetRequest-PDU.h [new file with mode: 0644]
libs/smux/include/stg/GetResponse-PDU.h [new file with mode: 0644]
libs/smux/include/stg/INTEGER.h [new file with mode: 0644]
libs/smux/include/stg/IfEntry.h [new file with mode: 0644]
libs/smux/include/stg/IpAddrEntry.h [new file with mode: 0644]
libs/smux/include/stg/IpAddress.h [new file with mode: 0644]
libs/smux/include/stg/IpNetToMediaEntry.h [new file with mode: 0644]
libs/smux/include/stg/IpRouteEntry.h [new file with mode: 0644]
libs/smux/include/stg/Message.h [new file with mode: 0644]
libs/smux/include/stg/NULL.h [new file with mode: 0644]
libs/smux/include/stg/NativeEnumerated.h [new file with mode: 0644]
libs/smux/include/stg/NativeInteger.h [new file with mode: 0644]
libs/smux/include/stg/NetworkAddress.h [new file with mode: 0644]
libs/smux/include/stg/OBJECT_IDENTIFIER.h [new file with mode: 0644]
libs/smux/include/stg/OCTET_STRING.h [new file with mode: 0644]
libs/smux/include/stg/ObjectName.h [new file with mode: 0644]
libs/smux/include/stg/ObjectSyntax.h [new file with mode: 0644]
libs/smux/include/stg/Opaque.h [new file with mode: 0644]
libs/smux/include/stg/OpenPDU.h [new file with mode: 0644]
libs/smux/include/stg/PDU.h [new file with mode: 0644]
libs/smux/include/stg/PDUs.h [new file with mode: 0644]
libs/smux/include/stg/PhysAddress.h [new file with mode: 0644]
libs/smux/include/stg/RReqPDU.h [new file with mode: 0644]
libs/smux/include/stg/RRspPDU.h [new file with mode: 0644]
libs/smux/include/stg/SMUX-PDUs.h [new file with mode: 0644]
libs/smux/include/stg/SOutPDU.h [new file with mode: 0644]
libs/smux/include/stg/SetRequest-PDU.h [new file with mode: 0644]
libs/smux/include/stg/SimpleOpen.h [new file with mode: 0644]
libs/smux/include/stg/SimpleSyntax.h [new file with mode: 0644]
libs/smux/include/stg/TcpConnEntry.h [new file with mode: 0644]
libs/smux/include/stg/TimeTicks.h [new file with mode: 0644]
libs/smux/include/stg/Trap-PDU.h [new file with mode: 0644]
libs/smux/include/stg/UdpEntry.h [new file with mode: 0644]
libs/smux/include/stg/VarBind.h [new file with mode: 0644]
libs/smux/include/stg/VarBindList.h [new file with mode: 0644]
libs/smux/include/stg/asn_SEQUENCE_OF.h [new file with mode: 0644]
libs/smux/include/stg/asn_SET_OF.h [new file with mode: 0644]
libs/smux/include/stg/asn_application.h [new file with mode: 0644]
libs/smux/include/stg/asn_codecs.h [new file with mode: 0644]
libs/smux/include/stg/asn_codecs_prim.h [new file with mode: 0644]
libs/smux/include/stg/asn_internal.h [new file with mode: 0644]
libs/smux/include/stg/asn_system.h [new file with mode: 0644]
libs/smux/include/stg/ber_decoder.h [new file with mode: 0644]
libs/smux/include/stg/ber_tlv_length.h [new file with mode: 0644]
libs/smux/include/stg/ber_tlv_tag.h [new file with mode: 0644]
libs/smux/include/stg/constr_CHOICE.h [new file with mode: 0644]
libs/smux/include/stg/constr_SEQUENCE.h [new file with mode: 0644]
libs/smux/include/stg/constr_SEQUENCE_OF.h [new file with mode: 0644]
libs/smux/include/stg/constr_SET_OF.h [new file with mode: 0644]
libs/smux/include/stg/constr_TYPE.h [new file with mode: 0644]
libs/smux/include/stg/constraints.h [new file with mode: 0644]
libs/smux/include/stg/der_encoder.h [new file with mode: 0644]
libs/smux/include/stg/per_decoder.h [new file with mode: 0644]
libs/smux/include/stg/per_encoder.h [new file with mode: 0644]
libs/smux/include/stg/per_support.h [new file with mode: 0644]
libs/smux/include/stg/xer_decoder.h [new file with mode: 0644]
libs/smux/include/stg/xer_encoder.h [new file with mode: 0644]
libs/smux/include/stg/xer_support.h [new file with mode: 0644]
libs/smux/per_decoder.c [new file with mode: 0644]
libs/smux/per_encoder.c [new file with mode: 0644]
libs/smux/per_support.c [new file with mode: 0644]
libs/smux/xer_decoder.c [new file with mode: 0644]
libs/smux/xer_encoder.c [new file with mode: 0644]
libs/smux/xer_support.c [new file with mode: 0644]
libs/srvconf/CMakeLists.txt [new file with mode: 0644]
libs/srvconf/Makefile [new file with mode: 0644]
libs/srvconf/include/stg/servconf.h [new file with mode: 0644]
libs/srvconf/include/stg/servconf_types.h [new file with mode: 0644]
libs/srvconf/netunit.cpp [new file with mode: 0644]
libs/srvconf/netunit.h [new file with mode: 0644]
libs/srvconf/parsers/auth_by.cpp [new file with mode: 0644]
libs/srvconf/parsers/auth_by.h [new file with mode: 0644]
libs/srvconf/parsers/base.h [new file with mode: 0644]
libs/srvconf/parsers/chg_admin.cpp [new file with mode: 0644]
libs/srvconf/parsers/chg_admin.h [new file with mode: 0644]
libs/srvconf/parsers/chg_corp.cpp [new file with mode: 0644]
libs/srvconf/parsers/chg_corp.h [new file with mode: 0644]
libs/srvconf/parsers/chg_service.cpp [new file with mode: 0644]
libs/srvconf/parsers/chg_service.h [new file with mode: 0644]
libs/srvconf/parsers/chg_tariff.cpp [new file with mode: 0644]
libs/srvconf/parsers/chg_tariff.h [new file with mode: 0644]
libs/srvconf/parsers/chg_user.cpp [new file with mode: 0644]
libs/srvconf/parsers/chg_user.h [new file with mode: 0644]
libs/srvconf/parsers/get_admin.cpp [new file with mode: 0644]
libs/srvconf/parsers/get_admin.h [new file with mode: 0644]
libs/srvconf/parsers/get_container.h [new file with mode: 0644]
libs/srvconf/parsers/get_corp.cpp [new file with mode: 0644]
libs/srvconf/parsers/get_corp.h [new file with mode: 0644]
libs/srvconf/parsers/get_service.cpp [new file with mode: 0644]
libs/srvconf/parsers/get_service.h [new file with mode: 0644]
libs/srvconf/parsers/get_tariff.cpp [new file with mode: 0644]
libs/srvconf/parsers/get_tariff.h [new file with mode: 0644]
libs/srvconf/parsers/get_user.cpp [new file with mode: 0644]
libs/srvconf/parsers/get_user.h [new file with mode: 0644]
libs/srvconf/parsers/property.cpp [new file with mode: 0644]
libs/srvconf/parsers/property.h [new file with mode: 0644]
libs/srvconf/parsers/resetable_utils.h [new file with mode: 0644]
libs/srvconf/parsers/server_info.cpp [new file with mode: 0644]
libs/srvconf/parsers/server_info.h [new file with mode: 0644]
libs/srvconf/parsers/simple.cpp [new file with mode: 0644]
libs/srvconf/parsers/simple.h [new file with mode: 0644]
libs/srvconf/servconf.cpp [new file with mode: 0644]
make_tarball/get_from_cvs [new file with mode: 0755]
make_tarball/make.sh [new file with mode: 0755]
make_tarball/mt.sh [new file with mode: 0755]
projects/libs/Makefile [deleted file]
projects/libs/build [deleted file]
projects/make_tarball/get_from_cvs [deleted file]
projects/make_tarball/make.sh [deleted file]
projects/make_tarball/mt.sh [deleted file]
projects/rlm_stg/Makefile [deleted file]
projects/rlm_stg/build [deleted file]
projects/rlm_stg/conn.cpp [deleted file]
projects/rlm_stg/conn.h [deleted file]
projects/rlm_stg/iface.cpp [deleted file]
projects/rlm_stg/iface.h [deleted file]
projects/rlm_stg/radlog.c [deleted file]
projects/rlm_stg/radlog.h [deleted file]
projects/rlm_stg/rlm_stg.c [deleted file]
projects/rlm_stg/stg_client.cpp [deleted file]
projects/rlm_stg/stg_client.h [deleted file]
projects/rlm_stg/stgpair.h [deleted file]
projects/rlm_stg/types.h [deleted file]
projects/rscriptd/Makefile [deleted file]
projects/rscriptd/build [deleted file]
projects/rscriptd/listener.cpp [deleted file]
projects/rscriptd/listener.h [deleted file]
projects/rscriptd/main.cpp [deleted file]
projects/rscriptd/pidfile.cpp [deleted file]
projects/rscriptd/pidfile.h [deleted file]
projects/rscriptd/rscriptd.conf [deleted file]
projects/sgauth/.gitignore [deleted file]
projects/sgauth/Makefile [deleted file]
projects/sgauth/build [deleted file]
projects/sgauth/main.cpp [deleted file]
projects/sgauth/make_css.sh [deleted file]
projects/sgauth/settings_impl.cpp [deleted file]
projects/sgauth/settings_impl.h [deleted file]
projects/sgauth/sgauth.conf [deleted file]
projects/sgauth/sgauth.css [deleted file]
projects/sgauth/web.cpp [deleted file]
projects/sgauth/web.h [deleted file]
projects/sgauthstress/Makefile [deleted file]
projects/sgauthstress/build [deleted file]
projects/sgauthstress/main.cpp [deleted file]
projects/sgauthstress/mkifs.sh [deleted file]
projects/sgauthstress/proto.cpp [deleted file]
projects/sgauthstress/proto.h [deleted file]
projects/sgauthstress/rmifs.sh [deleted file]
projects/sgauthstress/settings.cpp [deleted file]
projects/sgauthstress/settings.h [deleted file]
projects/sgauthstress/sgauthstress.conf [deleted file]
projects/sgauthstress/store_loader.cpp [deleted file]
projects/sgauthstress/store_loader.h [deleted file]
projects/sgauthstress/user.cpp [deleted file]
projects/sgauthstress/user.h [deleted file]
projects/sgauthstress/users.1000 [deleted file]
projects/sgconf/CHANGES [deleted file]
projects/sgconf/Makefile [deleted file]
projects/sgconf/README.txt [deleted file]
projects/sgconf/TODO [deleted file]
projects/sgconf/action.h [deleted file]
projects/sgconf/actions.cpp [deleted file]
projects/sgconf/actions.h [deleted file]
projects/sgconf/admins.cpp [deleted file]
projects/sgconf/admins.h [deleted file]
projects/sgconf/api_action.cpp [deleted file]
projects/sgconf/api_action.h [deleted file]
projects/sgconf/build [deleted file]
projects/sgconf/config.h [deleted file]
projects/sgconf/corps.cpp [deleted file]
projects/sgconf/corps.h [deleted file]
projects/sgconf/info.cpp [deleted file]
projects/sgconf/info.h [deleted file]
projects/sgconf/main.cpp [deleted file]
projects/sgconf/options.cpp [deleted file]
projects/sgconf/options.h [deleted file]
projects/sgconf/parser_state.h [deleted file]
projects/sgconf/services.cpp [deleted file]
projects/sgconf/services.h [deleted file]
projects/sgconf/tariffs.cpp [deleted file]
projects/sgconf/tariffs.h [deleted file]
projects/sgconf/users.cpp [deleted file]
projects/sgconf/users.h [deleted file]
projects/sgconf/utils.h [deleted file]
projects/sgconf/xml.cpp [deleted file]
projects/sgconf/xml.h [deleted file]
projects/sgconf_xml/CHANGES [deleted file]
projects/sgconf_xml/Makefile [deleted file]
projects/sgconf_xml/README.txt [deleted file]
projects/sgconf_xml/build [deleted file]
projects/sgconf_xml/main.cpp [deleted file]
projects/sgconf_xml/parser.cpp [deleted file]
projects/sgconf_xml/request.h [deleted file]
projects/sgconf_xml/stg_req [deleted file]
projects/sgconv/Makefile [deleted file]
projects/sgconv/build [deleted file]
projects/sgconv/main.cpp [deleted file]
projects/sgconv/settings_impl.cpp [deleted file]
projects/sgconv/settings_impl.h [deleted file]
projects/sgconv/sgconv.conf [deleted file]
projects/stargazer/BUGS [deleted file]
projects/stargazer/CHANGES [deleted file]
projects/stargazer/Makefile [deleted file]
projects/stargazer/README [deleted file]
projects/stargazer/TODO [deleted file]
projects/stargazer/actions.h [deleted file]
projects/stargazer/actions.inl.h [deleted file]
projects/stargazer/admin_impl.cpp [deleted file]
projects/stargazer/admin_impl.h [deleted file]
projects/stargazer/admins_impl.cpp [deleted file]
projects/stargazer/admins_impl.h [deleted file]
projects/stargazer/build [deleted file]
projects/stargazer/corps_impl.cpp [deleted file]
projects/stargazer/corps_impl.h [deleted file]
projects/stargazer/eventloop.cpp [deleted file]
projects/stargazer/eventloop.h [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/OnChange [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/OnConnect [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/OnDisconnect [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/OnUserAdd [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/OnUserDel [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf [deleted symlink]
projects/stargazer/inst/freebsd/etc/stargazer/rules [deleted file]
projects/stargazer/inst/freebsd/etc/stargazer/stargazer.conf [deleted file]
projects/stargazer/inst/linux/etc/init.d/stargazer.gentoo [deleted file]
projects/stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 [deleted file]
projects/stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 [deleted file]
projects/stargazer/inst/linux/etc/stargazer/OnChange [deleted file]
projects/stargazer/inst/linux/etc/stargazer/OnConnect [deleted file]
projects/stargazer/inst/linux/etc/stargazer/OnDisconnect [deleted file]
projects/stargazer/inst/linux/etc/stargazer/OnUserAdd [deleted file]
projects/stargazer/inst/linux/etc/stargazer/OnUserDel [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf [deleted file]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf [deleted symlink]
projects/stargazer/inst/linux/etc/stargazer/rules [deleted file]
projects/stargazer/inst/linux/etc/stargazer/stargazer.conf [deleted file]
projects/stargazer/inst/var/00-alter-01.postgresql.sql [deleted file]
projects/stargazer/inst/var/00-alter-01.sql [deleted file]
projects/stargazer/inst/var/00-base-00.postgresql.sql [deleted file]
projects/stargazer/inst/var/00-base-00.sql [deleted file]
projects/stargazer/inst/var/00-mysql-01.sql [deleted file]
projects/stargazer/inst/var/01-alter-02.mysql.sql [deleted file]
projects/stargazer/inst/var/01-alter-02.postgresql.sql [deleted file]
projects/stargazer/inst/var/01-alter-02.sql [deleted file]
projects/stargazer/inst/var/02-alter-03.postgresql.sql [deleted file]
projects/stargazer/inst/var/02-alter-03.sql [deleted file]
projects/stargazer/inst/var/base.dia [deleted file]
projects/stargazer/inst/var/stargazer/admins/admin.adm [deleted file]
projects/stargazer/inst/var/stargazer/tariffs/tariff.tf [deleted file]
projects/stargazer/inst/var/stargazer/users/test/conf [deleted file]
projects/stargazer/inst/var/stargazer/users/test/stat [deleted file]
projects/stargazer/main.cpp [deleted file]
projects/stargazer/modules/.placeholder [deleted file]
projects/stargazer/pidfile.cpp [deleted file]
projects/stargazer/pidfile.h [deleted file]
projects/stargazer/plugin_mgr.cpp [deleted file]
projects/stargazer/plugin_mgr.h [deleted file]
projects/stargazer/plugin_runner.cpp [deleted file]
projects/stargazer/plugin_runner.h [deleted file]
projects/stargazer/plugins/Makefile [deleted file]
projects/stargazer/plugins/Makefile.in [deleted file]
projects/stargazer/plugins/authorization/ao/Makefile [deleted file]
projects/stargazer/plugins/authorization/ao/ao.cpp [deleted file]
projects/stargazer/plugins/authorization/ao/ao.h [deleted file]
projects/stargazer/plugins/authorization/inetaccess/Makefile [deleted file]
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp [deleted file]
projects/stargazer/plugins/authorization/inetaccess/inetaccess.h [deleted file]
projects/stargazer/plugins/authorization/stress/Makefile [deleted file]
projects/stargazer/plugins/authorization/stress/stress.cpp [deleted file]
projects/stargazer/plugins/authorization/stress/stress.h [deleted file]
projects/stargazer/plugins/capture/cap_debug/Makefile [deleted file]
projects/stargazer/plugins/capture/cap_debug/checksum.c [deleted file]
projects/stargazer/plugins/capture/cap_debug/checksum.h [deleted file]
projects/stargazer/plugins/capture/cap_debug/constants.h [deleted file]
projects/stargazer/plugins/capture/cap_debug/debug_cap.cpp [deleted file]
projects/stargazer/plugins/capture/cap_debug/debug_cap.h [deleted file]
projects/stargazer/plugins/capture/cap_debug/ip.c [deleted file]
projects/stargazer/plugins/capture/cap_debug/libpal.h [deleted file]
projects/stargazer/plugins/capture/cap_debug/packet.c [deleted file]
projects/stargazer/plugins/capture/cap_debug/tcp.c [deleted file]
projects/stargazer/plugins/capture/cap_debug/types.h [deleted file]
projects/stargazer/plugins/capture/cap_nf/Makefile [deleted file]
projects/stargazer/plugins/capture/cap_nf/cap_nf.cpp [deleted file]
projects/stargazer/plugins/capture/cap_nf/cap_nf.h [deleted file]
projects/stargazer/plugins/capture/divert_freebsd/Makefile [deleted file]
projects/stargazer/plugins/capture/divert_freebsd/divert_cap.cpp [deleted file]
projects/stargazer/plugins/capture/divert_freebsd/divert_cap.h [deleted file]
projects/stargazer/plugins/capture/ether_freebsd/Makefile [deleted file]
projects/stargazer/plugins/capture/ether_freebsd/ether_cap.cpp [deleted file]
projects/stargazer/plugins/capture/ether_freebsd/ether_cap.h [deleted file]
projects/stargazer/plugins/capture/ether_linux/Makefile [deleted file]
projects/stargazer/plugins/capture/ether_linux/ether_cap.cpp [deleted file]
projects/stargazer/plugins/capture/ether_linux/ether_cap.h [deleted file]
projects/stargazer/plugins/capture/ipq_linux/Makefile [deleted file]
projects/stargazer/plugins/capture/ipq_linux/ipq_cap.cpp [deleted file]
projects/stargazer/plugins/capture/ipq_linux/ipq_cap.h [deleted file]
projects/stargazer/plugins/capture/ipq_linux/libipq.c [deleted file]
projects/stargazer/plugins/capture/ipq_linux/libipq.h [deleted file]
projects/stargazer/plugins/capture/nfqueue/Makefile [deleted file]
projects/stargazer/plugins/capture/nfqueue/nfqueue.cpp [deleted file]
projects/stargazer/plugins/capture/nfqueue/nfqueue.h [deleted file]
projects/stargazer/plugins/capture/pcap/Makefile [deleted file]
projects/stargazer/plugins/capture/pcap/pcap_cap.cpp [deleted file]
projects/stargazer/plugins/capture/pcap/pcap_cap.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/Makefile [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/admins_methods.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/admins_methods.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/info_methods.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/messages_methods.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/messages_methods.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/rpcconfig.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/tariff_helper.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/user_helper.h [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp [deleted file]
projects/stargazer/plugins/configuration/rpcconfig/users_methods.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/Makefile [deleted file]
projects/stargazer/plugins/configuration/sgconfig/configproto.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/configproto.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/conn.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/conn.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/dumphelpers.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_admins.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_auth_by.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_message.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_message.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_server_info.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_server_info.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_services.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_services.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_tariffs.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_user_info.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/parser_users.h [deleted file]
projects/stargazer/plugins/configuration/sgconfig/stgconfig.cpp [deleted file]
projects/stargazer/plugins/configuration/sgconfig/stgconfig.h [deleted file]
projects/stargazer/plugins/other/ping/Makefile [deleted file]
projects/stargazer/plugins/other/ping/ping.cpp [deleted file]
projects/stargazer/plugins/other/ping/ping.h [deleted file]
projects/stargazer/plugins/other/radius/Makefile [deleted file]
projects/stargazer/plugins/other/radius/config.cpp [deleted file]
projects/stargazer/plugins/other/radius/config.h [deleted file]
projects/stargazer/plugins/other/radius/conn.cpp [deleted file]
projects/stargazer/plugins/other/radius/conn.h [deleted file]
projects/stargazer/plugins/other/radius/radius.cpp [deleted file]
projects/stargazer/plugins/other/radius/radius.h [deleted file]
projects/stargazer/plugins/other/rscript/Makefile [deleted file]
projects/stargazer/plugins/other/rscript/nrmap_parser.cpp [deleted file]
projects/stargazer/plugins/other/rscript/nrmap_parser.h [deleted file]
projects/stargazer/plugins/other/rscript/rscript.cpp [deleted file]
projects/stargazer/plugins/other/rscript/rscript.h [deleted file]
projects/stargazer/plugins/other/rscript/send_functor.h [deleted file]
projects/stargazer/plugins/other/rscript/ur_functor.h [deleted file]
projects/stargazer/plugins/other/smux/Makefile [deleted file]
projects/stargazer/plugins/other/smux/STG-MIB.mib [deleted file]
projects/stargazer/plugins/other/smux/TODO [deleted file]
projects/stargazer/plugins/other/smux/handlers.cpp [deleted file]
projects/stargazer/plugins/other/smux/pen.h [deleted file]
projects/stargazer/plugins/other/smux/sensors.cpp [deleted file]
projects/stargazer/plugins/other/smux/sensors.h [deleted file]
projects/stargazer/plugins/other/smux/smux.cpp [deleted file]
projects/stargazer/plugins/other/smux/smux.h [deleted file]
projects/stargazer/plugins/other/smux/tables.cpp [deleted file]
projects/stargazer/plugins/other/smux/tables.h [deleted file]
projects/stargazer/plugins/other/smux/types.cpp [deleted file]
projects/stargazer/plugins/other/smux/types.h [deleted file]
projects/stargazer/plugins/other/smux/utils.cpp [deleted file]
projects/stargazer/plugins/other/smux/utils.h [deleted file]
projects/stargazer/plugins/other/smux/value2os.h [deleted file]
projects/stargazer/plugins/store/files/Makefile [deleted file]
projects/stargazer/plugins/store/files/file_store.cpp [deleted file]
projects/stargazer/plugins/store/files/file_store.h [deleted file]
projects/stargazer/plugins/store/firebird/Makefile [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store.h [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_admins.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_corporations.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_messages.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_services.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_tariffs.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_users.cpp [deleted file]
projects/stargazer/plugins/store/firebird/firebird_store_utils.cpp [deleted file]
projects/stargazer/plugins/store/mysql/Makefile [deleted file]
projects/stargazer/plugins/store/mysql/mysql_store.cpp [deleted file]
projects/stargazer/plugins/store/mysql/mysql_store.h [deleted file]
projects/stargazer/plugins/store/postgresql/Makefile [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store.h [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_admins.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_messages.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_services.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_users.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_utils.cpp [deleted file]
projects/stargazer/plugins/store/postgresql/postgresql_store_utils.h [deleted file]
projects/stargazer/scripts/clean_db [deleted file]
projects/stargazer/scripts/monitor [deleted file]
projects/stargazer/scripts/shaper/OnConnect [deleted file]
projects/stargazer/scripts/shaper/OnDisconnect [deleted file]
projects/stargazer/scripts/shaper/Readme.txt [deleted file]
projects/stargazer/scripts/shaper/shaper.sh [deleted file]
projects/stargazer/scripts/shaper/shaper.stop.sh [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/Readme [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/firewall/firewall [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/pptpd.conf [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/radiusclient/servers [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnChange [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/rules [deleted file]
projects/stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf [deleted file]
projects/stargazer/services_impl.cpp [deleted file]
projects/stargazer/services_impl.h [deleted file]
projects/stargazer/settings_impl.cpp [deleted file]
projects/stargazer/settings_impl.h [deleted file]
projects/stargazer/stg_timer.cpp [deleted file]
projects/stargazer/stg_timer.h [deleted file]
projects/stargazer/store_loader.cpp [deleted file]
projects/stargazer/store_loader.h [deleted file]
projects/stargazer/tariff_impl.cpp [deleted file]
projects/stargazer/tariff_impl.h [deleted file]
projects/stargazer/tariffs_impl.cpp [deleted file]
projects/stargazer/tariffs_impl.h [deleted file]
projects/stargazer/traffcounter_impl.cpp [deleted file]
projects/stargazer/traffcounter_impl.h [deleted file]
projects/stargazer/user_impl.cpp [deleted file]
projects/stargazer/user_impl.h [deleted file]
projects/stargazer/user_property.cpp [deleted file]
projects/stargazer/users_impl.cpp [deleted file]
projects/stargazer/users_impl.h [deleted file]
rlm_stg/CMakeLists.txt [new file with mode: 0644]
rlm_stg/Makefile [new file with mode: 0644]
rlm_stg/build [new file with mode: 0755]
rlm_stg/conn.cpp [new file with mode: 0644]
rlm_stg/conn.h [new file with mode: 0644]
rlm_stg/iface.cpp [new file with mode: 0644]
rlm_stg/iface.h [new file with mode: 0644]
rlm_stg/radlog.c [new file with mode: 0644]
rlm_stg/radlog.h [new file with mode: 0644]
rlm_stg/rlm_stg.c [new file with mode: 0644]
rlm_stg/stg_client.cpp [new file with mode: 0644]
rlm_stg/stg_client.h [new file with mode: 0644]
rlm_stg/stgpair.h [new file with mode: 0644]
rlm_stg/types.h [new file with mode: 0644]
rscriptd/CMakeLists.txt [new file with mode: 0644]
rscriptd/Makefile [new file with mode: 0644]
rscriptd/build [new file with mode: 0755]
rscriptd/listener.cpp [new file with mode: 0644]
rscriptd/listener.h [new file with mode: 0644]
rscriptd/main.cpp [new file with mode: 0644]
rscriptd/pidfile.cpp [new file with mode: 0644]
rscriptd/pidfile.h [new file with mode: 0644]
rscriptd/rscriptd.conf [new file with mode: 0644]
sgauth/.gitignore [new file with mode: 0644]
sgauth/CMakeLists.txt [new file with mode: 0644]
sgauth/Makefile [new file with mode: 0644]
sgauth/build [new file with mode: 0755]
sgauth/main.cpp [new file with mode: 0644]
sgauth/make_css.sh [new file with mode: 0755]
sgauth/settings_impl.cpp [new file with mode: 0644]
sgauth/settings_impl.h [new file with mode: 0644]
sgauth/sgauth.conf [new file with mode: 0644]
sgauth/sgauth.css [new file with mode: 0644]
sgauth/web.cpp [new file with mode: 0644]
sgauth/web.h [new file with mode: 0644]
sgconf/CHANGES [new file with mode: 0644]
sgconf/CMakeLists.txt [new file with mode: 0644]
sgconf/Makefile [new file with mode: 0644]
sgconf/README.txt [new file with mode: 0644]
sgconf/TODO [new file with mode: 0644]
sgconf/action.h [new file with mode: 0644]
sgconf/actions.cpp [new file with mode: 0644]
sgconf/actions.h [new file with mode: 0644]
sgconf/admins.cpp [new file with mode: 0644]
sgconf/admins.h [new file with mode: 0644]
sgconf/api_action.cpp [new file with mode: 0644]
sgconf/api_action.h [new file with mode: 0644]
sgconf/build [new file with mode: 0755]
sgconf/config.h [new file with mode: 0644]
sgconf/corps.cpp [new file with mode: 0644]
sgconf/corps.h [new file with mode: 0644]
sgconf/info.cpp [new file with mode: 0644]
sgconf/info.h [new file with mode: 0644]
sgconf/main.cpp [new file with mode: 0644]
sgconf/options.cpp [new file with mode: 0644]
sgconf/options.h [new file with mode: 0644]
sgconf/parser_state.h [new file with mode: 0644]
sgconf/services.cpp [new file with mode: 0644]
sgconf/services.h [new file with mode: 0644]
sgconf/tariffs.cpp [new file with mode: 0644]
sgconf/tariffs.h [new file with mode: 0644]
sgconf/users.cpp [new file with mode: 0644]
sgconf/users.h [new file with mode: 0644]
sgconf/utils.h [new file with mode: 0644]
sgconf/xml.cpp [new file with mode: 0644]
sgconf/xml.h [new file with mode: 0644]
stargazer/BUGS [new file with mode: 0644]
stargazer/CHANGES [new file with mode: 0644]
stargazer/CMakeLists.txt [new file with mode: 0644]
stargazer/Makefile [new file with mode: 0644]
stargazer/README [new file with mode: 0644]
stargazer/TODO [new file with mode: 0644]
stargazer/actions.h [new file with mode: 0644]
stargazer/actions.inl.h [new file with mode: 0644]
stargazer/admin_impl.cpp [new file with mode: 0644]
stargazer/admin_impl.h [new file with mode: 0644]
stargazer/admins_impl.cpp [new file with mode: 0644]
stargazer/admins_impl.h [new file with mode: 0644]
stargazer/build [new file with mode: 0755]
stargazer/corps_impl.cpp [new file with mode: 0644]
stargazer/corps_impl.h [new file with mode: 0644]
stargazer/eventloop.cpp [new file with mode: 0644]
stargazer/eventloop.h [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/OnChange [new file with mode: 0755]
stargazer/inst/freebsd/etc/stargazer/OnConnect [new file with mode: 0755]
stargazer/inst/freebsd/etc/stargazer/OnDisconnect [new file with mode: 0755]
stargazer/inst/freebsd/etc/stargazer/OnUserAdd [new file with mode: 0755]
stargazer/inst/freebsd/etc/stargazer/OnUserDel [new file with mode: 0755]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ao.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_bpf.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_divert.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_cap_nf.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ia.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_ping.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_radius.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_remote_script.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_rpc.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_sg.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/mod_smux.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_files.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_firebird.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_mysql.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-available.d/store_postgresql.conf [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ao.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_cap_bpf.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ia.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_ping.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/mod_sg.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/conf-enabled.d/store_files.conf [new symlink]
stargazer/inst/freebsd/etc/stargazer/rules [new file with mode: 0644]
stargazer/inst/freebsd/etc/stargazer/stargazer.conf [new file with mode: 0644]
stargazer/inst/linux/etc/init.d/stargazer.gentoo [new file with mode: 0755]
stargazer/inst/linux/etc/init.d/stargazer.suse.9.3 [new file with mode: 0755]
stargazer/inst/linux/etc/init.d/stargazer.ubuntu.7.10 [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/OnChange [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/OnConnect [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/OnDisconnect [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/OnUserAdd [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/OnUserDel [new file with mode: 0755]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ao.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ether.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_ipq.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_cap_nf.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ia.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_ping.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_radius.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_remote_script.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_rpc.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_sg.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/mod_smux.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/store_files.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/store_firebird.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/store_mysql.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-available.d/store_postgresql.conf [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ao.conf [new symlink]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_cap_ether.conf [new symlink]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ia.conf [new symlink]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_ping.conf [new symlink]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/mod_sg.conf [new symlink]
stargazer/inst/linux/etc/stargazer/conf-enabled.d/store_files.conf [new symlink]
stargazer/inst/linux/etc/stargazer/rules [new file with mode: 0644]
stargazer/inst/linux/etc/stargazer/stargazer.conf [new file with mode: 0644]
stargazer/inst/var/00-alter-01.postgresql.sql [new file with mode: 0644]
stargazer/inst/var/00-alter-01.sql [new file with mode: 0644]
stargazer/inst/var/00-base-00.postgresql.sql [new file with mode: 0644]
stargazer/inst/var/00-base-00.sql [new file with mode: 0644]
stargazer/inst/var/00-mysql-01.sql [new file with mode: 0644]
stargazer/inst/var/01-alter-02.mysql.sql [new file with mode: 0644]
stargazer/inst/var/01-alter-02.postgresql.sql [new file with mode: 0644]
stargazer/inst/var/01-alter-02.sql [new file with mode: 0644]
stargazer/inst/var/02-alter-03.postgresql.sql [new file with mode: 0644]
stargazer/inst/var/02-alter-03.sql [new file with mode: 0644]
stargazer/inst/var/base.dia [new file with mode: 0644]
stargazer/inst/var/stargazer/admins/admin.adm [new file with mode: 0644]
stargazer/inst/var/stargazer/tariffs/tariff.tf [new file with mode: 0644]
stargazer/inst/var/stargazer/users/test/conf [new file with mode: 0644]
stargazer/inst/var/stargazer/users/test/stat [new file with mode: 0644]
stargazer/main.cpp [new file with mode: 0644]
stargazer/pidfile.cpp [new file with mode: 0644]
stargazer/pidfile.h [new file with mode: 0644]
stargazer/plugin_mgr.cpp [new file with mode: 0644]
stargazer/plugin_mgr.h [new file with mode: 0644]
stargazer/plugin_runner.cpp [new file with mode: 0644]
stargazer/plugin_runner.h [new file with mode: 0644]
stargazer/plugins/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/Makefile [new file with mode: 0644]
stargazer/plugins/Makefile.in [new file with mode: 0644]
stargazer/plugins/authorization/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/authorization/ao/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/authorization/ao/Makefile [new file with mode: 0644]
stargazer/plugins/authorization/ao/ao.cpp [new file with mode: 0644]
stargazer/plugins/authorization/ao/ao.h [new file with mode: 0644]
stargazer/plugins/authorization/inetaccess/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/authorization/inetaccess/Makefile [new file with mode: 0644]
stargazer/plugins/authorization/inetaccess/inetaccess.cpp [new file with mode: 0644]
stargazer/plugins/authorization/inetaccess/inetaccess.h [new file with mode: 0644]
stargazer/plugins/capture/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/cap_nf/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/cap_nf/Makefile [new file with mode: 0644]
stargazer/plugins/capture/cap_nf/cap_nf.cpp [new file with mode: 0644]
stargazer/plugins/capture/cap_nf/cap_nf.h [new file with mode: 0644]
stargazer/plugins/capture/divert_freebsd/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/divert_freebsd/Makefile [new file with mode: 0644]
stargazer/plugins/capture/divert_freebsd/divert_cap.cpp [new file with mode: 0644]
stargazer/plugins/capture/divert_freebsd/divert_cap.h [new file with mode: 0644]
stargazer/plugins/capture/ether_freebsd/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/ether_freebsd/Makefile [new file with mode: 0644]
stargazer/plugins/capture/ether_freebsd/ether_cap.cpp [new file with mode: 0644]
stargazer/plugins/capture/ether_freebsd/ether_cap.h [new file with mode: 0644]
stargazer/plugins/capture/ether_linux/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/ether_linux/Makefile [new file with mode: 0644]
stargazer/plugins/capture/ether_linux/ether_cap.cpp [new file with mode: 0644]
stargazer/plugins/capture/ether_linux/ether_cap.h [new file with mode: 0644]
stargazer/plugins/capture/nfqueue/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/nfqueue/Makefile [new file with mode: 0644]
stargazer/plugins/capture/nfqueue/nfqueue.cpp [new file with mode: 0644]
stargazer/plugins/capture/nfqueue/nfqueue.h [new file with mode: 0644]
stargazer/plugins/capture/pcap/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/capture/pcap/Makefile [new file with mode: 0644]
stargazer/plugins/capture/pcap/pcap_cap.cpp [new file with mode: 0644]
stargazer/plugins/capture/pcap/pcap_cap.h [new file with mode: 0644]
stargazer/plugins/configuration/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/Makefile [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/admins_methods.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/admins_methods.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/info_methods.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/info_methods.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/messages_methods.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/messages_methods.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/rpcconfig.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/rpcconfig.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/tariff_helper.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/tariff_helper.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/tariffs_methods.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/user_helper.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/user_helper.h [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/users_methods.cpp [new file with mode: 0644]
stargazer/plugins/configuration/rpcconfig/users_methods.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/Makefile [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/configproto.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/configproto.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/conn.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/conn.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/dumphelpers.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_admins.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_admins.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_auth_by.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_auth_by.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_message.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_message.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_server_info.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_server_info.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_services.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_services.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_tariffs.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_tariffs.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_user_info.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_user_info.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_users.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/parser_users.h [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/stgconfig.cpp [new file with mode: 0644]
stargazer/plugins/configuration/sgconfig/stgconfig.h [new file with mode: 0644]
stargazer/plugins/other/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/other/ping/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/other/ping/Makefile [new file with mode: 0644]
stargazer/plugins/other/ping/ping.cpp [new file with mode: 0644]
stargazer/plugins/other/ping/ping.h [new file with mode: 0644]
stargazer/plugins/other/radius/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/other/radius/Makefile [new file with mode: 0644]
stargazer/plugins/other/radius/config.cpp [new file with mode: 0644]
stargazer/plugins/other/radius/config.h [new file with mode: 0644]
stargazer/plugins/other/radius/conn.cpp [new file with mode: 0644]
stargazer/plugins/other/radius/conn.h [new file with mode: 0644]
stargazer/plugins/other/radius/radius.cpp [new file with mode: 0644]
stargazer/plugins/other/radius/radius.h [new file with mode: 0644]
stargazer/plugins/other/rscript/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/other/rscript/Makefile [new file with mode: 0644]
stargazer/plugins/other/rscript/nrmap_parser.cpp [new file with mode: 0644]
stargazer/plugins/other/rscript/nrmap_parser.h [new file with mode: 0644]
stargazer/plugins/other/rscript/rscript.cpp [new file with mode: 0644]
stargazer/plugins/other/rscript/rscript.h [new file with mode: 0644]
stargazer/plugins/other/rscript/send_functor.h [new file with mode: 0644]
stargazer/plugins/other/rscript/ur_functor.h [new file with mode: 0644]
stargazer/plugins/other/smux/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/other/smux/Makefile [new file with mode: 0644]
stargazer/plugins/other/smux/STG-MIB.mib [new file with mode: 0644]
stargazer/plugins/other/smux/TODO [new file with mode: 0644]
stargazer/plugins/other/smux/handlers.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/pen.h [new file with mode: 0644]
stargazer/plugins/other/smux/sensors.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/sensors.h [new file with mode: 0644]
stargazer/plugins/other/smux/smux.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/smux.h [new file with mode: 0644]
stargazer/plugins/other/smux/tables.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/tables.h [new file with mode: 0644]
stargazer/plugins/other/smux/types.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/types.h [new file with mode: 0644]
stargazer/plugins/other/smux/utils.cpp [new file with mode: 0644]
stargazer/plugins/other/smux/utils.h [new file with mode: 0644]
stargazer/plugins/other/smux/value2os.h [new file with mode: 0644]
stargazer/plugins/store/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/store/files/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/store/files/Makefile [new file with mode: 0644]
stargazer/plugins/store/files/file_store.cpp [new file with mode: 0644]
stargazer/plugins/store/files/file_store.h [new file with mode: 0644]
stargazer/plugins/store/firebird/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/store/firebird/Makefile [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store.h [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_admins.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_corporations.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_messages.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_services.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_tariffs.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_users.cpp [new file with mode: 0644]
stargazer/plugins/store/firebird/firebird_store_utils.cpp [new file with mode: 0644]
stargazer/plugins/store/mysql/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/store/mysql/Makefile [new file with mode: 0644]
stargazer/plugins/store/mysql/mysql_store.cpp [new file with mode: 0644]
stargazer/plugins/store/mysql/mysql_store.h [new file with mode: 0644]
stargazer/plugins/store/postgresql/CMakeLists.txt [new file with mode: 0644]
stargazer/plugins/store/postgresql/Makefile [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store.h [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_admins.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_messages.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_services.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_users.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_utils.cpp [new file with mode: 0644]
stargazer/plugins/store/postgresql/postgresql_store_utils.h [new file with mode: 0644]
stargazer/scripts/clean_db [new file with mode: 0755]
stargazer/scripts/monitor [new file with mode: 0755]
stargazer/scripts/shaper/OnConnect [new file with mode: 0755]
stargazer/scripts/shaper/OnDisconnect [new file with mode: 0755]
stargazer/scripts/shaper/Readme.txt [new file with mode: 0644]
stargazer/scripts/shaper/shaper.sh [new file with mode: 0755]
stargazer/scripts/shaper/shaper.stop.sh [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/Readme [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/firewall/firewall [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/freeradius/clients.conf [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/freeradius/radiusd.conf [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/ppp/ip-down.d/stg [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/ppp/ip-up.d/stg [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/ppp/pptpd-options [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/pptpd.conf [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/radiusclient/servers [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/stargazer/OnChange [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/stargazer/OnConnect [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/stargazer/OnDisconnect [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/stargazer/OnUserAdd [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/stargazer/OnUserDel [new file with mode: 0755]
stargazer/scripts/shaper_vpn_radius/stargazer/rules [new file with mode: 0644]
stargazer/scripts/shaper_vpn_radius/stargazer/stargazer.conf [new file with mode: 0644]
stargazer/services_impl.cpp [new file with mode: 0644]
stargazer/services_impl.h [new file with mode: 0644]
stargazer/settings_impl.cpp [new file with mode: 0644]
stargazer/settings_impl.h [new file with mode: 0644]
stargazer/stg_timer.cpp [new file with mode: 0644]
stargazer/stg_timer.h [new file with mode: 0644]
stargazer/store_loader.cpp [new file with mode: 0644]
stargazer/store_loader.h [new file with mode: 0644]
stargazer/tariff_impl.cpp [new file with mode: 0644]
stargazer/tariff_impl.h [new file with mode: 0644]
stargazer/tariffs_impl.cpp [new file with mode: 0644]
stargazer/tariffs_impl.h [new file with mode: 0644]
stargazer/traffcounter_impl.cpp [new file with mode: 0644]
stargazer/traffcounter_impl.h [new file with mode: 0644]
stargazer/user_impl.cpp [new file with mode: 0644]
stargazer/user_impl.h [new file with mode: 0644]
stargazer/user_property.cpp [new file with mode: 0644]
stargazer/users_impl.cpp [new file with mode: 0644]
stargazer/users_impl.h [new file with mode: 0644]
stglibs/Makefile [deleted file]
stglibs/Makefile.in [deleted file]
stglibs/common.lib/Makefile [deleted file]
stglibs/common.lib/blockio.cpp [deleted file]
stglibs/common.lib/common.bpf [deleted file]
stglibs/common.lib/common.bpr [deleted file]
stglibs/common.lib/common.cpp [deleted file]
stglibs/common.lib/include/stg/blockio.h [deleted file]
stglibs/common.lib/include/stg/common.h [deleted file]
stglibs/common.lib/strptime.cpp [deleted file]
stglibs/conffiles.lib/Makefile [deleted file]
stglibs/conffiles.lib/conffiles.cpp [deleted file]
stglibs/conffiles.lib/include/stg/conffiles.h [deleted file]
stglibs/crypto.lib/Makefile [deleted file]
stglibs/crypto.lib/ag_md5.c [deleted file]
stglibs/crypto.lib/bfstream.cpp [deleted file]
stglibs/crypto.lib/blowfish.c [deleted file]
stglibs/crypto.lib/crypto.bpf [deleted file]
stglibs/crypto.lib/crypto.bpr [deleted file]
stglibs/crypto.lib/include/stg/ag_md5.h [deleted file]
stglibs/crypto.lib/include/stg/bfstream.h [deleted file]
stglibs/crypto.lib/include/stg/blowfish.h [deleted file]
stglibs/dotconfpp.lib/Makefile [deleted file]
stglibs/dotconfpp.lib/dotconfpp.cpp [deleted file]
stglibs/dotconfpp.lib/include/stg/dotconfpp.h [deleted file]
stglibs/dotconfpp.lib/mempool.cpp [deleted file]
stglibs/dotconfpp.lib/mempool.h [deleted file]
stglibs/ia.lib/Makefile [deleted file]
stglibs/ia.lib/ia.bpf [deleted file]
stglibs/ia.lib/ia.bpr [deleted file]
stglibs/ia.lib/ia.cpp [deleted file]
stglibs/ia.lib/include/stg/ia.h [deleted file]
stglibs/ibpp.lib/Makefile [deleted file]
stglibs/ibpp.lib/_dpb.cpp [deleted file]
stglibs/ibpp.lib/_ibpp.cpp [deleted file]
stglibs/ibpp.lib/_ibpp.h [deleted file]
stglibs/ibpp.lib/_ibs.cpp [deleted file]
stglibs/ibpp.lib/_rb.cpp [deleted file]
stglibs/ibpp.lib/_spb.cpp [deleted file]
stglibs/ibpp.lib/_tpb.cpp [deleted file]
stglibs/ibpp.lib/all_in_one.cpp [deleted file]
stglibs/ibpp.lib/array.cpp [deleted file]
stglibs/ibpp.lib/blob.cpp [deleted file]
stglibs/ibpp.lib/database.cpp [deleted file]
stglibs/ibpp.lib/date.cpp [deleted file]
stglibs/ibpp.lib/dbkey.cpp [deleted file]
stglibs/ibpp.lib/events.cpp [deleted file]
stglibs/ibpp.lib/exception.cpp [deleted file]
stglibs/ibpp.lib/ibase.h [deleted file]
stglibs/ibpp.lib/iberror.h [deleted file]
stglibs/ibpp.lib/include/stg/ibpp.h [deleted file]
stglibs/ibpp.lib/row.cpp [deleted file]
stglibs/ibpp.lib/service.cpp [deleted file]
stglibs/ibpp.lib/statement.cpp [deleted file]
stglibs/ibpp.lib/time.cpp [deleted file]
stglibs/ibpp.lib/transaction.cpp [deleted file]
stglibs/ibpp.lib/user.cpp [deleted file]
stglibs/json.lib/Makefile [deleted file]
stglibs/json.lib/generator.cpp [deleted file]
stglibs/json.lib/include/stg/json_generator.h [deleted file]
stglibs/json.lib/include/stg/json_parser.h [deleted file]
stglibs/json.lib/parser.cpp [deleted file]
stglibs/logger.lib/Makefile [deleted file]
stglibs/logger.lib/include/stg/logger.h [deleted file]
stglibs/logger.lib/logger.cpp [deleted file]
stglibs/pinger.lib/Makefile [deleted file]
stglibs/pinger.lib/include/stg/pinger.h [deleted file]
stglibs/pinger.lib/pinger.cpp [deleted file]
stglibs/scriptexecuter.lib/Makefile [deleted file]
stglibs/scriptexecuter.lib/include/stg/scriptexecuter.h [deleted file]
stglibs/scriptexecuter.lib/scriptexecuter.c [deleted file]
stglibs/smux.lib/ANY.c [deleted file]
stglibs/smux.lib/ApplicationSyntax.c [deleted file]
stglibs/smux.lib/AtEntry.c [deleted file]
stglibs/smux.lib/BIT_STRING.c [deleted file]
stglibs/smux.lib/BOOLEAN.c [deleted file]
stglibs/smux.lib/ClosePDU.c [deleted file]
stglibs/smux.lib/Counter.c [deleted file]
stglibs/smux.lib/DisplayString.c [deleted file]
stglibs/smux.lib/EgpNeighEntry.c [deleted file]
stglibs/smux.lib/Gauge.c [deleted file]
stglibs/smux.lib/GetNextRequest-PDU.c [deleted file]
stglibs/smux.lib/GetRequest-PDU.c [deleted file]
stglibs/smux.lib/GetResponse-PDU.c [deleted file]
stglibs/smux.lib/INTEGER.c [deleted file]
stglibs/smux.lib/IfEntry.c [deleted file]
stglibs/smux.lib/IpAddrEntry.c [deleted file]
stglibs/smux.lib/IpAddress.c [deleted file]
stglibs/smux.lib/IpNetToMediaEntry.c [deleted file]
stglibs/smux.lib/IpRouteEntry.c [deleted file]
stglibs/smux.lib/Makefile [deleted file]
stglibs/smux.lib/Message.c [deleted file]
stglibs/smux.lib/NULL.c [deleted file]
stglibs/smux.lib/NativeEnumerated.c [deleted file]
stglibs/smux.lib/NativeInteger.c [deleted file]
stglibs/smux.lib/NetworkAddress.c [deleted file]
stglibs/smux.lib/OBJECT_IDENTIFIER.c [deleted file]
stglibs/smux.lib/OCTET_STRING.c [deleted file]
stglibs/smux.lib/ObjectName.c [deleted file]
stglibs/smux.lib/ObjectSyntax.c [deleted file]
stglibs/smux.lib/Opaque.c [deleted file]
stglibs/smux.lib/OpenPDU.c [deleted file]
stglibs/smux.lib/PDU.c [deleted file]
stglibs/smux.lib/PDUs.c [deleted file]
stglibs/smux.lib/PhysAddress.c [deleted file]
stglibs/smux.lib/RFC1155-SMI.asn1 [deleted file]
stglibs/smux.lib/RFC1157-SNMP.asn1 [deleted file]
stglibs/smux.lib/RFC1213-MIB.asn1 [deleted file]
stglibs/smux.lib/RReqPDU.c [deleted file]
stglibs/smux.lib/RRspPDU.c [deleted file]
stglibs/smux.lib/SMUX-PDUs.c [deleted file]
stglibs/smux.lib/SMUX.asn1 [deleted file]
stglibs/smux.lib/SOutPDU.c [deleted file]
stglibs/smux.lib/SetRequest-PDU.c [deleted file]
stglibs/smux.lib/SimpleOpen.c [deleted file]
stglibs/smux.lib/SimpleSyntax.c [deleted file]
stglibs/smux.lib/TcpConnEntry.c [deleted file]
stglibs/smux.lib/TimeTicks.c [deleted file]
stglibs/smux.lib/Trap-PDU.c [deleted file]
stglibs/smux.lib/UdpEntry.c [deleted file]
stglibs/smux.lib/VarBind.c [deleted file]
stglibs/smux.lib/VarBindList.c [deleted file]
stglibs/smux.lib/asn_SEQUENCE_OF.c [deleted file]
stglibs/smux.lib/asn_SET_OF.c [deleted file]
stglibs/smux.lib/asn_codecs_prim.c [deleted file]
stglibs/smux.lib/ber_decoder.c [deleted file]
stglibs/smux.lib/ber_tlv_length.c [deleted file]
stglibs/smux.lib/ber_tlv_tag.c [deleted file]
stglibs/smux.lib/constr_CHOICE.c [deleted file]
stglibs/smux.lib/constr_SEQUENCE.c [deleted file]
stglibs/smux.lib/constr_SEQUENCE_OF.c [deleted file]
stglibs/smux.lib/constr_SET_OF.c [deleted file]
stglibs/smux.lib/constr_TYPE.c [deleted file]
stglibs/smux.lib/constraints.c [deleted file]
stglibs/smux.lib/der_encoder.c [deleted file]
stglibs/smux.lib/include/stg/ANY.h [deleted file]
stglibs/smux.lib/include/stg/ApplicationSyntax.h [deleted file]
stglibs/smux.lib/include/stg/AtEntry.h [deleted file]
stglibs/smux.lib/include/stg/BIT_STRING.h [deleted file]
stglibs/smux.lib/include/stg/BOOLEAN.h [deleted file]
stglibs/smux.lib/include/stg/ClosePDU.h [deleted file]
stglibs/smux.lib/include/stg/Counter.h [deleted file]
stglibs/smux.lib/include/stg/DisplayString.h [deleted file]
stglibs/smux.lib/include/stg/EgpNeighEntry.h [deleted file]
stglibs/smux.lib/include/stg/Gauge.h [deleted file]
stglibs/smux.lib/include/stg/GetNextRequest-PDU.h [deleted file]
stglibs/smux.lib/include/stg/GetRequest-PDU.h [deleted file]
stglibs/smux.lib/include/stg/GetResponse-PDU.h [deleted file]
stglibs/smux.lib/include/stg/INTEGER.h [deleted file]
stglibs/smux.lib/include/stg/IfEntry.h [deleted file]
stglibs/smux.lib/include/stg/IpAddrEntry.h [deleted file]
stglibs/smux.lib/include/stg/IpAddress.h [deleted file]
stglibs/smux.lib/include/stg/IpNetToMediaEntry.h [deleted file]
stglibs/smux.lib/include/stg/IpRouteEntry.h [deleted file]
stglibs/smux.lib/include/stg/Message.h [deleted file]
stglibs/smux.lib/include/stg/NULL.h [deleted file]
stglibs/smux.lib/include/stg/NativeEnumerated.h [deleted file]
stglibs/smux.lib/include/stg/NativeInteger.h [deleted file]
stglibs/smux.lib/include/stg/NetworkAddress.h [deleted file]
stglibs/smux.lib/include/stg/OBJECT_IDENTIFIER.h [deleted file]
stglibs/smux.lib/include/stg/OCTET_STRING.h [deleted file]
stglibs/smux.lib/include/stg/ObjectName.h [deleted file]
stglibs/smux.lib/include/stg/ObjectSyntax.h [deleted file]
stglibs/smux.lib/include/stg/Opaque.h [deleted file]
stglibs/smux.lib/include/stg/OpenPDU.h [deleted file]
stglibs/smux.lib/include/stg/PDU.h [deleted file]
stglibs/smux.lib/include/stg/PDUs.h [deleted file]
stglibs/smux.lib/include/stg/PhysAddress.h [deleted file]
stglibs/smux.lib/include/stg/RReqPDU.h [deleted file]
stglibs/smux.lib/include/stg/RRspPDU.h [deleted file]
stglibs/smux.lib/include/stg/SMUX-PDUs.h [deleted file]
stglibs/smux.lib/include/stg/SOutPDU.h [deleted file]
stglibs/smux.lib/include/stg/SetRequest-PDU.h [deleted file]
stglibs/smux.lib/include/stg/SimpleOpen.h [deleted file]
stglibs/smux.lib/include/stg/SimpleSyntax.h [deleted file]
stglibs/smux.lib/include/stg/TcpConnEntry.h [deleted file]
stglibs/smux.lib/include/stg/TimeTicks.h [deleted file]
stglibs/smux.lib/include/stg/Trap-PDU.h [deleted file]
stglibs/smux.lib/include/stg/UdpEntry.h [deleted file]
stglibs/smux.lib/include/stg/VarBind.h [deleted file]
stglibs/smux.lib/include/stg/VarBindList.h [deleted file]
stglibs/smux.lib/include/stg/asn_SEQUENCE_OF.h [deleted file]
stglibs/smux.lib/include/stg/asn_SET_OF.h [deleted file]
stglibs/smux.lib/include/stg/asn_application.h [deleted file]
stglibs/smux.lib/include/stg/asn_codecs.h [deleted file]
stglibs/smux.lib/include/stg/asn_codecs_prim.h [deleted file]
stglibs/smux.lib/include/stg/asn_internal.h [deleted file]
stglibs/smux.lib/include/stg/asn_system.h [deleted file]
stglibs/smux.lib/include/stg/ber_decoder.h [deleted file]
stglibs/smux.lib/include/stg/ber_tlv_length.h [deleted file]
stglibs/smux.lib/include/stg/ber_tlv_tag.h [deleted file]
stglibs/smux.lib/include/stg/constr_CHOICE.h [deleted file]
stglibs/smux.lib/include/stg/constr_SEQUENCE.h [deleted file]
stglibs/smux.lib/include/stg/constr_SEQUENCE_OF.h [deleted file]
stglibs/smux.lib/include/stg/constr_SET_OF.h [deleted file]
stglibs/smux.lib/include/stg/constr_TYPE.h [deleted file]
stglibs/smux.lib/include/stg/constraints.h [deleted file]
stglibs/smux.lib/include/stg/der_encoder.h [deleted file]
stglibs/smux.lib/include/stg/per_decoder.h [deleted file]
stglibs/smux.lib/include/stg/per_encoder.h [deleted file]
stglibs/smux.lib/include/stg/per_support.h [deleted file]
stglibs/smux.lib/include/stg/xer_decoder.h [deleted file]
stglibs/smux.lib/include/stg/xer_encoder.h [deleted file]
stglibs/smux.lib/include/stg/xer_support.h [deleted file]
stglibs/smux.lib/per_decoder.c [deleted file]
stglibs/smux.lib/per_encoder.c [deleted file]
stglibs/smux.lib/per_support.c [deleted file]
stglibs/smux.lib/xer_decoder.c [deleted file]
stglibs/smux.lib/xer_encoder.c [deleted file]
stglibs/smux.lib/xer_support.c [deleted file]
stglibs/srvconf.lib/Makefile [deleted file]
stglibs/srvconf.lib/include/stg/servconf.h [deleted file]
stglibs/srvconf.lib/include/stg/servconf_types.h [deleted file]
stglibs/srvconf.lib/netunit.cpp [deleted file]
stglibs/srvconf.lib/netunit.h [deleted file]
stglibs/srvconf.lib/parsers/auth_by.cpp [deleted file]
stglibs/srvconf.lib/parsers/auth_by.h [deleted file]
stglibs/srvconf.lib/parsers/base.h [deleted file]
stglibs/srvconf.lib/parsers/chg_admin.cpp [deleted file]
stglibs/srvconf.lib/parsers/chg_admin.h [deleted file]
stglibs/srvconf.lib/parsers/chg_corp.cpp [deleted file]
stglibs/srvconf.lib/parsers/chg_corp.h [deleted file]
stglibs/srvconf.lib/parsers/chg_service.cpp [deleted file]
stglibs/srvconf.lib/parsers/chg_service.h [deleted file]
stglibs/srvconf.lib/parsers/chg_tariff.cpp [deleted file]
stglibs/srvconf.lib/parsers/chg_tariff.h [deleted file]
stglibs/srvconf.lib/parsers/chg_user.cpp [deleted file]
stglibs/srvconf.lib/parsers/chg_user.h [deleted file]
stglibs/srvconf.lib/parsers/get_admin.cpp [deleted file]
stglibs/srvconf.lib/parsers/get_admin.h [deleted file]
stglibs/srvconf.lib/parsers/get_container.h [deleted file]
stglibs/srvconf.lib/parsers/get_corp.cpp [deleted file]
stglibs/srvconf.lib/parsers/get_corp.h [deleted file]
stglibs/srvconf.lib/parsers/get_service.cpp [deleted file]
stglibs/srvconf.lib/parsers/get_service.h [deleted file]
stglibs/srvconf.lib/parsers/get_tariff.cpp [deleted file]
stglibs/srvconf.lib/parsers/get_tariff.h [deleted file]
stglibs/srvconf.lib/parsers/get_user.cpp [deleted file]
stglibs/srvconf.lib/parsers/get_user.h [deleted file]
stglibs/srvconf.lib/parsers/property.cpp [deleted file]
stglibs/srvconf.lib/parsers/property.h [deleted file]
stglibs/srvconf.lib/parsers/resetable_utils.h [deleted file]
stglibs/srvconf.lib/parsers/server_info.cpp [deleted file]
stglibs/srvconf.lib/parsers/server_info.h [deleted file]
stglibs/srvconf.lib/parsers/simple.cpp [deleted file]
stglibs/srvconf.lib/parsers/simple.h [deleted file]
stglibs/srvconf.lib/servconf.cpp [deleted file]
tests/CMakeLists.txt [new file with mode: 0644]
tests/test_bfstream.cpp
tests/test_conffiles.cpp
tests/test_raw_ip.cpp
tests/testtariffs.h

index b49a31e..ba791f7 100644 (file)
@@ -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 (file)
index 0000000..0872ec2
--- /dev/null
@@ -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 (file)
index 0000000..5199bef
--- /dev/null
@@ -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 (file)
index 0000000..833f1bc
--- /dev/null
@@ -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 (file)
index 0000000..6ab31ae
--- /dev/null
@@ -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 (file)
index 0000000..7909cb0
--- /dev/null
@@ -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 (file)
index 0000000..b05e61b
--- /dev/null
@@ -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 (file)
index 0000000..d1dff55
--- /dev/null
@@ -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 (file)
index 0000000..2e18caf
--- /dev/null
@@ -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 )
index 961968a..f385129 100644 (file)
@@ -22,9 +22,9 @@
 #define ADMIN_H
 
 #include <string>
+#include <cstdint>
 
 #include "admin_conf.h"
-#include "os_int.h"
 
 class ADMIN {
 public:
index 6f8005f..88d944b 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <string>
 
-#include "os_int.h"
+#include <cstdint>
 
 #define ADM_LOGIN_LEN   (32)
 #define ADM_PASSWD_LEN  (32)
index 3520270..afc014c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PACKETH
 #define PACKETH
 
-#include "os_int.h"
+#include <cstdint>
 
 #define CONN_SYN_N          0
 #define CONN_SYN_ACK_N      1
index 5a0e918..49f8c7c 100644 (file)
  */
 
 #include <ctime>
+#include <cstdint>
 #include <string>
 
-#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 (file)
index 00ab3fa..0000000
+++ /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 <stg34@stargazer.dp.ua>
- */
-
- /*
- $Revision: 1.4 $
- $Date: 2008/03/25 17:41:50 $
- */
-
-
-#ifndef OS_INT_H
-#define OS_INT_H
-
-#ifdef LINUX
-#include <stdint.h>
-#endif
-
-#if defined(FREE_BSD5) || defined(DARWIN)
-#include <inttypes.h>
-#endif
-
-#ifdef FREE_BSD
-#include <sys/inttypes.h>
-#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
-
index 2deabcc..d02ff69 100644 (file)
@@ -29,9 +29,9 @@
 #define PLUGIN_H
 
 #include <string>
+#include <cstdint>
 
 #include "noncopyable.h"
-#include "os_int.h"
 #include "admins.h"
 #include "users.h"
 #include "tariffs.h"
index 96cddc4..90ed929 100644 (file)
@@ -23,7 +23,7 @@
 
 #define RAD_ID "00100"
 
-#include "os_int.h"
+#include <cstdint>
 
 struct RAD_PACKET
 {
index b94faf8..30e1c8f 100644 (file)
@@ -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 <netinet/in_systm.h> // n_long in netinet/ip.h
 #endif
 
index 503fe91..0c31e22 100644 (file)
@@ -34,7 +34,7 @@
 
 #define RS_ID "RSP00"
 
-#include "os_int.h"
+#include <cstdint>
 
 namespace RS
 {
index b6c2449..a9b8d5c 100644 (file)
@@ -22,9 +22,9 @@
 #define SERVICE_CONF_H
 
 #include "resetable.h"
-#include "os_int.h"
 
 #include <string>
+#include <cstdint>
 
 struct SERVICE_CONF
 {
index 4f5b416..6f9d876 100644 (file)
 #ifndef TARIFF_H
 #define TARIFF_H
 
-#include "os_int.h"
-
 #include <string>
+#include <istream>
 #include <cstring>
 #include <ctime>
-#include <istream>
+#include <cstdint>
 
 struct TARIFF_DATA;
 
index 7772a29..654f334 100644 (file)
 #include "message.h"
 #include "tariff.h"
 #include "user_traff.h"
-#include "os_int.h"
 
 #include <vector>
 #include <string>
 
 #include <ctime>
+#include <cstdint>
 
 class USER_PROPERTIES;
 class AUTH;
index a16b392..d48682d 100644 (file)
@@ -9,10 +9,10 @@
 
 #include <string>
 #include <vector>
+#include <cstdint>
 #include "const.h"
 #include "user_ips.h"
 #include "resetable.h"
-#include "os_int.h"
 
 //-----------------------------------------------------------------------------
 struct USER_CONF
index bb92095..ee227e5 100644 (file)
@@ -28,9 +28,9 @@
 #define USER_IPS_H
 
 #include "stg/common.h"
-#include "os_int.h"
 
 #include <cstring>
+#include <cstdint>
 #include <vector>
 #include <string>
 #include <iostream>
index ff020dc..4cedb59 100644 (file)
 #define USER_STAT_H
 
 #include <ctime>
+#include <cstdint>
 #include <map>
 #include <utility>
 #include <string>
 
-#include "os_int.h"
 #include "resetable.h"
 #include "user_traff.h"
 //-----------------------------------------------------------------------------
index 3ca9768..5abcee3 100644 (file)
 
 #include "resetable.h"
 #include "const.h"
-#include "os_int.h"
 
 #include <iostream>
 #include <vector>
+#include <cstdint>
 
 enum TRAFF_DIRECTION {TRAFF_UPLOAD, TRAFF_DOWNLOAD};
 
diff --git a/lib/.placeholder b/lib/.placeholder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..af3d944
--- /dev/null
@@ -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 (file)
index 0000000..330ee0d
--- /dev/null
@@ -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/libs/common/Makefile b/libs/common/Makefile
new file mode 100644 (file)
index 0000000..932e270
--- /dev/null
@@ -0,0 +1,18 @@
+###############################################################################
+# $Id: Makefile,v 1.9 2010/01/21 13:02:12 faust Exp $
+###############################################################################
+
+include ../../Makefile.conf
+
+LIB_NAME = stgcommon
+
+SRCS = common.cpp \
+       strptime.cpp \
+       blockio.cpp
+
+INCS = common.h \
+       blockio.h
+
+LIBS += $(LIBICONV)
+
+include ../Makefile.in
diff --git a/libs/common/blockio.cpp b/libs/common/blockio.cpp
new file mode 100644 (file)
index 0000000..04fd1d8
--- /dev/null
@@ -0,0 +1,102 @@
+#include "stg/blockio.h"
+
+namespace
+{
+
+void* adjust(void* base, size_t shift)
+{
+    char* ptr = static_cast<char*>(base);
+    return ptr + shift;
+}
+
+} // namspace anonymous
+
+using STG::BlockReader;
+using STG::BlockWriter;
+
+BlockReader::BlockReader(const IOVec& ioVec)
+    : m_dest(ioVec),
+      m_remainder(0)
+{
+    for (size_t i = 0; i < m_dest.size(); ++i)
+        m_remainder += m_dest[i].iov_len;
+}
+
+bool BlockReader::read(int socket)
+{
+    if (m_remainder == 0)
+        return true;
+
+    size_t offset = m_dest.size() - 1;
+    size_t toRead = m_remainder;
+    while (offset > 0) {
+        if (toRead < m_dest[offset].iov_len)
+            break;
+        toRead -= m_dest[offset].iov_len;
+        --offset;
+    }
+
+    IOVec dest(m_dest.size() - offset);
+    for (size_t i = 0; i < dest.size(); ++i) {
+        if (i == 0) {
+            dest[0].iov_len = toRead;
+            dest[0].iov_base = adjust(m_dest[offset].iov_base, m_dest[offset].iov_len - toRead);
+        } else {
+            dest[i] = m_dest[offset + i];
+        }
+    }
+
+    ssize_t res = readv(socket, dest.data(), dest.size());
+    if (res < 0)
+        return false;
+    if (res == 0)
+        return m_remainder == 0;
+    if (res < static_cast<ssize_t>(m_remainder))
+        m_remainder -= res;
+    else
+        m_remainder = 0;
+    return true;
+}
+
+BlockWriter::BlockWriter(const IOVec& ioVec)
+    : m_source(ioVec),
+      m_remainder(0)
+{
+    for (size_t i = 0; i < m_source.size(); ++i)
+        m_remainder += m_source[i].iov_len;
+}
+
+bool BlockWriter::write(int socket)
+{
+    if (m_remainder == 0)
+        return true;
+
+    size_t offset = m_source.size() - 1;
+    size_t toWrite = m_remainder;
+    while (offset > 0) {
+        if (toWrite < m_source[offset].iov_len)
+            break;
+        toWrite -= m_source[offset].iov_len;
+        --offset;
+    }
+
+    IOVec source(m_source.size() - offset);
+    for (size_t i = 0; i < source.size(); ++i) {
+        if (i == 0) {
+            source[0].iov_len = toWrite;
+            source[0].iov_base = adjust(m_source[offset].iov_base, m_source[offset].iov_len - toWrite);
+        } else {
+            source[i] = m_source[offset + i];
+        }
+    }
+    ssize_t res = writev(socket, source.data(), source.size());
+    if (res < 0)
+        return false;
+    if (res == 0)
+        return m_remainder == 0;
+    if (res < static_cast<ssize_t>(m_remainder))
+        m_remainder -= res;
+    else
+        m_remainder = 0;
+    return true;
+}
diff --git a/libs/common/common.cpp b/libs/common/common.cpp
new file mode 100644 (file)
index 0000000..8cfcf40
--- /dev/null
@@ -0,0 +1,1165 @@
+/*
+ *    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 <stg34@stargazer.dp.ua>
+ */
+
+ /*
+ $Revision: 1.42 $
+ $Date: 2010/11/08 10:11:19 $
+ $Author: faust $
+ */
+
+// For old and dub systems
+// Like FreeBSD4
+#include <sys/types.h>
+#include <sys/time.h>
+#include <pwd.h>
+#include <grp.h>
+
+#include <sys/select.h>
+
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/select.h>
+#endif
+
+#include <iconv.h>
+
+#include <algorithm>
+
+#include <cstdlib>
+#include <cstdarg>
+#include <cstdio>
+#include <cstring>
+#include <cerrno>
+#include <cassert>
+
+#include "stg/common.h"
+
+#ifndef INET_ADDRSTRLEN
+#   define INET_ADDRSTRLEN 16
+#endif
+
+namespace
+{
+//---------------------------------------------------------------------------
+unsigned char koi2win[] = {
+        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+        0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+        0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+        0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+        0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+        0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+        0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+        0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+        0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+        0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+        0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
+        0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+        0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
+        0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+        0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+        0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+        0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+        0xA0, 0xA1, 0xA2, 0xB8, 0xBA, 0xA5, 0xB3, 0xBF,
+        0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xB4, 0xAE, 0xAF,
+        0xB0, 0xB1, 0xB2, 0xA8, 0xAA, 0xB5, 0xB2, 0xAF,
+        0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xA5, 0xBE, 0xBF,
+        0xFE, 0xE0, 0xE1, 0xF6, 0xE4, 0xE5, 0xF4, 0xE3,
+        0xF5, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE,
+        0xEF, 0xFF, 0xF0, 0xF1, 0xF2, 0xF3, 0xE6, 0xE2,
+        0xFC, 0xFB, 0xE7, 0xF8, 0xFD, 0xF9, 0xF7, 0xFA,
+        0xDE, 0xC0, 0xC1, 0xD6, 0xC4, 0xC5, 0xD4, 0xC3,
+        0xD5, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE,
+        0xCF, 0xDF, 0xD0, 0xD1, 0xD2, 0xD3, 0xC6, 0xC2,
+        0xDC, 0xDB, 0xC7, 0xD8, 0xDD, 0xD9, 0xD7, 0xDA};
+
+
+unsigned char win2koi[] = {
+        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+        0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+        0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+        0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+        0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+        0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+        0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+        0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+        0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+        0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+        0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+        0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+        0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
+        0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+        0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
+        0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+        0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+        0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+        0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+        0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xBD, 0xA6, 0xA7,
+        0xB3, 0xA9, 0xB4, 0xAB, 0xAC, 0xAD, 0xAE, 0xB7,
+        0xB0, 0xB1, 0xB6, 0xA6, 0xAD, 0xB5, 0xB6, 0xB7,
+        0xA3, 0xB9, 0xA4, 0xBB, 0xBC, 0xBD, 0xBE, 0xA7,
+        0xE1, 0xE2, 0xF7, 0xE7, 0xE4, 0xE5, 0xF6, 0xFA,
+        0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0,
+        0xF2, 0xF3, 0xF4, 0xF5, 0xE6, 0xE8, 0xE3, 0xFE,
+        0xFB, 0xFD, 0xFF, 0xF9, 0xF8, 0xFC, 0xE0, 0xF1,
+        0xC1, 0xC2, 0xD7, 0xC7, 0xC4, 0xC5, 0xD6, 0xDA,
+        0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0,
+        0xD2, 0xD3, 0xD4, 0xD5, 0xC6, 0xC8, 0xC3, 0xDE,
+        0xDB, 0xDD, 0xDF, 0xD9, 0xD8, 0xDC, 0xC0, 0xD1};
+}
+
+#ifdef WIN32
+//-----------------------------------------------------------------------------
+const char * inet_ntop(int af, const void * src, char * dst, unsigned long length)
+{
+struct sockaddr_in addr;
+addr.sin_family = af;
+addr.sin_port = 0;
+memcpy(&addr.sin_addr.s_addr, src, sizeof(addr.sin_addr.s_addr));
+if (WSAAddressToStringA(reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr), 0, dst, &length))
+    {
+    return NULL;
+    }
+return dst;
+}
+//-----------------------------------------------------------------------------
+int inet_pton(int af, const char * src, void * dst)
+{
+// Fuck you Microsoft!
+// Why the hell not to use const char *?
+size_t slen = strlen(src);
+char * buf = new char[slen + 1];
+strncpy(buf, src, slen + 1);
+buf[slen] = 0;
+struct sockaddr_in addr;
+addr.sin_family = af;
+addr.sin_port = 0;
+addr.sin_addr.s_addr = 0;
+int length = sizeof(addr);
+if (WSAStringToAddressA(buf, af, 0, reinterpret_cast<struct sockaddr *>(&addr), &length))
+    {
+    delete[] buf;
+    return -1;
+    }
+memcpy(dst, &addr, sizeof(addr));
+delete[] buf;
+return 1;
+}
+#endif
+//-----------------------------------------------------------------------------
+int strtodouble2(const char * s, double &a)
+{
+char *res;
+
+a = strtod(s, &res);
+
+if (*res != 0)
+    return EINVAL;
+
+return 0;
+}
+//-----------------------------------------------------------------------------
+#ifdef DEBUG
+int printfd(const char * __file__, const char * fmt, ...)
+#else
+int printfd(const char *, const char *, ...)
+#endif
+{
+#ifdef DEBUG
+char buff[1024];
+
+time_t t = time(NULL);
+
+va_list vl;
+va_start(vl, fmt);
+vsnprintf(buff, sizeof(buff), fmt, vl);
+va_end(vl);
+
+printf("%18s > %s > ", __file__, LogDate(t)+11);
+printf("%s", buff);
+
+#endif
+return 0;
+}
+//-----------------------------------------------------------------------------
+int strprintf(std::string * str, const char * fmt, ...)
+{
+char buff[1024];
+
+va_list vl;
+va_start(vl, fmt);
+int n = vsnprintf(buff, sizeof(buff), fmt, vl);
+va_end(vl);
+buff[1023] = 0;
+*str = buff;
+
+return n;
+}
+//-----------------------------------------------------------------------------
+const char *IntToKMG(int64_t a, int stat)
+{
+static const double K = 1024;
+static const double M = 1024 * 1024;
+static const double G = 1024 * 1024 * 1024;
+static char str[30];
+double value = a;
+
+switch (stat)
+    {
+    case ST_B:
+        #ifdef __WIN32__
+        sprintf(str, "%Ld", a);
+        #else
+        sprintf(str, "%lld", a);
+        #endif
+        break;
+    case ST_KB:
+        sprintf(str, "%.2f kb", value / K);
+        break;
+    case ST_MB:
+        sprintf(str, "%.2f Mb", value / M);
+        break;
+    default:
+        if (a > G)
+            {
+            sprintf(str, "%.2f Gb", value / G);
+            return &str[0];
+            }
+        if (a < -G)
+            {
+            sprintf(str, "%.2f Gb", value / G);
+            return &str[0];
+            }
+        if (a > M)
+            {
+            sprintf(str, "%.2f Mb", value / M);
+            return &str[0];
+            }
+        if (a < -M)
+            {
+            sprintf(str, "%.2f Mb", value / M);
+            return &str[0];
+            }
+
+        sprintf(str, "%.2f kb", value / K);
+        break;
+    }
+return str;
+}
+//---------------------------------------------------------------------------
+void KOIToWin(const char * s1, char * s2, int l)
+{
+for (int j = 0; j < l; j++)
+    {
+    unsigned char t = s1[j];
+    s2[j] = koi2win[t];
+
+    if (s1[j] == 0)
+        break;
+    }
+}
+//---------------------------------------------------------------------------
+void WinToKOI(const char * s1, char * s2, int l)
+{
+for (int j = 0; j < l; j++)
+    {
+    unsigned char t = s1[j];
+    s2[j] = win2koi[t];
+
+    if (s1[j] == 0)
+        break;
+    }
+}
+//---------------------------------------------------------------------------
+void KOIToWin(const std::string & s1, std::string * s2)
+{
+s2->erase(s2->begin(), s2->end());
+s2->reserve(s1.length());
+for (size_t j = 0; j < s1.length(); j++)
+    {
+    unsigned char t = s1[j];
+    s2->push_back(koi2win[t]);
+    }
+}
+//---------------------------------------------------------------------------
+void WinToKOI(const std::string & s1, std::string * s2)
+{
+s2->erase(s2->begin(), s2->end());
+s2->reserve(s1.length());
+for (size_t j = 0; j < s1.length(); j++)
+    {
+    unsigned char t = s1[j];
+    s2->push_back(win2koi[t]);
+    }
+}
+//---------------------------------------------------------------------------
+void Encode12str(std::string & dst, const std::string & src)
+{
+dst.erase(dst.begin(), dst.end());
+for (size_t i = 0; i < src.length(); i++)
+    {
+    dst.push_back('a' + (src[i] & 0x0f));
+    dst.push_back('a' + ((src[i] & 0xf0) >> 4));
+    }
+}
+//---------------------------------------------------------------------------
+void Decode21str(std::string & dst, const std::string & src)
+{
+dst.erase(dst.begin(), dst.end());
+for (size_t i = 0; i < src.length() / 2; i++)
+    {
+    char c1 = src[i * 2];
+    char c2 = src[i * 2 + 1];
+
+    c1 -= 'a';
+    c2 -= 'a';
+
+    dst.push_back(static_cast<char>(c1 + (c2 << 4)));
+    }
+}
+//---------------------------------------------------------------------------
+void Encode12(char * dst, const char * src, size_t srcLen)
+{
+for (size_t i = 0; i <= srcLen; i++)
+    {
+    char c1 = src[i] & 0x0f;
+    char c2 = (src[i] & 0xf0) >> 4;
+
+    c1 += 'a';
+    c2 += 'a';
+
+    dst[i * 2] = c1;
+    dst[i * 2 + 1] = c2;
+    }
+dst[srcLen * 2] = 0;
+}
+//---------------------------------------------------------------------------
+void Decode21(char * dst, const char * src)
+{
+for (size_t i = 0; ; i++)
+    {
+    if (src[i * 2] == 0)
+        break;
+
+    char c1 = src[i * 2];
+    char c2 = src[i * 2 + 1];
+
+    c1 -= 'a';
+    c2 -= 'a';
+
+    dst[i] = static_cast<char>(c1 + (c2 << 4));
+    }
+dst[strlen(src) / 2] = 0;
+}
+//---------------------------------------------------------------------------
+int ParseIPString(const char * str, uint32_t * ips, int maxIP)
+{
+/*
+ *Function Name:ParseIPString
+ *
+ *Parameters:
+ ÓÔÒÏËÁ ÄÌÑ ÒÁÚÂÏÒÁ É ÍÁÓÓÉ× ËÕÄÁ ÚÁÎÏÓÉÔØ ÐÏÌÕÞÅÎÎÙÅ ÁÄÒÅÓÁ
+ *
+ *Description:
+ îÁ ×ÈÏÄÅ ÄÏÌÖÎÁ ÂÙÔØ ÓÔÒÏËÁ ×ÉÄÁ "ip1,ip2,ip3" ÉÌÉ "*"
+ ÷ ÐÅÒ×ÏÍ ÓÌÕÞÁÅ × ÍÁÓÓÉ× ÚÁÎÏÓÑÔÓÑ ÒÁÚÏÂÒÁÎÎÙÅ ÁÄÒÅÓÁ.
+ åÓÌÉ ÉÈ ÍÅÎØÛÅ MAX_IP?, ÔÏ ÐÏÓÌÅÄÎÉÊ ÁÄÒÅÓ ÂÕÄÅÔ 255.255.255.255
+ åÓÌÉ ÓÔÒÏËÁ * , ÔÏ ÐÅÒ×ÁÙÊ ÁÄÒÅÓ ÂÕÄÅÔ 0.0.0.0, Ô.Å. ÌÀÂÏÊ
+ *
+ *Returns: 0 ÅÓÌÉ ×ÓÅ ïë
+ *
+ */
+
+char p[255];
+int n = 0;
+
+strncpy(p, str, 254);
+char * pp = p;
+
+memset(ips, 0xFF, sizeof(unsigned long) * maxIP);
+
+if (str[0] == '*' && strlen(str) == 1)
+    {
+    ips[0] = 0;
+    return 0;
+    }
+
+for (int i = 0; i < maxIP; i++)
+    {
+    char * p1 = strtok(pp, ",\n ");
+    pp = NULL;
+
+    if (p1 == NULL && n == 0)// ÕËÁÚÁÔÅÌØ ÎÕÌØ É ÐÒÏÞÉÔÁÎÏ ÁÄÒÅÓÏ× ÔÏÖÅ ÎÏÌØ
+        {
+        return EINVAL;
+        }
+
+    if (p1 == NULL && n)
+        {
+        return 0;
+        }
+
+    struct in_addr in;
+    if (inet_pton(AF_INET, p1, &in) != 1)
+        {
+        //printf("INADDR_NONE\n");
+        return EINVAL;
+        }
+
+    ips[n] = in.s_addr;
+
+    /*if (ips[n] == INADDR_NONE)
+        return EINVAL;*/
+
+    n++;
+
+    if (n >= maxIP)
+        return 0;
+
+    }
+
+return 0;
+}
+//-----------------------------------------------------------------------------
+int DaysInCurrentMonth()
+{
+time_t t = time(NULL);
+
+struct tm * lt = localtime(&t);
+
+return DaysInMonth(lt->tm_year, lt->tm_mon);
+}
+//-----------------------------------------------------------------------------
+int DaysInMonth(unsigned year, unsigned mon)
+{
+assert(mon < 12 && "Month number should be 0 - 11");
+switch (mon)
+    {
+    case 0: return 31;  //jan
+    case 1:
+        if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
+            return 29;
+        return 28;      //feb
+    case 2: return 31;  //mar
+    case 3: return 30;  //apr
+    case 4: return 31;  //may
+    case 5: return 30;  //june
+    case 6: return 31;  //jule
+    case 7: return 31;  //aug
+    case 8: return 30;  //sep
+    case 9: return 31;  //oct
+    case 10: return 30; //nov
+    case 11: return 31; //dec
+    }
+return -1; // We will never reach here
+}
+//-----------------------------------------------------------------------------
+int Min8(int a)
+{
+/*
+æÕÎËÃÉÑ ×ÏÚ×ÒÁÝÁÅÔ ÎÁÉÍÅÎØÛÅÅ ÞÉÓÌÏ ËÒÁÔÎÏÅ 8-ÍÉ ÂÏÌØÛÅÅ ÉÌÉ ÒÁ×ÎÏÅ ÚÁÄÁÎÎÏÍÕ
+ * */
+if (a % 8 == 0)
+    return a;
+
+return a + (8 - a % 8);
+}
+//-----------------------------------------------------------------------------
+/*char * inet_ntostr(unsigned long ip)
+{
+struct in_addr addr = {ip};
+return inet_ntoa(addr);
+}*/
+//-----------------------------------------------------------------------------
+std::string inet_ntostring(uint32_t ip)
+{
+    char buf[INET_ADDRSTRLEN + 1];
+    return inet_ntop(AF_INET, &ip, buf, INET_ADDRSTRLEN);
+}
+//-----------------------------------------------------------------------------
+uint32_t inet_strington(const std::string & value)
+{
+    uint32_t result;
+
+    if (inet_pton(AF_INET, value.c_str(), &result) <= 0)
+        return 0;
+
+    return result;
+}
+//-----------------------------------------------------------------------------
+std::string TimeToString(time_t time)
+{
+struct tm brokenTime;
+
+brokenTime.tm_wday = 0;
+brokenTime.tm_yday = 0;
+brokenTime.tm_isdst = 0;
+
+gmtime_r(&time, &brokenTime);
+
+char buf[32];
+strftime(buf, 32, "%Y-%m-%d %H:%M:%S", &brokenTime);
+
+return buf;
+}
+//-----------------------------------------------------------------------------
+int ParseTariffTimeStr(const char * str, int &h1, int &m1, int &h2, int &m2)
+{
+char hs1[10], ms1[10], hs2[10], ms2[10];
+char s1[25], s2[25];
+char ss[49];
+char *p1, *p2;
+
+strncpy(ss, str, 48);
+
+p1 = strtok(ss, "-");
+if (!p1)
+    return -1;
+
+strncpy(s1, p1, 24);
+
+p2 = strtok(NULL, "-");
+if (!p2)
+    return -1;
+
+strncpy(s2, p2, 24);
+
+p1 = strtok(s1, ":");
+if (!p1)
+    return -1;
+
+strncpy(hs1, p1, 9);
+
+p2 = strtok(NULL, ":");
+if (!p2)
+    return -1;
+
+strncpy(ms1, p2, 9);
+
+p1 = strtok(s2, ":");
+if (!p1)
+    return -1;
+
+strncpy(hs2, p1, 9);
+
+p2 = strtok(NULL, ":");
+if (!p2)
+    return -1;
+
+strncpy(ms2, p2, 9);
+
+if (str2x(hs1, h1) != 0)
+    return -1;
+
+if (str2x(ms1, m1) != 0)
+    return -1;
+
+if (str2x(hs2, h2) != 0)
+    return -1;
+
+if (str2x(ms2, m2) != 0)
+    return -1;
+
+return 0;
+}
+/*//---------------------------------------------------------------------------
+bool IsDigit(char c)
+{
+if (c >= '0' && c <= '9')
+    return true;
+return false;
+}
+//-----------------------------------------------------------------------------
+bool IsAlpha(char c)
+{
+if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
+    return true;
+return false;
+}*/
+//-----------------------------------------------------------------------------
+const char * LogDate(time_t t)
+{
+static char s[32];
+struct tm * tt = localtime(&t);
+
+snprintf(s, 20, "%d-%s%d-%s%d %s%d:%s%d:%s%d",
+         tt->tm_year + 1900,
+         tt->tm_mon + 1 < 10 ? "0" : "", tt->tm_mon + 1,
+         tt->tm_mday    < 10 ? "0" : "", tt->tm_mday,
+         tt->tm_hour    < 10 ? "0" : "", tt->tm_hour,
+         tt->tm_min     < 10 ? "0" : "", tt->tm_min,
+         tt->tm_sec     < 10 ? "0" : "", tt->tm_sec);
+
+return s;
+}
+//-----------------------------------------------------------------------------
+uint32_t CalcMask(uint32_t msk)
+{
+if (msk >= 32) return 0xFFffFFff;
+if (msk == 0) return 0;
+return htonl(0xFFffFFff << (32 - msk));
+}
+//---------------------------------------------------------------------------
+void TouchFile(const std::string & fileName)
+{
+FILE * f = fopen(fileName.c_str(), "w");
+if (f)
+    fclose(f);
+}
+//---------------------------------------------------------------------------
+#ifdef WIN32
+void EncodeStr(char * str, unsigned long serial, int useHDD)
+{
+int len = strlen(str);
+char stren[100];
+int i, j = 0;
+char c1, c2;
+char serial_c[sizeof(serial)];
+memcpy(serial_c, &serial, sizeof(serial));
+
+for (i = 0; i < len; i++)
+    {
+    if (!useHDD)
+        str[i] = str[i]^49;
+    else
+        {
+        str[i] = str[i]^serial_c[j%sizeof(serial)];
+        j++;
+        }
+    }
+
+for (i = 0; i < 2*len; i++)
+    {
+    if (i%2)
+        {
+        c1 = (str[i/2] >> 4);
+        c1 = c1 + 50;
+        stren[i] = c1;
+        }
+    else
+        {
+        c2 = (str[i/2] & 0x0f);
+        c2 += 50;
+        stren[i] = c2;
+        }
+    }
+stren[i] = 0;
+strcpy(str, stren);
+}
+//---------------------------------------------------------------------------
+void DecodeStr(char * str, unsigned long serial, int useHDD)
+{
+size_t len = strlen(str);
+char strdc[100];
+char serial_c[sizeof(serial)];
+memcpy(serial_c, &serial, sizeof(serial));
+
+for (size_t i = 0; i < len; i += 2)
+    {
+    char c1 = (str[i] - 50);
+    char c2 = (str[i+1] - 50)<<4;
+    strdc[i/2] = c1+c2;
+    }
+for (size_t i = 0; i < len/2; i++)
+    {
+    if (!useHDD)
+        strdc[i] = strdc[i]^49;
+    else
+        {
+        strdc[i] = strdc[i]^serial_c[j%sizeof(serial)];
+        j++;
+        }
+    }
+strdc[i] = 0;
+strcpy(str, strdc);
+}
+//---------------------------------------------------------------------------
+#endif //WIN32
+void SwapBytes(uint16_t & value)
+{
+    value = static_cast<uint16_t>((value >> 8) |
+                                  (value << 8));
+}
+//---------------------------------------------------------------------------
+void SwapBytes(uint32_t & value)
+{
+    value = static_cast<uint32_t>((value >> 24) |
+                                  ((value << 8) &  0x00FF0000L) |
+                                  ((value >> 8) &  0x0000FF00L) |
+                                  (value << 24));
+}
+//---------------------------------------------------------------------------
+void SwapBytes(uint64_t & value)
+{
+    value = static_cast<uint64_t>((value >> 56) |
+                                  ((value << 40) & 0x00FF000000000000LL) |
+                                  ((value << 24) & 0x0000FF0000000000LL) |
+                                  ((value << 8)  & 0x000000FF00000000LL) |
+                                  ((value >> 8)  & 0x00000000FF000000LL) |
+                                  ((value >> 24) & 0x0000000000FF0000LL) |
+                                  ((value >> 40) & 0x000000000000FF00LL) |
+                                  (value << 56));
+}
+//---------------------------------------------------------------------------
+void SwapBytes(int16_t & value)
+{
+    uint16_t temp = value;
+    SwapBytes(temp);
+    value = temp;
+}
+//---------------------------------------------------------------------------
+void SwapBytes(int32_t & value)
+{
+    uint32_t temp = value;
+    SwapBytes(temp);
+    value = temp;
+}
+//---------------------------------------------------------------------------
+void SwapBytes(int64_t & value)
+{
+    uint64_t temp = value;
+    SwapBytes(temp);
+    value = temp;
+}
+//---------------------------------------------------------------------------
+std::string formatTime(time_t ts)
+{
+char buf[32];
+struct tm brokenTime;
+
+brokenTime.tm_wday = 0;
+brokenTime.tm_yday = 0;
+brokenTime.tm_isdst = 0;
+
+gmtime_r(&ts, &brokenTime);
+
+strftime(buf, 32, "%Y-%m-%d %H:%M:%S", &brokenTime);
+
+return buf;
+}
+//---------------------------------------------------------------------------
+time_t readTime(const std::string & ts)
+{
+if (ts == "0000-00-00 00:00:00")
+    return 0;
+
+struct tm brokenTime;
+
+brokenTime.tm_wday = 0;
+brokenTime.tm_yday = 0;
+brokenTime.tm_isdst = 0;
+
+stg_strptime(ts.c_str(), "%Y-%m-%d %H:%M:%S", &brokenTime);
+
+return stg_timegm(&brokenTime);
+}
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, int32_t & x)
+{
+x = static_cast<int32_t>(strtol(str.c_str(), NULL, 10));
+
+if (errno == ERANGE)
+    return -1;
+
+return 0;
+}
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, uint32_t & x)
+{
+x = static_cast<uint32_t>(strtoul(str.c_str(), NULL, 10));
+
+if (errno == ERANGE)
+    return -1;
+
+return 0;
+}
+#ifndef WIN32
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, int64_t & x)
+{
+x = strtoll(str.c_str(), NULL, 10);
+
+if (errno == ERANGE)
+    return -1;
+
+return 0;
+}
+//---------------------------------------------------------------------------
+int str2x(const std::string & str, uint64_t & x)
+{
+x = strtoull(str.c_str(), NULL, 10);
+
+if (errno == ERANGE)
+    return -1;
+
+return 0;
+}
+#endif
+//---------------------------------------------------------------------------
+const std::string & x2str(uint32_t x, std::string & s)
+{
+return unsigned2str(x, s);
+}
+//---------------------------------------------------------------------------
+const std::string & x2str(uint64_t x, std::string & s)
+{
+return unsigned2str(x, s);
+}
+//---------------------------------------------------------------------------
+const std::string & x2str(double x, std::string & s)
+{
+char buf[256];
+snprintf(buf, sizeof(buf), "%f", x);
+s = buf;
+return s;
+}
+//---------------------------------------------------------------------------
+std::string & TrimL(std::string & val)
+{
+size_t pos = val.find_first_not_of(" \t");
+if (pos == std::string::npos)
+    {
+    val.erase(val.begin(), val.end());
+    }
+else
+    {
+    val.erase(0, pos);
+    }
+return val;
+}
+//---------------------------------------------------------------------------
+std::string & TrimR(std::string & val)
+{
+size_t pos = val.find_last_not_of(" \t");
+if (pos != std::string::npos)
+    {
+    val.erase(pos + 1);
+    }
+return val;
+}
+//---------------------------------------------------------------------------
+std::string & Trim(std::string & val)
+{
+return TrimR(TrimL(val));
+}
+//---------------------------------------------------------------------------
+std::string Trim(const std::string & val)
+{
+std::string res(val);
+return TrimR(TrimL(res));
+}
+//---------------------------------------------------------------------------
+std::string ToLower(std::string value)
+{
+    std::transform(value.begin(), value.end(), value.begin(), ::tolower);
+    return value;
+}
+//---------------------------------------------------------------------------
+std::string ToUpper(std::string value)
+{
+    std::transform(value.begin(), value.end(), value.begin(), ::toupper);
+    return value;
+}
+//---------------------------------------------------------------------------
+#ifdef WIN32
+static int is_leap(unsigned y)
+{
+    y += 1900;
+    return (y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0);
+}
+#endif
+//---------------------------------------------------------------------------
+
+time_t stg_timegm(struct tm * brokenTime)
+{
+#ifdef WIN32
+static const unsigned ndays[2][12] ={
+    {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+    {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
+time_t res = 0;
+for (int i = 70; i < brokenTime->tm_year; ++i)
+    res += is_leap(i) ? 366 : 365;
+for (int i = 0; i < brokenTime->tm_mon; ++i)
+    res += ndays[is_leap(brokenTime->tm_year)][i];
+res += brokenTime->tm_mday - 1;
+res *= 24;
+res += brokenTime->tm_hour;
+res *= 60;
+res += brokenTime->tm_min;
+res *= 60;
+res += brokenTime->tm_sec;
+return res;
+#else
+#ifdef HAVE_TIMEGM
+return timegm(brokenTime);
+#else
+time_t ret;
+char *tz;
+tz = getenv("TZ");
+setenv("TZ", "", 1);
+tzset();
+ret = mktime(brokenTime);
+if (tz)
+    setenv("TZ", tz, 1);
+else
+    unsetenv("TZ");
+tzset();
+return ret;
+#endif // HAVE_TIMEGM
+#endif // WIN32
+}
+//---------------------------------------------------------------------------
+std::string IconvString(const std::string & source,
+                        const std::string & from,
+                        const std::string & to)
+{
+if (source.empty())
+    return std::string();
+
+size_t inBytesLeft = source.length() + 1;
+size_t outBytesLeft = source.length() * 2 + 1;
+
+char * inBuf = new char[inBytesLeft];
+char * outBuf = new char[outBytesLeft];
+
+strncpy(inBuf, source.c_str(), source.length());
+
+inBuf[source.length()] = 0;
+
+#if defined(CONST_ICONV)
+const char * srcPos = inBuf;
+#else
+char * srcPos = inBuf;
+#endif
+char * dstPos = outBuf;
+
+iconv_t handle = iconv_open(to.c_str(),
+                            from.c_str());
+
+if (handle == iconv_t(-1))
+    {
+    if (errno == EINVAL)
+        {
+        printfd(__FILE__, "IconvString(): iconv from %s to %s failed\n", from.c_str(), to.c_str());
+        delete[] outBuf;
+        delete[] inBuf;
+        return source;
+        }
+    else
+        printfd(__FILE__, "IconvString(): iconv_open error\n");
+
+    delete[] outBuf;
+    delete[] inBuf;
+    return source;
+    }
+
+size_t res = iconv(handle,
+                   &srcPos, &inBytesLeft,
+                   &dstPos, &outBytesLeft);
+
+if (res == size_t(-1))
+    {
+    printfd(__FILE__, "IconvString(): '%s'\n", strerror(errno));
+
+    iconv_close(handle);
+    delete[] outBuf;
+    delete[] inBuf;
+    return source;
+    }
+
+dstPos = 0;
+
+std::string dst(outBuf);
+
+iconv_close(handle);
+
+delete[] outBuf;
+delete[] inBuf;
+
+return dst;
+}
+
+int ParseYesNo(const std::string & str, bool * val)
+{
+if (0 == strncasecmp(str.c_str(), "yes", 3))
+    {
+    *val = true;
+    return 0;
+    }
+
+if (0 == strncasecmp(str.c_str(), "no", 2))
+    {
+    *val = false;
+    return 0;
+    }
+
+return -1;
+}
+
+int ParseInt(const std::string & str, int * val)
+{
+if (str2x<int>(str, *val))
+    return -1;
+return 0;
+}
+
+int ParseUnsigned(const std::string & str, unsigned * val)
+{
+if (str2x<unsigned>(str, *val))
+    return -1;
+return 0;
+}
+
+int ParseIntInRange(const std::string & str, int min, int max, int * val)
+{
+if (ParseInt(str, val) != 0)
+    return -1;
+
+if (*val < min || *val > max)
+    return -1;
+
+return 0;
+}
+
+int ParseUnsignedInRange(const std::string & str, unsigned min,
+                         unsigned max, unsigned * val)
+{
+if (ParseUnsigned(str, val) != 0)
+    return -1;
+
+if (*val < min || *val > max)
+    return -1;
+
+return 0;
+}
+
+bool WaitPackets(int sd)
+{
+fd_set rfds;
+FD_ZERO(&rfds);
+FD_SET(sd, &rfds);
+
+struct timeval tv;
+tv.tv_sec = 0;
+tv.tv_usec = 500000;
+
+int res = select(sd + 1, &rfds, NULL, NULL, &tv);
+if (res == -1) // Error
+    {
+    if (errno != EINTR)
+        printfd(__FILE__, "Error on select: '%s'\n", strerror(errno));
+    return false;
+    }
+
+if (res == 0) // Timeout
+    return false;
+
+return true;
+}
+
+bool ReadAll(int sd, void * dest, size_t size)
+{
+size_t done = 0;
+char * ptr = static_cast<char *>(dest);
+while (done < size)
+    {
+    if (!WaitPackets(sd))
+        return false;
+    ssize_t res = read(sd, ptr + done, size - done);
+    if (res < 0)
+        return false;
+    if (res == 0)
+        return true;
+    done += res;
+    }
+return true;
+}
+
+bool WriteAll(int sd, const void * source, size_t size)
+{
+size_t done = 0;
+const char * ptr = static_cast<const char *>(source);
+while (done < size)
+    {
+    ssize_t res = write(sd, ptr + done, size - done);
+    if (res <= 0)
+        return false;
+    done += res;
+    }
+return true;
+}
+
+std::string ToPrintable(const std::string & src)
+{
+    std::string dest;
+
+    for (size_t i = 0; i < src.size(); ++i)
+        if (std::isprint(src[i]))
+            dest += src[i];
+        else
+            dest += "\\" + x2str(src[i]);
+
+    return dest;
+}
+
+uid_t str2uid(const std::string& name)
+{
+    const passwd* res = getpwnam(name.c_str());
+    if (res == NULL)
+        return -1;
+    return res->pw_uid;
+}
+
+gid_t str2gid(const std::string& name)
+{
+    const group* res = getgrnam(name.c_str());
+    if (res == NULL)
+        return -1;
+    return res->gr_gid;
+}
+
+mode_t str2mode(const std::string& name)
+{
+    if (name.length() < 3 || name.length() > 4)
+        return -1;
+
+    if (name.length() == 4 && name[0] != '0')
+        return -1;
+
+    mode_t res = 0;
+    for (size_t i = 0; i < name.length(); ++i)
+    {
+        if (name[i] > '7' || name[i] < '0')
+            return -1;
+        res = (res << 3) + (name[i] - '0');
+    }
+    return res;
+}
diff --git a/libs/common/include/stg/blockio.h b/libs/common/include/stg/blockio.h
new file mode 100644 (file)
index 0000000..3879e39
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef __STG_STGLIBS_BLOCK_IO_H__
+#define __STG_STGLIBS_BLOCK_IO_H__
+
+#include <vector>
+
+#include <sys/uio.h>
+
+namespace STG
+{
+
+typedef std::vector<iovec> IOVec;
+
+class BlockReader
+{
+    public:
+        BlockReader(const IOVec& ioVec);
+
+        bool read(int socket);
+        bool done() const { return m_remainder == 0; }
+        size_t remainder() const { return m_remainder; }
+
+    private:
+        IOVec m_dest;
+        size_t m_remainder;
+};
+
+class BlockWriter
+{
+    public:
+        BlockWriter(const IOVec& ioVec);
+
+        bool write(int socket);
+        bool done() const { return m_remainder == 0; }
+        size_t remainder() const { return m_remainder; }
+
+    private:
+        IOVec m_source;
+        size_t m_remainder;
+};
+
+} // namespace STG
+
+#endif
diff --git a/libs/common/include/stg/common.h b/libs/common/include/stg/common.h
new file mode 100644 (file)
index 0000000..94cf9f0
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ *    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 <stg34@stargazer.dp.ua>
+ */
+
+ /*
+ $Revision: 1.32 $
+ $Date: 2010/11/08 10:11:19 $
+ $Author: faust $
+ */
+
+#ifndef common_h
+#define common_h
+
+//#include "stg/const.h"
+
+#include <string>
+#include <sstream>
+#include <ctime>
+#include <climits> // NAME_MAX
+#include <cstdint>
+
+#include <unistd.h> // uid_t, gid_t
+#include <sys/stat.h> // mode_t
+
+#define STAT_TIME_3         (1)
+#define STAT_TIME_2         (2)
+#define STAT_TIME_1         (3)
+#define STAT_TIME_1_2       (4)
+#define STAT_TIME_1_4       (5)
+#define STAT_TIME_1_6       (6)
+
+#define FN_STR_LEN      (NAME_MAX)
+
+#define ST_F    0
+#define ST_B    1
+#define ST_KB   2
+#define ST_MB   3
+
+//-----------------------------------------------------------------------------
+const char    * IntToKMG(int64_t a, int statType = ST_F);
+const char    * LogDate(time_t t);
+int             ParesTimeStat(const char * str);
+int             IsTimeStat(struct tm * t, int statTime);
+int             strtodouble2(const char * str, double & value);
+inline int      strtodouble2(const std::string & str, double & value) { return strtodouble2(str.c_str(), value); }
+int             printfd(const char * __file__, const char * fmt, ...);
+void            Encode12(char * dst, const char * src, size_t srcLen);
+void            Decode21(char * dst, const char * src);
+
+void            Encode12str(std::string & dst, const std::string & src);
+void            Decode21str(std::string & dst, const std::string & src);
+inline std::string Encode12str(const std::string & src) { std::string dst; Encode12str(dst, src); return dst; }
+inline std::string Decode21str(const std::string & src) { std::string dst; Decode21str(dst, src); return dst; }
+
+int             ParseIPString(const char * str, uint32_t * ips, int maxIP);
+void            KOIToWin(const char * s1, char * s2, int l);
+void            WinToKOI(const char * s1, char * s2, int l);
+void            KOIToWin(const std::string & s1, std::string * s2);
+void            WinToKOI(const std::string & s1, std::string * s2);
+int             DaysInMonth(unsigned year, unsigned mon);
+int             DaysInCurrentMonth();
+int             Min8(int a);
+std::string     inet_ntostring(uint32_t);
+uint32_t        inet_strington(const std::string & value);
+std::string     TimeToString(time_t time);
+int             strprintf(std::string * str, const char * fmt, ...);
+int             ParseTariffTimeStr(const char * str, int &h1, int &m1, int &h2, int &m2);
+uint32_t        CalcMask(uint32_t msk);
+void            TouchFile(const std::string & fileName);
+#ifdef WIN32
+void            EncodeStr(char * str, unsigned long serial, int useHDD);
+void            DecodeStr(char * str, unsigned long serial, int useHDD);
+#endif //WIN32
+void            SwapBytes(uint16_t & value);
+void            SwapBytes(uint32_t & value);
+void            SwapBytes(uint64_t & value);
+void            SwapBytes(int16_t & value);
+void            SwapBytes(int32_t & value);
+void            SwapBytes(int64_t & value);
+
+std::string &   TrimL(std::string & val);
+std::string &   TrimR(std::string & val);
+std::string &   Trim(std::string & val);
+std::string     Trim(const std::string & val);
+
+std::string     ToLower(std::string value);
+std::string     ToUpper(std::string value);
+
+template <typename C, typename F>
+inline
+C Split(const std::string & value, char delim, F conv)
+{
+C res;
+size_t startPos = 0;
+size_t pos = value.find_first_of(delim);
+while (pos != std::string::npos)
+    {
+    res.push_back(conv(value.substr(startPos, pos - startPos)));
+    startPos = pos + 1;
+    pos = value.find_first_of(delim, pos + 1);
+    }
+res.push_back(conv(value.substr(startPos, pos - startPos)));
+return res;
+}
+
+template <typename T>
+inline
+T FromString(const std::string & value)
+{
+T res;
+std::istringstream stream(value);
+stream >> res;
+return res;
+}
+
+template <>
+inline
+std::string FromString<std::string>(const std::string & value)
+{
+return value;
+}
+
+template <typename C>
+inline
+C Split(const std::string & value, char delim)
+{
+    return Split<C>(value, delim, FromString<typename C::value_type>);
+}
+
+std::string IconvString(const std::string & source, const std::string & from, const std::string & to);
+
+int ParseInt(const std::string & str, int * val);
+int ParseUnsigned(const std::string & str, unsigned * val);
+int ParseIntInRange(const std::string & str, int min, int max, int * val);
+int ParseUnsignedInRange(const std::string & str, unsigned min,
+                         unsigned max, unsigned * val);
+int ParseYesNo(const std::string & str, bool * val);
+
+bool WaitPackets(int sd);
+
+bool ReadAll(int sd, void * dest, size_t size);
+bool WriteAll(int sd, const void * source, size_t size);
+
+std::string ToPrintable(const std::string & src);
+
+std::string formatTime(time_t value);
+time_t readTime(const std::string & value);
+//-----------------------------------------------------------------------------
+int str2x(const std::string & str, int32_t & x);
+int str2x(const std::string & str, uint32_t & x);
+inline
+int str2x(const std::string & str, double & x) { return strtodouble2(str.c_str(), x); }
+#ifndef WIN32
+int str2x(const std::string & str, int64_t & x);
+int str2x(const std::string & str, uint64_t & x);
+#endif
+//-----------------------------------------------------------------------------
+const std::string & x2str(uint32_t x, std::string & s);
+const std::string & x2str(uint64_t x, std::string & s);
+//-----------------------------------------------------------------------------
+const std::string & x2str(double x, std::string & s);
+//-----------------------------------------------------------------------------
+
+template <typename varT>
+int str2x(const std::string & str, varT & x);
+template <typename varT>
+const std::string & x2str(varT x, std::string & s);
+template <typename varT>
+std::string x2str(varT x) { std::string s; return x2str(x, s); }
+template <typename varT>
+const std::string & unsigned2str(varT x, std::string & s);
+template <typename varT>
+std::string unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
+
+//-----------------------------------------------------------------------------
+template <typename varT>
+inline
+int str2x(const std::string & str, varT & x)
+{
+    int pos = 0;
+    int minus = 1;
+
+    if (str.empty())
+        return -1;
+
+    if (str[0] == '+')
+        pos++;
+
+    if (str[0] == '-')
+    {
+        pos++;
+        minus = -1;
+    }
+
+    if ((str[pos] < '0' || str[pos] > '9'))
+        return -1;
+
+    x = str[pos++] - '0';
+
+    for (unsigned i = pos; i < str.size(); i++)
+    {
+        if ((str[i] < '0' || str[i] > '9'))
+            return -1;
+
+        x *= 10;
+        x += str[i] - '0';
+    }
+
+    x *= minus;
+
+    return 0;
+}
+//-----------------------------------------------------------------------------
+template <typename varT>
+inline
+const std::string & x2str(varT x, std::string & s)
+{
+    varT xx = x;
+    int pos = 1;
+
+    x /= 10;
+    while (x != 0)
+    {
+        x /= 10;
+        pos++;
+    }
+
+    if (xx < 0)
+    {
+        pos++;
+        s.resize(pos, 0);
+        s[0] = '-';
+    }
+    else if (xx > 0)
+    {
+        s.resize(pos, 0);
+    }
+    else
+    {
+        s.resize(1, 0);
+        s[0] = '0';
+        return s;
+    }
+
+    x = xx;
+
+    while (x != 0)
+    {
+        if (x < 0)
+            s[--pos] = -(x % 10) + '0';
+        else
+            s[--pos] = x % 10 + '0';
+
+        x /= 10;
+    }
+
+    return s;
+}
+//-----------------------------------------------------------------------------
+template <typename varT>
+inline
+const std::string & unsigned2str(varT x, std::string & s)
+{
+    varT xx = x;
+    int pos = 1;
+
+    x /= 10;
+    while (x != 0)
+    {
+        x /= 10;
+        pos++;
+    }
+
+    if (xx > 0)
+    {
+        s.resize(pos, 0);
+    }
+    else
+    {
+        s.resize(1, 0);
+        s[0] = '0';
+        return s;
+    }
+
+    x = xx;
+
+    while (x != 0)
+    {
+        s[--pos] = x % 10 + '0';
+
+        x /= 10;
+    }
+
+    return s;
+}
+//-----------------------------------------------------------------------------
+char * stg_strptime(const char *, const char *, struct tm *);
+time_t stg_timegm(struct tm *);
+
+uid_t str2uid(const std::string& name);
+gid_t str2gid(const std::string& name);
+mode_t str2mode(const std::string& mode);
+
+#endif
diff --git a/libs/common/strptime.cpp b/libs/common/strptime.cpp
new file mode 100644 (file)
index 0000000..38b86b4
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * $Revision: 1.1 $
+ * $Date: 2007/05/17 08:25:58 $
+ *
+ * This file contain a replacement of commonly used function strptime
+ * Under some OS's it appears only with _XOPEN_SOURCE definition
+ *
+ */
+
+#define _XOPEN_SOURCE
+#include <time.h>
+
+#include "stg/common.h"
+
+char * stg_strptime(const char * a, const char * b, struct tm * tm)
+{
+return strptime(a, b, tm);
+}
+
diff --git a/libs/conffiles/CMakeLists.txt b/libs/conffiles/CMakeLists.txt
new file mode 100644 (file)
index 0000000..34e1801
--- /dev/null
@@ -0,0 +1,5 @@
+set ( CPP_FILES conffiles.cpp )
+
+add_library ( conffiles STATIC ${CPP_FILES} )
+
+target_include_directories ( conffiles PUBLIC include )
diff --git a/libs/conffiles/Makefile b/libs/conffiles/Makefile
new file mode 100644 (file)
index 0000000..4d48557
--- /dev/null
@@ -0,0 +1,11 @@
+###############################################################################
+# $Id: Makefile,v 1.4 2007/05/08 14:29:19 faust Exp $
+###############################################################################
+
+LIB_NAME = stgconffiles
+
+SRCS = conffiles.cpp
+
+INCS = conffiles.h
+
+include ../Makefile.in
diff --git a/libs/conffiles/conffiles.cpp b/libs/conffiles/conffiles.cpp
new file mode 100644 (file)
index 0000000..b254128
--- /dev/null
@@ -0,0 +1,423 @@
+/*
+ *    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 <stg34@ua.fm>
+ */
+
+ /*
+ $Revision: 1.5 $
+ $Date: 2009/10/22 11:40:22 $
+ */
+
+//---------------------------------------------------------------------------
+
+// getpid
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <cerrno> // E*
+#include <cstring>
+#include <sstream>
+#include <cstdlib>
+#include <cstdio>
+
+#include <fstream>
+
+#include "stg/conffiles.h"
+
+namespace
+{
+//---------------------------------------------------------------------------
+std::string TrimL(std::string val)
+{
+size_t pos = val.find_first_not_of(" \t");
+if (pos == std::string::npos)
+    {
+    val.erase(val.begin(), val.end());
+    }
+else
+    {
+    val.erase(0, pos);
+    }
+return val;
+}
+//---------------------------------------------------------------------------
+std::string TrimR(std::string val)
+{
+size_t pos = val.find_last_not_of(" \t");
+if (pos != std::string::npos)
+    {
+    val.erase(pos + 1);
+    }
+return val;
+}
+//---------------------------------------------------------------------------
+std::string Trim(const std::string& val)
+{
+return TrimR(TrimL(val));
+}
+//---------------------------------------------------------------------------
+} // namespace anonymous
+
+//---------------------------------------------------------------------------
+bool StringCaseCmp(const std::string & str1, const std::string & str2)
+{
+return (strcasecmp(str1.c_str(), str2.c_str()) < 0);
+}
+//---------------------------------------------------------------------------
+CONFIGFILE::CONFIGFILE(const std::string & fn, bool nook)
+    : param_val(StringCaseCmp),
+      fileName(fn),
+      error(0),
+      changed(false)
+{
+std::ifstream f(fileName.c_str());
+
+if (!f)
+    {
+    if (!nook)
+        error = -1;
+    return;
+    }
+
+std::string line;
+while (getline(f, line))
+    {
+    size_t pos = line.find('#');
+    if (pos != std::string::npos)
+        line.resize(pos);
+
+    if (line.find_first_not_of(" \t\r") == std::string::npos)
+        continue;
+
+    pos = line.find_first_of('=');
+    if (pos == std::string::npos)
+        {
+        error = -1;
+        return;
+        }
+
+    std::string parameter = Trim(line.substr(0, pos));
+    std::string value = Trim(line.substr(pos + 1));
+    param_val[parameter] = value;
+    }
+}
+//---------------------------------------------------------------------------
+CONFIGFILE::~CONFIGFILE()
+{
+Flush();
+}
+//---------------------------------------------------------------------------
+const std::string & CONFIGFILE::GetFileName() const
+{
+return fileName;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::Error() const
+{
+int e = error;
+error = 0;
+return e;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadString(const std::string & param, std::string * val, const std::string & defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    *val = it->second;
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+void CONFIGFILE::WriteString(const std::string & param, const std::string &val)
+{
+param_val[param] = val;
+changed = true;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadTime(const std::string & param, time_t * val, time_t defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtol(it->second.c_str(), &res, 10);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadInt(const std::string & param, int * val, int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = static_cast<int>(strtol(it->second.c_str(), &res, 10));
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadUInt(const std::string & param, unsigned int * val, unsigned int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = static_cast<unsigned int>(strtoul(it->second.c_str(), &res, 10));
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadLongInt(const std::string & param, long int * val, long int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtol(it->second.c_str(), &res, 10);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadULongInt(const std::string & param, unsigned long int * val, unsigned long int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtoul(it->second.c_str(), &res, 10);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadLongLongInt(const std::string & param, int64_t * val, int64_t defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtoll(it->second.c_str(), &res, 10);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadULongLongInt(const std::string & param, uint64_t * val, uint64_t defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtoull(it->second.c_str(), &res, 10);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadShortInt(const std::string & param, short int * val, short int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = static_cast<short>(strtol(it->second.c_str(), &res, 10));
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadUShortInt(const std::string & param, unsigned short int * val, unsigned short int defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = static_cast<short>(strtoul(it->second.c_str(), &res, 10));
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+void CONFIGFILE::WriteInt(const std::string & param, int64_t val)
+{
+char buf[32];
+snprintf(buf, sizeof(buf), "%lld", static_cast<long long int>(val));
+param_val[param] = buf;
+changed = true;
+}
+//---------------------------------------------------------------------------
+void CONFIGFILE::WriteTime(const std::string & param, time_t val)
+{
+std::stringstream ss;
+ss<<val;
+param_val[param] = ss.str();
+changed = true;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::ReadDouble(const std::string & param, double * val, double defaultVal) const
+{
+const std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it(param_val.find(param));
+
+if (it != param_val.end())
+    {
+    char *res;
+    *val = strtod(it->second.c_str(), &res);
+    if (*res != 0)
+        {
+        *val = defaultVal; //Error!
+        return EINVAL;
+        }
+    return 0;
+    }
+
+*val = defaultVal;
+return -1;
+}
+//---------------------------------------------------------------------------
+void CONFIGFILE::WriteDouble(const std::string & param, double val)
+{
+char s[30];
+snprintf(s, 30, "%f", val);
+param_val[param] = s;
+changed = true;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::Flush(const std::string & path) const
+{
+std::ofstream f(path.c_str());
+if (!f.is_open())
+    {
+    error = EIO;
+    return EIO;
+    }
+
+std::map<std::string, std::string, StringCaseCmp_t>::const_iterator it = param_val.begin();
+while (it != param_val.end())
+    {
+    f << it->first << "=" << it->second << "\n";
+    ++it;
+    }
+
+f.close();
+return 0;
+}
+//---------------------------------------------------------------------------
+int CONFIGFILE::Flush() const
+{
+if (!changed)
+    return 0;
+
+char pid[6];
+snprintf(pid, sizeof(pid), "%d", getpid());
+
+if (Flush(fileName + "." + pid))
+    return -1;
+
+if (rename((fileName + "." + pid).c_str(), fileName.c_str()))
+    return -1;
+
+changed = false;
+
+return 0;
+}
+//---------------------------------------------------------------------------
diff --git a/libs/conffiles/include/stg/conffiles.h b/libs/conffiles/include/stg/conffiles.h
new file mode 100644 (file)
index 0000000..710cd04
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ *    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 <stg34@ua.fm>
+ */
+
+/*
+ $Revision: 1.5 $
+ $Date: 2009/06/22 16:00:38 $
+ */
+
+//---------------------------------------------------------------------------
+
+#ifndef ConfFilesH
+#define ConfFilesH
+
+#include <map>
+#include <string>
+#include <cstdint>
+
+//---------------------------------------------------------------------------
+
+typedef bool (*StringCaseCmp_t)(const std::string & str1, const std::string & str2);
+
+class CONFIGFILE
+{
+public:
+    CONFIGFILE(const std::string & fn, bool nook = false);
+    ~CONFIGFILE();
+    const std::string & GetFileName() const;
+
+    // æÕÎËÃÉÉ Read* ×ÏÚ×ÒÁÝÁÀÔ 0 ÐÒÉ ÕÓÐÅÛÎÏÍ ÓÞÉÔÙ×ÁÎÉÉ
+    // É EINVAL ÐÒÉ ÏÔÓÕÔÓ×ÉÉ ÐÁÒÁÍÅÔÒÁ É ×ÙÓÔÁ×ÌÑÀÔ defaulValue
+    //int ReadString(const std::string & param, char * val, int * maxLen, const char * defaultVal) const;
+    int ReadString(const std::string & param, std::string * val, const std::string & defaultVal) const;
+    int ReadTime(const std::string & param, time_t *, time_t) const;
+    int ReadShortInt(const std::string & param, short int *, short int) const;
+    int ReadInt(const std::string & param, int *, int) const;
+    int ReadLongInt(const std::string & param, long int *, long int) const;
+    int ReadLongLongInt(const std::string & param, int64_t *, int64_t) const;
+    int ReadUShortInt(const std::string & param, unsigned short int *, unsigned short int) const;
+    int ReadUInt(const std::string & param, unsigned int *, unsigned int) const;
+    int ReadULongInt(const std::string & param, unsigned long int *, unsigned long int) const;
+    int ReadULongLongInt(const std::string & param, uint64_t *, uint64_t) const;
+    int ReadDouble(const std::string & param, double * val, double defaultVal) const;
+
+    void WriteString(const std::string & param, const char * val) { return WriteString(param, std::string(val)); }
+    void WriteString(const std::string & param, const std::string& val);
+    void WriteInt(const std::string & param, int64_t val);
+    void WriteDouble(const std::string & param, double val);
+    void WriteTime(const std::string & param, time_t val);
+
+    int Error() const;
+    int Flush() const;
+
+private:
+    std::map<std::string, std::string, StringCaseCmp_t> param_val;
+    std::string fileName;
+    mutable int error;
+    mutable bool changed;
+
+    int Flush(const std::string & path) const;
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/libs/crypto/CMakeLists.txt b/libs/crypto/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9b40d18
--- /dev/null
@@ -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/libs/crypto/Makefile b/libs/crypto/Makefile
new file mode 100644 (file)
index 0000000..47e9120
--- /dev/null
@@ -0,0 +1,15 @@
+###############################################################################
+# $Id: Makefile,v 1.5 2009/10/09 07:15:48 nobunaga Exp $
+###############################################################################
+
+LIB_NAME = stgcrypto
+
+SRCS = ag_md5.c \
+       blowfish.c \
+       bfstream.cpp
+
+INCS = ag_md5.h \
+       blowfish.h \
+       bfstream.h
+
+include ../Makefile.in
diff --git a/libs/crypto/ag_md5.c b/libs/crypto/ag_md5.c
new file mode 100644 (file)
index 0000000..a638c18
--- /dev/null
@@ -0,0 +1,455 @@
+#ifdef WIN32
+#include <process.h>
+#include <windows.h>
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "stg/ag_md5.h"
+
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+#define MD5STEP(f, w, x, y, z, data, s) \
+    ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+
+int i64c(int i)
+{
+    if (i <= 0)
+        return ('.');
+
+    if (i == 1)
+        return ('/');
+
+    if (i >= 2 && i < 12)
+        return ('0' - 2 + i);
+
+    if (i >= 12 && i < 38)
+        return ('A' - 12 + i);
+
+    if (i >= 38 && i < 63)
+        return ('a' - 38 + i);
+
+    return ('z');
+}
+
+char * l64a_(long l)
+{
+    static  char    buf[8];
+    int i = 0;
+
+    if (l < 0L)
+        return ((char *) 0);
+
+    do {
+        buf[i++] = i64c ((int) (l % 64));
+        buf[i] = '\0';
+    } while (l /= 64L, l > 0 && i < 6);
+
+    return (buf);
+}
+
+char * crypt_make_salt(void)
+{
+
+    static char result[40];
+    #ifdef WIN32
+    unsigned int tsec;
+    #else
+    struct timeval tv;
+    #endif
+
+    result[0] = '\0';
+        strcpy(result, "$1$");  /* magic for the new MD5 crypt() */
+
+    /*
+     * Generate 8 chars of salt, the old crypt() will use only first 2.
+     */
+    #ifdef WIN32
+    strcat(result, l64a_(GetTickCount()));
+    tsec = time(NULL);
+    strcat(result, l64a_(tsec + getpid() + clock()));
+    #else
+    gettimeofday(&tv, (struct timezone *) 0);
+    strcat(result, l64a_(tv.tv_usec));
+    strcat(result, l64a_(tv.tv_sec + getpid() + clock()));
+    #endif
+
+    if (strlen(result) > 3 + 8)  /* magic+salt */
+        result[11] = '\0';
+
+    return result;
+}
+
+void byteReverse(unsigned char *buf, unsigned longs)
+{
+    uint32_t t;
+    do {
+    t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+        ((unsigned) buf[1] << 8 | buf[0]);
+    *(uint32_t *) buf = t;
+    buf += 4;
+    } while (--longs);
+}
+
+/*
+ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void MD5Init(struct MD5Context *ctx)
+{
+    ctx->buf[0] = 0x67452301;
+    ctx->buf[1] = 0xefcdab89;
+    ctx->buf[2] = 0x98badcfe;
+    ctx->buf[3] = 0x10325476;
+
+    ctx->bits[0] = 0;
+    ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void MD5Update(struct MD5Context *ctx, char const *buf, unsigned len)
+{
+    uint32_t t;
+
+    /* Update bitcount */
+
+    t = ctx->bits[0];
+    if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
+    ctx->bits[1]++;     /* Carry from low to high */
+    ctx->bits[1] += len >> 29;
+
+    t = (t >> 3) & 0x3f;    /* Bytes already in shsInfo->data */
+
+    /* Handle any leading odd-sized chunks */
+
+    if (t) {
+    unsigned char *p = (unsigned char *) ctx->in + t;
+
+    t = 64 - t;
+    if (len < t) {
+        memcpy(p, buf, len);
+        return;
+    }
+    memcpy(p, buf, t);
+    byteReverse(ctx->in, 16);
+    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+    buf += t;
+    len -= t;
+    }
+    /* Process data in 64-byte chunks */
+
+    while (len >= 64) {
+    memcpy(ctx->in, buf, 64);
+    byteReverse(ctx->in, 16);
+    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+    buf += 64;
+    len -= 64;
+    }
+
+    /* Handle any remaining bytes of data. */
+
+    memcpy(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void
+MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+{
+    unsigned count;
+    unsigned char *p;
+
+    /* Compute number of bytes mod 64 */
+    count = (ctx->bits[0] >> 3) & 0x3F;
+
+    /* Set the first char of padding to 0x80.  This is safe since there is
+       always at least one byte free */
+    p = ctx->in + count;
+    *p++ = 0x80;
+
+    /* Bytes of padding needed to make 64 bytes */
+    count = 64 - 1 - count;
+
+    /* Pad out to 56 mod 64 */
+    if (count < 8) {
+    /* Two lots of padding:  Pad the first block to 64 bytes */
+    memset(p, 0, count);
+    byteReverse(ctx->in, 16);
+    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+
+    /* Now fill the next block with 56 bytes */
+    memset(ctx->in, 0, 56);
+    } else {
+    /* Pad block to 56 bytes */
+    memset(p, 0, count - 8);
+    }
+    byteReverse(ctx->in, 14);
+
+    /* Append length in bits and transform */
+    ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+    ((uint32_t *) ctx->in)[15] = ctx->bits[1];
+
+    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+    byteReverse((unsigned char *) ctx->buf, 4);
+    memcpy(digest, ctx->buf, 16);
+    memset((char *) ctx, 0, sizeof(ctx));   /* In case it's sensitive */
+}
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data.  MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+void
+MD5Transform(uint32_t buf[4], uint32_t const in[16])
+{
+    register uint32_t a, b, c, d;
+
+    a = buf[0];
+    b = buf[1];
+    c = buf[2];
+    d = buf[3];
+
+    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+    buf[0] += a;
+    buf[1] += b;
+    buf[2] += c;
+    buf[3] += d;
+}
+
+static unsigned char itoa64[] =     /* 0 ... 63 => ascii - 64 */
+    "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+static void
+to64(char *s, unsigned long v, int n)
+{
+    while (--n >= 0) {
+        *s++ = itoa64[v&0x3f];
+        v >>= 6;
+    }
+}
+
+/*
+ * UNIX password
+ *
+ * Use MD5 for what it is best at...
+ */
+
+char *
+libshadow_md5_crypt(const char *pw, const char *salt)
+{
+    static const char *magic = "$1$"; /*
+                         * This string is magic for
+                         * this algorithm.  Having
+                         * it this way, we can get
+                         * get better later on
+                         */
+    static char     passwd[120], *p;
+    static const char *sp,*ep;
+    unsigned char   final[16];
+    int sl,pl,i,j;
+    MD5_CTX ctx,ctx1;
+    unsigned long l;
+
+    /* Refine the Salt first */
+    sp = salt;
+
+    /* If it starts with the magic string, then skip that */
+    if(!strncmp(sp,magic,strlen(magic)))
+        sp += strlen(magic);
+
+    /* It stops at the first '$', max 8 chars */
+    for(ep=sp;*ep && *ep != '$' && ep < (sp+8);ep++)
+        continue;
+
+    /* get the length of the true salt */
+    sl = ep - sp;
+
+    MD5Init(&ctx);
+
+    /* The password first, since that is what is most unknown */
+    MD5Update(&ctx, pw, strlen(pw));
+
+    /* Then our magic string */
+    MD5Update(&ctx, magic, strlen(magic));
+
+    /* Then the raw salt */
+    MD5Update(&ctx, sp, sl);
+
+    /* Then just as many characters of the MD5(pw,salt,pw) */
+    MD5Init(&ctx1);
+    MD5Update(&ctx1,pw,strlen(pw));
+    MD5Update(&ctx1,sp,sl);
+    MD5Update(&ctx1,pw,strlen(pw));
+    MD5Final(final,&ctx1);
+    for(pl = strlen(pw); pl > 0; pl -= 16)
+        MD5Update(&ctx, (char*)final, pl>16 ? 16 : pl);
+
+    /* Don't leave anything around in vm they could use. */
+    memset(final,0,sizeof final);
+
+    /* Then something really weird... */
+    for (j=0,i = strlen(pw); i ; i >>= 1)
+        if(i&1)
+            MD5Update(&ctx, (char*)final+j, 1);
+        else
+            MD5Update(&ctx, pw+j, 1);
+
+    /* Now make the output string */
+    strcpy(passwd,magic);
+    strncat(passwd,sp,sl);
+    strcat(passwd,"$");
+
+    MD5Final(final,&ctx);
+
+    /*
+     * and now, just to make sure things don't run too fast
+     * On a 60 Mhz Pentium this takes 34 msec, so you would
+     * need 30 seconds to build a 1000 entry dictionary...
+         */
+        /*
+    for(i=0;i<1000;i++) {
+        MD5Init(&ctx1);
+        if(i & 1)
+            MD5Update(&ctx1,pw,strlen(pw));
+        else
+            MD5Update(&ctx1,final,16);
+
+        if(i % 3)
+            MD5Update(&ctx1,sp,sl);
+
+        if(i % 7)
+            MD5Update(&ctx1,pw,strlen(pw));
+
+        if(i & 1)
+            MD5Update(&ctx1,final,16);
+        else
+            MD5Update(&ctx1,pw,strlen(pw));
+        MD5Final(final,&ctx1);
+    }*/
+
+    p = passwd + strlen(passwd);
+
+    l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4;
+    l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4;
+    l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4;
+    l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4;
+    l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4;
+    l =                    final[11]                ; to64(p,l,2); p += 2;
+    *p = '\0';
+
+    /* Don't leave anything around in vm they could use. */
+    memset(final,0,sizeof final);
+
+    return passwd;
+}
+
+char *pw_encrypt(const char *clear, const char *salt) {
+
+    /*
+     * If the salt string from the password file or from crypt_make_salt()
+     * begins with the magic string, use the new algorithm.
+     */
+    if (strncmp(salt, "$1$", 3) == 0)
+            return(libshadow_md5_crypt(clear, salt));
+        else return(NULL);
+
+}
+/* AG MD5 functions */
+char *make_ag_hash(time_t salt, const char *clear) {
+    char salt_str[20];
+    char *res=NULL;
+    char *p;
+
+    unsigned long slt = salt;
+    sprintf(salt_str, "$1$%08lx", slt);
+    res=libshadow_md5_crypt(clear, salt_str);
+    p=strrchr(res, '$');
+    return(++p);
+}
+
+int check_ag_hash(time_t salt, const char *clear, const char *hash) {
+    return(strcmp(hash, make_ag_hash(salt, clear)));
+}
+
diff --git a/libs/crypto/bfstream.cpp b/libs/crypto/bfstream.cpp
new file mode 100644 (file)
index 0000000..3325bd1
--- /dev/null
@@ -0,0 +1,142 @@
+#include "stg/bfstream.h"
+
+#include "stg/blowfish.h"
+
+#include <cstring>
+
+namespace
+{
+
+#ifndef BFSTREAM_BUF_SIZE
+const size_t BUFFER_SIZE = 1024;
+#else
+const size_t BUFFER_SIZE = BFSTREAM_BUF_SIZE;
+#endif
+
+class COMMON
+{
+    public:
+        typedef bool (* CALLBACK)(const void * block, size_t size, void * data);
+        typedef void (* PROC)(void * dest, const void * source, size_t length, const BLOWFISH_CTX * ctx);
+
+        COMMON(const std::string & key, CALLBACK callback, void * data, PROC proc)
+            : m_ptr(m_buffer),
+              m_callback(callback),
+              m_data(data),
+              m_proc(proc),
+              m_ok(true)
+        {
+        InitContext(key.c_str(), key.length(), &m_ctx);
+        memset(m_buffer, 0, sizeof(m_buffer));
+        }
+
+        void Put(const void * data, size_t size, bool last)
+        {
+        size_t dataSize = m_ptr - m_buffer;
+        while (dataSize + size > sizeof(m_buffer))
+            {
+            memcpy(m_ptr, data, sizeof(m_buffer) - dataSize); // Fill buffer
+            size -= sizeof(m_buffer) - dataSize; // Adjust size
+            data = static_cast<const char *>(data) + sizeof(m_buffer) - dataSize; // Adjust data pointer
+            m_proc(m_buffer, m_buffer, sizeof(m_buffer), &m_ctx); // Process
+            m_ok = m_ok && m_callback(m_buffer, sizeof(m_buffer), m_data); // Consume
+            m_ptr = m_buffer;
+            dataSize = 0;
+            }
+        if (!m_ok)
+            return;
+        memcpy(m_ptr, data, size);
+        m_ptr += size;
+        m_tryConsume(last);
+        }
+
+        bool IsOk() const { return m_ok; }
+
+    private:
+        char m_buffer[BUFFER_SIZE];
+        char * m_ptr;
+        CALLBACK m_callback;
+        void * m_data;
+        BLOWFISH_CTX m_ctx;
+        PROC m_proc;
+        bool m_ok;
+
+        void m_tryConsume(bool last)
+        {
+        size_t dataSize = (m_ptr - m_buffer) & ~7;
+        size_t remainder = m_ptr - m_buffer - dataSize;
+        if (last && remainder > 0)
+            {
+            dataSize += 8;
+            remainder = 0;
+            }
+        if (!last && dataSize == 0) // Allow to call callback with 0 data on last call.
+            return;
+        m_proc(m_buffer, m_buffer, dataSize, &m_ctx);
+        m_ok = m_ok && m_callback(m_buffer, dataSize, m_data);
+        if (!m_ok)
+&nbs