├── cli
├── .gitignore
└── CMakeLists.txt
├── doc
├── .gitignore
├── images
│ ├── architecture.png
│ ├── module_start.png
│ ├── frame_automata.png
│ └── frame_timeline.png
├── sources
│ ├── architecture.dia
│ ├── architecture.odg
│ ├── module_start.dia
│ ├── ogon_frame_automata.odg
│ ├── ogon_frame_timeline.odg
│ └── backend_protocol_init_sequence.dia
├── SCOPES.md
├── SBProtocol.md
├── exampleConfig.ini
└── desktop-hints.md
├── packaging
├── deb
│ └── ogon
│ │ ├── compat
│ │ ├── ogon-core.docs
│ │ ├── source
│ │ └── format
│ │ ├── libogon-backend1.install
│ │ ├── ogon-dev.lintian-overrides
│ │ ├── ogon-core-dbg.lintian-overrides
│ │ ├── libogon-backend1.lintian-overrides
│ │ ├── libogon-backend1-dbg.lintian-overrides
│ │ ├── ogon-core.install
│ │ ├── ogon-dev.install
│ │ ├── .gitignore
│ │ ├── ogon-core.lintian-overrides
│ │ ├── changelog
│ │ └── copyright
├── scripts
│ └── prepare_deb.sh
└── rpm
│ └── ogon-core-rpmlintrc
├── snmon
├── .gitignore
└── CMakeLists.txt
├── rdp-server
├── .gitignore
├── test
│ ├── .gitignore
│ └── CMakeLists.txt
├── icp
│ ├── CMakeLists.txt
│ ├── pbrpc
│ │ ├── pipe_transport.h
│ │ ├── pbrpc_utils.h
│ │ └── pbrpc_transport.h
│ └── icp_server_stubs.h
├── frontend.h
├── CMakeLists.txt
├── app_context.h
├── bandwidth_mgmt.h
└── openh264.h
├── backend-launcher
├── .gitignore
├── CMakeLists.txt
└── SystemSession.h
├── COPYING
├── session-manager
├── .gitignore
├── auth
│ ├── CMakeLists.txt
│ └── pam
│ │ ├── CMakeLists.txt
│ │ └── pam_auth.h
├── module
│ ├── CMakeLists.txt
│ ├── Weston
│ │ ├── CMakeLists.txt
│ │ └── weston_module.h
│ ├── Qt
│ │ ├── CMakeLists.txt
│ │ └── qt_module.h
│ ├── X11
│ │ ├── CMakeLists.txt
│ │ └── x11_module.h
│ └── common
│ │ └── module_helper.h
├── config
│ ├── ReadMe.txt
│ └── ogon.SessionManager.conf
├── otsapi
│ └── CMakeLists.txt
└── common
│ ├── utils
│ ├── MakeCert.h
│ ├── TimeHelpers.h
│ ├── CSGuard.h
│ ├── StringHelpers.cpp
│ ├── TimeHelpers.cpp
│ ├── SignalingQueue.h
│ └── StringHelpers.h
│ ├── call
│ ├── CallFactory.cpp
│ ├── TaskCallInLogonUser.cpp
│ ├── Call.cpp
│ ├── TaskCallInLogonUser.h
│ ├── TaskEndRemoteControl.h
│ ├── CallOutPing.h
│ ├── CallFactory.h
│ ├── CallInPing.h
│ ├── CallOut.h
│ ├── CallInEndSession.h
│ ├── Call.h
│ ├── CallOutLogOffUserSession.h
│ ├── CallIn.h
│ ├── CallInRemoteControlEnded.h
│ ├── CallOutDisconnectUserSession.h
│ ├── CallOutOtsApiStopRemoteControl.h
│ ├── CallInPropertyBool.h
│ ├── TaskEndRemoteControl.cpp
│ ├── CallInSBPVersion.h
│ ├── CallInPropertyNumber.h
│ ├── CallInPropertyString.h
│ ├── CallInDisconnectUserSession.h
│ ├── CallOutPing.cpp
│ ├── CallInAuthenticateUser.h
│ ├── CallInPing.cpp
│ ├── CallOut.cpp
│ ├── CallOutOtsApiVirtualChannelClose.h
│ ├── CallOutSwitchTo.h
│ ├── TaskAuthenticateUser.h
│ └── CallOutOtsApiStartRemoteControl.h
│ ├── module
│ ├── CallBacks.h
│ ├── CallBacks.cpp
│ ├── AuthModule.h
│ └── LocalModule.h
│ ├── task
│ ├── Task.h
│ ├── ThreadTask.h
│ ├── InformableTask.h
│ └── Executor.h
│ ├── session
│ ├── TaskSessionTimeout.h
│ ├── TaskCallIn.h
│ ├── TaskCallIn.cpp
│ ├── TaskShutdown.h
│ ├── TaskEnd.h
│ ├── SessionNotifier.h
│ ├── TaskSwitchTo.h
│ ├── TaskShutdown.cpp
│ ├── TaskDisconnect.h
│ └── ConnectionStore.h
│ ├── config
│ ├── PropertyLevel.h
│ ├── PropertyCWrapper.h
│ └── PropertyCWrapper.cpp
│ ├── permission
│ ├── LogonPermission.cpp
│ ├── LogonPermission.h
│ └── permission.h
│ ├── otsapi
│ ├── TaskLogoff.h
│ ├── TaskStopRemoteControl.h
│ ├── TaskDisconnect.h
│ └── OTSApiServer.h
│ └── process
│ └── ProcessMonitor.h
├── misc
├── .gitignore
├── ogon_cleanup.sh
├── pam.d
│ ├── ogon.debian
│ ├── ogon.fedora
│ └── ogon.suse
├── firewalld
│ └── rdp.xml
├── ogon-rdp-server.service.in
├── ogon-session-manager.service.in
├── ogon-start-vc.sh.in
├── CMakeLists.txt
├── ogonXsession
└── config.ini.debian.in
├── backend
├── .gitignore
├── ogon-backendConfig.cmake.in
├── ogon-backend.pc.in
└── CMakeLists.txt
├── 3rdparty
├── SOURCES
└── openh264
│ └── codec_ver.h
├── ogonConfig.cmake.in
├── cmake
├── CheckCmakeCompat.cmake
├── ConfigOptions.cmake
├── GNUInstallDirsWrapper.cmake
├── FindPAM.cmake
├── GetGitRevisionDescription.cmake.in
├── ThriftUtils.cmake
├── FindThrift.cmake
└── Findlibsystemd.cmake
├── ogon.pc.in
├── .gitignore
├── config.h.in
├── include
├── CMakeLists.txt
└── ogon
│ ├── message.h
│ ├── api.h
│ ├── version.h.in
│ └── build-config.h.in
├── protocols
└── protobuf
│ ├── pbRPC.proto
│ ├── SBP.proto
│ └── Module.proto
├── common
├── procutils.h
├── global.h
├── icp.h
├── security.h
└── procutils.c
├── utils
└── astylerc
└── README.md
/cli/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-cli
2 |
--------------------------------------------------------------------------------
/doc/.gitignore:
--------------------------------------------------------------------------------
1 | .*.md.html
2 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/compat:
--------------------------------------------------------------------------------
1 | 10
2 |
--------------------------------------------------------------------------------
/snmon/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-snmon
2 |
--------------------------------------------------------------------------------
/rdp-server/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-rdp-server
2 |
--------------------------------------------------------------------------------
/rdp-server/test/.gitignore:
--------------------------------------------------------------------------------
1 | TestOgonCore.c
2 |
--------------------------------------------------------------------------------
/backend-launcher/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-backend-launcher
2 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-core.docs:
--------------------------------------------------------------------------------
1 | doc/config.md
2 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | Please see the file LICENSE in this directory.
2 |
--------------------------------------------------------------------------------
/session-manager/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-session-manager
2 | gen/
3 |
--------------------------------------------------------------------------------
/misc/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-get-openh264-codec
2 | config.ini.debian
3 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/libogon-backend1.install:
--------------------------------------------------------------------------------
1 | usr/lib/*/libogon-backend.so.*
2 |
--------------------------------------------------------------------------------
/packaging/scripts/prepare_deb.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ln -s packaging/deb/ogon debian
4 |
--------------------------------------------------------------------------------
/session-manager/auth/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if(PAM_FOUND)
2 | add_subdirectory(pam)
3 | endif()
4 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-dev.lintian-overrides:
--------------------------------------------------------------------------------
1 | ogon-dev binary: new-package-should-close-itp-bug
2 |
--------------------------------------------------------------------------------
/backend/.gitignore:
--------------------------------------------------------------------------------
1 | ogon-backend*.pc
2 | ogon-backendConfig.cmake
3 | ogon-backendConfigVersion.cmake
4 |
--------------------------------------------------------------------------------
/doc/images/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/images/architecture.png
--------------------------------------------------------------------------------
/doc/images/module_start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/images/module_start.png
--------------------------------------------------------------------------------
/doc/images/frame_automata.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/images/frame_automata.png
--------------------------------------------------------------------------------
/doc/images/frame_timeline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/images/frame_timeline.png
--------------------------------------------------------------------------------
/doc/sources/architecture.dia:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/architecture.dia
--------------------------------------------------------------------------------
/doc/sources/architecture.odg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/architecture.odg
--------------------------------------------------------------------------------
/doc/sources/module_start.dia:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/module_start.dia
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-core-dbg.lintian-overrides:
--------------------------------------------------------------------------------
1 | ogon-core-dbg binary: new-package-should-close-itp-bug
2 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/libogon-backend1.lintian-overrides:
--------------------------------------------------------------------------------
1 | libogon-backend1 binary: new-package-should-close-itp-bug
2 |
--------------------------------------------------------------------------------
/session-manager/module/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(X11)
2 | add_subdirectory(Qt)
3 | add_subdirectory(Weston)
4 |
--------------------------------------------------------------------------------
/doc/sources/ogon_frame_automata.odg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/ogon_frame_automata.odg
--------------------------------------------------------------------------------
/doc/sources/ogon_frame_timeline.odg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/ogon_frame_timeline.odg
--------------------------------------------------------------------------------
/packaging/deb/ogon/libogon-backend1-dbg.lintian-overrides:
--------------------------------------------------------------------------------
1 | libogon-backend1-dbg binary: new-package-should-close-itp-bug
2 |
--------------------------------------------------------------------------------
/misc/ogon_cleanup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # get rid of temorary pulse audio directories
4 | rm -rf /tmp/.rdpsnd-*
5 | exit 0
6 |
--------------------------------------------------------------------------------
/misc/pam.d/ogon.debian:
--------------------------------------------------------------------------------
1 | #%PAM-1.0
2 | auth include common-auth
3 | account include common-account
4 |
5 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-core.install:
--------------------------------------------------------------------------------
1 | usr/sbin/ogon-*
2 | usr/bin/ogon-*
3 | etc/dbus-1/system.d
4 | etc/ogon
5 | usr/lib/*/ogon1
6 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-dev.install:
--------------------------------------------------------------------------------
1 | usr/share/ogon
2 | usr/lib/*/cmake/*
3 | usr/lib/*/*.so
4 | usr/lib/*/pkgconfig/*
5 | usr/include/ogon1
6 |
--------------------------------------------------------------------------------
/doc/sources/backend_protocol_init_sequence.dia:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ogon-project/ogon/HEAD/doc/sources/backend_protocol_init_sequence.dia
--------------------------------------------------------------------------------
/packaging/rpm/ogon-core-rpmlintrc:
--------------------------------------------------------------------------------
1 | setBadness("suse-dbus-unauthorized-service",0)
2 | addFilter("suse-dbus-unauthorized-service .*/etc/dbus-1/system.d/.*");
3 |
--------------------------------------------------------------------------------
/3rdparty/SOURCES:
--------------------------------------------------------------------------------
1 | # openh264
2 | https://github.com/cisco/openh264/tree/v1.7.1-Firefox39/codec/api/svc
3 | openh264 commit 6c2e7008f8bbe2ff90100972f97071eb87ec37cb
4 |
--------------------------------------------------------------------------------
/misc/pam.d/ogon.fedora:
--------------------------------------------------------------------------------
1 | #%PAM-1.0
2 | auth include password-auth
3 | account include password-auth
4 | session include password-auth
5 |
6 |
--------------------------------------------------------------------------------
/misc/pam.d/ogon.suse:
--------------------------------------------------------------------------------
1 | #%PAM-1.0
2 | auth include common-auth
3 | account include common-account
4 | password include common-password
5 | session required pam_loginuid.so
6 | session include common-session
7 |
8 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | .debhelper/
3 | debhelper-build-stamp
4 | files
5 | *.substvars
6 | tmp
7 | ogon-core-dbg/
8 | ogon-core/
9 | ogon-dev/
10 | libogon-backend1-dbg/
11 | libogon-backend1/
12 |
13 | *.debhelper
14 | *.pam
15 | *.service
16 | *.init
17 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/ogon-core.lintian-overrides:
--------------------------------------------------------------------------------
1 | ogon-core binary: new-package-should-close-itp-bug
2 | ogon-core binary: binary-without-manpage *
3 | ogon-core binary: pkg-has-shlibs-control-file-but-no-actual-shared-libs
4 | ogon-core binary: postinst-has-useless-call-to-ldconfig
5 |
--------------------------------------------------------------------------------
/misc/firewalld/rdp.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | rdp
4 | Enable this if you run a RDP server, and you wish that external users can connect using the RDP protocol.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/session-manager/config/ReadMe.txt:
--------------------------------------------------------------------------------
1 | firRDS Sessionmanager DBUS configuration:
2 |
3 | to allow the session manager to use the dbus for session change notification,
4 | put the config file ogon.SessionManager.conf in the system.d directory
5 | of our local dbus installation.
6 |
7 | On Ubuntu 13.10 the path is /etc/dbus-1/system.d/
--------------------------------------------------------------------------------
/cli/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | set(MODULE_NAME "ogon-cli")
3 | set(MODULE_PREFIX "OGON_CLI")
4 |
5 | set(${MODULE_PREFIX}_SRCS
6 | cli.cpp)
7 |
8 | add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
9 |
10 | target_link_libraries(${MODULE_NAME} winpr)
11 |
12 | install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
13 |
14 |
--------------------------------------------------------------------------------
/ogonConfig.cmake.in:
--------------------------------------------------------------------------------
1 |
2 | @PACKAGE_INIT@
3 |
4 | set(OGON_VERSION_MAJOR "@OGON_VERSION_MAJOR@")
5 | set(OGON_VERSION_MINOR "@OGON_VERSION_MINOR@")
6 | set(OGON_VERSION_REVISION "@OGON_VERSION_REVISION@")
7 |
8 | set_and_check(OGON_INCLUDE_DIR "@PACKAGE_OGON_INCLUDE_DIR@")
9 | set_and_check(OGON_PROTOCOL_DIR "@PACKAGE_OGON_PROTOCOL_DIR@")
10 |
--------------------------------------------------------------------------------
/cmake/CheckCmakeCompat.cmake:
--------------------------------------------------------------------------------
1 | # GetGitRevisionDescription requires FindGit which was added in version 2.8.2
2 | # build won't fail but GIT_REVISION is set to n/a
3 | if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
4 | message(WARNING "GetGitRevisionDescription reqires (FindGit) cmake >= 2.8.2 to work properly -
5 | GIT_REVISION will be set to n/a")
6 | endif()
7 |
--------------------------------------------------------------------------------
/cmake/ConfigOptions.cmake:
--------------------------------------------------------------------------------
1 | # Build unit tests
2 | option(BUILD_TESTING "Build unit tests" OFF)
3 |
4 | # Build with OpenH264 support
5 | option(WITH_OPENH264 "Add support for H.264 encoding" ON)
6 |
7 | # Debugging options
8 | option(WITH_DEBUG_STATE "Enable frame state machine debugging." OFF)
9 | option(WITH_ENCODER_STATS "Enable encoding stats" OFF)
10 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/changelog:
--------------------------------------------------------------------------------
1 | ogon (1.0.0) UNRELEASED; urgency=low
2 |
3 | * Updated to compile on debian bullseye.
4 |
5 | -- ogon packaging team Wed, 14 Oct 2020 23:15:58 +0200
6 |
7 | ogon (0.0.1) UNRELEASED; urgency=low
8 |
9 | * Initial release.
10 |
11 | -- ogon packaging team Fri, 01 Apr 2016 15:50:58 +0200
12 |
--------------------------------------------------------------------------------
/ogon.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | exec_prefix=@CMAKE_INSTALL_PREFIX@
3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@
4 | includedir=@CMAKE_INSTALL_PREFIX@/@OGON_INCLUDE_DIR@
5 | protocol_dir=@CMAKE_INSTALL_PREFIX@/share/ogon/@OGON_VERSION_MAJOR@
6 | module_dir=@CMAKE_INSTALL_FULL_LIBDIR@/ogon@OGON_VERSION_MAJOR@
7 |
8 | Name: ogon
9 | Description: ogon RDP server
10 | URL: http://ogon-project.com/
11 | Version: @OGON_VERSION_FULL@
12 |
--------------------------------------------------------------------------------
/doc/SCOPES.md:
--------------------------------------------------------------------------------
1 | # ogon commit message scopes
2 |
3 | * protocols - protocol definitions
4 | * rdp-server - RDP server
5 | * misc - miscellaneous like start scripts or configurations
6 | * cli - command line utility
7 | * common - common definitions and code
8 | * snmon - custom dbus monitor for session manager notifications
9 | * libbackend - backend library
10 | * backend-launcher - (systemd) backend launcher
11 | * session-manager - session manager
12 |
--------------------------------------------------------------------------------
/backend/ogon-backendConfig.cmake.in:
--------------------------------------------------------------------------------
1 |
2 | @PACKAGE_INIT@
3 |
4 | set(OGON-BACKEND_VERSION_MAJOR "@OGON_VERSION_MAJOR@")
5 | set(OGON-BACKEND_VERSION_MINOR "@OGON_VERSION_MINOR@")
6 | set(OGON-BACKEND_VERSION_REVISION "@OGON_VERSION_REVISION@")
7 |
8 | set_and_check(OGON-BACKEND_INCLUDE_DIR "@PACKAGE_OGON_INCLUDE_DIR@")
9 | set_and_check(OGON-BACKEND_PROTOCOL_DIR "@PACKAGE_OGON_PROTOCOL_DIR@")
10 |
11 | include("${CMAKE_CURRENT_LIST_DIR}/ogon-backend.cmake")
12 |
13 |
--------------------------------------------------------------------------------
/snmon/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | set(MODULE_NAME "ogon-snmon")
3 | set(MODULE_PREFIX "OGON_SNMON")
4 |
5 | set(${MODULE_PREFIX}_SRCS
6 | snmon.cpp)
7 |
8 | include_directories(${DBUS_INCLUDE_DIR})
9 | include_directories(${DBUS_ARCH_INCLUDE_DIR})
10 |
11 | add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
12 |
13 | target_link_libraries(${MODULE_NAME} winpr ${DBUS_LIBRARIES})
14 |
15 | install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
16 |
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Makefile
2 | CMakeCache.txt
3 | CMakeFiles/
4 | CTestTestfile.cmake
5 | cmake_install.cmake
6 | install_manifest.txt
7 | *.DS_Store
8 | .project
9 | .cproject
10 | Testing/
11 | config.h
12 | buildflags.h
13 | DartConfiguration.tcl
14 | include/ogon/build-config.h
15 | include/ogon/version.h
16 | ogon*.pc
17 | ogonConfig.cmake
18 | ogonConfigVersion.cmake
19 | *.init
20 | *.service
21 | *.pb.cc
22 | *.pb.h
23 | *.pb-c.c
24 | *.pb-c.h
25 | *.so
26 | *.so.*
27 | *.a
28 | *.o
29 | external
30 | .idea
31 |
--------------------------------------------------------------------------------
/3rdparty/openh264/codec_ver.h:
--------------------------------------------------------------------------------
1 | //The current file is auto-generated by script: generate_codec_ver.sh
2 | #ifndef CODEC_VER_H
3 | #define CODEC_VER_H
4 |
5 | #include "codec_app_def.h"
6 |
7 | static const OpenH264Version g_stCodecVersion = {1, 7, 1, 1706};
8 | static const char* const g_strCodecVer = "OpenH264 version:1.7.1.1706";
9 |
10 | #define OPENH264_MAJOR (1)
11 | #define OPENH264_MINOR (7)
12 | #define OPENH264_REVISION (1)
13 | #define OPENH264_RESERVED (1706)
14 |
15 | #endif // CODEC_VER_H
16 |
--------------------------------------------------------------------------------
/config.h.in:
--------------------------------------------------------------------------------
1 | #ifndef _OGON_CONFIG_H_
2 | #define _OGON_CONFIG_H_
3 |
4 | #define OGON_OPENH264_LIBRARY "${OGON_OPENH264_LIBRARY}"
5 |
6 | /* Include files */
7 |
8 | #cmakedefine HAVE_UNISTD_H
9 | #cmakedefine HAVE_EVENTFD_H
10 | #cmakedefine HAVE_EPOLL_H
11 |
12 | /* Debug */
13 | #cmakedefine WITH_DEBUG_STATE
14 |
15 | /* Cisco OpenH264 */
16 | #cmakedefine WITH_OPENH264
17 | #cmakedefine WITH_LIBSYSTEMD
18 |
19 | /* Encoder stats */
20 | #cmakedefine WITH_ENCODER_STATS
21 |
22 | #endif /* _OGON_CONFIG_H_ */
23 |
--------------------------------------------------------------------------------
/session-manager/otsapi/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-otsapi")
2 | set(MODULE_PREFIX "OGON_OTSAPI")
3 |
4 | set(${MODULE_PREFIX}_SRCS otsapi_thrift.cpp)
5 |
6 | add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
7 | set(${MODULE_PREFIX}_LIBS otsapi-thrift)
8 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
9 |
10 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
11 | set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "lib")
12 |
13 | install(TARGETS ${MODULE_NAME} DESTINATION ${OGON_APP_LIB_PATH})
14 |
--------------------------------------------------------------------------------
/misc/ogon-rdp-server.service.in:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=ogon RDP server
3 | After=network.target
4 | After=ogon-session-manager.service
5 | Requires=ogon-session-manager.service
6 | JoinsNamespaceOf=ogon-session-manager.service
7 |
8 | [Service]
9 | Type=forking
10 | PIDFile=${OGON_PID_PATH}/ogon-rdp-server.pid
11 | ExecStart=${OGON_SBIN_PATH}/ogon-rdp-server --log=syslog
12 | ExecStop=${OGON_SBIN_PATH}/ogon-rdp-server --kill
13 | StandardOutput=journal
14 | StandardError=journal
15 |
16 | [Install]
17 | WantedBy=multi-user.target
18 |
--------------------------------------------------------------------------------
/session-manager/auth/pam/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-auth-pam")
2 | set(MODULE_PREFIX "OGON_AUTH_PAM")
3 |
4 | include_directories(${PAM_INCLUDE_DIR})
5 |
6 | set(${MODULE_PREFIX}_SRCS
7 | pam_auth.c
8 | pam_auth.h)
9 |
10 | add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
11 |
12 | set(${MODULE_PREFIX}_LIBS ${PAM_LIBRARY})
13 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
14 |
15 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
16 |
17 | install(TARGETS ${MODULE_NAME} DESTINATION ${OGON_AUTH_MODULE_LIB_PATH})
18 |
--------------------------------------------------------------------------------
/session-manager/module/Weston/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-mod-weston")
2 | set(MODULE_PREFIX "OGON_MODULE_WESTON")
3 |
4 | set(${MODULE_PREFIX}_SRCS
5 | weston_module.cpp
6 | weston_module.h
7 | ../common/module_helper.cpp
8 | ../common/module_helper.h)
9 |
10 | add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
11 |
12 | list(APPEND ${MODULE_PREFIX}_LIBS ogon-backend)
13 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
14 |
15 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
16 |
17 | install(TARGETS ${MODULE_NAME} DESTINATION ${OGON_MODULE_LIB_PATH})
18 |
--------------------------------------------------------------------------------
/misc/ogon-session-manager.service.in:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=ogon session manager
3 | After=network.target
4 | Requires=dbus.service
5 |
6 | [Service]
7 | Type=forking
8 | ExecStartPre=-${OGON_CFG_PATH}/ogon_cleanup.sh
9 | ExecStart=${OGON_SBIN_PATH}/ogon-session-manager --log=syslog
10 | ExecStop=${OGON_SBIN_PATH}/ogon-session-manager --kill
11 | ExecReload=/bin/kill -HUP $MAINPID
12 | User=root
13 | Group=root
14 | KillMode=control-group
15 | PIDFile=${OGON_PID_PATH}/ogon-session-manager.pid
16 | StandardOutput=journal
17 | StandardError=journal
18 |
19 | [Install]
20 | WantedBy=multi-user.target
21 |
--------------------------------------------------------------------------------
/backend/ogon-backend.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | exec_prefix=@CMAKE_INSTALL_PREFIX@
3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@
4 | includedir=@CMAKE_INSTALL_PREFIX@/@OGON_INCLUDE_DIR@
5 | protocol_dir=@CMAKE_INSTALL_PREFIX@/share/ogon/@OGON_VERSION_MAJOR@
6 | module_dir=@CMAKE_INSTALL_FULL_LIBDIR@/ogon@OGON_VERSION_MAJOR@
7 | libs=-logon-backend
8 |
9 | Name: ogon backend
10 | Description: ogon RDP server backend library
11 | URL: http://ogon-project.com/
12 | Version: @OGON_VERSION_FULL@
13 | Requires:
14 | Requires.private: freerdp2
15 | Libs: -L${libdir} ${libs}
16 | Cflags: -I${includedir}
17 |
--------------------------------------------------------------------------------
/session-manager/module/Qt/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-mod-qt")
2 | set(MODULE_PREFIX "OGON_MODULE_QT")
3 |
4 | set(${MODULE_PREFIX}_SRCS
5 | qt_module.cpp
6 | qt_module.h
7 | ../common/module_helper.cpp
8 | ../common/module_helper.h)
9 |
10 | add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
11 |
12 | set(${MODULE_PREFIX}_LIBS "")
13 | list(APPEND ${MODULE_PREFIX}_LIBS ogon-backend)
14 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
15 |
16 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
17 |
18 | install(TARGETS ${MODULE_NAME} DESTINATION ${OGON_MODULE_LIB_PATH})
19 |
--------------------------------------------------------------------------------
/include/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/ogon/version.h)
2 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/ogon/build-config.h)
3 |
4 | file(GLOB OGON_HEADERS "ogon/*.h")
5 | install(FILES ${OGON_HEADERS} DESTINATION include/ogon${OGON_VERSION_MAJOR}/ogon COMPONENT headers)
6 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ogon/version.h DESTINATION include/ogon${OGON_VERSION_MAJOR}/ogon COMPONENT headers)
7 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ogon/build-config.h DESTINATION include/ogon${OGON_VERSION_MAJOR}/ogon COMPONENT headers)
8 |
--------------------------------------------------------------------------------
/protocols/protobuf/pbRPC.proto:
--------------------------------------------------------------------------------
1 | syntax="proto2";
2 | package ogon.pbrpc;
3 |
4 | message VersionInfo {
5 | required uint32 vmajor = 1;
6 | required uint32 vminor = 2;
7 | optional string cookie = 3;
8 | }
9 |
10 | message RPCBase {
11 | required uint32 tag = 1; // Tag to identify the message
12 | required bool isResponse = 2 [default = false]; // request or response
13 | enum RPCSTATUS {
14 | SUCCESS = 0;
15 | FAILED = 1;
16 | NOTFOUND = 2;
17 | }
18 | required RPCSTATUS status = 3 [default = SUCCESS];
19 | required uint32 msgType = 4;
20 | optional bytes payload = 5;
21 | optional string errorDescription = 6;
22 | optional VersionInfo versionInfo = 7;
23 | }
24 |
--------------------------------------------------------------------------------
/session-manager/module/X11/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-mod-x11")
2 | set(MODULE_PREFIX "OGON_MODULE_X11")
3 |
4 | set(${MODULE_PREFIX}_SRCS
5 | x11_module.cpp
6 | x11_module.h
7 | ../common/module_helper.cpp
8 | ../common/module_helper.h)
9 |
10 | add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
11 |
12 | list(APPEND ${MODULE_PREFIX}_LIBS ogon-backend)
13 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
14 | list(APPEND ${MODULE_PREFIX}_LIBS ${X11_Xau_LIB})
15 |
16 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
17 | include_directories(${X11_Xau_INCLUDE_PATH})
18 |
19 | install(TARGETS ${MODULE_NAME} DESTINATION ${OGON_MODULE_LIB_PATH})
20 |
--------------------------------------------------------------------------------
/session-manager/config/ogon.SessionManager.conf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/cmake/GNUInstallDirsWrapper.cmake:
--------------------------------------------------------------------------------
1 | # GNUInstallDirs is a relatively new cmake module, so wrap it to avoid errors
2 | include(GNUInstallDirs OPTIONAL RESULT_VARIABLE GID_PATH)
3 | if(GID_PATH STREQUAL "NOTFOUND")
4 | if(NOT DEFINED CMAKE_INSTALL_BINDIR)
5 | set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
6 | endif()
7 |
8 | if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
9 | set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE PATH "object code libraries (lib)")
10 | endif()
11 |
12 | foreach(dir BINDIR LIBDIR)
13 | if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
14 | set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
15 | else()
16 | set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
17 | endif()
18 | endforeach()
19 |
20 | mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR)
21 | endif()
22 |
--------------------------------------------------------------------------------
/rdp-server/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | set(MODULE_NAME "TestOgonCore")
3 | set(MODULE_PREFIX "TEST_OGON_CORE")
4 |
5 | set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
6 |
7 | set(${MODULE_PREFIX}_TESTS
8 | TestOgonEventLoop.c
9 | TestOgonTimer.c
10 | )
11 |
12 | create_test_sourcelist(${MODULE_PREFIX}_SRCS
13 | ${${MODULE_PREFIX}_DRIVER}
14 | ${${MODULE_PREFIX}_TESTS}
15 | )
16 |
17 | add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
18 |
19 | target_link_libraries(${MODULE_NAME} winpr)
20 |
21 | set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
22 |
23 | foreach(test ${${MODULE_PREFIX}_TESTS})
24 | get_filename_component(TestName ${test} NAME_WE)
25 | add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
26 | endforeach()
27 |
28 | set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/Test")
29 |
30 |
--------------------------------------------------------------------------------
/rdp-server/icp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_NAME "ogon-icp")
2 | set(MODULE_PREFIX "OGON_ICP")
3 | set(PBRPC_PREFIX "pbrpc")
4 |
5 | PROTOBUFC_GENERATE_C(ICP_PROTOC_SRC ICP_PROTOC_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/../../protocols/protobuf/ICP.proto)
6 | PROTOBUFC_GENERATE_C(PBRPC_PROTOC_SRC PBRPC_PROTOC_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/../../protocols/protobuf/pbRPC.proto)
7 |
8 | set(PBRPC_SRC
9 | ${PBRPC_PREFIX}/pbrpc.c
10 | ${PBRPC_PREFIX}/pbrpc_utils.c
11 | ${PBRPC_PREFIX}/pipe_transport.c
12 | ${PBRPC_PROTOC_HDRS}
13 | ${PBRPC_PROTOC_SRC}
14 | )
15 |
16 | include_directories(${PBRPC_PREFIX})
17 | include_directories(${CMAKE_CURRENT_BINARY_DIR})
18 | include_directories(${CMAKE_BINARY_DIR}/backend)
19 |
20 | set(${MODULE_PREFIX}_SRCS
21 | icp.c
22 | icp_client_stubs.c
23 | icp_server_stubs.c
24 | ${ICP_PROTOC_SRC}
25 | ${ICP_PROTOC_HDRS}
26 | ${PBRPC_SRC}
27 | )
28 |
29 | add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
30 |
31 |
32 | target_link_libraries(${MODULE_NAME} winpr ${PROTOBUFC_LIBRARIES})
33 |
--------------------------------------------------------------------------------
/protocols/protobuf/SBP.proto:
--------------------------------------------------------------------------------
1 | syntax="proto2";
2 | package ogon.sbp;
3 |
4 | enum MSGTYPE {
5 | AuthenticateUser = 200;
6 | EndSession = 201;
7 | VersionInfo = 202;
8 | }
9 |
10 | message VersionInfoRequest {
11 | required uint32 sessionId = 1;
12 | required uint32 vmajor = 2;
13 | required uint32 vminor = 3;
14 | }
15 |
16 | message VersionInfoResponse {
17 | required uint32 vmajor = 2;
18 | required uint32 vminor = 3;
19 | }
20 |
21 | message AuthenticateUserRequest {
22 | required uint32 sessionId = 1;
23 | required string username = 2;
24 | required string password = 3;
25 | required string domain = 4;
26 | }
27 |
28 | message AuthenticateUserResponse {
29 | enum AUTH_STATUS {
30 | AUTH_SUCCESSFUL = 0;
31 | AUTH_BAD_CREDENTIALS = 1;
32 | AUTH_WRONG_SESSION_STATE = 2;
33 | AUTH_UNKNOWN_ERROR = 3;
34 | }
35 |
36 | required AUTH_STATUS authStatus = 1;
37 | }
38 |
39 | message EndSessionRequest {
40 | required uint32 sessionId = 1;
41 | }
42 |
43 | message EndSessionResponse {
44 | required bool success = 1;
45 | }
46 |
--------------------------------------------------------------------------------
/rdp-server/frontend.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * RDP Server
4 | * Frontend
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 |
25 | #ifndef _OGON_RDPSRV_FRONTEND_H_
26 | #define _OGON_RDPSRV_FRONTEND_H_
27 |
28 | void handle_wait_timer_state(ogon_connection *conn);
29 |
30 | #endif /* _OGON_RDPSRV_FRONTEND_H_ */
31 |
--------------------------------------------------------------------------------
/packaging/deb/ogon/copyright:
--------------------------------------------------------------------------------
1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 | Upstream-Name: ogon
3 | Upstream-Contact: ogon
4 | Source: http://github.com/ogon/ogon
5 |
6 | Files: *
7 | Copyright: 2018 Thincast Technologies GmBH
8 | License: Apache-2.0
9 |
10 | License: Apache-2.0
11 | Licensed under the Apache License, Version 2.0 (the "License");
12 | you may not use this file except in compliance with the License.
13 | You may obtain a copy of the License at
14 | .
15 | http://www.apache.org/licenses/LICENSE-2.0
16 | .
17 | Unless required by applicable law or agreed to in writing, software
18 | distributed under the License is distributed on an "AS IS" BASIS,
19 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 | See the License for the specific language governing permissions and
21 | limitations under the License.
22 | .
23 | On Debian systems, the complete text of the Apache 2.0 License
24 | can be found in /usr/share/common-licenses/Apache-2.0 file.
25 |
--------------------------------------------------------------------------------
/session-manager/common/utils/MakeCert.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * makecert helper
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_MAKECERT_H_
25 | #define _OGON_SMGR_MAKECERT_H_
26 |
27 | #include
28 |
29 | int ogon_generate_certificate(std::string &certFile, std::string &keyFile);
30 |
31 | #endif //_OGON_SMGR_MAKECERT_H_
32 |
--------------------------------------------------------------------------------
/misc/ogon-start-vc.sh.in:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # rdp clipboard
4 | RDPCLIP=@OGON_BIN_PATH@/rdpclip
5 | if [ -x "$RDPCLIP" ]; then
6 | "$RDPCLIP" --log=syslog &
7 | # Options:
8 | # --log=[syslog|journald|console]
9 | fi
10 |
11 | # rdp device redirector
12 | RDPDR=@OGON_BIN_PATH@/rdpdr
13 | if [ -x "$RDPDR" ]; then
14 | "$RDPDR" "--mountpointrule={HOME}/rdpfiles/{CLIENTNAME}/{DEVICENAME}/" --log=syslog &
15 | # Options:
16 | # --log=[syslog|journald|console]
17 | fi
18 |
19 | # rdp audio
20 | PULSE=@OGON_BIN_PATH@/pulseaudio
21 | if [ -x "$PULSE" ] && [ ! -z "$OGON_SID" ]; then
22 | export PULSE_RUNTIME_PATH="/tmp/.rdpsnd-$OGON_SID/"
23 | export PULSE_STATE_PATH="$PULSE_RUNTIME_PATH"
24 | export HOME="$PULSE_RUNTIME_PATH"
25 | $PULSE --start --log-target=syslog
26 | # Options:
27 | # --log-target=[auto|syslog|stderr|file:PATH|newfile:PATH]
28 | # --log-level=debug
29 |
30 | # if not configured to use x11 publish the following can be used
31 | #if [ $? -eq 0 ] && [ x"$DISPLAY" != x ] ;then
32 | # /usr/bin/ogon-pactl load-module module-x11-publish "display=$DISPLAY"
33 | #fi
34 | fi
35 |
36 |
--------------------------------------------------------------------------------
/include/ogon/message.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * WTS Message Type Definitions
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * This file may be used under the terms of the GNU Affero General
8 | * Public License version 3 as published by the Free Software Foundation
9 | * and appearing in the file LICENSE-AGPL included in the distribution
10 | * of this file.
11 | *
12 | * Under the GNU Affero General Public License version 3 section 7 the
13 | * copyright holders grant the additional permissions set forth in the
14 | * ogon Core AGPL Exceptions version 1 as published by
15 | * Thincast Technologies GmbH.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Library AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_MESSAGE_H_
26 | #define _OGON_MESSAGE_H_
27 |
28 | #define MESSAGE_CUSTOM_TYPE 1
29 | #define MESSAGE_REQUEST_REMOTE_CONTROL 2
30 |
31 | #endif /* _OGON_MESSAGE_H_ */
32 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallFactory.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Factory for rpc calls
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "CallFactory.h"
29 |
30 | namespace ogon { namespace sessionmanager { namespace call {
31 |
32 | CallFactory::CallFactory() {
33 | }
34 |
35 | CallFactory::~CallFactory() {
36 | }
37 |
38 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
39 |
--------------------------------------------------------------------------------
/rdp-server/icp/pbrpc/pipe_transport.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * pbRPC: Simple Protocol Buffers based RPC
4 | * Named Pipe Transport
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_RDPSRV_ICP_PIPETRANSPORT_H_
25 | #define _OGON_RDPSRV_ICP_PIPETRANSPORT_H_
26 |
27 | #include "pbrpc.h"
28 | #include "pbrpc_transport.h"
29 |
30 | pbRPCTransportContext* tp_npipe_new();
31 | void tp_npipe_free(pbRPCTransportContext *context);
32 | #endif /* _OGON_RDPSRV_ICP_PIPETRANSPORT_H_ */
33 |
--------------------------------------------------------------------------------
/session-manager/module/X11/x11_module.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * X11 Backend Module Header
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_X11MODULE_H_
25 | #define _OGON_SMGR_X11MODULE_H_
26 |
27 | #include
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | int RdsModuleEntry(RDS_MODULE_ENTRY_POINTS* pEntryPoints);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 | #endif /* _OGON_SMGR_X11MODULE_H_ */
40 |
--------------------------------------------------------------------------------
/include/ogon/api.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * API Header
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * This file may be used under the terms of the GNU Affero General
8 | * Public License version 3 as published by the Free Software Foundation
9 | * and appearing in the file LICENSE-AGPL included in the distribution
10 | * of this file.
11 | *
12 | * Under the GNU Affero General Public License version 3 section 7 the
13 | * copyright holders grant the additional permissions set forth in the
14 | * ogon Core AGPL Exceptions version 1 as published by
15 | * Thincast Technologies GmbH.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Library AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_API_H_
26 | #define _OGON_API_H_
27 |
28 | #if __GNUC__ >= 4
29 | #define OGON_API __attribute__ ((visibility("default")))
30 | #else
31 | #define OGON_API
32 | #endif
33 |
34 | #endif /* _OGON_API_H_ */
35 |
--------------------------------------------------------------------------------
/session-manager/module/Weston/weston_module.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Weston Backend Module Header
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * David Fort
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_WESTONMODULE_H_
25 | #define _OGON_SMGR_WESTONMODULE_H_
26 |
27 | #include
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | int RdsModuleEntry(RDS_MODULE_ENTRY_POINTS* pEntryPoints);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 | #endif /* _OGON_SMGR_WESTONMODULE_H_ */
40 |
--------------------------------------------------------------------------------
/backend-launcher/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(MODULE_PREFIX "OGON_SESSION_MANAGER")
2 | set(MODULE_NAME "ogon-backend-launcher")
3 |
4 | PROTOBUF_GENERATE_CPP(PBRPC_PROTOBUF_SRC PBRPC_PROTOBUF_HEADERS ${CMAKE_SOURCE_DIR}/protocols/protobuf/pbRPC.proto)
5 | PROTOBUF_GENERATE_CPP(MODULE_PROTOBUF_SRC MODULE_PROTOBUF_HEADERS ${CMAKE_SOURCE_DIR}/protocols/protobuf/Module.proto)
6 |
7 | include_directories(${PROTOBUF_INCLUDE_DIRS})
8 |
9 | set(${MODULE_PREFIX}_SRCS
10 | SystemSession.cpp
11 | ../session-manager/common/module/RemoteModuleTransport.cpp
12 | ModuleCommunication.cpp
13 | main.cpp
14 | ${PBRPC_PROTOBUF_SRC}
15 | ${PBRPC_PROTOBUF_HEADERS}
16 | ${MODULE_PROTOBUF_SRC}
17 | ${MODULE_PROTOBUF_HEADERS}
18 | )
19 |
20 | include_directories(${CMAKE_CURRENT_SOURCE_DIR})
21 | include_directories(${CMAKE_CURRENT_BINARY_DIR})
22 | add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
23 | target_link_libraries(${MODULE_NAME} ${PAM_LIBRARY} ${PROTOBUF_LIBRARY} winpr ${CMAKE_THREAD_LIBS_INIT})
24 | if(WITH_LIBSYSTEMD)
25 | target_link_libraries(${MODULE_NAME} ${LIBSYSTEMD_LIBRARIES})
26 | include_directories(${LIBSYSTEMD_INCLUDE_DIRS})
27 | endif(WITH_LIBSYSTEMD)
28 |
29 | install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_SBINDIR})
30 |
--------------------------------------------------------------------------------
/cmake/FindPAM.cmake:
--------------------------------------------------------------------------------
1 | # - Try to find the PAM libraries
2 | # Once done this will define
3 | #
4 | # PAM_FOUND - system has pam
5 | # PAM_INCLUDE_DIR - the pam include directory
6 | # PAM_LIBRARIES - libpam library
7 |
8 | if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
9 | set(PAM_FIND_QUIETLY TRUE)
10 | endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
11 |
12 | find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
13 | find_library(PAM_LIBRARY pam)
14 | find_library(DL_LIBRARY dl)
15 |
16 | if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
17 | set(PAM_FOUND TRUE)
18 | if (DL_LIBRARY)
19 | set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
20 | else (DL_LIBRARY)
21 | set(PAM_LIBRARIES ${PAM_LIBRARY})
22 | endif (DL_LIBRARY)
23 |
24 | if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
25 | set(HAVE_PAM_PAM_APPL_H 1)
26 | endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
27 | endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
28 |
29 | if (PAM_FOUND)
30 | if (NOT PAM_FIND_QUIETLY)
31 | message(STATUS "Found PAM: ${PAM_LIBRARIES}")
32 | endif (NOT PAM_FIND_QUIETLY)
33 | else (PAM_FOUND)
34 | if (PAM_FIND_REQUIRED)
35 | message(FATAL_ERROR "PAM was not found")
36 | endif(PAM_FIND_REQUIRED)
37 | endif (PAM_FOUND)
38 |
39 | mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY)
40 |
41 |
--------------------------------------------------------------------------------
/session-manager/module/Qt/qt_module.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Qt Backend Module Header
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * David Fort
10 | * Martin Haimberger
11 | *
12 | * This file may be used under the terms of the GNU Affero General
13 | * Public License version 3 as published by the Free Software Foundation
14 | * and appearing in the file LICENSE-AGPL included in the distribution
15 | * of this file.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Core AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_SMGR_QTMODULE_H_
26 | #define _OGON_SMGR_QTMODULE_H_
27 |
28 | #include
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | int RdsModuleEntry(RDS_MODULE_ENTRY_POINTS* pEntryPoints);
35 |
36 | #ifdef __cplusplus
37 | }
38 | #endif
39 |
40 | #endif /* _OGON_SMGR_QTMODULE_H_ */
41 |
--------------------------------------------------------------------------------
/misc/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-rdp-server.service.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-rdp-server.service)
2 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-session-manager.service.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-session-manager.service)
3 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-session-manager.init.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-session-manager.init)
4 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-rdp-server.init.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-rdp-server.init)
5 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.ini.debian.in ${CMAKE_CURRENT_BINARY_DIR}/config.ini.debian)
6 |
7 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-start-vc.sh.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-start-vc.sh)
8 | install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/ogon-start-vc.sh" DESTINATION ${CMAKE_INSTALL_BINDIR})
9 |
10 | install(PROGRAMS "ogonXsession" DESTINATION ${OGON_CFG_PATH})
11 | install(PROGRAMS "ogon_cleanup.sh" DESTINATION ${OGON_CFG_PATH})
12 |
13 | if(WITH_OPENH264)
14 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ogon-get-openh264-codec.in ${CMAKE_CURRENT_BINARY_DIR}/ogon-get-openh264-codec)
15 | install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/ogon-get-openh264-codec" DESTINATION ${CMAKE_INSTALL_SBINDIR})
16 | endif()
17 |
--------------------------------------------------------------------------------
/common/procutils.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * procutils
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * Authors:
8 | * Bernhard Miklautz
9 | * Norbert Federa
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_PROCUTILS_H_
25 | #define _OGON_PROCUTILS_H_
26 |
27 | #include
28 | #include
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif /* __cplusplus */
33 |
34 |
35 | BOOL get_parent_pid(const pid_t pid, pid_t *ppid);
36 | char* get_process_name(const pid_t pid);
37 |
38 | #ifdef __cplusplus
39 | };
40 | #endif /* __cplusplus */
41 |
42 | #endif /* _OGON_PROCUTILS_H_ */
43 |
--------------------------------------------------------------------------------
/common/global.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Global Macros and Defines
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * Authors:
8 | * Bernhard Miklautz
9 | *
10 | * This file may be used under the terms of the GNU Affero General
11 | * Public License version 3 as published by the Free Software Foundation
12 | * and appearing in the file LICENSE-AGPL included in the distribution
13 | * of this file.
14 | *
15 | * Under the GNU Affero General Public License version 3 section 7 the
16 | * copyright holders grant the additional permissions set forth in the
17 | * ogon Core AGPL Exceptions version 1 as published by
18 | * Thincast Technologies GmbH.
19 | *
20 | * Under the GNU Affero General Public License version 3 section 7 the
21 | * copyright holders grant the additional permissions set forth in the
22 | * ogon Library AGPL Exceptions version 1 as published by
23 | * Thincast Technologies GmbH.
24 | *
25 | * For more information see the file LICENSE in the distribution of this file.
26 | */
27 |
28 | #ifndef _OGON_GLOBAL_H_
29 | #define _OGON_GLOBAL_H_
30 |
31 | #include
32 |
33 | #define OGON_TAG(tag) "com.ogon." tag
34 |
35 | #define OGON_UNUSED(x) (void)(x)
36 |
37 |
38 | #endif /* _OGON_GLOBAL_H_ */
39 |
--------------------------------------------------------------------------------
/cmake/GetGitRevisionDescription.cmake.in:
--------------------------------------------------------------------------------
1 | # Internal file for GetGitRevisionDescription.cmake
2 | #
3 | # Requires CMake 2.6 or newer (uses the 'function' command)
4 | #
5 | # Original Author:
6 | # 2009-2010 Ryan Pavlik
7 | # http://academic.cleardefinition.com
8 | # Iowa State University HCI Graduate Program/VRAC
9 | #
10 | # Copyright Iowa State University 2009-2010.
11 | # Distributed under the Boost Software License, Version 1.0.
12 | # (See http://www.boost.org/LICENSE_1_0.txt)
13 |
14 | set(HEAD_HASH)
15 |
16 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
17 |
18 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
19 | if(HEAD_CONTENTS MATCHES "ref")
20 | # named branch
21 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
22 | if(EXISTS "@GIT_DIR@/${HEAD_REF}")
23 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
24 | elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
25 | configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
26 | set(HEAD_HASH "${HEAD_REF}")
27 | endif()
28 | else()
29 | # detached HEAD
30 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
31 | endif()
32 |
33 | if(NOT HEAD_HASH)
34 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
35 | string(STRIP "${HEAD_HASH}" HEAD_HASH)
36 | endif()
37 |
--------------------------------------------------------------------------------
/session-manager/common/utils/TimeHelpers.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * helper functions for time
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_TIMEHELPERS_H_
25 | #define _OGON_SMGR_TIMEHELPERS_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | void GetUnixTimeAsFileTime(time_t t, LPFILETIME lpSystemTimeAsFileTime);
32 | time_t to_time_t(boost::posix_time::ptime t);
33 | __uint64 convertFileTimeToint64( const FILETIME &fileTime);
34 |
35 | #endif /* _OGON_SMGR_TIMEHELPERS_H_ */
36 |
--------------------------------------------------------------------------------
/cmake/ThriftUtils.cmake:
--------------------------------------------------------------------------------
1 | function(THRIFT_GEN VAR)
2 | IF (NOT ARGN)
3 | MESSAGE(SEND_ERROR "Error: THRIFT_GEN called without any src files")
4 | RETURN()
5 | ENDIF(NOT ARGN)
6 |
7 | set(${VAR})
8 | foreach(FIL ${ARGN})
9 | # Get full path
10 | get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
11 | # Get basename
12 | get_filename_component(FIL_WE ${FIL} NAME_WE)
13 |
14 | set(OUTPUT_THRIFT_FILE "${THRIFT_OUTPUT_DIR}/${FIL_WE}_types.cpp")
15 | set(OUTPUT_THRIFT_FILE ${OUTPUT_THRIFT_FILE} "${THRIFT_OUTPUT_DIR}/${FIL_WE}_types.h")
16 | set(OUTPUT_THRIFT_FILE ${OUTPUT_THRIFT_FILE} "${THRIFT_OUTPUT_DIR}/${FIL_WE}_constants.cpp")
17 | set(OUTPUT_THRIFT_FILE ${OUTPUT_THRIFT_FILE} "${THRIFT_OUTPUT_DIR}/${FIL_WE}_constants.h")
18 | set(OUTPUT_THRIFT_FILE ${OUTPUT_THRIFT_FILE} "${THRIFT_OUTPUT_DIR}/${FIL_WE}.cpp")
19 |
20 | list(APPEND ${VAR} ${OUTPUT_THRIFT_FILE})
21 |
22 | set(CPP_ARGS ${THRIFT_INCLUDE_DIR_OPTION} --gen cpp -out ${THRIFT_OUTPUT_DIR})
23 |
24 | add_custom_command(
25 | OUTPUT ${OUTPUT_THRIFT_FILE}
26 | COMMAND ${THRIFT_COMPILER} ${CPP_ARGS} ${FIL}
27 | DEPENDS ${ABS_FIL}
28 | COMMENT "Running thrift compiler on ${FIL}"
29 | VERBATIM
30 | )
31 | endforeach(FIL)
32 |
33 | set(${VAR} ${${VAR}} PARENT_SCOPE)
34 | endfunction(THRIFT_GEN)
35 |
--------------------------------------------------------------------------------
/session-manager/auth/pam/pam_auth.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * PAM Authentication Module
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | * Copyright (c) 2013 Marc-Andre Moreau
7 | *
8 | * Authors:
9 | * Marc-Andre Moreau
10 | * Martin Haimberger
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the "License");
13 | * you may not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * http://www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an "AS IS" BASIS,
20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | */
24 |
25 | #ifndef _OGON_SMGR_AUTH_PAM_H_
26 | #define _OGON_SMGR_AUTH_PAM_H_
27 |
28 | #include "../../auth.h"
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 |
34 | #define PAM_AUTH_DOMAIN ""
35 |
36 | int RdsAuthModuleEntry(RDS_AUTH_MODULE_ENTRY_POINTS* pEntryPoints);
37 |
38 | #ifdef __cplusplus
39 | }
40 | #endif
41 |
42 | #endif /* _OGON_SMGR_AUTH_PAM_H_ */
43 |
--------------------------------------------------------------------------------
/cmake/FindThrift.cmake:
--------------------------------------------------------------------------------
1 | # - Find Thrift (a cross platform RPC lib/tool)
2 | # This module defines
3 | # THRIFT_VERSION, version string of ant if found
4 | # THRIFT_INCLUDE_DIR, where to find THRIFT headers
5 | # THRIFT_LIBS, THRIFT libraries
6 | # THRIFT_FOUND, true or false
7 |
8 | # prefer the thrift version supplied in THRIFT_HOME
9 | message(STATUS "THRIFT_HOME: $ENV{THRIFT_HOME}")
10 |
11 | find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h HINTS
12 | $ENV{THRIFT_HOME}/include/
13 | /usr/local/include/
14 | /opt/local/include/)
15 |
16 | set(THRIFT_LIB_PATHS
17 | $ENV{THRIFT_HOME}/lib
18 | /usr/local/lib
19 | /opt/local/lib)
20 |
21 | find_library(THRIFT_LIBRARY NAMES "thrift" HINTS ${THRIFT_LIB_PATHS})
22 |
23 | find_program(THRIFT_COMPILER thrift
24 | $ENV{THRIFT_HOME}/bin
25 | /usr/local/bin
26 | /usr/bin)
27 |
28 | if(THRIFT_LIBRARY)
29 | set(THRIFT_FOUND TRUE)
30 | set(THRIFT_LIBS ${THRIFT_LIBRARY})
31 | set(THRIFT_STATIC_LIB "${THRIFT_LIBRARY}")
32 | exec_program(${THRIFT_COMPILER} ARGS -version OUTPUT_VARIABLE THRIFT_VERSION RETURN_VALUE THRIFT_RETURN)
33 | else()
34 | set(THRIFT_FOUND FALSE)
35 | endif()
36 |
37 | if(THRIFT_FOUND)
38 | if (NOT THRIFT_FIND_QUIETLY)
39 | message(STATUS "Thrift version: ${THRIFT_VERSION}")
40 | message(STATUS "Thrift library: ${THRIFT_LIBRARY}")
41 | endif()
42 | endif()
43 |
44 | mark_as_advanced(
45 | THRIFT_LIBRARY
46 | THRIFT_COMPILER
47 | THRIFT_INCLUDE_DIR)
48 |
--------------------------------------------------------------------------------
/session-manager/common/module/CallBacks.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Callback Handlers for Modules
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_MODULE_CALLBACKS_H_
25 | #define _OGON_SMGR_MODULE_CALLBACKS_H_
26 |
27 | #include
28 |
29 | namespace ogon { namespace sessionmanager { namespace module {
30 |
31 | class CallBacks {
32 | public:
33 | static void addMonitoringProcess(DWORD processId, UINT32 sessionId, bool terminateSession, RDS_MODULE_COMMON *context);
34 | static bool removeMonitoringProcess(DWORD processId);
35 | };
36 |
37 | } /*module*/ } /*sessionmanager*/ } /*ogon*/
38 |
39 | #endif /* _OGON_SMGR_MODULE_CALLBACKS_H_ */
40 |
--------------------------------------------------------------------------------
/rdp-server/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories(${CMAKE_CURRENT_BINARY_DIR}/icp)
2 | add_subdirectory(icp)
3 |
4 | set(MODULE_NAME "ogon-rdp-server")
5 | set(MODULE_PREFIX "OGON_CORE")
6 |
7 | include_directories(".")
8 | include_directories("${CMAKE_BINARY_DIR}/backend")
9 |
10 | set(${MODULE_PREFIX}_SRCS
11 | app_context.c
12 | app_context.h
13 | backend.c
14 | channels.c
15 | channels.h
16 | encoder.c
17 | encoder.h
18 | eventloop.c
19 | eventloop.h
20 | ogon.c
21 | ogon.h
22 | frontend.c
23 | graphics.c
24 | peer.c
25 | peer.h
26 | PMurHash.c
27 | PMurHash.h
28 | state.c
29 | state.h
30 | rdpgfx.c
31 | rdpgfx.h
32 | font8x8.h
33 | openh264.c
34 | openh264.h
35 | bandwidth_mgmt.c
36 | bandwidth_mgmt.h
37 | ../common/procutils.c
38 | ../common/procutils.h
39 | )
40 |
41 |
42 | add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
43 |
44 | list(APPEND ${MODULE_PREFIX}_LIBS freerdp)
45 | list(APPEND ${MODULE_PREFIX}_LIBS ogon-backend)
46 | list(APPEND ${MODULE_PREFIX}_LIBS ogon-icp)
47 | list(APPEND ${MODULE_PREFIX}_LIBS freerdp-server)
48 | list(APPEND ${MODULE_PREFIX}_LIBS ${OPENSSL_LIBRARIES})
49 | list(APPEND ${MODULE_PREFIX}_LIBS winpr)
50 | list(APPEND ${MODULE_PREFIX}_LIBS ${CMAKE_DL_LIBS})
51 | target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${CMAKE_THREAD_LIBS_INIT})
52 |
53 | install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_SBINDIR})
54 |
55 | if(BUILD_TESTING)
56 | add_subdirectory(test)
57 | endif()
58 |
--------------------------------------------------------------------------------
/session-manager/common/task/Task.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task Object for an Executor
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_TASK_H_
25 | #define _OGON_SMGR_TASK_H_
26 |
27 | #include
28 | #include
29 |
30 | namespace ogon { namespace sessionmanager { namespace task {
31 |
32 | class Task {
33 | public:
34 | Task(){}
35 | virtual ~Task() {}
36 | virtual void run() = 0;
37 | virtual void preProcess(){};
38 | virtual void postProcess(){};
39 | virtual void abortTask(){};
40 | };
41 |
42 | typedef std::shared_ptr TaskPtr;
43 |
44 | } /*task*/ } /*sessionmanager*/ } /*ogon*/
45 |
46 | namespace taskNS = ogon::sessionmanager::task;
47 |
48 | #endif /* _OGON_SMGR_TASK_H_ */
49 |
--------------------------------------------------------------------------------
/session-manager/common/call/TaskCallInLogonUser.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * call task for Logging on a user.
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "TaskCallInLogonUser.h"
29 | #include
30 | #include
31 |
32 |
33 | namespace ogon { namespace sessionmanager { namespace call {
34 |
35 | void TaskCallInLogonUser::run() {
36 | if (mCall == NULL) {
37 | return;
38 | }
39 | mCall->doStuff();
40 | APP_CONTEXT.getRpcOutgoingQueue()->addElement(mCall);
41 | return;
42 | }
43 |
44 | void TaskCallInLogonUser::setCallIn(CallInPtr call) {
45 | mCall = call;
46 | }
47 |
48 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
49 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskSessionTimeout.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for session timeout
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKSESSIONTIMEOUT_H_
25 | #define _OGON_SMGR_SESSION_TASKSESSIONTIMEOUT_H_
26 |
27 | #include
28 |
29 | namespace ogon { namespace sessionmanager { namespace session {
30 |
31 | class TaskSessionTimeout: public taskNS::ThreadTask {
32 | public:
33 | virtual void run();
34 | virtual bool isThreaded();
35 | };
36 |
37 | typedef std::shared_ptr TaskSessionTimeoutPtr;
38 |
39 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
40 |
41 | namespace sessionNS = ogon::sessionmanager::session;
42 |
43 | #endif /* _OGON_SMGR_SESSION_TASKSESSIONTIMEOUT_H_ */
44 |
--------------------------------------------------------------------------------
/utils/astylerc:
--------------------------------------------------------------------------------
1 |
2 | # /* *INDENT-OFF* */
3 | # /* *INDENT-ON* */
4 | # http://astyle.sourceforge.net/astyle.html#_Options
5 |
6 |
7 | # set the maximum code lenght
8 | --max-code-length=80
9 |
10 | # set mode for c/c++
11 | --mode=c
12 |
13 | # attached brackets
14 | # --style=google (the google style also sets some ident modifiers)
15 | --style=java
16 |
17 | # intend with tab and use space for continuation line alignment
18 | --indent=tab
19 |
20 | # attach the brackets to the namespace
21 | --attach-namespaces
22 |
23 | # attach the brackets to classes
24 | --indent-classes
25 |
26 | # attach the brackets to extern "C"
27 | --attach-extern-c
28 |
29 | # intend one line comments to the code level
30 | --indent-col1-comments
31 |
32 | # when having multiline conditions indent the next line at least one ident
33 | --min-conditional-indent=1
34 |
35 | #
36 | --max-instatement-indent=40
37 |
38 | # TODO
39 | --indent-switches
40 |
41 | # pad operators
42 | --pad-oper
43 |
44 | # insert space between if, for and while
45 | --pad-header
46 |
47 | # alingn pointer at the name like char *xx
48 | --align-pointer=name
49 |
50 | # align reference on their name
51 | --align-reference=name
52 |
53 | # add brackets even for signle lines
54 | --add-brackets
55 |
56 | # break after logical conjunctions
57 | --break-after-logical
58 |
59 | ## general options
60 | # preserve the date
61 | --preserve-date
62 | # force linux line endings
63 | --lineend=linux
64 | # don't save the original file as we are in git anyways
65 | --suffix=none
66 |
--------------------------------------------------------------------------------
/session-manager/common/call/Call.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Baseclass of an rpc call
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "Call.h"
29 | #include
30 | #include
31 |
32 | namespace ogon { namespace sessionmanager { namespace call {
33 |
34 | Call::Call():mTag(0), mResult(0) {
35 | }
36 |
37 | Call::~Call() {
38 | }
39 |
40 | void Call::setTag(uint32_t tag) {
41 | mTag = tag;
42 | }
43 |
44 | uint32_t Call::getTag() {
45 | return mTag;
46 | }
47 |
48 | uint32_t Call::getResult() {
49 | return mResult;
50 | }
51 |
52 | std::string Call::getErrorDescription() {
53 | return mErrorDescription;
54 | }
55 |
56 | } /*call*/ } /*sessionmanager*/ } /*call*/
57 |
--------------------------------------------------------------------------------
/session-manager/common/utils/CSGuard.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Guard object for critical sections
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CSGUARD_H_
25 | #define _OGON_SMGR_CSGUARD_H_
26 |
27 | #include
28 |
29 | class CSGuard {
30 | public:
31 | CSGuard(CRITICAL_SECTION *criticalSection) {
32 | mCriticalSection = criticalSection;
33 | EnterCriticalSection(mCriticalSection);
34 | }
35 |
36 | void leaveGuard() {
37 | LeaveCriticalSection(mCriticalSection);
38 | mCriticalSection = NULL;
39 | }
40 |
41 | ~CSGuard() {
42 | if (mCriticalSection != NULL) {
43 | LeaveCriticalSection(mCriticalSection);
44 | }
45 | }
46 |
47 | private:
48 | CRITICAL_SECTION *mCriticalSection;
49 |
50 | };
51 |
52 |
53 | #endif /* _OGON_SMGR_CSGUARD_H_ */
54 |
--------------------------------------------------------------------------------
/session-manager/common/config/PropertyLevel.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Property levels
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_PROPERTYLEVEL_H_
25 | #define _OGON_SMGR_PROPERTYLEVEL_H_
26 |
27 | #include
28 |
29 | typedef enum _PROPERTY_LEVEL
30 | {
31 | Global = 1,
32 | UserGroup = 2,
33 | User = 3
34 | }
35 | PROPERTY_LEVEL, *PPROPERTY_LEVEL;
36 |
37 | typedef enum _PROPERTY_STORE_TYPE
38 | {
39 | BoolType = 1,
40 | NumberType = 2,
41 | StringType = 3
42 | } PROPERTY_STORE_TYPE, *PPROPERTY_STORE_TYPE;
43 |
44 |
45 | typedef struct _PROPERTY_STORE_HELPER {
46 | PROPERTY_STORE_TYPE type;
47 | bool boolValue;
48 | long numberValue;
49 | std::string stringValue;
50 | } PROPERTY_STORE_HELPER, *PPROPERTY_STORE_HELPER;
51 |
52 | #endif /* _OGON_SMGR_PROPERTYLEVEL_H_ */
53 |
--------------------------------------------------------------------------------
/cmake/Findlibsystemd.cmake:
--------------------------------------------------------------------------------
1 | # Module defines
2 | # LIBSYSTEMD_FOUND - libsystemd libraries and includes found
3 | # LIBSYSTEMD_INCLUDE_DIRS - the libsystemd include directories
4 | # LIBSYSTEMD_LIBRARIES - the libsystemd libraries
5 | #
6 | # Cache entries:
7 | # LIBSYSTEMD_LIBRARY - detected libsystemd library
8 | # LIBSYSTEMD_INCLUDE_DIR - detected libsystemd include dir(s)
9 | #
10 |
11 | if(LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY)
12 | # in cache already
13 | set(LIBSYSTEMD_FOUND TRUE)
14 | set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY})
15 | set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR})
16 | else(LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY)
17 |
18 | find_package(PkgConfig)
19 | if(PKG_CONFIG_FOUND)
20 | pkg_check_modules(_LIBSYSTEMD_PC QUIET "libsystemd")
21 | endif(PKG_CONFIG_FOUND)
22 |
23 | find_path(LIBSYSTEMD_INCLUDE_DIR systemd/sd-journal.h
24 | ${_LIBSYSTEMD_PC_INCLUDE_DIRS}
25 | /usr/include
26 | /usr/local/include
27 | )
28 | mark_as_advanced(LIBSYSTEMD_INCLUDE_DIR)
29 |
30 | find_library (LIBSYSTEMD_LIBRARY NAMES systemd
31 | PATHS
32 | ${_LIBSYSTEMD_PC_LIBDIR}
33 | )
34 | mark_as_advanced(LIBSYSTEMD_LIBRARY)
35 |
36 | include(FindPackageHandleStandardArgs)
37 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(libsystemd DEFAULT_MSG LIBSYSTEMD_LIBRARY LIBSYSTEMD_INCLUDE_DIR)
38 |
39 | if(LIBSYSTEMD_FOUND)
40 | set(LIBSYSTEMD_LIBRARIES ${LIBSYSTEMD_LIBRARY})
41 | set(LIBSYSTEMD_INCLUDE_DIRS ${LIBSYSTEMD_INCLUDE_DIR})
42 | endif(LIBSYSTEMD_FOUND)
43 |
44 | endif(LIBSYSTEMD_INCLUDE_DIR AND LIBSYSTEMD_LIBRARY)
45 |
--------------------------------------------------------------------------------
/include/ogon/version.h.in:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Version Definitions
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * This file may be used under the terms of the GNU Affero General
8 | * Public License version 3 as published by the Free Software Foundation
9 | * and appearing in the file LICENSE-AGPL included in the distribution
10 | * of this file.
11 | *
12 | * Under the GNU Affero General Public License version 3 section 7 the
13 | * copyright holders grant the additional permissions set forth in the
14 | * ogon Core AGPL Exceptions version 1 as published by
15 | * Thincast Technologies GmbH.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Library AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_VERSION_H_
26 | #define _OGON_VERSION_H_
27 |
28 | #define OGON_VERSION_MAJOR ${OGON_VERSION_MAJOR}
29 | #define OGON_VERSION_MINOR ${OGON_VERSION_MINOR}
30 | #define OGON_VERSION_REVISION ${OGON_VERSION_REVISION}
31 | #define OGON_VERSION_SUFFIX "${OGON_VERSION_SUFFIX}"
32 | #define OGON_VERSION "${OGON_VERSION}"
33 | #define OGON_VERSION_FULL "${OGON_VERSION_FULL}"
34 | #define GIT_REVISION "${GIT_REVISION}"
35 |
36 | #define OGON_PROTOCOL_VERSION_MAJOR 1
37 | #define OGON_PROTOCOL_VERSION_MINOR 1
38 |
39 | #endif /* _OGON_VERSION_H_ */
40 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskCallIn.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for async Calls
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKCALLIN_H_
25 | #define _OGON_SMGR_SESSION_TASKCALLIN_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace session {
32 |
33 | class TaskCallIn: public taskNS::Task {
34 | public:
35 | virtual void run();
36 | void setCallIn(callNS::CallInPtr call);
37 | virtual void abortTask();
38 |
39 | private:
40 | callNS::CallInPtr mCall;
41 | };
42 |
43 | typedef std::shared_ptr TaskCallInPtr;
44 |
45 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
46 |
47 | namespace callNS = ogon::sessionmanager::call;
48 |
49 | #endif /* _OGON_SMGR_SESSION_TASKCALLIN_H_ */
50 |
--------------------------------------------------------------------------------
/session-manager/common/call/TaskCallInLogonUser.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * call task for Logging on a user.
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_TASKCALLINLOGONUSER_H_
25 | #define _OGON_SMGR_CALL_TASKCALLINLOGONUSER_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | class TaskCallInLogonUser: public taskNS::ThreadTask {
34 | public:
35 | virtual void run();
36 | void setCallIn(CallInPtr call);
37 |
38 | private:
39 | CallInPtr mCall;
40 | };
41 |
42 | typedef std::shared_ptr TaskCallInLogonUserPtr;
43 |
44 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
45 |
46 | namespace callNS = ogon::sessionmanager::call;
47 |
48 | #endif /* _OGON_SMGR_CALL_TASKCALLINLOGONUSER_H_ */
49 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskCallIn.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for async Calls
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "TaskCallIn.h"
29 | #include
30 | #include
31 |
32 |
33 | namespace ogon { namespace sessionmanager { namespace session {
34 |
35 | void TaskCallIn::run() {
36 | if (mCall == NULL) {
37 | return;
38 | }
39 | mCall->doStuff();
40 | APP_CONTEXT.getRpcOutgoingQueue()->addElement(mCall);
41 | return;
42 | }
43 |
44 | void TaskCallIn::setCallIn(callNS::CallInPtr call) {
45 | mCall = call;
46 | }
47 |
48 | void TaskCallIn::abortTask() {
49 | mCall->abort();
50 | APP_CONTEXT.getRpcOutgoingQueue()->addElement(mCall);
51 | }
52 |
53 |
54 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
55 |
--------------------------------------------------------------------------------
/common/icp.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Internal Communication Protocol (ICP)
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * Authors:
8 | * Bernhard Miklautz
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * Under the GNU Affero General Public License version 3 section 7 the
22 | * copyright holders grant the additional permissions set forth in the
23 | * ogon Library AGPL Exceptions version 1 as published by
24 | * Thincast Technologies GmbH.
25 | *
26 | * For more information see the file LICENSE in the distribution of this file.
27 | */
28 |
29 | #ifndef _OGON_ICP_H_
30 | #define _OGON_ICP_H_
31 |
32 | #include
33 |
34 | int ogon_icp_start(HANDLE shutdown, UINT32 vmajor, UINT32 vminor);
35 | int ogon_icp_shutdown();
36 | void *ogon_icp_get_context();
37 | BOOL ogon_icp_get_protocol_version(void *context, UINT32 *vmajor, UINT32 *vminor);
38 |
39 | typedef void (*disconnected_callback)();
40 | void ogon_icp_set_disconnect_cb(disconnected_callback cb);
41 |
42 | #endif /* _OGON_ICP_H_ */
43 |
--------------------------------------------------------------------------------
/session-manager/common/permission/LogonPermission.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Logon permission class
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "LogonPermission.h"
29 |
30 | namespace ogon { namespace sessionmanager { namespace permission {
31 |
32 | LogonPermission::LogonPermission(const std::string &username, const std::string &domain,
33 | DWORD permission)
34 | {
35 | mUsername = username;
36 | mDomain = domain;
37 | mPermission = permission;
38 | }
39 |
40 | std::string LogonPermission::getUsername() const {
41 | return mUsername;
42 | }
43 |
44 | std::string LogonPermission::getDomain() const {
45 | return mDomain;
46 | }
47 |
48 | DWORD LogonPermission::getPermission() const {
49 | return mPermission;
50 | }
51 | } /*permission*/ } /*sessionmanager*/ } /*ogon*/
52 |
53 |
--------------------------------------------------------------------------------
/include/ogon/build-config.h.in:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Build Configuration (Core)
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * This file may be used under the terms of the GNU Affero General
8 | * Public License version 3 as published by the Free Software Foundation
9 | * and appearing in the file LICENSE-AGPL included in the distribution
10 | * of this file.
11 | *
12 | * Under the GNU Affero General Public License version 3 section 7 the
13 | * copyright holders grant the additional permissions set forth in the
14 | * ogon Core AGPL Exceptions version 1 as published by
15 | * Thincast Technologies GmbH.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Library AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_BUILD_CONFIG_H_
26 | #define _OGON_BUILD_CONFIG_H_
27 |
28 | /* Build related settings */
29 | #define OGON_BIN_PATH "${OGON_BIN_PATH}"
30 | #define OGON_SBIN_PATH "${OGON_SBIN_PATH}"
31 | #define OGON_CFG_PATH "${OGON_CFG_PATH}"
32 | #define OGON_VAR_PATH "${OGON_VAR_PATH}"
33 | #define OGON_PID_PATH "${OGON_PID_PATH}"
34 |
35 | #define OGON_LIB_PATH "${OGON_LIB_PATH}"
36 | #define OGON_APP_LIB_PATH "${OGON_APP_LIB_PATH}"
37 | #define OGON_MODULE_LIB_PATH "${OGON_MODULE_LIB_PATH}"
38 | #define OGON_AUTH_MODULE_LIB_PATH "${OGON_AUTH_MODULE_LIB_PATH}"
39 |
40 | #endif /* _OGON_BUILD_CONFIG_H_ */
41 |
42 |
--------------------------------------------------------------------------------
/session-manager/common/call/TaskEndRemoteControl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * call task for stopping remote control (shadowing)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_TASKENDREMOTECONTROL_H_
25 | #define _OGON_SMGR_CALL_TASKENDREMOTECONTROL_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | class TaskEndRemoteControl : public taskNS::Task, sessionNS::SessionAccessor {
34 |
35 | public:
36 | TaskEndRemoteControl(UINT32 connectionId);
37 | virtual void run();
38 | bool getResult();
39 |
40 | private:
41 | UINT32 mConnectionId;
42 | bool mResult;
43 |
44 | };
45 |
46 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
47 |
48 | namespace callNS = ogon::sessionmanager::call;
49 |
50 | #endif /* _OGON_SMGR_CALL_ENDREMOTECONTROL_H_ */
51 |
--------------------------------------------------------------------------------
/session-manager/common/module/CallBacks.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Callback Handlers for Modules
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "CallBacks.h"
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | namespace ogon { namespace sessionmanager { namespace module {
35 |
36 | void CallBacks::addMonitoringProcess(DWORD processId, UINT32 sessionId, bool terminateSession, RDS_MODULE_COMMON *context) {
37 | APP_CONTEXT.getProcessMonitor()->addProcess(processId, sessionId, terminateSession, context);
38 | }
39 | bool CallBacks::removeMonitoringProcess(DWORD processId) {
40 | return APP_CONTEXT.getProcessMonitor()->removeProcess(processId);
41 | }
42 |
43 |
44 | } /*module*/ } /*sessionmanager*/ } /*ogon*/
45 |
--------------------------------------------------------------------------------
/rdp-server/app_context.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * RDP Server
4 | * Application Context
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | * David Fort
11 | *
12 | * This file may be used under the terms of the GNU Affero General
13 | * Public License version 3 as published by the Free Software Foundation
14 | * and appearing in the file LICENSE-AGPL included in the distribution
15 | * of this file.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Core AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_RDPSRV_APPCONTEXT_H_
26 | #define _OGON_RDPSRV_APPCONTEXT_H_
27 |
28 | #include
29 |
30 | #include "commondefs.h"
31 |
32 | /** @brief the global ogon context */
33 | typedef struct _ogon_app_context {
34 | wListDictionary *connections;
35 | volatile LONG connectionId;
36 | } ogon_app_context;
37 |
38 | BOOL app_context_init();
39 | void app_context_uninit();
40 | long app_context_get_connectionid();
41 | BOOL app_context_add_connection(ogon_connection *connection);
42 | void app_context_remove_connection(long id);
43 | BOOL app_context_post_message_connection(long id, UINT32 type,void *wParam, void *lParam);
44 | BOOL app_context_stop_all_connections();
45 |
46 | #endif /* _OGON_RDPSRV_APPCONTEXT_H_ */
47 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOutPing.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call Ping (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLOUTPING_H_
25 | #define _OGON_SMGR_CALL_CALLOUTPING_H_
26 |
27 | #include
28 | #include "CallOut.h"
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | /**
34 | * @brief
35 | */
36 | class CallOutPing: public CallOut {
37 | public:
38 | CallOutPing();
39 | virtual ~CallOutPing();
40 |
41 | virtual unsigned long getCallType() const;
42 |
43 | virtual bool encodeRequest();
44 | virtual bool decodeResponse();
45 |
46 | bool getPong();
47 |
48 | private:
49 | bool mPong;
50 | };
51 |
52 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
53 |
54 | namespace callNS = ogon::sessionmanager::call;
55 |
56 | #endif /* _OGON_SMGR_CALL_CALLOUTPING_H_ */
57 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskShutdown.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for shutting down a session (internally used by session)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKSHUTDOWN_H_
25 | #define _OGON_SMGR_SESSION_TASKSHUTDOWN_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace session {
32 |
33 | class TaskShutdown: public taskNS::Task, sessionNS::SessionAccessor{
34 | public:
35 | TaskShutdown(sessionNS::SessionPtr session);
36 | virtual ~TaskShutdown(){};
37 | virtual void run();
38 | };
39 |
40 | typedef std::shared_ptr TaskShutdownPtr;
41 |
42 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
43 |
44 | namespace sessionNS = ogon::sessionmanager::session;
45 |
46 | #endif /* _OGON_SMGR_SESSION_TASKSHUTDOWN_H_ */
47 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskEnd.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task to end a session
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKENDSESSION_H_
25 | #define _OGON_SMGR_SESSION_TASKENDSESSION_H_
26 |
27 | #include
28 | #define SHUTDOWN_TIME_OUT (10*1000)
29 |
30 | namespace ogon { namespace sessionmanager { namespace session {
31 |
32 | class TaskEnd: public taskNS::InformableTask {
33 | public:
34 | TaskEnd();
35 | virtual void run();
36 | void setSessionId(UINT32 sessionId);
37 | bool getResults();
38 | virtual void abortTask();
39 |
40 | private:
41 | void stopSession();
42 | UINT32 mSessionId;
43 | bool mSuccess;
44 | };
45 |
46 | typedef std::shared_ptr TaskEndPtr;
47 |
48 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
49 |
50 | namespace sessionNS = ogon::sessionmanager::session;
51 |
52 | #endif /* _OGON_SMGR_SESSION_TASKENDSESSION_H_ */
53 |
--------------------------------------------------------------------------------
/rdp-server/icp/pbrpc/pbrpc_utils.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * pbRPC: Simple Protocol Buffers based RPC
4 | * Utility Functions
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | * Martin Haimberger
11 | *
12 | * This file may be used under the terms of the GNU Affero General
13 | * Public License version 3 as published by the Free Software Foundation
14 | * and appearing in the file LICENSE-AGPL included in the distribution
15 | * of this file.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Core AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_RDPSRV_ICP_PBRPCUTILS_H_
26 | #define _OGON_RDPSRV_ICP_PBRPCUTILS_H_
27 |
28 | #include "pbRPC.pb-c.h"
29 | #include "pbrpc.h"
30 |
31 | DWORD pbrpc_getTag(pbRPCContext *context);
32 | Ogon__Pbrpc__RPCBase *pbrpc_message_new();
33 | void pbrpc_message_free(Ogon__Pbrpc__RPCBase* msg, BOOL freePayload);
34 | void pbrpc_message_free_response(Ogon__Pbrpc__RPCBase* msg);
35 | void pbrpc_prepare_request(pbRPCContext* context, Ogon__Pbrpc__RPCBase* msg);
36 | void pbrpc_prepare_response(Ogon__Pbrpc__RPCBase* msg, UINT32 tag);
37 | void pbrpc_prepare_error(Ogon__Pbrpc__RPCBase* msg, UINT32 tag, char* error);
38 | pbRPCPayload* pbrpc_payload_new();
39 | void pbrpc_free_payload(pbRPCPayload* response);
40 |
41 | #endif /* _OGON_RDPSRV_ICP_PBRPCUTILS_H_ */
42 |
--------------------------------------------------------------------------------
/session-manager/common/session/SessionNotifier.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * SessionNotifier class
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 |
25 | #ifndef _OGON_SMGR_SESSION_SESSIONNOTIFIER_H_
26 | #define _OGON_SMGR_SESSION_SESSIONNOTIFIER_H_
27 |
28 | #include "Connection.h"
29 |
30 | #include
31 | #include
32 |
33 | #include
34 |
35 | namespace ogon { namespace sessionmanager { namespace session {
36 |
37 | class SessionNotifier {
38 | public:
39 | SessionNotifier();
40 | ~SessionNotifier();
41 |
42 | bool init();
43 | bool notify(DWORD reason, UINT32 sessionId);
44 | bool shutdown();
45 |
46 | private:
47 | const char *wtsNotificationToString(int signal);
48 | DBusConnection *mDBusConn;
49 | CRITICAL_SECTION mCSection;
50 | };
51 |
52 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
53 |
54 | namespace sessionNS = ogon::sessionmanager::session;
55 |
56 | #endif /* _OGON_SMGR_SESSION_SESSIONNOTIFIER_H_ */
57 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallFactory.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Factory for rpc calls
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLFACTORY_H_
25 | #define _OGON_SMGR_CALL_CALLFACTORY_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #include
32 |
33 | #define CALL_FACTORY ogon::sessionmanager::call::CallFactory::instance()
34 |
35 | namespace ogon { namespace sessionmanager { namespace call {
36 |
37 | /**
38 | * @class PacketFactory.
39 | *
40 | * @brief Factory for creating packetes.
41 | *
42 | * @author Martin Haimberger
43 | */
44 |
45 | class CallFactory :public FactoryBase, public SingletonBase {
46 | SINGLETON_ADD_INITIALISATION(CallFactory)
47 | };
48 |
49 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
50 |
51 | namespace callNS = ogon::sessionmanager::call;
52 |
53 | #endif /* _OGON_SMGR_CALL_CALLFACTORY_H_ */
54 |
--------------------------------------------------------------------------------
/rdp-server/bandwidth_mgmt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * RDP Server
4 | * Bandwidth Management
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_RDPSRV_BANDWIDTH_MGMT_H_
25 | #define _OGON_RDPSRV_BANDWIDTH_MGMT_H_
26 |
27 | #include
28 | #include "commondefs.h"
29 |
30 |
31 | void ogon_bwmgmt_init_buckets(ogon_connection *conn, UINT32 bitrate);
32 | UINT32 ogon_bwmgmt_update_bucket(ogon_connection *conn);
33 | BOOL ogon_bwmgmt_update_data_usage(ogon_connection *conn);
34 | UINT32 ogon_bwmgtm_calc_max_target_frame_size(ogon_connection *conn);
35 |
36 | BOOL ogon_bwmgmt_client_detect_rtt(ogon_connection *conn);
37 | BOOL ogon_bwmgmt_client_rtt_measure_response(rdpContext *context, UINT16 sequenceNumber);
38 |
39 | BOOL ogon_bwmgmt_detect_bandwidth_start(ogon_connection *conn);
40 | BOOL ogon_bwmgmt_detect_bandwidth_stop(ogon_connection *conn);
41 | BOOL ogon_bwmgmt_client_bandwidth_measure_results(rdpContext *context, UINT16 sequenceNumber);
42 |
43 | #endif /* _OGON_RDPSRV_BANDWIDTH_MGMT_H_ */
44 |
--------------------------------------------------------------------------------
/session-manager/common/utils/StringHelpers.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * helper templates for strings
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #include "StringHelpers.h"
25 |
26 | namespace std{
27 |
28 | bool stringEndsWith(const string &compString, const string &suffix)
29 | {
30 | return compString.rfind(suffix) == (compString.size()-suffix.size());
31 | }
32 |
33 | bool stringStartsWith(const string &string2comp, const string &startswith)
34 | {
35 | return string2comp.size() >= startswith.size()
36 | && equal(startswith.begin(), startswith.end(), string2comp.begin());
37 | }
38 |
39 | }
40 |
41 |
42 |
43 | namespace boost {
44 | template<> bool lexical_cast(const std::string &arg) {
45 | std::istringstream ss(arg);
46 | bool b;
47 | ss >> std::boolalpha >> b;
48 | return b;
49 | }
50 |
51 | template<> std::string lexical_cast(const bool &b) {
52 | std::ostringstream ss;
53 | ss << std::boolalpha << b;
54 | return ss.str();
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInPing.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for ping rpc call (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | * Martin Haimberger
11 | *
12 | * This file may be used under the terms of the GNU Affero General
13 | * Public License version 3 as published by the Free Software Foundation
14 | * and appearing in the file LICENSE-AGPL included in the distribution
15 | * of this file.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Core AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_SMGR_CALL_CALLINPING_H_
26 | #define _OGON_SMGR_CALL_CALLINPING_H_
27 |
28 | #include "CallFactory.h"
29 | #include
30 | #include "CallIn.h"
31 | #include
32 |
33 | namespace ogon { namespace sessionmanager { namespace call {
34 |
35 | /**
36 | * @brief
37 | */
38 | class CallInPing: public CallIn {
39 | public:
40 | CallInPing();
41 | virtual ~CallInPing();
42 |
43 | virtual unsigned long getCallType() const;
44 | virtual bool decodeRequest();
45 | virtual bool encodeResponse();
46 | virtual bool doStuff();
47 | };
48 |
49 | FACTORY_REGISTER_DWORD(CallFactory, CallInPing, ogon::icp::Ping);
50 |
51 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
52 |
53 | namespace callNS = ogon::sessionmanager::call;
54 |
55 | #endif /* _OGON_SMGR_CALL_CALLINPING_H_ */
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Welcome to the ogon (core) repository
2 |
3 | The ogon repository is part of the ogon project and contains the code of the
4 | RDP server and session manager as well as protocol descriptions and some command line
5 | (helper) utilities.
6 |
7 | ## What is the ogon project?
8 |
9 | The ogon project is an open source driven collection of services and tools mainly written in C/C++
10 | that provide graphical remote access to Linux desktop sessions using the Remote Desktop Protocol
11 | (RDP). It supports most modern RDP protocol extensions, bitmap compression codecs, dis- and
12 | reconnection to sessions and device redirections.
13 | ogon is compatible with virtually any existing RDP Client.
14 |
15 | Any X11 destkop, weston or qt application can be used as session. Due to it's modular
16 | design it's easily possible to extend or add features or add new backends.
17 |
18 | # tl;dr - too long; didn't read - I just want ...
19 |
20 | * .. to report [a BUG][bugs]
21 | * .. to build it - have a look at our [documentation][documentation]
22 | * .. help - have a look to our [SUPPORT.md document][support]
23 | * .. to get in touch - have a look to our [SUPPORT.md document][support]
24 | * .. to contribute - have a look to [CONTRIBUTING.md][contribute]
25 |
26 | # License
27 |
28 | Most components of the ogon-project are licensed under the GNU AFFERO GENERAL PUBLIC LICENSE version 3.
29 | See LICENSE file of the respective repository.
30 |
31 | [support]: https://github.com/ogon-project/ogon-project/blob/master/SUPPORT.md
32 | [bugs]: https://github.com/ogon-project/ogon-project/blob/master/SUPPORT.md#bugs
33 | [documentation]: https://github.com/ogon-project/ogon-project/blob/master/SUPPORT.md#documentation
34 | [contribute]: https://github.com/ogon-project/ogon-project/blob/master/CONTRIBUTING.md
35 |
--------------------------------------------------------------------------------
/doc/SBProtocol.md:
--------------------------------------------------------------------------------
1 | ogon Session Manager to backend protocol
2 | =============
3 |
4 | # Introduction
5 |
6 | This document describes the protocol that is used between the ogon Session Manager and a backend.
7 | The SBP uses the ICP connection for transport and uses the same wire format. The MSGTYPE has to be 200 or greater to
8 | be treated as SBP Message from the ogon RDP Server and to be forwarded to the backend.
9 |
10 | # Protocol
11 |
12 | For the packing and the wire format please have a look at the ICP protocol definition.
13 | The messages can go both directions, but at the moment only calls from the backend to the ogon Session Manager are implemented
14 | so far.
15 |
16 | ## ogon backend to ogon Session Manager messages
17 |
18 | ### AuthenticateUser
19 |
20 | This message is sent if a backend needs to authenticate a user. This is obviously used for greeters, so the entered
21 | authentication informatio can be transmitted to the ogon Session Manager.
22 |
23 | The message contains:
24 |
25 | * sessionId - the sessionId to identify the session.
26 | * username - the username
27 | * password - the password
28 | * domain - the domain
29 |
30 | The response:
31 |
32 | * authStatus - result of the authentication:
33 | - AUTH_SUCCESSFUL: Authentication was succesful.
34 | - AUTH_BAD_CREDENTIAL: bad credentials.
35 | - AUTH_WRONG_SESSION_STATE: session was in wrong state.
36 | - AUTH_UNKOWN_ERROR : unknown error.
37 |
38 |
39 | ### EndSession
40 |
41 | This message is sent if a backend wants to terminate. This is only used in the greeter so far, if cancel gets pressed.
42 |
43 | The message contains:
44 |
45 | * sessionId - the sessionId to identify the session.
46 |
47 | The response:
48 |
49 | * success - ture if successfully otherwise false.
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/session-manager/common/otsapi/TaskLogoff.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * otsapi task for logging off a user
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_OTSAPI_TASKLOGOFF_H_
25 | #define _OGON_SMGR_OTSAPI_TASKLOGOFF_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace otsapi {
32 |
33 | class TaskLogoff: public taskNS::InformableTask {
34 | public:
35 | TaskLogoff(UINT32 sessionId, BOOL wait, DWORD timeout);
36 | virtual ~TaskLogoff(){};
37 | virtual void run();
38 | BOOL getResults();
39 | virtual void abortTask();
40 |
41 |
42 | private:
43 | BOOL logoff();
44 | UINT32 mSessionId;
45 | BOOL mWait;
46 | DWORD mTimeout;
47 | bool mLoggedoff;
48 | };
49 |
50 | typedef std::shared_ptr TaskLogoffPtr;
51 |
52 | } /*otsapi*/ } /*sessionmanager*/ } /*ogon*/
53 |
54 | namespace otsapiNS = ogon::sessionmanager::otsapi;
55 |
56 | #endif /* _OGON_SMGR_OTSAPI_TASKLOGOFF_H_ */
57 |
--------------------------------------------------------------------------------
/rdp-server/icp/pbrpc/pbrpc_transport.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * pbRPC: Simple Protocol Buffers based RPC
4 | * Transport Protocol Abstraction
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_RDPSRV_ICP_PBRPCTRANSPORT_H_
25 | #define _OGON_RDPSRV_ICP_PBRPCTRANSPORT_H_
26 |
27 | #include
28 |
29 | typedef struct pbrpc_transport_context pbRPCTransportContext;
30 |
31 | typedef int (*pTransport_open)(pbRPCTransportContext* context, int timeout);
32 | typedef int (*pTransport_close)(pbRPCTransportContext* context);
33 | typedef int (*pTransport_write)(pbRPCTransportContext* context, char* data, unsigned int datalen);
34 | typedef int (*pTransport_read)(pbRPCTransportContext* context, char* data, unsigned int datalen);
35 | typedef HANDLE (*pTransport_get_fds)(pbRPCTransportContext* context);
36 |
37 | struct pbrpc_transport_context
38 | {
39 | pTransport_open open;
40 | pTransport_close close;
41 | pTransport_read read;
42 | pTransport_write write;
43 | pTransport_get_fds get_fds;
44 | };
45 |
46 | #endif /* _OGON_RDPSRV_ICP_PBRPCTRANSPORT_H_ */
47 |
--------------------------------------------------------------------------------
/session-manager/common/config/PropertyCWrapper.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Wrapper to access Property Manager from C
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_PROPERTYCWRAPPER_H_
25 | #define _OGON_SMGR_PROPERTYCWRAPPER_H_
26 |
27 | #include
28 | #include "PropertyLevel.h"
29 |
30 | #ifdef __cplusplus
31 | extern "C" {
32 | #endif
33 | #include
34 |
35 | bool getPropertyBool(UINT32 sessionID, const char *path, bool *value);
36 | bool getPropertyNumber(UINT32 sessionID, const char *path, long *value);
37 | bool getPropertyString(UINT32 sessionID, const char *path, char *value, unsigned int valueLength);
38 |
39 | bool setPropertyBool(PROPERTY_LEVEL level, UINT32 sessionID, const char *path, bool value);
40 | bool setPropertyNumber(PROPERTY_LEVEL level, UINT32 sessionID, const char *path, long value);
41 | bool setPropertyString(PROPERTY_LEVEL level, UINT32 sessionID, const char *path, char *value);
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 |
47 | #endif /* _OGON_SMGR_PROPERTYCWRAPPER_H_ */
48 |
--------------------------------------------------------------------------------
/misc/ogonXsession:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | CONF_FILE="${HOME}/.config/ogon/desktop"
4 | XSESSION_DIR="/usr/share/xsessions"
5 | ENV_FILE="/etc/environment"
6 | LOCALE_FILE="/etc/default/locale"
7 | DESKTOP_SESSION=""
8 | SESSION_COMMAND=""
9 |
10 | # Make sure to set the very basic environment
11 | if [ -r "${ENV_FILE}" ]; then
12 | . "${ENV_FILE}"
13 | fi
14 | if [ -r "${LOCALE_FILE}" ]; then
15 | . "${LOCALE_FILE}"
16 | fi
17 | [ -z "$LANG" ] || export LANG
18 | [ -z "$LC_ALL" ] || export LC_ALL
19 |
20 | if [ -z "${OGON_X11_NODBUS}" ] && [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
21 | eval $(dbus-launch --sh-syntax --exit-with-session)
22 | fi
23 |
24 | if [ ! -z "${OGON_X11_DESKTOP}" ]; then
25 | DESKTOP_SESSION="${OGON_X11_DESKTOP}"
26 | elif [ -r ${CONF_FILE} ]; then
27 | DESKTOP_SESSION="$(cat ${CONF_FILE} | tr -d '\n')"
28 | fi
29 |
30 | if [ ! -z ${DESKTOP_SESSION} ] && [ -r "${XSESSION_DIR}/${DESKTOP_SESSION}.desktop" ]; then
31 | SESSION_COMMAND="$(grep -e '^Exec=' "${XSESSION_DIR}/${DESKTOP_SESSION}.desktop" | tr -d '\n' | cut -d "=" -f 2-)"
32 | fi
33 |
34 | # Option passed to Xsession needs to have 1 argument only
35 | export DESKTOP_SESSION="${DESKTOP_SESSION}"
36 | export GDMSESSION="${DESKTOP_SESSION}"
37 | export XDG_SESSION_DESKTOP="${DESKTOP_SESSION}"
38 |
39 | # SESSION_COMMAND should be one argument - will be parsed later
40 | if [ -r /etc/X11/Xsession ]; then
41 | . /etc/X11/Xsession "${SESSION_COMMAND}"
42 | elif [ -r /etc/X11/xdm/Xsession ]; then
43 | . /etc/X11/xdm/Xsession "${SESSION_COMMAND}"
44 | elif [ -r /etc/gdm/Xsession ]; then
45 | /etc/gdm/Xsession "${SESSION_COMMAND}"
46 | elif [ -r /etc/X11/xinit/Xsession ]; then
47 | . /etc/X11/xinit/Xsession "${SESSION_COMMAND}"
48 | elif [ -r /etc/X11/xinit/xinitrc ]; then
49 | . /etc/X11/xinit/xinitrc "${SESSION_COMMAND}"
50 | fi
51 |
--------------------------------------------------------------------------------
/session-manager/common/permission/LogonPermission.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Logon permission class
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_LOGONPERMISSION_H_
25 | #define _OGON_SMGR_LOGONPERMISSION_H_
26 |
27 | #include
28 |
29 | #include
30 |
31 | #include
32 |
33 | namespace ogon { namespace sessionmanager { namespace permission {
34 |
35 | /**
36 | * @brief
37 | */
38 | class LogonPermission {
39 | public:
40 | LogonPermission(const std::string &username, const std::string &domain, DWORD permission);
41 |
42 | std::string getUsername() const;
43 | std::string getDomain() const;
44 | DWORD getPermission() const;
45 |
46 | private:
47 | std::string mUsername;
48 | std::string mDomain;
49 | DWORD mPermission;
50 | };
51 |
52 | typedef std::shared_ptr LogonPermissionPtr;
53 |
54 | } /*permission*/ } /*sessionmanager*/ } /*ogon*/
55 |
56 | namespace permissionNS = ogon::sessionmanager::permission;
57 |
58 | #endif /* _OGON_SMGR_LOGONPERMISSION_H_ */
59 |
--------------------------------------------------------------------------------
/rdp-server/icp/icp_server_stubs.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Internal Communication Protocol (ICP)
4 | * Server Stubs
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | * Martin Haimberger
11 | *
12 | * This file may be used under the terms of the GNU Affero General
13 | * Public License version 3 as published by the Free Software Foundation
14 | * and appearing in the file LICENSE-AGPL included in the distribution
15 | * of this file.
16 | *
17 | * Under the GNU Affero General Public License version 3 section 7 the
18 | * copyright holders grant the additional permissions set forth in the
19 | * ogon Core AGPL Exceptions version 1 as published by
20 | * Thincast Technologies GmbH.
21 | *
22 | * For more information see the file LICENSE in the distribution of this file.
23 | */
24 |
25 | #ifndef _OGON_RDPSRV_ICPSERVERSTUBS_H_
26 | #define _OGON_RDPSRV_ICPSERVERSTUBS_H_
27 |
28 | #include "pbrpc.h"
29 |
30 | int ping(LONG tag, pbRPCPayload *request, pbRPCPayload **response);
31 | int switchTo(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload** pbresponse);
32 | int logoffUserSession(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload** pbresponse);
33 | int otsapiVirtualChannelOpen(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload** pbresponse);
34 | int otsapiVirtualChannelClose(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload** pbresponse);
35 | int otsapiStartRemoteControl(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload **pbresponse);
36 | int otsapiStopRemoteControl(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload **pbresponse);
37 | int message(LONG tag, pbRPCPayload* pbrequest, pbRPCPayload** pbresponse);
38 |
39 | #endif /* _OGON_RDPSRV_ICPSERVERSTUBS_H_ */
40 |
--------------------------------------------------------------------------------
/session-manager/common/task/ThreadTask.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task Object for an Executor
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_THREADTASK_H_
25 | #define _OGON_SMGR_THREADTASK_H_
26 |
27 | #include
28 |
29 | namespace ogon { namespace sessionmanager { namespace task {
30 |
31 | class ThreadTask: public Task {
32 | public:
33 | ThreadTask():mhStarted(0), mhStop(0){}
34 | virtual ~ThreadTask() {}
35 | virtual void run() = 0;
36 |
37 | void setHandles(HANDLE stopHandle,HANDLE startedHandle) {
38 | mhStop = stopHandle;
39 | mhStarted = startedHandle;
40 | }
41 |
42 | virtual void preProcess(){
43 | informStarted();
44 | };
45 |
46 | void informStarted() {
47 | SetEvent(mhStarted);
48 | }
49 |
50 | private:
51 | HANDLE mhStarted;
52 | protected:
53 | HANDLE mhStop;
54 | };
55 |
56 | typedef std::shared_ptr ThreadTaskPtr;
57 |
58 | } /*task*/ } /*sessionmanager*/ } /*ogon*/
59 |
60 | namespace taskNS = ogon::sessionmanager::task;
61 |
62 | #endif /* _OGON_SMGR_THREADTASK_H_ */
63 |
--------------------------------------------------------------------------------
/session-manager/common/otsapi/TaskStopRemoteControl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * otsapi task for stopping remote control (shadowing)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_OTSAPI_TASKSTOPREMOTECONTROL_H_
25 | #define _OGON_SMGR_OTSAPI_TASKSTOPREMOTECONTROL_H_
26 |
27 | #include
28 | #include
29 |
30 | namespace ogon { namespace sessionmanager { namespace otsapi {
31 |
32 | class TaskStopRemoteControl: public taskNS::InformableTask, sessionNS::SessionAccessor {
33 | public:
34 | TaskStopRemoteControl(UINT32 sessionId, UINT32 timeout);
35 | virtual ~TaskStopRemoteControl(){};
36 | virtual void run();
37 | BOOL getResults();
38 | virtual void abortTask();
39 |
40 | private:
41 | UINT32 mSessionId;
42 | BOOL mResult;
43 | UINT32 mTimeOut;
44 | };
45 |
46 | typedef std::shared_ptr TaskStopRemoteControlPtr;
47 |
48 | } /*otsapi*/ } /*sessionmanager*/ } /*ogon*/
49 |
50 | namespace otsapiNS = ogon::sessionmanager::otsapi;
51 |
52 | #endif /* _OGON_SMGR_OTSAPI_TASKSTOPREMOTECONTROL_H_ */
53 |
--------------------------------------------------------------------------------
/common/security.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Common Security Functions
4 | *
5 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
6 | *
7 | * Authors:
8 | * David Fort
9 | *
10 | * This file may be used under the terms of the GNU Affero General
11 | * Public License version 3 as published by the Free Software Foundation
12 | * and appearing in the file LICENSE-AGPL included in the distribution
13 | * of this file.
14 | *
15 | * Under the GNU Affero General Public License version 3 section 7 the
16 | * copyright holders grant the additional permissions set forth in the
17 | * ogon Core AGPL Exceptions version 1 as published by
18 | * Thincast Technologies GmbH.
19 | *
20 | * Under the GNU Affero General Public License version 3 section 7 the
21 | * copyright holders grant the additional permissions set forth in the
22 | * ogon Library AGPL Exceptions version 1 as published by
23 | * Thincast Technologies GmbH.
24 | *
25 | * For more information see the file LICENSE in the distribution of this file.
26 | */
27 |
28 | #ifndef _OGON_SECURITY_H_
29 | #define _OGON_SECURITY_H_
30 |
31 | #include
32 | #include
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | /**
39 | * Tries to get peer's identity using the socket and SO_PEERCRED like functions.
40 | *
41 | * @param fd a file descriptor of a connected socket
42 | * @param uid the uid to fill
43 | * @param haveUid if we have been able to fill the uid
44 | * @param pid the pid to fill
45 | * @param havePid if we have been able to fill the pid
46 | * @return if the function was successful
47 | */
48 | BOOL ogon_socket_credentials(int fd, uid_t *uid, BOOL *haveUid, pid_t *pid, BOOL *havePid);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 |
54 | #endif /* _OGON_SECURITY_H_ */
55 |
--------------------------------------------------------------------------------
/session-manager/common/permission/permission.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * WTS Permission Flags
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_PERMISSION_H_
25 | #define _OGON_SMGR_PERMISSION_H_
26 |
27 | #define WTS_PERM_FLAGS_QUERY_INFORMATION 0x0001
28 | #define WTS_PERM_FLAGS_SET_INFORMATION 0x0002
29 | #define WTS_PERM_FLAGS_REMOTE_CONTROL 0x0004
30 | #define WTS_PERM_FLAGS_LOGON 0x0008
31 | #define WTS_PERM_FLAGS_LOGOFF 0x0010
32 | #define WTS_PERM_FLAGS_MESSAGE 0x0020
33 | #define WTS_PERM_FLAGS_CONNECT 0x0040
34 | #define WTS_PERM_FLAGS_DISCONNECT 0x0080
35 | #define WTS_PERM_FLAGS_VIRTUAL_CHANNEL 0x0100
36 |
37 | #define WTS_PERM_FLAGS_FULL 0x01FF /* all permissions */
38 | #define WTS_PERM_FLAGS_USER 0x0049 /* WTS_PERM_FLAGS_CONNECT | WTS_PERM_FLAGS_QUERY_INFORMATION | WTS_PERM_FLAGS_LOGON */
39 | #define WTS_PERM_FLAGS_GUEST 0x0008 /* WTS_PERM_FLAGS_LOGON */
40 |
41 | #endif /* _OGON_SMGR_PERMISSION_H_ */
42 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskSwitchTo.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for switching to another session
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKSWITCHTO_H_
25 | #define _OGON_SMGR_SESSION_TASKSWITCHTO_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace session {
32 |
33 | class TaskSwitchTo: public taskNS::InformableTask, sessionNS::SessionAccessor{
34 | public:
35 | TaskSwitchTo(UINT32 connectionId, UINT32 sessionId);
36 | virtual ~TaskSwitchTo(){};
37 | virtual void run();
38 | UINT32 getResults(bool &disconnected);
39 | virtual void abortTask();
40 |
41 | private:
42 | UINT32 mConnectionId;
43 | UINT32 mSessionId;
44 | bool mSuccess;
45 | UINT32 mResult;
46 | };
47 |
48 | typedef std::shared_ptr TaskSwitchToPtr;
49 |
50 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
51 |
52 | namespace sessionNS = ogon::sessionmanager::session;
53 |
54 | #endif /* _OGON_SMGR_SESSION_TASKSWITCHTO_H_ */
55 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOut.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Baseclass for outgoing rpc calls (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLOUT_H_
25 | #define _OGON_SMGR_CALL_CALLOUT_H_
26 |
27 | #include
28 | #include
29 |
30 | namespace ogon { namespace sessionmanager { namespace call {
31 |
32 | class CallOut : public Call {
33 | public:
34 | CallOut();
35 | ~CallOut();
36 |
37 | virtual bool encodeRequest() = 0;
38 | std::string getEncodedRequest() const;
39 |
40 | void setEncodedeResponse(const std::string &encodedResponse);
41 | virtual bool decodeResponse() = 0;
42 |
43 | void initAnswerHandle();
44 | HANDLE getAnswerHandle();
45 |
46 | void setResult(uint32_t result);
47 | void setErrorDescription(const std::string &error);
48 |
49 | private :
50 | HANDLE mAnswer;
51 | };
52 |
53 | typedef std::shared_ptr CallOutPtr;
54 |
55 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
56 |
57 | namespace callNS = ogon::sessionmanager::call;
58 |
59 |
60 | #endif /* _OGON_SMGR_CALL_CALLOUT_H_ */
61 |
--------------------------------------------------------------------------------
/session-manager/common/otsapi/TaskDisconnect.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * otsapi task for disconnecting a user
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_OTSAPI_TASKDISCONNECT_H_
25 | #define _OGON_SMGR_OTSAPI_TASKDISCONNECT_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace otsapi {
32 |
33 | class TaskDisconnect: public taskNS::InformableTask, sessionNS::SessionAccessor{
34 | public:
35 | TaskDisconnect(UINT32 sessionId, BOOL wait, DWORD timeout);
36 | virtual ~TaskDisconnect(){};
37 | virtual void run();
38 | BOOL getResults();
39 | virtual void abortTask();
40 |
41 | private:
42 | BOOL disconnectSession();
43 | UINT32 mSessionId;
44 | BOOL mWait;
45 | DWORD mTimeout;
46 | bool mDisconnected;
47 | };
48 |
49 | typedef std::shared_ptr TaskDisconnectPtr;
50 |
51 | } /*otsapi*/ } /*sessionmanager*/ } /*ogon*/
52 |
53 | namespace otsapiNS = ogon::sessionmanager::otsapi;
54 |
55 | #endif /* _OGON_SMGR_OTSAPI_TASKDISCONNECT_H_ */
56 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInEndSession.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call CallInEndSession (service to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINENDSESSION_H_
25 | #define _OGON_SMGR_CALL_CALLINENDSESSION_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 |
32 | namespace ogon { namespace sessionmanager { namespace call {
33 |
34 | /**
35 | * @brief
36 | */
37 | class CallInEndSession: public CallIn {
38 | public:
39 | CallInEndSession();
40 | virtual ~CallInEndSession();
41 |
42 | virtual unsigned long getCallType() const;
43 | virtual bool decodeRequest();
44 | virtual bool encodeResponse();
45 | virtual bool prepare();
46 | virtual bool doStuff();
47 |
48 | private:
49 | UINT32 mSessionId;
50 | bool mSuccess;
51 | };
52 |
53 | FACTORY_REGISTER_DWORD(CallFactory, CallInEndSession, ogon::sbp::EndSession);
54 |
55 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
56 |
57 | namespace callNS = ogon::sessionmanager::call;
58 |
59 | #endif /* _OGON_SMGR_CALL_CALLINENDSESSION_H_ */
60 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskShutdown.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task for shutting down a session (internally used by session)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "TaskShutdown.h"
29 | #include
30 | #include
31 |
32 |
33 | namespace ogon { namespace sessionmanager { namespace session {
34 |
35 | TaskShutdown::TaskShutdown(sessionNS::SessionPtr session) {
36 | setAccessorSession(session);
37 | }
38 |
39 | void TaskShutdown::run() {
40 | destroyAuthBackend();
41 | switch (getAccessorSession()->getConnectState()) {
42 | case WTSActive:
43 | setConnectState(WTSDisconnected);
44 | /* no break */
45 | case WTSConnected:
46 | setConnectState(WTSDown);
47 | break;
48 | case WTSDisconnected:
49 | setConnectState(WTSDown);
50 | break;
51 | default:
52 | break;
53 | }
54 | stopModule();
55 |
56 | unregisterSession();
57 | removeAuthToken();
58 | getAccessorSession()->stopExecutorThread(false);
59 | }
60 |
61 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
62 |
--------------------------------------------------------------------------------
/doc/exampleConfig.ini:
--------------------------------------------------------------------------------
1 | [global]
2 | environment_add_string=WTSAPI_LIBRARY:/opt/ogon/lib/x86_64-linux-gnu/libogon-otsapi.so
3 | auth_greeter_string=greeter
4 | auth_module_string=PAM
5 | module_string=xsession
6 | module_xsession_fontPath_string=/usr/X11R6/lib/X11/fonts/misc,/usr/X11R6/lib/X11/fonts/75dpi,/usr/X11R6/lib/X11/fonts/100dpi,/usr/X11R6/lib/X11/fonts/URW,/usr/X11R6/lib/X11/fonts/encodings,/usr/X11R6/lib/X11/fonts/local,/usr/X11R6/lib/X11/fonts/util,/usr/X11R6/lib/X11/fonts/cyrillic/,/usr/X11R6/lib/X11/fonts/java,/usr/X11R6/lib/X11/fonts/Speedo,/usr/X11R6/lib/X11/fonts/Type1,/usr/X11R6/lib/X11/fonts/truetype
7 |
8 | module_greeter_modulename_string=Qt
9 | module_greeter_cmd_string=/opt/ogon/bin/ogon-qt-greeter --noeffects
10 | module_greeter_colordepth_number=24
11 |
12 | module_xsession_modulename_string=X11
13 | module_xsession_colordepth_number=24
14 | module_xsession_displayOffset_number=100
15 | module_xsession_uselauncher_bool=true
16 | module_xsession_launcherexecutable_string=/opt/ogon/sbin/ogon-backend-launcher
17 |
18 | module_weston_modulename_string=Weston
19 | module_weston_cmd_string=/opt/ogon/bin/weston
20 | module_weston_uselauncher_bool=true
21 | session_singleSession_bool=true
22 |
23 | session_reconnect_bool=false
24 | session_timeout_number=60
25 | session_maxXRes_number=1920
26 | session_maxYRes_number=1200
27 | session_xres_number=1024
28 | session_yres_number=768
29 |
30 | #module_xsession_startvc_string=/opt/ogon/etc/ogon/ogonXsession
31 | #environment_add_string=ALSA_CONFIG_PATH:/opt/ogon/etc/ogon/pulse/alsa.conf
32 |
33 | [user_demo1]
34 | session_timeout_number=0
35 |
36 | [user_demo2]
37 | module_string=xsession
38 | session_reconnect_bool=true
39 | session_reconnect_fromSameClient_bool=true
40 |
41 | [user_demo3]
42 | module_string=weston
43 | session_reconnect_bool=true
44 | session_reconnect_fromSameClient_bool=true
45 |
46 | [user_root]
47 | permission_level_string=FULL
48 |
49 |
--------------------------------------------------------------------------------
/session-manager/common/call/Call.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Baseclass of an rpc call
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALL_H_
25 | #define _OGON_SMGR_CALL_CALL_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | class Call: public std::enable_shared_from_this {
34 | public:
35 | Call();
36 | virtual ~Call();
37 |
38 | virtual unsigned long getCallType() const = 0;
39 |
40 | void setTag(uint32_t tag);
41 | uint32_t getTag();
42 |
43 | uint32_t getResult();
44 | std::string getErrorDescription();
45 |
46 | void abort() {
47 | mResult = -2;
48 | }
49 |
50 | private:
51 | uint32_t mTag;
52 | protected:
53 | std::string mEncodedRequest;
54 | std::string mEncodedResponse;
55 |
56 | uint32_t mResult;
57 | // this is used if result ist not 0
58 | std::string mErrorDescription;
59 | };
60 |
61 | typedef std::shared_ptr CallPtr;
62 |
63 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
64 |
65 | namespace callNS = ogon::sessionmanager::call;
66 |
67 | #endif /* _OGON_SMGR_CALL_CALL_H_ */
68 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOutLogOffUserSession.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call LogOffUserSession (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLOUTLOGOFFUSERSESSION_H_
25 | #define _OGON_SMGR_CALL_CALLOUTLOGOFFUSERSESSION_H_
26 |
27 | #include
28 | #include "CallOut.h"
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | /**
34 | * @brief
35 | */
36 | class CallOutLogOffUserSession: public CallOut {
37 | public:
38 | CallOutLogOffUserSession();
39 | virtual ~CallOutLogOffUserSession();
40 |
41 | virtual unsigned long getCallType() const;
42 | virtual bool encodeRequest();
43 | virtual bool decodeResponse();
44 |
45 | void setConnectionId(UINT32 connectionId);
46 | bool isLoggedOff();
47 |
48 | private:
49 | UINT32 mConnectionId;
50 | bool mLoggedOff;
51 | };
52 |
53 | typedef std::shared_ptr CallOutLogOffUserSessionPtr;
54 |
55 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
56 |
57 | namespace callNS = ogon::sessionmanager::call;
58 |
59 | #endif /* _OGON_SMGR_CALL_CALLOUTLOGOFFUSERSESSION_H_ */
60 |
--------------------------------------------------------------------------------
/session-manager/module/common/module_helper.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Module Helper
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_MODULEHELPER_H_
25 | #define _OGON_SMGR_MODULEHELPER_H_
26 |
27 | #include
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | void initResolutions(RDS_MODULE_CONFIG_CALLBACKS* config, UINT32 sessionId , long* xres, long* yres, long* colordepth);
34 |
35 | bool getPropertyBoolWrapper(const char* basePath, RDS_MODULE_CONFIG_CALLBACKS* config, UINT32 sessionID, const char* path, bool* value);
36 | bool getPropertyNumberWrapper(const char* basePath, RDS_MODULE_CONFIG_CALLBACKS* config, UINT32 sessionID, const char* path, long* value);
37 | bool getPropertyStringWrapper(const char* basePath, RDS_MODULE_CONFIG_CALLBACKS* config, UINT32 sessionID, const char* path, char* value, unsigned int valueLength);
38 | bool TerminateChildProcessAfterTimeout(DWORD dwProcessId, DWORD dwMilliseconds, int* pExitCode, UINT32 sessionID = 0);
39 | bool TerminateChildProcess(DWORD dwProcessId, DWORD dwTimeout, int* pExitCode, UINT32 sessionID);
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 |
45 | #endif /* _OGON_SMGR_MODULEHELPER_H_ */
46 |
--------------------------------------------------------------------------------
/session-manager/common/session/TaskDisconnect.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task to disconnect a session.
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_SESSION_TASKDISCONNECT_H_
25 | #define _OGON_SMGR_SESSION_TASKDISCONNECT_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace session {
32 |
33 | class TaskDisconnect: public taskNS::InformableTask, sessionNS::SessionAccessor {
34 | public:
35 | TaskDisconnect(UINT32 connectionId, UINT32 sessionId = 0);
36 | virtual ~TaskDisconnect(){};
37 | virtual void run();
38 | UINT32 getResults(bool &disconnected);
39 | virtual void abortTask();
40 |
41 |
42 | private:
43 | UINT32 disconnect_Connection();
44 | UINT32 disconnect_Session();
45 | UINT32 mConnectionId;
46 | UINT32 mSessionId;
47 | bool mDisconnected;
48 | UINT32 mResult;
49 | };
50 |
51 | typedef std::shared_ptr TaskDisconnectPtr;
52 |
53 | } /*session*/ } /*sessionmanager*/ } /*ogon*/
54 |
55 | namespace sessionNS = ogon::sessionmanager::session;
56 |
57 | #endif /* _OGON_SMGR_SESSION_TASKDISCONNECT_H_ */
58 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallIn.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Baseclass for incoming rpc calls (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLIN_H_
25 | #define _OGON_SMGR_CALL_CALLIN_H_
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | /**
34 | * @brief
35 | */
36 | class CallIn: public Call {
37 | public:
38 | CallIn();
39 | virtual ~CallIn();
40 |
41 | void setEncodedRequest(const std::string &encodedRequest);
42 | virtual bool decodeRequest() = 0;
43 |
44 | virtual bool encodeResponse() = 0;
45 | std::string getEncodedResponse() const;
46 | std::shared_ptr shared_from_this();
47 |
48 | virtual bool prepare() {return true;};
49 | virtual bool doStuff() = 0;
50 | protected:
51 | bool putInSessionExecutor_conId(UINT32 connectionId);
52 | bool putInSessionExecutor_sesId(UINT32 sessionId);
53 | };
54 |
55 | typedef std::shared_ptr CallInPtr;
56 |
57 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
58 |
59 | namespace callNS = ogon::sessionmanager::call;
60 |
61 | #endif // _OGON_SMGR_CALL_CALLIN_H_
62 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInRemoteControlEnded.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Call sent from ogon when shadowing was stopped for a connection
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINREMOTECONTROLENDED_H_
25 | #define _OGON_SMGR_CALL_CALLINREMOTECONTROLENDED_H_
26 |
27 | #include "CallFactory.h"
28 | #include "CallIn.h"
29 | #include
30 |
31 | namespace ogon {
32 | namespace sessionmanager {
33 | namespace call {
34 |
35 | /**
36 | * @brief
37 | */
38 | class CallInRemoteControlEnded: public CallIn {
39 | public:
40 | CallInRemoteControlEnded();
41 | virtual ~CallInRemoteControlEnded();
42 |
43 | virtual unsigned long getCallType() const;
44 | virtual bool decodeRequest();
45 | virtual bool prepare();
46 | virtual bool doStuff();
47 | virtual bool encodeResponse();
48 | private:
49 | UINT32 mConnectionId;
50 | UINT32 mConnectionIdTarget;
51 | bool mSuccess;
52 | };
53 |
54 | FACTORY_REGISTER_DWORD(CallFactory, CallInRemoteControlEnded, ogon::icp::RemoteControlEnded);
55 |
56 | } /*call*/
57 | } /*sessionmanager*/
58 | } /*ogon*/
59 |
60 | namespace callNS = ogon::sessionmanager::call;
61 |
62 | #endif /* _OGON_SMGR_CALL_CALLINREMOTECONTROLENDED_H_ */
63 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOutDisconnectUserSession.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call DisconnectUserSession (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLOUTDISCONNECTUSERSESSION_H_
25 | #define _OGON_SMGR_CALL_CALLOUTDISCONNECTUSERSESSION_H_
26 |
27 | #include
28 | #include "CallOut.h"
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | /**
34 | * @brief
35 | */
36 | class CallOutDisconnectUserSession: public CallOut {
37 | public:
38 | CallOutDisconnectUserSession();
39 | virtual ~CallOutDisconnectUserSession();
40 |
41 | virtual unsigned long getCallType() const;
42 | virtual bool encodeRequest();
43 | virtual bool decodeResponse();
44 |
45 | void setConnectionId(UINT32 connectionId);
46 | bool isDisconnected();
47 |
48 | private:
49 | UINT32 mConnectionId;
50 | bool mDisconnected;
51 | };
52 |
53 | typedef std::shared_ptr CallOutDisconnectUserSessionPtr;
54 |
55 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
56 |
57 | namespace callNS = ogon::sessionmanager::call;
58 |
59 | #endif /* _OGON_SMGR_CALL_CALLOUTDISCONNECTUSERSESSION_H_ */
60 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOutOtsApiStopRemoteControl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call StopRemoteControl (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLOUTOTSAPISTOPREMOTECONTROL_H_
25 | #define _OGON_SMGR_CALL_CALLOUTOTSAPISTOPREMOTECONTROL_H_
26 |
27 | #include
28 | #include "CallOut.h"
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | /**
34 | * @brief
35 | */
36 | class CallOutOtsApiStopRemoteControl: public CallOut {
37 | public:
38 | CallOutOtsApiStopRemoteControl();
39 | virtual ~CallOutOtsApiStopRemoteControl();
40 |
41 | virtual unsigned long getCallType() const;
42 |
43 | virtual bool encodeRequest();
44 | virtual bool decodeResponse();
45 |
46 | void setConnectionId(UINT32 connectionId);
47 | bool isSuccess();
48 |
49 | private:
50 | UINT32 mConnectionId;
51 | bool mSuccess;
52 | };
53 |
54 | typedef std::shared_ptr CallOutOtsApiStopRemoteControlPtr;
55 |
56 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
57 |
58 | namespace callNS = ogon::sessionmanager::call;
59 |
60 | #endif /* _OGON_SMGR_CALL_CALLOUTOTSAPISTOPREMOTECONTROL_H_ */
61 |
--------------------------------------------------------------------------------
/session-manager/common/task/InformableTask.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Task Object for an Executor
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_INFORMABLETASK_H_
25 | #define _OGON_SMGR_INFORMABLETASK_H_
26 |
27 | #include
28 | #include
29 |
30 | namespace ogon { namespace sessionmanager { namespace task {
31 |
32 | /**
33 | * @brief
34 | */
35 | class InformableTask: public Task {
36 | public:
37 | InformableTask(){
38 | if (!(mhDone = CreateEvent(NULL, TRUE, FALSE, NULL))) {
39 | throw std::bad_alloc();
40 | }
41 | }
42 | virtual ~InformableTask() {
43 | CloseHandle(mhDone);
44 | }
45 | virtual void run() = 0;
46 | virtual void postProcess(){
47 | informDone();
48 | };
49 |
50 | virtual void informDone() {
51 | SetEvent(mhDone);
52 | }
53 | HANDLE getHandle() {
54 | return mhDone;
55 | }
56 |
57 | virtual void abortTask(){
58 | SetEvent(mhDone);
59 | };
60 |
61 | private:
62 | HANDLE mhDone;
63 | };
64 |
65 | typedef std::shared_ptr InformableTaskPtr;
66 |
67 | } /*task*/ } /*sessionmanager*/ } /*ogon*/
68 |
69 | namespace taskNS = ogon::sessionmanager::task;
70 |
71 | #endif /* _OGON_SMGR_INFORMABLETASK_H_ */
72 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInPropertyBool.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call GetPropertyBool (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINPROPERTYBOOL_H_
25 | #define _OGON_SMGR_CALL_CALLINPROPERTYBOOL_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 |
32 | #include
33 |
34 | namespace ogon { namespace sessionmanager { namespace call {
35 |
36 | /**
37 | * @brief
38 | */
39 | class CallInPropertyBool: public CallIn {
40 | public:
41 | CallInPropertyBool();
42 | virtual ~CallInPropertyBool();
43 |
44 | virtual unsigned long getCallType() const;
45 | virtual bool decodeRequest();
46 | virtual bool encodeResponse();
47 | virtual bool prepare();
48 | virtual bool doStuff();
49 |
50 |
51 | private:
52 | std::string mPropertyPath;
53 | UINT32 mConnectionId;
54 | bool mFound;
55 | bool mValue;
56 | };
57 |
58 | FACTORY_REGISTER_DWORD(CallFactory, CallInPropertyBool, ogon::icp::PropertyBool);
59 |
60 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
61 |
62 | namespace callNS = ogon::sessionmanager::call;
63 |
64 | #endif /* _OGON_SMGR_CALL_CALLINPROPERTYBOOL_H_ */
65 |
--------------------------------------------------------------------------------
/session-manager/common/call/TaskEndRemoteControl.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * call task for stopping remote control (shadowing)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Bernhard Miklautz
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "TaskEndRemoteControl.h"
29 | #include
30 |
31 | namespace ogon { namespace sessionmanager { namespace call {
32 |
33 | TaskEndRemoteControl::TaskEndRemoteControl(UINT32 connectionId) : mResult(false) {
34 | mConnectionId = connectionId;
35 | }
36 |
37 | void TaskEndRemoteControl::run() {
38 | sessionNS::ConnectionPtr currentConnection = APP_CONTEXT.getConnectionStore()->getConnection(mConnectionId);
39 | if ((currentConnection == NULL) || (currentConnection->getSessionId() == 0)) {
40 | mResult = false;
41 | return;
42 | }
43 |
44 | sessionNS::SessionPtr currentSession = APP_CONTEXT.getSessionStore()->getSession(currentConnection->getSessionId());
45 |
46 | if (!currentSession) {
47 | mResult = false;
48 | return;
49 | }
50 | setAccessorSession(currentSession);
51 | stopRemoteControl();
52 | mResult = true;
53 | }
54 |
55 | bool TaskEndRemoteControl::getResult() {
56 | return mResult;
57 | }
58 |
59 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
60 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInSBPVersion.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call SBP Version (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINSBPVERSION_H_
25 | #define _OGON_SMGR_CALL_CALLINSBPVERSION_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 | #include
32 |
33 | namespace ogon { namespace sessionmanager { namespace call {
34 |
35 | /**
36 | * @brief
37 | */
38 | class CallInSBPVersion: public CallIn, public ogon::sessionmanager::session::SessionAccessor {
39 | public:
40 | CallInSBPVersion();
41 | virtual ~CallInSBPVersion();
42 |
43 | virtual unsigned long getCallType() const;
44 | virtual bool decodeRequest();
45 | virtual bool encodeResponse();
46 | virtual bool prepare();
47 | virtual bool doStuff();
48 |
49 | private:
50 | UINT32 mSessionId;
51 | UINT32 mVersionMajor;
52 | UINT32 mVersionMinor;
53 | };
54 |
55 | FACTORY_REGISTER_DWORD(CallFactory, CallInSBPVersion, ogon::sbp::VersionInfo);
56 |
57 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
58 |
59 | namespace callNS = ogon::sessionmanager::call;
60 |
61 | #endif /* _OGON_SMGR_CALL_CALLINSBPVERSION_H_ */
62 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInPropertyNumber.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call GetPropertyNumber (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINPROPERTYNUMBER_H_
25 | #define _OGON_SMGR_CALL_CALLINPROPERTYNUMBER_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 |
32 | #include
33 |
34 | namespace ogon { namespace sessionmanager { namespace call {
35 |
36 | /**
37 | * @brief
38 | */
39 | class CallInPropertyNumber: public CallIn {
40 | public:
41 | CallInPropertyNumber();
42 | virtual ~CallInPropertyNumber();
43 |
44 | virtual unsigned long getCallType() const;
45 | virtual bool decodeRequest();
46 | virtual bool encodeResponse();
47 | virtual bool prepare();
48 | virtual bool doStuff();
49 |
50 | private:
51 | std::string mPropertyPath;
52 | UINT32 mConnectionId;
53 | bool mFound;
54 | long mValue;
55 |
56 | };
57 |
58 | FACTORY_REGISTER_DWORD(CallFactory, CallInPropertyNumber, ogon::icp::PropertyNumber);
59 |
60 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
61 |
62 | namespace callNS = ogon::sessionmanager::call;
63 |
64 | #endif /* _OGON_SMGR_CALL_CALLINPROPERTYNUMBER_H_ */
65 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInPropertyString.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call GetPropertyString (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINPROPERTYSTRING_H_
25 | #define _OGON_SMGR_CALL_CALLINPROPERTYSTRING_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 |
32 | #include
33 |
34 | namespace ogon { namespace sessionmanager { namespace call {
35 |
36 | /**
37 | * @brief
38 | */
39 | class CallInPropertyString: public CallIn {
40 | public:
41 | CallInPropertyString();
42 | virtual ~CallInPropertyString();
43 |
44 | virtual unsigned long getCallType() const;
45 | virtual bool decodeRequest();
46 | virtual bool encodeResponse();
47 | virtual bool prepare();
48 | virtual bool doStuff();
49 |
50 | private:
51 | std::string mPropertyPath;
52 | UINT32 mConnectionId;
53 | bool mFound;
54 | std::string mValue;
55 |
56 | };
57 |
58 | FACTORY_REGISTER_DWORD(CallFactory, CallInPropertyString, ogon::icp::PropertyString);
59 |
60 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
61 |
62 | namespace callNS = ogon::sessionmanager::call;
63 |
64 | #endif /* _OGON_SMGR_CALL_CALLINPROPERTYSTRING_H_ */
65 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallInDisconnectUserSession.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for rpc call DisconnectUserSession (ogon to session manager)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_CALL_CALLINDISCONNECTUSERSESSION_H_
25 | #define _OGON_SMGR_CALL_CALLINDISCONNECTUSERSESSION_H_
26 |
27 | #include "CallFactory.h"
28 | #include
29 | #include "CallIn.h"
30 | #include
31 | #include
32 |
33 | namespace ogon { namespace sessionmanager { namespace call {
34 |
35 | /**
36 | * @brief
37 | */
38 | class CallInDisconnectUserSession: public CallIn {
39 | public:
40 | CallInDisconnectUserSession();
41 | virtual ~CallInDisconnectUserSession();
42 |
43 | virtual unsigned long getCallType() const;
44 | virtual bool decodeRequest();
45 | virtual bool encodeResponse();
46 | virtual bool prepare();
47 | virtual bool doStuff();
48 |
49 | private:
50 |
51 | UINT32 mConnectionId;
52 | bool mDisconnected;
53 | };
54 |
55 | FACTORY_REGISTER_DWORD(CallFactory, CallInDisconnectUserSession, ogon::icp::DisconnectUserSession);
56 |
57 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
58 |
59 | namespace callNS = ogon::sessionmanager::call;
60 |
61 | #endif /* _OGON_SMGR_CALL_CALLINDISCONNECTUSERSESSION_H_ */
62 |
--------------------------------------------------------------------------------
/session-manager/common/utils/TimeHelpers.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * helper functions for time
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #include "TimeHelpers.h"
25 |
26 | void GetUnixTimeAsFileTime(time_t t, LPFILETIME lpSystemTimeAsFileTime)
27 | {
28 | ULARGE_INTEGER time64;
29 |
30 | time64.u.HighPart = 0;
31 |
32 | /* time represented in tenths of microseconds since midnight of January 1, 1601 */
33 |
34 | time64.QuadPart = t + 11644473600LL; /* Seconds since January 1, 1601 */
35 | time64.QuadPart *= 10000000; /* Convert timestamp to tenths of a microsecond */
36 |
37 | lpSystemTimeAsFileTime->dwLowDateTime = time64.u.LowPart;
38 | lpSystemTimeAsFileTime->dwHighDateTime = time64.u.HighPart;
39 | }
40 |
41 | time_t to_time_t(boost::posix_time::ptime t)
42 | {
43 | using namespace boost::posix_time;
44 | boost::posix_time::ptime epoch(boost::gregorian::date(1970, boost::gregorian::Jan, 1));
45 | boost::posix_time::time_duration::sec_type x = (t - epoch).total_seconds();
46 | return time_t(x);
47 | }
48 |
49 |
50 | __uint64 convertFileTimeToint64(const FILETIME &fileTime)
51 | {
52 | ULARGE_INTEGER lv_Large ;
53 |
54 | lv_Large.u.LowPart = fileTime.dwLowDateTime;
55 | lv_Large.u.HighPart = fileTime.dwHighDateTime;
56 |
57 | return lv_Large.QuadPart ;
58 | }
59 |
--------------------------------------------------------------------------------
/session-manager/common/task/Executor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Global Executor which runs Task objects
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifndef _OGON_SMGR_EXECUTOR_H_
25 | #define _OGON_SMGR_EXECUTOR_H_
26 |
27 | #include "Task.h"
28 | #include
29 | #include
30 |
31 | #define PIPE_BUFFER_SIZE 0xFFFF
32 |
33 | namespace ogon { namespace sessionmanager { namespace task {
34 |
35 | class Executor {
36 | public:
37 | Executor();
38 | ~Executor();
39 |
40 | bool start();
41 | bool stop();
42 |
43 | void runExecutor();
44 |
45 | bool addTask(TaskPtr task);
46 |
47 |
48 | private:
49 | static void* execThread(void *arg);
50 | static void* execTask(void *arg);
51 |
52 | bool checkThreadHandles(const HANDLE value) const;
53 | bool waitThreadHandles(const HANDLE value) const;
54 |
55 | private:
56 | HANDLE mhStopEvent;
57 | HANDLE mhServerThread;
58 |
59 | HANDLE mhStopThreads;
60 | HANDLE mhTaskThreadStarted;
61 |
62 | bool mRunning;
63 |
64 | std::list mTaskThreadList;
65 | CRITICAL_SECTION mCSection;
66 | SignalingQueue mTasks;
67 | };
68 |
69 | } /*task*/ } /*sessionmanager*/ } /*ogon*/
70 |
71 | namespace taskNS = ogon::sessionmanager::task;
72 |
73 | #endif /* _OGON_SMGR_EXECUTOR_H_ */
74 |
--------------------------------------------------------------------------------
/protocols/protobuf/Module.proto:
--------------------------------------------------------------------------------
1 | syntax="proto2";
2 | package ogon.module;
3 |
4 | enum MSGTYPE {
5 | ModuleStart = 300;
6 | ModuleStop = 301;
7 | ModuleGetCustomInfo = 302;
8 | ModuleConnect = 303;
9 | ModuleDisconnect = 304;
10 | PropertyBool = 305;
11 | PropertyNumber = 306;
12 | PropertyString = 307;
13 | ModuleExit = 308;
14 | }
15 |
16 | message ModuleStartRequest {
17 | required uint32 sessionId = 1;
18 | required string userName = 2;
19 | required string userDomain = 3;
20 | required string baseConfigPath = 4;
21 | required bytes envBlock = 5;
22 | required string moduleFileName = 6;
23 | required string remoteIp = 7;
24 | }
25 |
26 | message ModuleStartResponse {
27 | required string pipeName = 1;
28 | }
29 |
30 | message ModuleStopRequest {
31 | }
32 |
33 | message ModuleStopResponse {
34 | required int32 success = 1;
35 | }
36 |
37 | message ModuleGetCustomInfoRequest {
38 | }
39 |
40 | message ModuleGetCustomInfoResponse {
41 | required string info = 1;
42 | }
43 |
44 | message ModuleConnectRequest {
45 | }
46 |
47 | message ModuleConnectResponse {
48 | required int32 success = 1;
49 | }
50 |
51 | message ModuleDisconnectRequest {
52 | }
53 |
54 | message ModuleDisconnectResponse {
55 | required int32 success = 1;
56 | }
57 |
58 | message PropertyBoolRequest {
59 | required uint32 sessionId = 1;
60 | required string path = 2;
61 | }
62 |
63 | message PropertyBoolResponse {
64 | required bool success = 1;
65 | optional bool value = 2;
66 | }
67 |
68 | message PropertyNumberRequest {
69 | required uint32 sessionId = 1;
70 | required string path = 2;
71 | }
72 |
73 | message PropertyNumberResponse {
74 | required bool success = 1;
75 | optional uint32 value = 2;
76 | }
77 |
78 | message PropertyStringRequest {
79 | required uint32 sessionId = 1;
80 | required string path = 2;
81 | }
82 |
83 | message PropertyStringResponse {
84 | required bool success = 1;
85 | optional string value = 2;
86 | }
87 |
88 | message ModuleExitRequest {
89 | }
90 |
91 | message ModuleExitResponse {
92 | required bool success = 1;
93 | }
94 |
--------------------------------------------------------------------------------
/session-manager/common/call/CallOutPing.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Class for ping rpc call (session manager to ogon)
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 | #ifdef HAVE_CONFIG_H
25 | #include "config.h"
26 | #endif
27 |
28 | #include "CallOutPing.h"
29 |
30 | using ogon::icp::PingRequest;
31 | using ogon::icp::PingResponse;
32 |
33 | namespace ogon { namespace sessionmanager { namespace call {
34 |
35 | CallOutPing::CallOutPing() {
36 | mPong = false;
37 | }
38 |
39 | CallOutPing::~CallOutPing(){
40 | }
41 |
42 | unsigned long CallOutPing::getCallType() const {
43 | return ogon::icp::Ping;
44 | }
45 |
46 | bool CallOutPing::encodeRequest() {
47 | // decode protocol buffers
48 | PingRequest req;
49 |
50 | if (!req.SerializeToString(&mEncodedRequest)) {
51 | // failed to serialize
52 | mResult = 1;
53 | return false;
54 | }
55 | return true;
56 | }
57 |
58 | bool CallOutPing::decodeResponse() {
59 | // encode protocol buffers
60 | PingResponse resp;
61 |
62 | if (!resp.ParseFromString(mEncodedResponse)) {
63 | // failed to serialize
64 | mResult = 1;
65 | return false;
66 | }
67 | mPong = resp.pong();
68 | return true;
69 | }
70 |
71 | bool CallOutPing::getPong() {
72 | return mPong;
73 | }
74 |
75 | } /*call*/ } /*sessionmanager*/ } /*ogon*/
76 |
--------------------------------------------------------------------------------
/session-manager/common/session/ConnectionStore.h:
--------------------------------------------------------------------------------
1 | /**
2 | * ogon - Free Remote Desktop Services
3 | * Session Manager
4 | * Connection store class
5 | *
6 | * Copyright (c) 2013-2018 Thincast Technologies GmbH
7 | *
8 | * Authors:
9 | * Martin Haimberger
10 | *
11 | * This file may be used under the terms of the GNU Affero General
12 | * Public License version 3 as published by the Free Software Foundation
13 | * and appearing in the file LICENSE-AGPL included in the distribution
14 | * of this file.
15 | *
16 | * Under the GNU Affero General Public License version 3 section 7 the
17 | * copyright holders grant the additional permissions set forth in the
18 | * ogon Core AGPL Exceptions version 1 as published by
19 | * Thincast Technologies GmbH.
20 | *
21 | * For more information see the file LICENSE in the distribution of this file.
22 | */
23 |
24 |
25 | #ifndef _OGON_SMGR_SESSION_CONNECTIONSTORE_H_
26 | #define _OGON_SMGR_SESSION_CONNECTIONSTORE_H_
27 |
28 | #include "Connection.h"
29 |
30 | #include
31 | #include
32 | #include