3.1.1-alt1
- 3.1-1
This commit is contained in:
parent
8bc4e058e7
commit
6115e73cea
@ -1,3 +1,4 @@
|
||||
copy: *.patch
|
||||
tar.bz2: spice name=spice-0.14.1
|
||||
tar.xz: spice-protocol name=spice-protocol
|
||||
tar.xz: spiceterm name=spiceterm
|
||||
|
53
pve-spice-protocol.patch
Normal file
53
pve-spice-protocol.patch
Normal file
@ -0,0 +1,53 @@
|
||||
--- spice/configure.ac.spice-proto 2018-08-22 11:31:30.000000000 +0000
|
||||
+++ spice/configure.ac 2019-08-05 09:32:49.621487826 +0000
|
||||
@@ -139,7 +139,7 @@ AM_CONDITIONAL(HAVE_SASL, test "x$have_s
|
||||
dnl =========================================================================
|
||||
dnl Check deps
|
||||
AC_CONFIG_SUBDIRS([subprojects/spice-common])
|
||||
-COMMON_CFLAGS='-I ${top_srcdir}/subprojects/spice-common/ -I ${top_builddir}/subprojects/spice-common/'
|
||||
+COMMON_CFLAGS='-I ${top_srcdir}/subprojects/spice-common/ -I ${top_builddir}/subprojects/spice-common/ -I ${top_builddir}/../spice-protocol'
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS -DG_LOG_DOMAIN=\\\"Spice\\\""
|
||||
AC_SUBST(COMMON_CFLAGS)
|
||||
|
||||
@@ -160,10 +160,6 @@ AS_IF([test x"$have_smartcard" = "xyes"]
|
||||
AS_VAR_APPEND([SPICE_REQUIRES], [" libcacard >= 0.1.2"])
|
||||
])
|
||||
|
||||
-SPICE_PROTOCOL_MIN_VER=0.12.14
|
||||
-PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= $SPICE_PROTOCOL_MIN_VER])
|
||||
-AC_SUBST([SPICE_PROTOCOL_MIN_VER])
|
||||
-
|
||||
GLIB2_REQUIRED=2.32
|
||||
GLIB2_ENCODED_VERSION="GLIB_VERSION_2_32"
|
||||
PKG_CHECK_MODULES([GLIB2], [glib-2.0 >= $GLIB2_REQUIRED gio-2.0 >= $GLIB2_REQUIRED])
|
||||
--- spice/subprojects/spice-common/Makefile.am.spice-proto 2018-08-08 10:13:13.000000000 +0000
|
||||
+++ spice/subprojects/spice-common/Makefile.am 2019-08-05 09:28:53.078456697 +0000
|
||||
@@ -1,7 +1,7 @@
|
||||
NULL =
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
-SUBDIRS = python_modules common tests docs
|
||||
+SUBDIRS = python_modules common
|
||||
|
||||
EXTRA_DIST = \
|
||||
meson.build \
|
||||
--- spice/subprojects/spice-common/configure.ac.spice-proto 2018-08-08 10:13:13.000000000 +0000
|
||||
+++ spice/subprojects/spice-common/configure.ac 2019-08-05 09:25:44.239431862 +0000
|
||||
@@ -38,7 +38,7 @@ AS_IF([test "x$enable_alignment_checks"
|
||||
[AC_DEFINE([SPICE_DEBUG_ALIGNMENT], 1, [Enable runtime checks for cast alignment])])
|
||||
|
||||
# Checks for libraries
|
||||
-PKG_CHECK_MODULES([PROTOCOL], [spice-protocol >= 0.12.12])
|
||||
+#PKG_CHECK_MODULES([PROTOCOL], [spice-protocol >= 0.12.12])
|
||||
|
||||
SPICE_CHECK_PYTHON_MODULES()
|
||||
|
||||
@@ -50,7 +50,7 @@ SPICE_CHECK_OPUS
|
||||
SPICE_CHECK_OPENSSL
|
||||
SPICE_CHECK_GDK_PIXBUF
|
||||
|
||||
-SPICE_COMMON_CFLAGS='$(PIXMAN_CFLAGS) $(SMARTCARD_CFLAGS) $(CELT051_CFLAGS) $(GLIB2_CFLAGS) $(OPUS_CFLAGS) $(OPENSSL_CFLAGS)'
|
||||
+SPICE_COMMON_CFLAGS='$(PIXMAN_CFLAGS) $(SMARTCARD_CFLAGS) $(CELT051_CFLAGS) $(GLIB2_CFLAGS) $(OPUS_CFLAGS) $(OPENSSL_CFLAGS) -I$(top_srcdir)/../../../spice-protocol'
|
||||
SPICE_COMMON_CFLAGS="$SPICE_COMMON_CFLAGS -DG_LOG_DOMAIN=\\\"Spice\\\""
|
||||
SPICE_COMMON_LIBS='$(PIXMAN_LIBS) $(CELT051_LIBS) $(GLIB2_LIBS) $(OPUS_LIBS) $(OPENSSL_LIBS)'
|
||||
AC_SUBST(SPICE_COMMON_CFLAGS)
|
@ -3,36 +3,42 @@
|
||||
|
||||
Name: pve-%sname
|
||||
Summary: SPICE Terminal Emulator
|
||||
Version: 3.0.5
|
||||
Version: 3.1.1
|
||||
Release: alt1
|
||||
License: GPLv2
|
||||
Group: Networking/WWW
|
||||
Url: https://git.proxmox.com/
|
||||
Packager: Valery Inozemtsev <shrek@altlinux.ru>
|
||||
|
||||
ExclusiveArch: x86_64
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
|
||||
Source0: %sname.tar.xz
|
||||
Source1: spice-0.14.1.tar.bz2
|
||||
Source2: spice-protocol.tar.xz
|
||||
Patch0: allow-to-set-sasl-callbacks.patch
|
||||
|
||||
Patch10: spiceterm-alt.patch
|
||||
Patch11: pve-spice-protocol.patch
|
||||
|
||||
BuildRequires: libgio-devel libjpeg-devel liblz4-devel libogg-devel libopus-devel libpixman-devel
|
||||
BuildRequires: libsasl2-devel libssl-devel perl-Pod-Usage spice-protocol zlib-devel libgdk-pixbuf-devel
|
||||
BuildRequires: libsasl2-devel libssl-devel perl-Pod-Usage zlib-devel libgdk-pixbuf-devel
|
||||
BuildRequires: python-modules python-module-pyparsing python-module-six
|
||||
|
||||
%description
|
||||
With spiceterm you can start commands and export its standard input and
|
||||
output to any SPICE client (simulating a xterm Terminal).
|
||||
|
||||
%prep
|
||||
%setup -q -n %sname -a1
|
||||
ln -s spice-* spice
|
||||
%setup -q -n %sname -a1 -a2
|
||||
ln -s spice-0* spice
|
||||
|
||||
pushd spice
|
||||
%patch0 -p1
|
||||
popd
|
||||
%patch10 -p1
|
||||
%patch10 -p1 -b .alt
|
||||
%patch11 -p0
|
||||
|
||||
rm -f spice/subprojects/spice-common/common/generated_*
|
||||
|
||||
%build
|
||||
pushd spice
|
||||
@ -46,16 +52,19 @@ pushd spice
|
||||
%make_build
|
||||
popd
|
||||
|
||||
%make
|
||||
%make -C src
|
||||
|
||||
%install
|
||||
%make DESTDIR=%buildroot install
|
||||
%make -C src VERSION=%version DESTDIR=%buildroot install
|
||||
|
||||
%files
|
||||
%_bindir/%sname
|
||||
%_man1dir/%sname.1*
|
||||
|
||||
%changelog
|
||||
* Mon Aug 05 2019 Valery Inozemtsev <shrek@altlinux.ru> 3.1.1-alt1
|
||||
- 3.1-1
|
||||
|
||||
* Wed Nov 28 2018 Valery Inozemtsev <shrek@altlinux.ru> 3.0.5-alt1
|
||||
- 3.0-5
|
||||
|
||||
|
0
spice-protocol/AUTHORS
Normal file
0
spice-protocol/AUTHORS
Normal file
25
spice-protocol/COPYING
Normal file
25
spice-protocol/COPYING
Normal file
@ -0,0 +1,25 @@
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
0
spice-protocol/ChangeLog
Normal file
0
spice-protocol/ChangeLog
Normal file
27
spice-protocol/Makefile.am
Normal file
27
spice-protocol/Makefile.am
Normal file
@ -0,0 +1,27 @@
|
||||
NULL =
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
SUBDIRS = spice
|
||||
|
||||
pkgconfigdir = $(datadir)/pkgconfig
|
||||
pkgconfig_DATA = spice-protocol.pc
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(srcdir)/INSTALL \
|
||||
$(srcdir)/aclocal.m4 \
|
||||
$(srcdir)/autoscan.log \
|
||||
$(srcdir)/compile \
|
||||
$(srcdir)/config.guess \
|
||||
$(srcdir)/config.h.in \
|
||||
$(srcdir)/config.sub \
|
||||
$(srcdir)/configure.scan \
|
||||
$(srcdir)/depcomp \
|
||||
$(srcdir)/install-sh \
|
||||
$(srcdir)/ltmain.sh \
|
||||
$(srcdir)/missing \
|
||||
$(srcdir)/mkinstalldirs \
|
||||
`find "$(srcdir)" -type f -name Makefile.in -print` \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = meson.build
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
194
spice-protocol/NEWS
Normal file
194
spice-protocol/NEWS
Normal file
@ -0,0 +1,194 @@
|
||||
Major changes in 0.12.15
|
||||
========================
|
||||
* Add support for h265 video codec
|
||||
* qxl_dev: Align QXLRam to 4 bytes
|
||||
* meson: fix spice-protocol as subproject
|
||||
|
||||
Major changes in 0.12.14
|
||||
========================
|
||||
* add stream-device protocol
|
||||
* add SPICE_SURFACE_FLAGS_STREAMING_MODE flag
|
||||
* add e2k (Elbrus 2000) architecture
|
||||
* add SPICE_MAX_NUM_STREAMS
|
||||
* add meson support
|
||||
* add bult-ins byte swapping for Visual C++
|
||||
* switch to built-ins byte swapping in GCC
|
||||
|
||||
Major changes in 0.12.13
|
||||
========================
|
||||
* add DISPLAY_PREFERRED_VIDEO_CODEC_TYPE
|
||||
* add VP9 codec type
|
||||
* add VD_AGENT_CLEAR_CAPABILITY() macro
|
||||
* add VD_AGENT_CAP_FILE_XFER_DISABLED
|
||||
* add VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE
|
||||
* add new file-xfer statuses for detailed error
|
||||
* Change enums.h license to MIT
|
||||
|
||||
Major changes in 0.12.12
|
||||
========================
|
||||
* protocol: Add lz4 compression support to the SpiceVMC channel
|
||||
|
||||
Major changes in 0.12.11
|
||||
========================
|
||||
* protocol: add support for the VP8 and h264 video codecs
|
||||
* protocol: add unix GL scanout messages
|
||||
* remove code generation scripts, moved back to spice-common
|
||||
* macros improvements, more type safety
|
||||
|
||||
Major changes in 0.12.10
|
||||
========================
|
||||
* Add VD_AGENT_CAP_MONITORS_CONFIG_POSITION to handle multi-monitor
|
||||
configurations that are not multi-head
|
||||
* Add protocol code generation scripts from spice-common
|
||||
* Endianness and compiler portability fixes (clang)
|
||||
|
||||
Major changes in 0.12.9
|
||||
=======================
|
||||
* rename newly introduced SpiceImageCompress enum to SpiceImageCompression
|
||||
as otherwise it was clashing with the definition used by older spice-server
|
||||
releases, breaking QEMU build
|
||||
|
||||
Major changes in 0.12.8
|
||||
=======================
|
||||
* add LZ4 support
|
||||
* add audio volume synchronization
|
||||
* deprecate unused vdi-dev
|
||||
* add 'preferred-compression' message/capability
|
||||
* add a new Windows driver escape code to send
|
||||
monitors capability from guest to client
|
||||
|
||||
Major changes in 0.12.7
|
||||
=======================
|
||||
* add support for Webdav channel
|
||||
* add support for the Opus codec
|
||||
|
||||
Major changes in 0.12.6
|
||||
=======================
|
||||
* add adaptive video streaming support:
|
||||
control playback latency and receive playback
|
||||
reports from the client.
|
||||
* add agent capabilities for signaling guest line ending.
|
||||
|
||||
Major changes in 0.12.5
|
||||
=======================
|
||||
* Add agent file xfer success status
|
||||
* Add a client-disconnected agent message
|
||||
|
||||
Major changes in 0.12.4
|
||||
=======================
|
||||
* Add agent file copy support.
|
||||
* Add agent sparse monitors capability.
|
||||
* Add controller proxy message.
|
||||
|
||||
Major changes in 0.12.3
|
||||
=======================
|
||||
* Add a generic "port" channel
|
||||
|
||||
Major changes in 0.12.2
|
||||
=======================
|
||||
* Add A8 surface capability in display channel.
|
||||
* Add to qxl device support for:
|
||||
* client present
|
||||
* client capabilities
|
||||
* client monitors configuration
|
||||
|
||||
Major changes in 0.12.1
|
||||
=======================
|
||||
* Support seamless migration.
|
||||
* New QXLComposite message for better X support.
|
||||
* Support arbitrary scancode message INPUTS_KEY_SCANCODE.
|
||||
|
||||
Major changes in 0.12.0
|
||||
=======================
|
||||
* Add support for arbitrary resolution on Windows QXL with
|
||||
QXL_ESCAPE_SET_CUSTOM_DISPLAY
|
||||
* Add support for arbitrary resolution and multiple monitor per
|
||||
display channel with QXLMonitorsConfig and co
|
||||
* build cleanup
|
||||
|
||||
Major changes in 0.10.3 (0.10.2 was never released)
|
||||
===================================================
|
||||
* Add support for video streams with differently sized (wxh) data
|
||||
* Add controller messages for USB redirection, COLOR_DEPTH, DISABLE_EFFECTS,
|
||||
and ENABLE_SMARTCARD
|
||||
* Add name & uuid messages on main channel
|
||||
* some cleanups
|
||||
* Fixes RHBZ#815422, RHBZ#807295, RHBZ#787447
|
||||
|
||||
Major changes in 0.10.1
|
||||
=======================
|
||||
* Add support for a header without sublist and serial (mini header)
|
||||
|
||||
Major changes in 0.10.0
|
||||
=======================
|
||||
* no changes, released to match version with spice
|
||||
|
||||
Major changes in 0.9.1 (same as 0.8.2 in 0.8 branch)
|
||||
======================
|
||||
* Add support for semi-seamless migration
|
||||
|
||||
Major changes in 0.9.0
|
||||
======================
|
||||
* Add support for generic spicevmc chardev passthrough messages
|
||||
* Add USB redirection channel
|
||||
|
||||
Major changes in 0.8.1
|
||||
======================
|
||||
* Add support for volume change
|
||||
* Add support for async guest io writes and interrupt
|
||||
* Add support for suspend related guest io writes
|
||||
* Add support for interrupt indicating guest bug
|
||||
|
||||
Major changes in 0.8.0
|
||||
======================
|
||||
* Add support for different clipboards (selections) to vd_agent copy paste
|
||||
* Add support for using different authentication mechanisms (just SASL for now)
|
||||
|
||||
Major changes in 0.7.1
|
||||
======================
|
||||
* Add some enums for the xorg qxl driver
|
||||
* Some other small fixes
|
||||
|
||||
Major changes in 0.7.0
|
||||
======================
|
||||
* Add smartcard channel
|
||||
|
||||
Major changes in 0.6.4
|
||||
======================
|
||||
* Make controller client protocol menu text UTF8 rather then 16 bit unicode
|
||||
|
||||
Major changes in 0.6.3:
|
||||
=======================
|
||||
* Add support for copy and paste to the agent protocol
|
||||
* Add foreign-menu and external controller client protocol headers
|
||||
|
||||
Major changes in 0.6.2:
|
||||
=======================
|
||||
* Skipped to stay in sync with spice
|
||||
|
||||
Major changes in 0.6.1:
|
||||
=======================
|
||||
* Added compat flag for 16bpp commands
|
||||
|
||||
Major changes in 0.6.0:
|
||||
=======================
|
||||
* Initial messages for clipboard sharing
|
||||
* Move agent protocol structs from spice to spice-protocol
|
||||
* Add capabilities to agent protocol
|
||||
|
||||
Major changes in 0.5.3:
|
||||
=======================
|
||||
|
||||
Network major number changed to 2 to reflect that the network
|
||||
protocol is now stable and backwards compatible from this point.
|
||||
|
||||
Some vdagent messages for display settings and clipboard sharing
|
||||
were added.
|
||||
|
||||
Major changes in 0.5.2:
|
||||
=======================
|
||||
|
||||
This is the first release of the unstable 0.5.x series leading up to 0.6.
|
||||
This module was split out of spice so that e.g. drivers and qemu can
|
||||
get the types and constants they need without using the full spice
|
||||
codebase.
|
0
spice-protocol/README
Normal file
0
spice-protocol/README
Normal file
19
spice-protocol/autogen.sh
Executable file
19
spice-protocol/autogen.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -e # exit on errors
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
|
||||
(
|
||||
cd "$srcdir"
|
||||
autoreconf --verbose --force --install
|
||||
)
|
||||
|
||||
CONFIGURE_ARGS="--enable-maintainer-mode"
|
||||
|
||||
if [ -z "$NOCONFIGURE" ]; then
|
||||
echo "Running configure with $CONFIGURE_ARGS $@"
|
||||
"$srcdir/configure" $CONFIGURE_ARGS "$@"
|
||||
fi
|
21
spice-protocol/configure.ac
Normal file
21
spice-protocol/configure.ac
Normal file
@ -0,0 +1,21 @@
|
||||
AC_PREREQ([2.57])
|
||||
|
||||
m4_define([SPICE_MAJOR], 0)
|
||||
m4_define([SPICE_MINOR], 12)
|
||||
m4_define([SPICE_MICRO], 15)
|
||||
|
||||
AC_INIT(spice-protocol, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice-protocol)
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
spice-protocol.pc
|
||||
spice/Makefile
|
||||
])
|
227
spice-protocol/git.mk
Normal file
227
spice-protocol/git.mk
Normal file
@ -0,0 +1,227 @@
|
||||
# git.mk
|
||||
#
|
||||
# Copyright 2009, Red Hat, Inc.
|
||||
# Copyright 2010,2011 Behdad Esfahbod
|
||||
# Written by Behdad Esfahbod
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# is permitted in any medium without royalty provided the copyright
|
||||
# notice and this notice are preserved.
|
||||
#
|
||||
# The latest version of this file can be downloaded from:
|
||||
# https://raw.github.com/behdad/git.mk/master/git.mk
|
||||
# Bugs, etc, should be reported upstream at:
|
||||
# https://github.com/behdad/git.mk
|
||||
#
|
||||
# To use in your project, import this file in your git repo's toplevel,
|
||||
# then do "make -f git.mk". This modifies all Makefile.am files in
|
||||
# your project to -include git.mk. Remember to add that line to new
|
||||
# Makefile.am files you create in your project, or just rerun the
|
||||
# "make -f git.mk".
|
||||
#
|
||||
# This enables automatic .gitignore generation. If you need to ignore
|
||||
# more files, add them to the GITIGNOREFILES variable in your Makefile.am.
|
||||
# But think twice before doing that. If a file has to be in .gitignore,
|
||||
# chances are very high that it's a generated file and should be in one
|
||||
# of MOSTLYCLEANFILES, CLEANFILES, DISTCLEANFILES, or MAINTAINERCLEANFILES.
|
||||
#
|
||||
# The only case that you need to manually add a file to GITIGNOREFILES is
|
||||
# when remove files in one of mostlyclean-local, clean-local, distclean-local,
|
||||
# or maintainer-clean-local make targets.
|
||||
#
|
||||
# Note that for files like editor backup, etc, there are better places to
|
||||
# ignore them. See "man gitignore".
|
||||
#
|
||||
# If "make maintainer-clean" removes the files but they are not recognized
|
||||
# by this script (that is, if "git status" shows untracked files still), send
|
||||
# me the output of "git status" as well as your Makefile.am and Makefile for
|
||||
# the directories involved and I'll diagnose.
|
||||
#
|
||||
# For a list of toplevel files that should be in MAINTAINERCLEANFILES, see
|
||||
# Makefile.am.sample in the git.mk git repo.
|
||||
#
|
||||
# Don't EXTRA_DIST this file. It is supposed to only live in git clones,
|
||||
# not tarballs. It serves no useful purpose in tarballs and clutters the
|
||||
# build dir.
|
||||
#
|
||||
# This file knows how to handle autoconf, automake, libtool, gtk-doc,
|
||||
# gnome-doc-utils, yelp.m4, mallard, intltool, gsettings, dejagnu.
|
||||
#
|
||||
# This makefile provides the following targets:
|
||||
#
|
||||
# - all: "make all" will build all gitignore files.
|
||||
# - gitignore: makes all gitignore files in the current dir and subdirs.
|
||||
# - .gitignore: make gitignore file for the current dir.
|
||||
# - gitignore-recurse: makes all gitignore files in the subdirs.
|
||||
#
|
||||
# KNOWN ISSUES:
|
||||
#
|
||||
# - Recursive configure doesn't work as $(top_srcdir)/git.mk inside the
|
||||
# submodule doesn't find us. If you have configure.{in,ac} files in
|
||||
# subdirs, add a proxy git.mk file in those dirs that simply does:
|
||||
# "include $(top_srcdir)/../git.mk". Add more ..'s to your taste.
|
||||
# And add those files to git. See vte/gnome-pty-helper/git.mk for
|
||||
# example.
|
||||
#
|
||||
|
||||
git-all: git-mk-install
|
||||
|
||||
git-mk-install:
|
||||
@echo Installing git makefile
|
||||
@any_failed=; \
|
||||
find "`test -z "$(top_srcdir)" && echo . || echo "$(top_srcdir)"`" -name Makefile.am | while read x; do \
|
||||
if grep 'include .*/git.mk' $$x >/dev/null; then \
|
||||
echo $$x already includes git.mk; \
|
||||
else \
|
||||
failed=; \
|
||||
echo "Updating $$x"; \
|
||||
{ cat $$x; \
|
||||
echo ''; \
|
||||
echo '-include $$(top_srcdir)/git.mk'; \
|
||||
} > $$x.tmp || failed=1; \
|
||||
if test x$$failed = x; then \
|
||||
mv $$x.tmp $$x || failed=1; \
|
||||
fi; \
|
||||
if test x$$failed = x; then : else \
|
||||
echo Failed updating $$x; >&2 \
|
||||
any_failed=1; \
|
||||
fi; \
|
||||
fi; done; test -z "$$any_failed"
|
||||
|
||||
.PHONY: git-all git-mk-install
|
||||
|
||||
|
||||
### .gitignore generation
|
||||
|
||||
$(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk
|
||||
$(AM_V_GEN) \
|
||||
{ \
|
||||
if test "x$(DOC_MODULE)" = x -o "x$(DOC_MAIN_SGML_FILE)" = x; then :; else \
|
||||
for x in \
|
||||
$(DOC_MODULE)-decl-list.txt \
|
||||
$(DOC_MODULE)-decl.txt \
|
||||
tmpl/$(DOC_MODULE)-unused.sgml \
|
||||
"tmpl/*.bak" \
|
||||
xml html \
|
||||
; do echo /$$x; done; \
|
||||
fi; \
|
||||
if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \
|
||||
for lc in $(DOC_LINGUAS); do \
|
||||
for x in \
|
||||
$(if $(DOC_MODULE),$(DOC_MODULE).xml) \
|
||||
$(DOC_PAGES) \
|
||||
$(DOC_INCLUDES) \
|
||||
; do echo /$$lc/$$x; done; \
|
||||
done; \
|
||||
for x in \
|
||||
$(_DOC_OMF_ALL) \
|
||||
$(_DOC_DSK_ALL) \
|
||||
$(_DOC_HTML_ALL) \
|
||||
$(_DOC_MOFILES) \
|
||||
$(DOC_H_FILE) \
|
||||
"*/.xml2po.mo" \
|
||||
"*/*.omf.out" \
|
||||
; do echo /$$x; done; \
|
||||
fi; \
|
||||
if test "x$(HELP_ID)" = x -o "x$(HELP_LINGUAS)" = x; then :; else \
|
||||
for lc in $(HELP_LINGUAS); do \
|
||||
for x in \
|
||||
$(HELP_FILES) \
|
||||
"$$lc.stamp" \
|
||||
"$$lc.mo" \
|
||||
; do echo /$$lc/$$x; done; \
|
||||
done; \
|
||||
fi; \
|
||||
if test "x$(gsettings_SCHEMAS)" = x; then :; else \
|
||||
for x in \
|
||||
$(gsettings_SCHEMAS:.xml=.valid) \
|
||||
$(gsettings__enum_file) \
|
||||
; do echo /$$x; done; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/po/Makefile.in.in; then \
|
||||
for x in \
|
||||
po/Makefile.in.in \
|
||||
po/Makefile.in \
|
||||
po/Makefile \
|
||||
po/POTFILES \
|
||||
po/stamp-it \
|
||||
po/.intltool-merge-cache \
|
||||
"po/*.gmo" \
|
||||
"po/*.mo" \
|
||||
po/$(GETTEXT_PACKAGE).pot \
|
||||
intltool-extract.in \
|
||||
intltool-merge.in \
|
||||
intltool-update.in \
|
||||
; do echo /$$x; done; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/configure; then \
|
||||
for x in \
|
||||
autom4te.cache \
|
||||
configure \
|
||||
config.h \
|
||||
stamp-h1 \
|
||||
libtool \
|
||||
config.lt \
|
||||
; do echo /$$x; done; \
|
||||
fi; \
|
||||
if test "x$(DEJATOOL)" = x; then :; else \
|
||||
for x in \
|
||||
$(DEJATOOL) \
|
||||
; do echo /$$x.sum; echo /$$x.log; done; \
|
||||
echo /site.exp; \
|
||||
fi; \
|
||||
for x in \
|
||||
.gitignore \
|
||||
$(GITIGNOREFILES) \
|
||||
$(CLEANFILES) \
|
||||
$(PROGRAMS) $(check_PROGRAMS) $(EXTRA_PROGRAMS) \
|
||||
$(LIBRARIES) $(check_LIBRARIES) $(EXTRA_LIBRARIES) \
|
||||
$(LTLIBRARIES) $(check_LTLIBRARIES) $(EXTRA_LTLIBRARIES) \
|
||||
so_locations \
|
||||
.libs _libs \
|
||||
$(MOSTLYCLEANFILES) \
|
||||
"*.$(OBJEXT)" \
|
||||
"*.lo" \
|
||||
$(DISTCLEANFILES) \
|
||||
$(am__CONFIG_DISTCLEAN_FILES) \
|
||||
$(CONFIG_CLEAN_FILES) \
|
||||
TAGS ID GTAGS GRTAGS GSYMS GPATH tags \
|
||||
"*.tab.c" \
|
||||
$(MAINTAINERCLEANFILES) \
|
||||
$(BUILT_SOURCES) \
|
||||
$(DEPDIR) \
|
||||
Makefile \
|
||||
Makefile.in \
|
||||
"*.orig" \
|
||||
"*.rej" \
|
||||
"*.bak" \
|
||||
"*~" \
|
||||
".*.sw[nop]" \
|
||||
".dirstamp" \
|
||||
; do echo /$$x; done; \
|
||||
} | \
|
||||
sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \
|
||||
sed 's@/[.]/@/@g' | \
|
||||
LC_ALL=C sort | uniq > $@.tmp && \
|
||||
mv $@.tmp $@;
|
||||
|
||||
all: $(srcdir)/.gitignore gitignore-recurse-maybe
|
||||
gitignore: $(srcdir)/.gitignore gitignore-recurse
|
||||
|
||||
gitignore-recurse-maybe:
|
||||
@for subdir in $(DIST_SUBDIRS); do \
|
||||
case " $(SUBDIRS) " in \
|
||||
*" $$subdir "*) :;; \
|
||||
*) test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse-maybe || echo "Skipping $$subdir");; \
|
||||
esac; \
|
||||
done
|
||||
gitignore-recurse:
|
||||
@for subdir in $(DIST_SUBDIRS); do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) .gitignore gitignore-recurse || echo "Skipping $$subdir"); \
|
||||
done
|
||||
|
||||
maintainer-clean: gitignore-clean
|
||||
gitignore-clean:
|
||||
-rm -f $(srcdir)/.gitignore
|
||||
|
||||
.PHONY: gitignore-clean gitignore gitignore-recurse gitignore-recurse-maybe
|
49
spice-protocol/m4/ax_python_module.m4
Normal file
49
spice-protocol/m4/ax_python_module.m4
Normal file
@ -0,0 +1,49 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_PYTHON_MODULE(modname[, fatal])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Checks for Python module.
|
||||
#
|
||||
# If fatal is non-empty then absence of a module will trigger an error.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Andrew Collier
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 6
|
||||
|
||||
AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
|
||||
AC_DEFUN([AX_PYTHON_MODULE],[
|
||||
if test -z $PYTHON;
|
||||
then
|
||||
PYTHON="python"
|
||||
fi
|
||||
PYTHON_NAME=`basename $PYTHON`
|
||||
AC_MSG_CHECKING($PYTHON_NAME module: $1)
|
||||
$PYTHON -c "import $1" 2>/dev/null
|
||||
if test $? -eq 0;
|
||||
then
|
||||
AC_MSG_RESULT(yes)
|
||||
eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
eval AS_TR_CPP(HAVE_PYMOD_$1)=no
|
||||
#
|
||||
if test -n "$2"
|
||||
then
|
||||
AC_MSG_ERROR(failed to find required module $1)
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
])
|
25
spice-protocol/meson.build
Normal file
25
spice-protocol/meson.build
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# project definition
|
||||
#
|
||||
project('spice-protocol', 'c',
|
||||
version : '0.12.15',
|
||||
license : 'BSD',
|
||||
meson_version : '>= 0.41.0')
|
||||
|
||||
subdir('spice')
|
||||
|
||||
spice_protocol_dep = declare_dependency(include_directories : include_directories('.'))
|
||||
|
||||
#
|
||||
# spice-protocol.pc generation
|
||||
#
|
||||
datadir = get_option('datadir')
|
||||
pkgconfig_dir = join_paths(get_option('prefix'), datadir, 'pkgconfig')
|
||||
|
||||
pkgconfig = import('pkgconfig')
|
||||
pkgconfig.generate(name : meson.project_name(),
|
||||
description : 'SPICE protocol headers',
|
||||
version : meson.project_version(),
|
||||
subdirs : 'spice-1',
|
||||
install_dir : pkgconfig_dir,
|
||||
variables : 'datadir=@0@'.format(join_paths('${prefix}', datadir)))
|
10
spice-protocol/spice-protocol.pc.in
Normal file
10
spice-protocol/spice-protocol.pc.in
Normal file
@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
includedir=@includedir@
|
||||
datadir=${prefix}/share
|
||||
|
||||
Name: spice-protocol
|
||||
Description: SPICE protocol headers
|
||||
Version: @VERSION@
|
||||
|
||||
Libs:
|
||||
Cflags: -I${includedir}/spice-1
|
26
spice-protocol/spice/Makefile.am
Normal file
26
spice-protocol/spice/Makefile.am
Normal file
@ -0,0 +1,26 @@
|
||||
NULL =
|
||||
|
||||
spice_protocol_includedir = $(includedir)/spice-1/spice
|
||||
|
||||
spice_protocol_include_HEADERS = \
|
||||
barrier.h \
|
||||
controller_prot.h \
|
||||
end-packed.h \
|
||||
enums.h \
|
||||
foreign_menu_prot.h \
|
||||
ipc_ring.h \
|
||||
macros.h \
|
||||
protocol.h \
|
||||
qxl_dev.h \
|
||||
qxl_windows.h \
|
||||
start-packed.h \
|
||||
stats.h \
|
||||
types.h \
|
||||
vd_agent.h \
|
||||
vdi_dev.h \
|
||||
stream-device.h \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = meson.build
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
50
spice-protocol/spice/barrier.h
Normal file
50
spice-protocol/spice/barrier.h
Normal file
@ -0,0 +1,50 @@
|
||||
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_BARRIER
|
||||
#define _H_SPICE_BARRIER
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define spice_mb() __sync_synchronize ()
|
||||
|
||||
#else
|
||||
|
||||
#ifdef _WIN64
|
||||
//__asm not supported on _WIN64, so use macro instead.
|
||||
#define spice_mb MemoryBarrier
|
||||
#else
|
||||
#define spice_mb() __asm {lock add [esp], 0}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _H_SPICE_BARRIER */
|
125
spice-protocol/spice/controller_prot.h
Normal file
125
spice-protocol/spice/controller_prot.h
Normal file
@ -0,0 +1,125 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _H_CONTROLLER_PROT
|
||||
#define _H_CONTROLLER_PROT
|
||||
|
||||
#include <spice/macros.h>
|
||||
#include <spice/types.h>
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define CONTROLLER_MAGIC SPICE_MAGIC_CONST("CTRL")
|
||||
#define CONTROLLER_VERSION 1
|
||||
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED ControllerInitHeader {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
uint32_t size;
|
||||
} ControllerInitHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED ControllerInit {
|
||||
ControllerInitHeader base;
|
||||
uint64_t credentials;
|
||||
uint32_t flags;
|
||||
} ControllerInit;
|
||||
|
||||
enum {
|
||||
CONTROLLER_FLAG_EXCLUSIVE = 1 << 0,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED ControllerMsg {
|
||||
uint32_t id;
|
||||
uint32_t size;
|
||||
} ControllerMsg;
|
||||
|
||||
enum {
|
||||
//external app -> spice client
|
||||
CONTROLLER_HOST = 1,
|
||||
CONTROLLER_PORT,
|
||||
CONTROLLER_SPORT,
|
||||
CONTROLLER_PASSWORD,
|
||||
|
||||
CONTROLLER_SECURE_CHANNELS,
|
||||
CONTROLLER_DISABLE_CHANNELS,
|
||||
|
||||
CONTROLLER_TLS_CIPHERS,
|
||||
CONTROLLER_CA_FILE,
|
||||
CONTROLLER_HOST_SUBJECT,
|
||||
|
||||
CONTROLLER_FULL_SCREEN,
|
||||
CONTROLLER_SET_TITLE,
|
||||
|
||||
CONTROLLER_CREATE_MENU,
|
||||
CONTROLLER_DELETE_MENU,
|
||||
|
||||
CONTROLLER_HOTKEYS,
|
||||
CONTROLLER_SEND_CAD,
|
||||
|
||||
CONTROLLER_CONNECT,
|
||||
CONTROLLER_SHOW,
|
||||
CONTROLLER_HIDE,
|
||||
|
||||
CONTROLLER_ENABLE_SMARTCARD,
|
||||
|
||||
CONTROLLER_COLOR_DEPTH,
|
||||
CONTROLLER_DISABLE_EFFECTS,
|
||||
|
||||
CONTROLLER_ENABLE_USB,
|
||||
CONTROLLER_ENABLE_USB_AUTOSHARE,
|
||||
CONTROLLER_USB_FILTER,
|
||||
|
||||
CONTROLLER_PROXY,
|
||||
|
||||
//spice client -> external app
|
||||
CONTROLLER_MENU_ITEM_CLICK = 1001,
|
||||
};
|
||||
|
||||
#define CONTROLLER_TRUE (1 << 0)
|
||||
|
||||
enum {
|
||||
CONTROLLER_SET_FULL_SCREEN = CONTROLLER_TRUE,
|
||||
CONTROLLER_AUTO_DISPLAY_RES = 1 << 1,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED ControllerValue {
|
||||
ControllerMsg base;
|
||||
uint32_t value;
|
||||
} ControllerValue;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED ControllerData {
|
||||
ControllerMsg base;
|
||||
uint8_t data[0];
|
||||
} ControllerData;
|
||||
|
||||
#define CONTROLLER_MENU_ITEM_DELIMITER "\n"
|
||||
#define CONTROLLER_MENU_PARAM_DELIMITER "\r"
|
||||
|
||||
enum {
|
||||
CONTROLLER_MENU_FLAGS_SEPARATOR = 1 << 0,
|
||||
CONTROLLER_MENU_FLAGS_DISABLED = 1 << 1,
|
||||
CONTROLLER_MENU_FLAGS_POPUP = 1 << 2,
|
||||
CONTROLLER_MENU_FLAGS_CHECKED = 1 << 3,
|
||||
CONTROLLER_MENU_FLAGS_GRAYED = 1 << 4,
|
||||
};
|
||||
|
||||
#define SPICE_MENU_INTERNAL_ID_BASE 0x1300
|
||||
#define SPICE_MENU_INTERNAL_ID_SHIFT 8
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif
|
39
spice-protocol/spice/end-packed.h
Normal file
39
spice-protocol/spice/end-packed.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* See start-packed.h for details */
|
||||
|
||||
#undef SPICE_ATTR_PACKED
|
||||
#undef SPICE_ATTR_ALIGNED
|
||||
|
||||
#if defined(__MINGW32__) || !defined(__GNUC__)
|
||||
#pragma pack(pop)
|
||||
#endif
|
686
spice-protocol/spice/enums.h
Normal file
686
spice-protocol/spice/enums.h
Normal file
@ -0,0 +1,686 @@
|
||||
/* this is a file autogenerated by spice_codegen.py */
|
||||
/*
|
||||
Copyright (C) 2013 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_ENUMS
|
||||
#define _H_SPICE_ENUMS
|
||||
|
||||
typedef enum SpiceLinkErr {
|
||||
SPICE_LINK_ERR_OK,
|
||||
SPICE_LINK_ERR_ERROR,
|
||||
SPICE_LINK_ERR_INVALID_MAGIC,
|
||||
SPICE_LINK_ERR_INVALID_DATA,
|
||||
SPICE_LINK_ERR_VERSION_MISMATCH,
|
||||
SPICE_LINK_ERR_NEED_SECURED,
|
||||
SPICE_LINK_ERR_NEED_UNSECURED,
|
||||
SPICE_LINK_ERR_PERMISSION_DENIED,
|
||||
SPICE_LINK_ERR_BAD_CONNECTION_ID,
|
||||
SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE,
|
||||
|
||||
SPICE_LINK_ERR_ENUM_END
|
||||
} SpiceLinkErr;
|
||||
|
||||
typedef enum SpiceWarnCode {
|
||||
SPICE_WARN_GENERAL,
|
||||
|
||||
SPICE_WARN_CODE_ENUM_END
|
||||
} SpiceWarnCode;
|
||||
|
||||
typedef enum SpiceInfoCode {
|
||||
SPICE_INFO_GENERAL,
|
||||
|
||||
SPICE_INFO_CODE_ENUM_END
|
||||
} SpiceInfoCode;
|
||||
|
||||
typedef enum SpiceMigrateFlags {
|
||||
SPICE_MIGRATE_NEED_FLUSH = (1 << 0),
|
||||
SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1),
|
||||
|
||||
SPICE_MIGRATE_FLAGS_MASK = 0x3
|
||||
} SpiceMigrateFlags;
|
||||
|
||||
typedef enum SpiceCompositeFlags {
|
||||
SPICE_COMPOSITE_OP0 = (1 << 0),
|
||||
SPICE_COMPOSITE_OP1 = (1 << 1),
|
||||
SPICE_COMPOSITE_OP2 = (1 << 2),
|
||||
SPICE_COMPOSITE_OP3 = (1 << 3),
|
||||
SPICE_COMPOSITE_OP4 = (1 << 4),
|
||||
SPICE_COMPOSITE_OP5 = (1 << 5),
|
||||
SPICE_COMPOSITE_OP6 = (1 << 6),
|
||||
SPICE_COMPOSITE_OP7 = (1 << 7),
|
||||
SPICE_COMPOSITE_SRC_FILTER0 = (1 << 8),
|
||||
SPICE_COMPOSITE_SRC_FILTER1 = (1 << 9),
|
||||
SPICE_COMPOSITE_SRC_FILTER2 = (1 << 10),
|
||||
SPICE_COMPOSITE_MASK_FILTER0 = (1 << 11),
|
||||
SPICE_COMPOSITE_MASK_FITLER1 = (1 << 12),
|
||||
SPICE_COMPOSITE_MASK_FILTER2 = (1 << 13),
|
||||
SPICE_COMPOSITE_SRC_REPEAT0 = (1 << 14),
|
||||
SPICE_COMPOSITE_SRC_REPEAT1 = (1 << 15),
|
||||
SPICE_COMPOSITE_MASK_REPEAT0 = (1 << 16),
|
||||
SPICE_COMPOSITE_MASK_REPEAT1 = (1 << 17),
|
||||
SPICE_COMPOSITE_COMPONENT_ALPHA = (1 << 18),
|
||||
SPICE_COMPOSITE_HAS_MASK = (1 << 19),
|
||||
SPICE_COMPOSITE_HAS_SRC_TRANSFORM = (1 << 20),
|
||||
SPICE_COMPOSITE_HAS_MASK_TRANSFORM = (1 << 21),
|
||||
SPICE_COMPOSITE_SOURCE_OPAQUE = (1 << 22),
|
||||
SPICE_COMPOSITE_MASK_OPAQUE = (1 << 23),
|
||||
SPICE_COMPOSITE_DEST_OPAQUE = (1 << 24),
|
||||
|
||||
SPICE_COMPOSITE_FLAGS_MASK = 0x1ffffff
|
||||
} SpiceCompositeFlags;
|
||||
|
||||
typedef enum SpiceNotifySeverity {
|
||||
SPICE_NOTIFY_SEVERITY_INFO,
|
||||
SPICE_NOTIFY_SEVERITY_WARN,
|
||||
SPICE_NOTIFY_SEVERITY_ERROR,
|
||||
|
||||
SPICE_NOTIFY_SEVERITY_ENUM_END
|
||||
} SpiceNotifySeverity;
|
||||
|
||||
typedef enum SpiceNotifyVisibility {
|
||||
SPICE_NOTIFY_VISIBILITY_LOW,
|
||||
SPICE_NOTIFY_VISIBILITY_MEDIUM,
|
||||
SPICE_NOTIFY_VISIBILITY_HIGH,
|
||||
|
||||
SPICE_NOTIFY_VISIBILITY_ENUM_END
|
||||
} SpiceNotifyVisibility;
|
||||
|
||||
typedef enum SpiceMouseMode {
|
||||
SPICE_MOUSE_MODE_SERVER = (1 << 0),
|
||||
SPICE_MOUSE_MODE_CLIENT = (1 << 1),
|
||||
|
||||
SPICE_MOUSE_MODE_MASK = 0x3
|
||||
} SpiceMouseMode;
|
||||
|
||||
typedef enum SpicePubkeyType {
|
||||
SPICE_PUBKEY_TYPE_INVALID,
|
||||
SPICE_PUBKEY_TYPE_RSA,
|
||||
SPICE_PUBKEY_TYPE_RSA2,
|
||||
SPICE_PUBKEY_TYPE_DSA,
|
||||
SPICE_PUBKEY_TYPE_DSA1,
|
||||
SPICE_PUBKEY_TYPE_DSA2,
|
||||
SPICE_PUBKEY_TYPE_DSA3,
|
||||
SPICE_PUBKEY_TYPE_DSA4,
|
||||
SPICE_PUBKEY_TYPE_DH,
|
||||
SPICE_PUBKEY_TYPE_EC,
|
||||
|
||||
SPICE_PUBKEY_TYPE_ENUM_END
|
||||
} SpicePubkeyType;
|
||||
|
||||
typedef enum SpiceDataCompressionType {
|
||||
SPICE_DATA_COMPRESSION_TYPE_NONE,
|
||||
SPICE_DATA_COMPRESSION_TYPE_LZ4,
|
||||
|
||||
SPICE_DATA_COMPRESSION_TYPE_ENUM_END
|
||||
} SpiceDataCompressionType;
|
||||
|
||||
typedef enum SpiceClipType {
|
||||
SPICE_CLIP_TYPE_NONE,
|
||||
SPICE_CLIP_TYPE_RECTS,
|
||||
|
||||
SPICE_CLIP_TYPE_ENUM_END
|
||||
} SpiceClipType;
|
||||
|
||||
typedef enum SpicePathFlags {
|
||||
SPICE_PATH_BEGIN = (1 << 0),
|
||||
SPICE_PATH_END = (1 << 1),
|
||||
SPICE_PATH_CLOSE = (1 << 3),
|
||||
SPICE_PATH_BEZIER = (1 << 4),
|
||||
|
||||
SPICE_PATH_FLAGS_MASK = 0x1b
|
||||
} SpicePathFlags;
|
||||
|
||||
typedef enum SpiceVideoCodecType {
|
||||
SPICE_VIDEO_CODEC_TYPE_MJPEG = 1,
|
||||
SPICE_VIDEO_CODEC_TYPE_VP8,
|
||||
SPICE_VIDEO_CODEC_TYPE_H264,
|
||||
SPICE_VIDEO_CODEC_TYPE_VP9,
|
||||
SPICE_VIDEO_CODEC_TYPE_H265,
|
||||
|
||||
SPICE_VIDEO_CODEC_TYPE_ENUM_END
|
||||
} SpiceVideoCodecType;
|
||||
|
||||
typedef enum SpiceStreamFlags {
|
||||
SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0),
|
||||
|
||||
SPICE_STREAM_FLAGS_MASK = 0x1
|
||||
} SpiceStreamFlags;
|
||||
|
||||
typedef enum SpiceBrushType {
|
||||
SPICE_BRUSH_TYPE_NONE,
|
||||
SPICE_BRUSH_TYPE_SOLID,
|
||||
SPICE_BRUSH_TYPE_PATTERN,
|
||||
|
||||
SPICE_BRUSH_TYPE_ENUM_END
|
||||
} SpiceBrushType;
|
||||
|
||||
typedef enum SpiceMaskFlags {
|
||||
SPICE_MASK_FLAGS_INVERS = (1 << 0),
|
||||
|
||||
SPICE_MASK_FLAGS_MASK = 0x1
|
||||
} SpiceMaskFlags;
|
||||
|
||||
typedef enum SpiceImageType {
|
||||
SPICE_IMAGE_TYPE_BITMAP,
|
||||
SPICE_IMAGE_TYPE_QUIC,
|
||||
SPICE_IMAGE_TYPE_RESERVED,
|
||||
SPICE_IMAGE_TYPE_LZ_PLT = 100,
|
||||
SPICE_IMAGE_TYPE_LZ_RGB,
|
||||
SPICE_IMAGE_TYPE_GLZ_RGB,
|
||||
SPICE_IMAGE_TYPE_FROM_CACHE,
|
||||
SPICE_IMAGE_TYPE_SURFACE,
|
||||
SPICE_IMAGE_TYPE_JPEG,
|
||||
SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS,
|
||||
SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB,
|
||||
SPICE_IMAGE_TYPE_JPEG_ALPHA,
|
||||
SPICE_IMAGE_TYPE_LZ4,
|
||||
|
||||
SPICE_IMAGE_TYPE_ENUM_END
|
||||
} SpiceImageType;
|
||||
|
||||
typedef enum SpiceImageCompression {
|
||||
SPICE_IMAGE_COMPRESSION_INVALID,
|
||||
SPICE_IMAGE_COMPRESSION_OFF,
|
||||
SPICE_IMAGE_COMPRESSION_AUTO_GLZ,
|
||||
SPICE_IMAGE_COMPRESSION_AUTO_LZ,
|
||||
SPICE_IMAGE_COMPRESSION_QUIC,
|
||||
SPICE_IMAGE_COMPRESSION_GLZ,
|
||||
SPICE_IMAGE_COMPRESSION_LZ,
|
||||
SPICE_IMAGE_COMPRESSION_LZ4,
|
||||
|
||||
SPICE_IMAGE_COMPRESSION_ENUM_END
|
||||
} SpiceImageCompression;
|
||||
|
||||
typedef enum SpiceImageFlags {
|
||||
SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0),
|
||||
SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1),
|
||||
SPICE_IMAGE_FLAGS_CACHE_REPLACE_ME = (1 << 2),
|
||||
|
||||
SPICE_IMAGE_FLAGS_MASK = 0x7
|
||||
} SpiceImageFlags;
|
||||
|
||||
typedef enum SpiceBitmapFmt {
|
||||
SPICE_BITMAP_FMT_INVALID,
|
||||
SPICE_BITMAP_FMT_1BIT_LE,
|
||||
SPICE_BITMAP_FMT_1BIT_BE,
|
||||
SPICE_BITMAP_FMT_4BIT_LE,
|
||||
SPICE_BITMAP_FMT_4BIT_BE,
|
||||
SPICE_BITMAP_FMT_8BIT,
|
||||
SPICE_BITMAP_FMT_16BIT,
|
||||
SPICE_BITMAP_FMT_24BIT,
|
||||
SPICE_BITMAP_FMT_32BIT,
|
||||
SPICE_BITMAP_FMT_RGBA,
|
||||
SPICE_BITMAP_FMT_8BIT_A,
|
||||
|
||||
SPICE_BITMAP_FMT_ENUM_END
|
||||
} SpiceBitmapFmt;
|
||||
|
||||
typedef enum SpiceBitmapFlags {
|
||||
SPICE_BITMAP_FLAGS_PAL_CACHE_ME = (1 << 0),
|
||||
SPICE_BITMAP_FLAGS_PAL_FROM_CACHE = (1 << 1),
|
||||
SPICE_BITMAP_FLAGS_TOP_DOWN = (1 << 2),
|
||||
|
||||
SPICE_BITMAP_FLAGS_MASK = 0x7
|
||||
} SpiceBitmapFlags;
|
||||
|
||||
typedef enum SpiceJpegAlphaFlags {
|
||||
SPICE_JPEG_ALPHA_FLAGS_TOP_DOWN = (1 << 0),
|
||||
|
||||
SPICE_JPEG_ALPHA_FLAGS_MASK = 0x1
|
||||
} SpiceJpegAlphaFlags;
|
||||
|
||||
typedef enum SpiceImageScaleMode {
|
||||
SPICE_IMAGE_SCALE_MODE_INTERPOLATE,
|
||||
SPICE_IMAGE_SCALE_MODE_NEAREST,
|
||||
|
||||
SPICE_IMAGE_SCALE_MODE_ENUM_END
|
||||
} SpiceImageScaleMode;
|
||||
|
||||
typedef enum SpiceRopd {
|
||||
SPICE_ROPD_INVERS_SRC = (1 << 0),
|
||||
SPICE_ROPD_INVERS_BRUSH = (1 << 1),
|
||||
SPICE_ROPD_INVERS_DEST = (1 << 2),
|
||||
SPICE_ROPD_OP_PUT = (1 << 3),
|
||||
SPICE_ROPD_OP_OR = (1 << 4),
|
||||
SPICE_ROPD_OP_AND = (1 << 5),
|
||||
SPICE_ROPD_OP_XOR = (1 << 6),
|
||||
SPICE_ROPD_OP_BLACKNESS = (1 << 7),
|
||||
SPICE_ROPD_OP_WHITENESS = (1 << 8),
|
||||
SPICE_ROPD_OP_INVERS = (1 << 9),
|
||||
SPICE_ROPD_INVERS_RES = (1 << 10),
|
||||
|
||||
SPICE_ROPD_MASK = 0x7ff
|
||||
} SpiceRopd;
|
||||
|
||||
typedef enum SpiceLineFlags {
|
||||
SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2),
|
||||
SPICE_LINE_FLAGS_STYLED = (1 << 3),
|
||||
|
||||
SPICE_LINE_FLAGS_MASK = 0xc
|
||||
} SpiceLineFlags;
|
||||
|
||||
typedef enum SpiceStringFlags {
|
||||
SPICE_STRING_FLAGS_RASTER_A1 = (1 << 0),
|
||||
SPICE_STRING_FLAGS_RASTER_A4 = (1 << 1),
|
||||
SPICE_STRING_FLAGS_RASTER_A8 = (1 << 2),
|
||||
SPICE_STRING_FLAGS_RASTER_TOP_DOWN = (1 << 3),
|
||||
|
||||
SPICE_STRING_FLAGS_MASK = 0xf
|
||||
} SpiceStringFlags;
|
||||
|
||||
typedef enum SpiceSurfaceFlags {
|
||||
SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0),
|
||||
SPICE_SURFACE_FLAGS_STREAMING_MODE = (1 << 1),
|
||||
|
||||
SPICE_SURFACE_FLAGS_MASK = 0x3
|
||||
} SpiceSurfaceFlags;
|
||||
|
||||
typedef enum SpiceSurfaceFmt {
|
||||
SPICE_SURFACE_FMT_INVALID,
|
||||
SPICE_SURFACE_FMT_1_A,
|
||||
SPICE_SURFACE_FMT_8_A = 8,
|
||||
SPICE_SURFACE_FMT_16_555 = 16,
|
||||
SPICE_SURFACE_FMT_32_xRGB = 32,
|
||||
SPICE_SURFACE_FMT_16_565 = 80,
|
||||
SPICE_SURFACE_FMT_32_ARGB = 96,
|
||||
|
||||
SPICE_SURFACE_FMT_ENUM_END
|
||||
} SpiceSurfaceFmt;
|
||||
|
||||
typedef enum SpiceAlphaFlags {
|
||||
SPICE_ALPHA_FLAGS_DEST_HAS_ALPHA = (1 << 0),
|
||||
SPICE_ALPHA_FLAGS_SRC_SURFACE_HAS_ALPHA = (1 << 1),
|
||||
|
||||
SPICE_ALPHA_FLAGS_MASK = 0x3
|
||||
} SpiceAlphaFlags;
|
||||
|
||||
typedef enum SpiceResourceType {
|
||||
SPICE_RES_TYPE_INVALID,
|
||||
SPICE_RES_TYPE_PIXMAP,
|
||||
|
||||
SPICE_RESOURCE_TYPE_ENUM_END
|
||||
} SpiceResourceType;
|
||||
|
||||
typedef enum SpiceGlScanoutFlags {
|
||||
SPICE_GL_SCANOUT_FLAGS_Y0TOP = (1 << 0),
|
||||
|
||||
SPICE_GL_SCANOUT_FLAGS_MASK = 0x1
|
||||
} SpiceGlScanoutFlags;
|
||||
|
||||
typedef enum SpiceKeyboardModifierFlags {
|
||||
SPICE_KEYBOARD_MODIFIER_FLAGS_SCROLL_LOCK = (1 << 0),
|
||||
SPICE_KEYBOARD_MODIFIER_FLAGS_NUM_LOCK = (1 << 1),
|
||||
SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK = (1 << 2),
|
||||
|
||||
SPICE_KEYBOARD_MODIFIER_FLAGS_MASK = 0x7
|
||||
} SpiceKeyboardModifierFlags;
|
||||
|
||||
typedef enum SpiceMouseButton {
|
||||
SPICE_MOUSE_BUTTON_INVALID,
|
||||
SPICE_MOUSE_BUTTON_LEFT,
|
||||
SPICE_MOUSE_BUTTON_MIDDLE,
|
||||
SPICE_MOUSE_BUTTON_RIGHT,
|
||||
SPICE_MOUSE_BUTTON_UP,
|
||||
SPICE_MOUSE_BUTTON_DOWN,
|
||||
|
||||
SPICE_MOUSE_BUTTON_ENUM_END
|
||||
} SpiceMouseButton;
|
||||
|
||||
typedef enum SpiceMouseButtonMask {
|
||||
SPICE_MOUSE_BUTTON_MASK_LEFT = (1 << 0),
|
||||
SPICE_MOUSE_BUTTON_MASK_MIDDLE = (1 << 1),
|
||||
SPICE_MOUSE_BUTTON_MASK_RIGHT = (1 << 2),
|
||||
|
||||
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7
|
||||
} SpiceMouseButtonMask;
|
||||
|
||||
typedef enum SpiceCursorType {
|
||||
SPICE_CURSOR_TYPE_ALPHA,
|
||||
SPICE_CURSOR_TYPE_MONO,
|
||||
SPICE_CURSOR_TYPE_COLOR4,
|
||||
SPICE_CURSOR_TYPE_COLOR8,
|
||||
SPICE_CURSOR_TYPE_COLOR16,
|
||||
SPICE_CURSOR_TYPE_COLOR24,
|
||||
SPICE_CURSOR_TYPE_COLOR32,
|
||||
|
||||
SPICE_CURSOR_TYPE_ENUM_END
|
||||
} SpiceCursorType;
|
||||
|
||||
typedef enum SpiceCursorFlags {
|
||||
SPICE_CURSOR_FLAGS_NONE = (1 << 0),
|
||||
SPICE_CURSOR_FLAGS_CACHE_ME = (1 << 1),
|
||||
SPICE_CURSOR_FLAGS_FROM_CACHE = (1 << 2),
|
||||
|
||||
SPICE_CURSOR_FLAGS_MASK = 0x7
|
||||
} SpiceCursorFlags;
|
||||
|
||||
typedef enum SpiceAudioDataMode {
|
||||
SPICE_AUDIO_DATA_MODE_INVALID,
|
||||
SPICE_AUDIO_DATA_MODE_RAW,
|
||||
SPICE_AUDIO_DATA_MODE_CELT_0_5_1,
|
||||
SPICE_AUDIO_DATA_MODE_OPUS,
|
||||
|
||||
SPICE_AUDIO_DATA_MODE_ENUM_END
|
||||
} SpiceAudioDataMode;
|
||||
|
||||
typedef enum SpiceAudioFmt {
|
||||
SPICE_AUDIO_FMT_INVALID,
|
||||
SPICE_AUDIO_FMT_S16,
|
||||
|
||||
SPICE_AUDIO_FMT_ENUM_END
|
||||
} SpiceAudioFmt;
|
||||
|
||||
typedef enum SpiceTunnelServiceType {
|
||||
SPICE_TUNNEL_SERVICE_TYPE_INVALID,
|
||||
SPICE_TUNNEL_SERVICE_TYPE_GENERIC,
|
||||
SPICE_TUNNEL_SERVICE_TYPE_IPP,
|
||||
|
||||
SPICE_TUNNEL_SERVICE_TYPE_ENUM_END
|
||||
} SpiceTunnelServiceType;
|
||||
|
||||
typedef enum SpiceTunnelIpType {
|
||||
SPICE_TUNNEL_IP_TYPE_INVALID,
|
||||
SPICE_TUNNEL_IP_TYPE_IPv4,
|
||||
|
||||
SPICE_TUNNEL_IP_TYPE_ENUM_END
|
||||
} SpiceTunnelIpType;
|
||||
|
||||
typedef enum SpiceVscMessageType {
|
||||
SPICE_VSC_MESSAGE_TYPE_Init = 1,
|
||||
SPICE_VSC_MESSAGE_TYPE_Error,
|
||||
SPICE_VSC_MESSAGE_TYPE_ReaderAdd,
|
||||
SPICE_VSC_MESSAGE_TYPE_ReaderRemove,
|
||||
SPICE_VSC_MESSAGE_TYPE_ATR,
|
||||
SPICE_VSC_MESSAGE_TYPE_CardRemove,
|
||||
SPICE_VSC_MESSAGE_TYPE_APDU,
|
||||
SPICE_VSC_MESSAGE_TYPE_Flush,
|
||||
SPICE_VSC_MESSAGE_TYPE_FlushComplete,
|
||||
|
||||
SPICE_VSC_MESSAGE_TYPE_ENUM_END
|
||||
} SpiceVscMessageType;
|
||||
|
||||
enum {
|
||||
SPICE_CHANNEL_MAIN = 1,
|
||||
SPICE_CHANNEL_DISPLAY,
|
||||
SPICE_CHANNEL_INPUTS,
|
||||
SPICE_CHANNEL_CURSOR,
|
||||
SPICE_CHANNEL_PLAYBACK,
|
||||
SPICE_CHANNEL_RECORD,
|
||||
SPICE_CHANNEL_TUNNEL,
|
||||
SPICE_CHANNEL_SMARTCARD,
|
||||
SPICE_CHANNEL_USBREDIR,
|
||||
SPICE_CHANNEL_PORT,
|
||||
SPICE_CHANNEL_WEBDAV,
|
||||
|
||||
SPICE_END_CHANNEL
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_MIGRATE = 1,
|
||||
SPICE_MSG_MIGRATE_DATA,
|
||||
SPICE_MSG_SET_ACK,
|
||||
SPICE_MSG_PING,
|
||||
SPICE_MSG_WAIT_FOR_CHANNELS,
|
||||
SPICE_MSG_DISCONNECTING,
|
||||
SPICE_MSG_NOTIFY,
|
||||
SPICE_MSG_LIST,
|
||||
SPICE_MSG_BASE_LAST = 100,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_ACK_SYNC = 1,
|
||||
SPICE_MSGC_ACK,
|
||||
SPICE_MSGC_PONG,
|
||||
SPICE_MSGC_MIGRATE_FLUSH_MARK,
|
||||
SPICE_MSGC_MIGRATE_DATA,
|
||||
SPICE_MSGC_DISCONNECTING,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_MAIN_MIGRATE_BEGIN = 101,
|
||||
SPICE_MSG_MAIN_MIGRATE_CANCEL,
|
||||
SPICE_MSG_MAIN_INIT,
|
||||
SPICE_MSG_MAIN_CHANNELS_LIST,
|
||||
SPICE_MSG_MAIN_MOUSE_MODE,
|
||||
SPICE_MSG_MAIN_MULTI_MEDIA_TIME,
|
||||
SPICE_MSG_MAIN_AGENT_CONNECTED,
|
||||
SPICE_MSG_MAIN_AGENT_DISCONNECTED,
|
||||
SPICE_MSG_MAIN_AGENT_DATA,
|
||||
SPICE_MSG_MAIN_AGENT_TOKEN,
|
||||
SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST,
|
||||
SPICE_MSG_MAIN_MIGRATE_END,
|
||||
SPICE_MSG_MAIN_NAME,
|
||||
SPICE_MSG_MAIN_UUID,
|
||||
SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS,
|
||||
SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS,
|
||||
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK,
|
||||
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_NACK,
|
||||
|
||||
SPICE_MSG_END_MAIN
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_MAIN_CLIENT_INFO = 101,
|
||||
SPICE_MSGC_MAIN_MIGRATE_CONNECTED,
|
||||
SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR,
|
||||
SPICE_MSGC_MAIN_ATTACH_CHANNELS,
|
||||
SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST,
|
||||
SPICE_MSGC_MAIN_AGENT_START,
|
||||
SPICE_MSGC_MAIN_AGENT_DATA,
|
||||
SPICE_MSGC_MAIN_AGENT_TOKEN,
|
||||
SPICE_MSGC_MAIN_MIGRATE_END,
|
||||
SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS,
|
||||
SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS,
|
||||
|
||||
SPICE_MSGC_END_MAIN
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_DISPLAY_MODE = 101,
|
||||
SPICE_MSG_DISPLAY_MARK,
|
||||
SPICE_MSG_DISPLAY_RESET,
|
||||
SPICE_MSG_DISPLAY_COPY_BITS,
|
||||
SPICE_MSG_DISPLAY_INVAL_LIST,
|
||||
SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS,
|
||||
SPICE_MSG_DISPLAY_INVAL_PALETTE,
|
||||
SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES,
|
||||
SPICE_MSG_DISPLAY_STREAM_CREATE = 122,
|
||||
SPICE_MSG_DISPLAY_STREAM_DATA,
|
||||
SPICE_MSG_DISPLAY_STREAM_CLIP,
|
||||
SPICE_MSG_DISPLAY_STREAM_DESTROY,
|
||||
SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL,
|
||||
SPICE_MSG_DISPLAY_DRAW_FILL = 302,
|
||||
SPICE_MSG_DISPLAY_DRAW_OPAQUE,
|
||||
SPICE_MSG_DISPLAY_DRAW_COPY,
|
||||
SPICE_MSG_DISPLAY_DRAW_BLEND,
|
||||
SPICE_MSG_DISPLAY_DRAW_BLACKNESS,
|
||||
SPICE_MSG_DISPLAY_DRAW_WHITENESS,
|
||||
SPICE_MSG_DISPLAY_DRAW_INVERS,
|
||||
SPICE_MSG_DISPLAY_DRAW_ROP3,
|
||||
SPICE_MSG_DISPLAY_DRAW_STROKE,
|
||||
SPICE_MSG_DISPLAY_DRAW_TEXT,
|
||||
SPICE_MSG_DISPLAY_DRAW_TRANSPARENT,
|
||||
SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND,
|
||||
SPICE_MSG_DISPLAY_SURFACE_CREATE,
|
||||
SPICE_MSG_DISPLAY_SURFACE_DESTROY,
|
||||
SPICE_MSG_DISPLAY_STREAM_DATA_SIZED,
|
||||
SPICE_MSG_DISPLAY_MONITORS_CONFIG,
|
||||
SPICE_MSG_DISPLAY_DRAW_COMPOSITE,
|
||||
SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT,
|
||||
SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX,
|
||||
SPICE_MSG_DISPLAY_GL_DRAW,
|
||||
|
||||
SPICE_MSG_END_DISPLAY
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_DISPLAY_INIT = 101,
|
||||
SPICE_MSGC_DISPLAY_STREAM_REPORT,
|
||||
SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION,
|
||||
SPICE_MSGC_DISPLAY_GL_DRAW_DONE,
|
||||
SPICE_MSGC_DISPLAY_PREFERRED_VIDEO_CODEC_TYPE,
|
||||
|
||||
SPICE_MSGC_END_DISPLAY
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_INPUTS_INIT = 101,
|
||||
SPICE_MSG_INPUTS_KEY_MODIFIERS,
|
||||
SPICE_MSG_INPUTS_MOUSE_MOTION_ACK = 111,
|
||||
|
||||
SPICE_MSG_END_INPUTS
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_INPUTS_KEY_DOWN = 101,
|
||||
SPICE_MSGC_INPUTS_KEY_UP,
|
||||
SPICE_MSGC_INPUTS_KEY_MODIFIERS,
|
||||
SPICE_MSGC_INPUTS_KEY_SCANCODE,
|
||||
SPICE_MSGC_INPUTS_MOUSE_MOTION = 111,
|
||||
SPICE_MSGC_INPUTS_MOUSE_POSITION,
|
||||
SPICE_MSGC_INPUTS_MOUSE_PRESS,
|
||||
SPICE_MSGC_INPUTS_MOUSE_RELEASE,
|
||||
|
||||
SPICE_MSGC_END_INPUTS
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_CURSOR_INIT = 101,
|
||||
SPICE_MSG_CURSOR_RESET,
|
||||
SPICE_MSG_CURSOR_SET,
|
||||
SPICE_MSG_CURSOR_MOVE,
|
||||
SPICE_MSG_CURSOR_HIDE,
|
||||
SPICE_MSG_CURSOR_TRAIL,
|
||||
SPICE_MSG_CURSOR_INVAL_ONE,
|
||||
SPICE_MSG_CURSOR_INVAL_ALL,
|
||||
|
||||
SPICE_MSG_END_CURSOR
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_PLAYBACK_DATA = 101,
|
||||
SPICE_MSG_PLAYBACK_MODE,
|
||||
SPICE_MSG_PLAYBACK_START,
|
||||
SPICE_MSG_PLAYBACK_STOP,
|
||||
SPICE_MSG_PLAYBACK_VOLUME,
|
||||
SPICE_MSG_PLAYBACK_MUTE,
|
||||
SPICE_MSG_PLAYBACK_LATENCY,
|
||||
|
||||
SPICE_MSG_END_PLAYBACK
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_RECORD_START = 101,
|
||||
SPICE_MSG_RECORD_STOP,
|
||||
SPICE_MSG_RECORD_VOLUME,
|
||||
SPICE_MSG_RECORD_MUTE,
|
||||
|
||||
SPICE_MSG_END_RECORD
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_RECORD_DATA = 101,
|
||||
SPICE_MSGC_RECORD_MODE,
|
||||
SPICE_MSGC_RECORD_START_MARK,
|
||||
|
||||
SPICE_MSGC_END_RECORD
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_TUNNEL_INIT = 101,
|
||||
SPICE_MSG_TUNNEL_SERVICE_IP_MAP,
|
||||
SPICE_MSG_TUNNEL_SOCKET_OPEN,
|
||||
SPICE_MSG_TUNNEL_SOCKET_FIN,
|
||||
SPICE_MSG_TUNNEL_SOCKET_CLOSE,
|
||||
SPICE_MSG_TUNNEL_SOCKET_DATA,
|
||||
SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK,
|
||||
SPICE_MSG_TUNNEL_SOCKET_TOKEN,
|
||||
|
||||
SPICE_MSG_END_TUNNEL
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_TUNNEL_SERVICE_ADD = 101,
|
||||
SPICE_MSGC_TUNNEL_SERVICE_REMOVE,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_FIN,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_CLOSED,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_DATA,
|
||||
SPICE_MSGC_TUNNEL_SOCKET_TOKEN,
|
||||
|
||||
SPICE_MSGC_END_TUNNEL
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_SMARTCARD_DATA = 101,
|
||||
|
||||
SPICE_MSG_END_SMARTCARD
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_SMARTCARD_DATA = 101,
|
||||
SPICE_MSGC_SMARTCARD_HEADER = 101,
|
||||
SPICE_MSGC_SMARTCARD_ERROR = 101,
|
||||
SPICE_MSGC_SMARTCARD_ATR = 101,
|
||||
SPICE_MSGC_SMARTCARD_READER_ADD = 101,
|
||||
|
||||
SPICE_MSGC_END_SMARTCARD
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_SPICEVMC_DATA = 101,
|
||||
SPICE_MSG_SPICEVMC_COMPRESSED_DATA,
|
||||
|
||||
SPICE_MSG_END_SPICEVMC
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_SPICEVMC_DATA = 101,
|
||||
SPICE_MSGC_SPICEVMC_COMPRESSED_DATA,
|
||||
|
||||
SPICE_MSGC_END_SPICEVMC
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSG_PORT_INIT = 201,
|
||||
SPICE_MSG_PORT_EVENT,
|
||||
|
||||
SPICE_MSG_END_PORT
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MSGC_PORT_EVENT = 201,
|
||||
|
||||
SPICE_MSGC_END_PORT
|
||||
};
|
||||
|
||||
#endif /* _H_SPICE_ENUMS */
|
105
spice-protocol/spice/foreign_menu_prot.h
Normal file
105
spice-protocol/spice/foreign_menu_prot.h
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _H_FOREIGN_MENU_PROT
|
||||
#define _H_FOREIGN_MENU_PROT
|
||||
|
||||
#include <spice/macros.h>
|
||||
#include <spice/types.h>
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define FOREIGN_MENU_MAGIC SPICE_MAGIC_CONST("FRGM")
|
||||
#define FOREIGN_MENU_VERSION 1
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuInitHeader {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
uint32_t size;
|
||||
} FrgMenuInitHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuInit {
|
||||
FrgMenuInitHeader base;
|
||||
uint64_t credentials;
|
||||
uint8_t title[0]; //UTF8
|
||||
} FrgMenuInit;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuMsg {
|
||||
uint32_t id;
|
||||
uint32_t size;
|
||||
} FrgMenuMsg;
|
||||
|
||||
enum {
|
||||
//external app -> spice client
|
||||
FOREIGN_MENU_SET_TITLE = 1,
|
||||
FOREIGN_MENU_ADD_ITEM,
|
||||
FOREIGN_MENU_MODIFY_ITEM,
|
||||
FOREIGN_MENU_REMOVE_ITEM,
|
||||
FOREIGN_MENU_CLEAR,
|
||||
|
||||
//spice client -> external app
|
||||
FOREIGN_MENU_ITEM_EVENT = 1001,
|
||||
FOREIGN_MENU_APP_ACTIVATED,
|
||||
FOREIGN_MENU_APP_DEACTIVATED,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuSetTitle {
|
||||
FrgMenuMsg base;
|
||||
uint8_t string[0]; //UTF8
|
||||
} FrgMenuSetTitle;
|
||||
|
||||
enum {
|
||||
FOREIGN_MENU_ITEM_TYPE_CHECKED = 1 << 0,
|
||||
FOREIGN_MENU_ITEM_TYPE_DIM = 1 << 1,
|
||||
FOREIGN_MENU_ITEM_TYPE_SEPARATOR = 1 << 2
|
||||
};
|
||||
|
||||
#define FOREIGN_MENU_INVALID_ID 0
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuAddItem {
|
||||
FrgMenuMsg base;
|
||||
uint32_t id;
|
||||
uint32_t type;
|
||||
uint32_t position;
|
||||
uint8_t string[0]; //UTF8
|
||||
} FrgMenuAddItem, FrgMenuModItem;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuRmItem {
|
||||
FrgMenuMsg base;
|
||||
uint32_t id;
|
||||
} FrgMenuRmItem;
|
||||
|
||||
typedef struct FrgMenuMsg FrgMenuRmItems;
|
||||
typedef struct FrgMenuMsg FrgMenuDelete;
|
||||
|
||||
enum {
|
||||
FOREIGN_MENU_EVENT_CLICK,
|
||||
FOREIGN_MENU_EVENT_CHECKED,
|
||||
FOREIGN_MENU_EVENT_UNCHECKED
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED FrgMenuEvent {
|
||||
FrgMenuMsg base;
|
||||
uint32_t id;
|
||||
uint32_t action; //FOREIGN_MENU_EVENT_?
|
||||
} FrgMenuEvent;
|
||||
|
||||
typedef struct FrgMenuMsg FrgMenuActivate;
|
||||
typedef struct FrgMenuMsg FrgMenuDeactivate;
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif
|
136
spice-protocol/spice/ipc_ring.h
Normal file
136
spice-protocol/spice/ipc_ring.h
Normal file
@ -0,0 +1,136 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _H_SPICE_RING
|
||||
#define _H_SPICE_RING
|
||||
|
||||
#include <spice/types.h>
|
||||
|
||||
#define _SPICE_MSB_MASK4(x) \
|
||||
(((x) & 0x8) ? 0x8 : \
|
||||
((x) & 0x4) ? 0x4 : \
|
||||
((x) & 0x2) ? 0x2 : \
|
||||
((x) & 0x1) ? 0x1 : 0)
|
||||
|
||||
#define _SPICE_MSB_MASK8(x) \
|
||||
(((x) & 0xf0) ? _SPICE_MSB_MASK4((x) >> 4) << 4 : _SPICE_MSB_MASK4(x))
|
||||
|
||||
#define _SPICE_MSB_MASK16(x) \
|
||||
(((x) & 0xff00) ? _SPICE_MSB_MASK8((x) >> 8) << 8 : _SPICE_MSB_MASK8(x))
|
||||
|
||||
#define _SPICE_MSB_MASK(x) \
|
||||
(((x) & 0xffff0000) ? _SPICE_MSB_MASK16((x) >> 16) << 16 : _SPICE_MSB_MASK16(x))
|
||||
|
||||
#define _SPICE_POWER2_ALIGN(x) _SPICE_MSB_MASK((x) * 2 - 1)
|
||||
|
||||
|
||||
#define _SPICE_TOSHIFT_4(x) \
|
||||
(((x) & 0x8) ? 3 : \
|
||||
((x) & 0x4) ? 2 : \
|
||||
((x) & 0x2) ? 1 : 0)
|
||||
|
||||
#define _SPICE_TOSHIFT_8(x) \
|
||||
(((x) & 0xf0) ? _SPICE_TOSHIFT_4((x) >> 4) + 4 : _SPICE_TOSHIFT_4(x))
|
||||
|
||||
#define _SPICE_TOSHIFT_16(x) \
|
||||
(((x) & 0xff00) ? _SPICE_TOSHIFT_8((x) >> 8) + 8 : _SPICE_TOSHIFT_8(x))
|
||||
|
||||
#define _SPICE_POWER2_TO_SHIFT(x) \
|
||||
(((x) & 0xffff0000) ? _SPICE_TOSHIFT_16((x) >> 16) + 16 : _SPICE_TOSHIFT_16(x))
|
||||
|
||||
|
||||
|
||||
#define SPICE_RING_DECLARE(name, el_type, size) \
|
||||
typedef struct SPICE_ATTR_PACKED name##_ring_el { \
|
||||
union { \
|
||||
el_type el; \
|
||||
uint8_t data[_SPICE_POWER2_ALIGN(sizeof(el_type))]; \
|
||||
} ; \
|
||||
} name##_ring_el; \
|
||||
\
|
||||
typedef struct SPICE_ATTR_PACKED name { \
|
||||
uint32_t num_items; \
|
||||
uint32_t prod; \
|
||||
uint32_t notify_on_prod; \
|
||||
uint32_t cons; \
|
||||
uint32_t notify_on_cons; \
|
||||
name##_ring_el items[_SPICE_POWER2_ALIGN(size)]; \
|
||||
} name;
|
||||
|
||||
|
||||
#define SPICE_RING_INIT(r) \
|
||||
(r)->num_items = sizeof((r)->items) >> \
|
||||
_SPICE_POWER2_TO_SHIFT(sizeof((r)->items[0])); \
|
||||
(r)->prod = (r)->cons = 0; \
|
||||
(r)->notify_on_prod = 1; \
|
||||
(r)->notify_on_cons = 0;
|
||||
|
||||
|
||||
#define SPICE_RING_INDEX_MASK(r) ((r)->num_items - 1)
|
||||
|
||||
#define SPICE_RING_IS_PACKED(r) (sizeof((r)->items[0]) == sizeof((r)->items[0]).el)
|
||||
|
||||
#define SPICE_RING_IS_EMPTY(r) ((r)->cons == (r)->prod)
|
||||
|
||||
#define SPICE_RING_IS_FULL(r) (((r)->prod - (r)->cons) == (r)->num_items)
|
||||
|
||||
#define SPICE_RING_PROD_ITEM(r) (&(r)->items[(r)->prod & SPICE_RING_INDEX_MASK(r)].el)
|
||||
|
||||
#define SPICE_RING_PROD_WAIT(r, wait) \
|
||||
if (((wait) = SPICE_RING_IS_FULL(r))) { \
|
||||
(r)->notify_on_cons = (r)->cons + 1; \
|
||||
spice_mb(); \
|
||||
(wait) = SPICE_RING_IS_FULL(r); \
|
||||
}
|
||||
|
||||
#define SPICE_RING_PUSH(r, notify) \
|
||||
(r)->prod++; \
|
||||
spice_mb(); \
|
||||
(notify) = (r)->prod == (r)->notify_on_prod;
|
||||
|
||||
|
||||
#define SPICE_RING_CONS_ITEM(r) (&(r)->items[(r)->cons & SPICE_RING_INDEX_MASK(r)].el)
|
||||
|
||||
#define SPICE_RING_CONS_WAIT(r, wait) \
|
||||
if (((wait) = SPICE_RING_IS_EMPTY(r))) { \
|
||||
(r)->notify_on_prod = (r)->prod + 1; \
|
||||
spice_mb(); \
|
||||
(wait) = SPICE_RING_IS_EMPTY(r); \
|
||||
}
|
||||
|
||||
#define SPICE_RING_POP(r, notify) \
|
||||
(r)->cons++; \
|
||||
spice_mb(); \
|
||||
(notify) = (r)->cons == (r)->notify_on_cons;
|
||||
|
||||
|
||||
|
||||
#endif /* _H_SPICE_RING */
|
331
spice-protocol/spice/macros.h
Normal file
331
spice-protocol/spice/macros.h
Normal file
@ -0,0 +1,331 @@
|
||||
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
Copyright (C) 2010 Red Hat, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* This file is to a large extent based on gmacros.h from glib
|
||||
* Which is LGPL and copyright:
|
||||
*
|
||||
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GLib Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_MACROS
|
||||
#define _H_SPICE_MACROS
|
||||
|
||||
/* We include stddef.h to get the system's definition of NULL */
|
||||
#include <stddef.h>
|
||||
|
||||
#include <spice/types.h>
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
#define SPICE_GNUC_PURE __attribute__((__pure__))
|
||||
#define SPICE_GNUC_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
#define SPICE_GNUC_PURE
|
||||
#define SPICE_GNUC_MALLOC
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 4
|
||||
#define SPICE_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
|
||||
#else
|
||||
#define SPICE_GNUC_NULL_TERMINATED
|
||||
#endif
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0 /* Compatibility with non-clang compilers. */
|
||||
#endif
|
||||
|
||||
#if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
|
||||
(defined(__clang__) && __has_feature(__alloc_size__))
|
||||
#define SPICE_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
||||
#define SPICE_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
|
||||
#else
|
||||
#define SPICE_GNUC_ALLOC_SIZE(x)
|
||||
#define SPICE_GNUC_ALLOC_SIZE2(x,y)
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#define SPICE_GNUC_PRINTF( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
||||
#define SPICE_GNUC_SCANF( format_idx, arg_idx ) __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
|
||||
#define SPICE_GNUC_FORMAT( arg_idx ) __attribute__((__format_arg__ (arg_idx)))
|
||||
#define SPICE_GNUC_NORETURN __attribute__((__noreturn__))
|
||||
#define SPICE_GNUC_CONST __attribute__((__const__))
|
||||
#define SPICE_GNUC_UNUSED __attribute__((__unused__))
|
||||
#define SPICE_GNUC_NO_INSTRUMENT __attribute__((__no_instrument_function__))
|
||||
#else /* !__GNUC__ */
|
||||
#define SPICE_GNUC_PRINTF( format_idx, arg_idx )
|
||||
#define SPICE_GNUC_SCANF( format_idx, arg_idx )
|
||||
#define SPICE_GNUC_FORMAT( arg_idx )
|
||||
#define SPICE_GNUC_NORETURN
|
||||
#define SPICE_GNUC_CONST
|
||||
#define SPICE_GNUC_UNUSED
|
||||
#define SPICE_GNUC_NO_INSTRUMENT
|
||||
#endif /* !__GNUC__ */
|
||||
|
||||
#ifdef G_DEPRECATED
|
||||
#define SPICE_GNUC_DEPRECATED G_DEPRECATED
|
||||
#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
||||
#define SPICE_GNUC_DEPRECATED __attribute__((__deprecated__))
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
|
||||
#define SPICE_GNUC_DEPRECATED __declspec(deprecated)
|
||||
#else
|
||||
#define SPICE_GNUC_DEPRECATED
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
|
||||
# define SPICE_GNUC_MAY_ALIAS __attribute__((may_alias))
|
||||
#else
|
||||
# define SPICE_GNUC_MAY_ALIAS
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
||||
#define SPICE_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#else
|
||||
#define SPICE_GNUC_WARN_UNUSED_RESULT
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
/* Guard C code in headers, while including them from C++ */
|
||||
#ifdef __cplusplus
|
||||
# define SPICE_BEGIN_DECLS extern "C" {
|
||||
# define SPICE_END_DECLS }
|
||||
#else
|
||||
# define SPICE_BEGIN_DECLS
|
||||
# define SPICE_END_DECLS
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
#undef MAX
|
||||
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
#undef MIN
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
#undef ABS
|
||||
#define ABS(a) (((a) < 0) ? -(a) : (a))
|
||||
|
||||
/* Count the number of elements in an array. The array must be defined
|
||||
* as such; using this with a dynamically allocated array will give
|
||||
* incorrect results.
|
||||
*/
|
||||
#define SPICE_N_ELEMENTS(arr) (sizeof (arr) / sizeof ((arr)[0]))
|
||||
|
||||
#define SPICE_ALIGN(a, size) (((a) + ((size) - 1)) & ~((size) - 1))
|
||||
|
||||
/* Provide convenience macros for handling structure
|
||||
* fields through their offsets.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define SPICE_OFFSETOF(struct_type, member) \
|
||||
((long) offsetof (struct_type, member))
|
||||
#else
|
||||
# define SPICE_OFFSETOF(struct_type, member) \
|
||||
((long) ((uint8_t*) &((struct_type*) 0)->member))
|
||||
#endif
|
||||
|
||||
/* The SPICE_USE_SAFER_CONTAINEROF macro is used to avoid
|
||||
* compilation breakage with older spice-server releases which
|
||||
* triggered some errors without an additional patch.
|
||||
*/
|
||||
#if defined(__GNUC__) && defined(SPICE_USE_SAFER_CONTAINEROF) && \
|
||||
(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
#define SPICE_CONTAINEROF(ptr, struct_type, member) ({ \
|
||||
const typeof( ((struct_type *)0)->member ) *__mptr = (ptr); \
|
||||
((struct_type *)(void *)((uint8_t *)(__mptr) - SPICE_OFFSETOF(struct_type, member))); })
|
||||
#else
|
||||
#define SPICE_CONTAINEROF(ptr, struct_type, member) \
|
||||
((struct_type *)(void *)((uint8_t *)(ptr) - SPICE_OFFSETOF(struct_type, member)))
|
||||
#endif
|
||||
|
||||
#define SPICE_MEMBER_P(struct_p, struct_offset) \
|
||||
((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
|
||||
#define SPICE_MEMBER(member_type, struct_p, struct_offset) \
|
||||
(*(member_type*) SPICE_STRUCT_MEMBER_P ((struct_p), (struct_offset)))
|
||||
|
||||
/* Provide simple macro statement wrappers:
|
||||
* SPICE_STMT_START { statements; } SPICE_STMT_END;
|
||||
* This can be used as a single statement, like:
|
||||
* if (x) SPICE_STMT_START { ... } SPICE_STMT_END; else ...
|
||||
* This intentionally does not use compiler extensions like GCC's '({...})' to
|
||||
* avoid portability issue or side effects when compiled with different compilers.
|
||||
*/
|
||||
#if !(defined (SPICE_STMT_START) && defined (SPICE_STMT_END))
|
||||
# define SPICE_STMT_START do
|
||||
# define SPICE_STMT_END while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The SPICE_LIKELY and SPICE_UNLIKELY macros let the programmer give hints to
|
||||
* the compiler about the expected result of an expression. Some compilers
|
||||
* can use this information for optimizations.
|
||||
*
|
||||
* The _SPICE_BOOLEAN_EXPR macro is intended to trigger a gcc warning when
|
||||
* putting assignments in g_return_if_fail ().
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
|
||||
#define _SPICE_BOOLEAN_EXPR(expr) \
|
||||
__extension__ ({ \
|
||||
int _g_boolean_var_; \
|
||||
if (expr) \
|
||||
_g_boolean_var_ = 1; \
|
||||
else \
|
||||
_g_boolean_var_ = 0; \
|
||||
_g_boolean_var_; \
|
||||
})
|
||||
#define SPICE_LIKELY(expr) (__builtin_expect (_SPICE_BOOLEAN_EXPR(expr), 1))
|
||||
#define SPICE_UNLIKELY(expr) (__builtin_expect (_SPICE_BOOLEAN_EXPR(expr), 0))
|
||||
#else
|
||||
#define SPICE_LIKELY(expr) (expr)
|
||||
#define SPICE_UNLIKELY(expr) (expr)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define SPICE_UINT64_CONSTANT(x) (x ## UI64)
|
||||
#define SPICE_INT64_CONSTANT(x) (x ## I64)
|
||||
#else
|
||||
#if LONG_MAX == 2147483647L
|
||||
#define SPICE_UINT64_CONSTANT(x) (x ## ULL)
|
||||
#define SPICE_INT64_CONSTANT(x) (x ## LL)
|
||||
#else
|
||||
#define SPICE_UINT64_CONSTANT(x) (x ## UL)
|
||||
#define SPICE_INT64_CONSTANT(x) (x ## L)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Little/Bit endian byte swapping */
|
||||
|
||||
#define SPICE_BYTESWAP16_CONSTANT(val) ((uint16_t) ( \
|
||||
(uint16_t) ((uint16_t) (val) >> 8) | \
|
||||
(uint16_t) ((uint16_t) (val) << 8)))
|
||||
|
||||
#define SPICE_BYTESWAP32_CONSTANT(val) ((uint32_t) ( \
|
||||
(((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
|
||||
(((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \
|
||||
(((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \
|
||||
(((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24)))
|
||||
|
||||
#define SPICE_BYTESWAP64_CONSTANT(val) ((uint64_t) ( \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x00000000000000ff)) << 56) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x000000000000ff00)) << 40) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x0000000000ff0000)) << 24) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x00000000ff000000)) << 8) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x000000ff00000000)) >> 8) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x0000ff0000000000)) >> 24) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0x00ff000000000000)) >> 40) | \
|
||||
(((uint64_t) (val) & \
|
||||
(uint64_t) SPICE_UINT64_CONSTANT(0xff00000000000000)) >> 56)))
|
||||
|
||||
/* Arch specific stuff for speed
|
||||
*/
|
||||
#if defined (__GNUC__) && (__GNUC__ >= 4) && defined (__OPTIMIZE__)
|
||||
# define SPICE_BYTESWAP16(val) __builtin_bswap16(val)
|
||||
# define SPICE_BYTESWAP32(val) __builtin_bswap32(val)
|
||||
# define SPICE_BYTESWAP64(val) __builtin_bswap64(val)
|
||||
#elif defined(_MSC_VER)
|
||||
# define SPICE_BYTESWAP16(val) _byteswap_ushort(val)
|
||||
# define SPICE_BYTESWAP32(val) _byteswap_ulong(val)
|
||||
# define SPICE_BYTESWAP64(val) _byteswap_uint64(val)
|
||||
#else /* generic */
|
||||
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_CONSTANT (val))
|
||||
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_CONSTANT (val))
|
||||
# define SPICE_BYTESWAP64(val) (SPICE_BYTESWAP64_CONSTANT (val))
|
||||
#endif /* generic */
|
||||
|
||||
|
||||
/* detect endianness */
|
||||
#undef SPICE_ENDIAN
|
||||
#define SPICE_ENDIAN_LITTLE 4321
|
||||
#define SPICE_ENDIAN_BIG 1234
|
||||
#define SPICE_ENDIAN_PDP 2143
|
||||
|
||||
/* gcc already defined these, use them */
|
||||
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) \
|
||||
&& defined(__ORDER_BIG_ENDIAN__) && defined(__ORDER_PDP_ENDIAN__)
|
||||
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
|
||||
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_BIG
|
||||
# elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_PDP
|
||||
# else
|
||||
# error __BYTE_ORDER__ not defined correctly
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* use suggestions at http://sourceforge.net/p/predef/wiki/Endianness/ */
|
||||
#ifndef SPICE_ENDIAN
|
||||
# if defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) \
|
||||
|| defined(__THUMBEL__) || defined(__AARCH64EL__) \
|
||||
|| defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) \
|
||||
|| defined(__amd64__) || defined(__x86_64__) || defined(__i386__) \
|
||||
|| defined(__e2k__)
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
|
||||
# endif
|
||||
# if defined(__BIG_ENDIAN__) || defined(__ARMEB__) \
|
||||
|| defined(__THUMBEB__) || defined(__AARCH64EB__) \
|
||||
|| defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
|
||||
# ifdef SPICE_ENDIAN
|
||||
# error Both little and big endian detected
|
||||
# endif
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_BIG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* MS compiler */
|
||||
#if !defined(SPICE_ENDIAN) && defined(_MSC_VER)
|
||||
/* Windows support only little endian arm */
|
||||
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) \
|
||||
|| defined(_M_ARM)
|
||||
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(SPICE_ENDIAN)
|
||||
#error Unable to detect processor endianness
|
||||
#endif
|
||||
|
||||
#if SPICE_ENDIAN == SPICE_ENDIAN_PDP
|
||||
#error PDP endianness not supported by Spice
|
||||
#endif
|
||||
|
||||
|
||||
#if SPICE_ENDIAN == SPICE_ENDIAN_LITTLE
|
||||
#define SPICE_MAGIC_CONST(s) \
|
||||
((uint32_t)((s[0]&0xffu)|((s[1]&0xffu)<<8)|((s[2]&0xffu)<<16)|((s[3]&0xffu)<<24)))
|
||||
#else
|
||||
#define SPICE_MAGIC_CONST(s) \
|
||||
((uint32_t)((s[3]&0xffu)|((s[2]&0xffu)<<8)|((s[1]&0xffu)<<16)|((s[0]&0xffu)<<24)))
|
||||
#endif
|
||||
|
||||
#endif /* _H_SPICE_MACROS */
|
21
spice-protocol/spice/meson.build
Normal file
21
spice-protocol/spice/meson.build
Normal file
@ -0,0 +1,21 @@
|
||||
spice_protocol_headers = [
|
||||
'barrier.h',
|
||||
'controller_prot.h',
|
||||
'end-packed.h',
|
||||
'enums.h',
|
||||
'foreign_menu_prot.h',
|
||||
'ipc_ring.h',
|
||||
'macros.h',
|
||||
'protocol.h',
|
||||
'qxl_dev.h',
|
||||
'qxl_windows.h',
|
||||
'start-packed.h',
|
||||
'stats.h',
|
||||
'types.h',
|
||||
'vd_agent.h',
|
||||
'vdi_dev.h',
|
||||
'stream-device.h',
|
||||
]
|
||||
|
||||
install_headers(spice_protocol_headers,
|
||||
subdir : join_paths('spice-1', 'spice'))
|
171
spice-protocol/spice/protocol.h
Normal file
171
spice-protocol/spice/protocol.h
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_PROTOCOL
|
||||
#define _H_SPICE_PROTOCOL
|
||||
|
||||
#include <spice/types.h>
|
||||
#include <spice/enums.h>
|
||||
#include <spice/macros.h>
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define SPICE_MAGIC SPICE_MAGIC_CONST("REDQ")
|
||||
#define SPICE_VERSION_MAJOR 2
|
||||
#define SPICE_VERSION_MINOR 2
|
||||
|
||||
// Encryption & Ticketing Parameters
|
||||
#define SPICE_MAX_PASSWORD_LENGTH 60
|
||||
#define SPICE_TICKET_KEY_PAIR_LENGTH 1024
|
||||
#define SPICE_TICKET_PUBKEY_BYTES (SPICE_TICKET_KEY_PAIR_LENGTH / 8 + 34)
|
||||
|
||||
/*
|
||||
* This is the maximum number of streams possible.
|
||||
* IDs will be in the interval [0, SPICE_MAX_NUM_STREAMS).
|
||||
*/
|
||||
#define SPICE_MAX_NUM_STREAMS 64
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceLinkHeader {
|
||||
uint32_t magic;
|
||||
uint32_t major_version;
|
||||
uint32_t minor_version;
|
||||
uint32_t size;
|
||||
} SpiceLinkHeader;
|
||||
|
||||
enum {
|
||||
SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION,
|
||||
SPICE_COMMON_CAP_AUTH_SPICE,
|
||||
SPICE_COMMON_CAP_AUTH_SASL,
|
||||
SPICE_COMMON_CAP_MINI_HEADER,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceLinkMess {
|
||||
uint32_t connection_id;
|
||||
uint8_t channel_type;
|
||||
uint8_t channel_id;
|
||||
uint32_t num_common_caps;
|
||||
uint32_t num_channel_caps;
|
||||
uint32_t caps_offset;
|
||||
} SpiceLinkMess;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceLinkReply {
|
||||
uint32_t error;
|
||||
uint8_t pub_key[SPICE_TICKET_PUBKEY_BYTES];
|
||||
uint32_t num_common_caps;
|
||||
uint32_t num_channel_caps;
|
||||
uint32_t caps_offset;
|
||||
} SpiceLinkReply;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceLinkEncryptedTicket {
|
||||
uint8_t encrypted_data[SPICE_TICKET_KEY_PAIR_LENGTH / 8];
|
||||
} SpiceLinkEncryptedTicket;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceLinkAuthMechanism {
|
||||
uint32_t auth_mechanism;
|
||||
} SpiceLinkAuthMechanism;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceDataHeader {
|
||||
uint64_t serial;
|
||||
uint16_t type;
|
||||
uint32_t size;
|
||||
uint32_t sub_list; //offset to SpiceSubMessageList[]
|
||||
} SpiceDataHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceMiniDataHeader {
|
||||
uint16_t type;
|
||||
uint32_t size;
|
||||
} SpiceMiniDataHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceSubMessage {
|
||||
uint16_t type;
|
||||
uint32_t size;
|
||||
} SpiceSubMessage;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED SpiceSubMessageList {
|
||||
uint16_t size;
|
||||
uint32_t sub_messages[0]; //offsets to SpicedSubMessage
|
||||
} SpiceSubMessageList;
|
||||
|
||||
#define SPICE_INPUT_MOTION_ACK_BUNCH 4
|
||||
|
||||
enum {
|
||||
SPICE_PLAYBACK_CAP_CELT_0_5_1,
|
||||
SPICE_PLAYBACK_CAP_VOLUME,
|
||||
SPICE_PLAYBACK_CAP_LATENCY,
|
||||
SPICE_PLAYBACK_CAP_OPUS,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_RECORD_CAP_CELT_0_5_1,
|
||||
SPICE_RECORD_CAP_VOLUME,
|
||||
SPICE_RECORD_CAP_OPUS,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE,
|
||||
SPICE_MAIN_CAP_NAME_AND_UUID,
|
||||
SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS,
|
||||
SPICE_MAIN_CAP_SEAMLESS_MIGRATE,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_DISPLAY_CAP_SIZED_STREAM,
|
||||
SPICE_DISPLAY_CAP_MONITORS_CONFIG,
|
||||
SPICE_DISPLAY_CAP_COMPOSITE,
|
||||
SPICE_DISPLAY_CAP_A8_SURFACE,
|
||||
SPICE_DISPLAY_CAP_STREAM_REPORT,
|
||||
SPICE_DISPLAY_CAP_LZ4_COMPRESSION,
|
||||
SPICE_DISPLAY_CAP_PREF_COMPRESSION,
|
||||
SPICE_DISPLAY_CAP_GL_SCANOUT,
|
||||
SPICE_DISPLAY_CAP_MULTI_CODEC,
|
||||
SPICE_DISPLAY_CAP_CODEC_MJPEG,
|
||||
SPICE_DISPLAY_CAP_CODEC_VP8,
|
||||
SPICE_DISPLAY_CAP_CODEC_H264,
|
||||
SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE,
|
||||
SPICE_DISPLAY_CAP_CODEC_VP9,
|
||||
SPICE_DISPLAY_CAP_CODEC_H265,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_INPUTS_CAP_KEY_SCANCODE,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPICE_PORT_EVENT_OPENED,
|
||||
SPICE_PORT_EVENT_CLOSED,
|
||||
SPICE_PORT_EVENT_BREAK,
|
||||
};
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif /* _H_SPICE_PROTOCOL */
|
782
spice-protocol/spice/qxl_dev.h
Normal file
782
spice-protocol/spice/qxl_dev.h
Normal file
@ -0,0 +1,782 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _H_QXL_DEV
|
||||
#define _H_QXL_DEV
|
||||
|
||||
#include <spice/types.h>
|
||||
#include <spice/barrier.h>
|
||||
#include <spice/ipc_ring.h>
|
||||
#include <spice/enums.h>
|
||||
#include <spice/macros.h>
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#define REDHAT_PCI_VENDOR_ID 0x1b36
|
||||
|
||||
/* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */
|
||||
#define QXL_DEVICE_ID_STABLE 0x0100
|
||||
|
||||
enum {
|
||||
QXL_REVISION_STABLE_V04=0x01,
|
||||
QXL_REVISION_STABLE_V06=0x02,
|
||||
QXL_REVISION_STABLE_V10=0x03,
|
||||
QXL_REVISION_STABLE_V12=0x04,
|
||||
};
|
||||
|
||||
#define QXL_DEVICE_ID_DEVEL 0x01ff
|
||||
#define QXL_REVISION_DEVEL 0x01
|
||||
|
||||
#define QXL_ROM_MAGIC SPICE_MAGIC_CONST("QXRO")
|
||||
#define QXL_RAM_MAGIC SPICE_MAGIC_CONST("QXRA")
|
||||
|
||||
enum {
|
||||
QXL_RAM_RANGE_INDEX,
|
||||
QXL_VRAM_RANGE_INDEX,
|
||||
QXL_ROM_RANGE_INDEX,
|
||||
QXL_IO_RANGE_INDEX,
|
||||
|
||||
QXL_PCI_RANGES
|
||||
};
|
||||
|
||||
/* qxl-1 compat: append only */
|
||||
enum {
|
||||
QXL_IO_NOTIFY_CMD,
|
||||
QXL_IO_NOTIFY_CURSOR,
|
||||
QXL_IO_UPDATE_AREA,
|
||||
QXL_IO_UPDATE_IRQ,
|
||||
QXL_IO_NOTIFY_OOM,
|
||||
QXL_IO_RESET,
|
||||
QXL_IO_SET_MODE, /* qxl-1 */
|
||||
QXL_IO_LOG,
|
||||
/* appended for qxl-2 */
|
||||
QXL_IO_MEMSLOT_ADD,
|
||||
QXL_IO_MEMSLOT_DEL,
|
||||
QXL_IO_DETACH_PRIMARY,
|
||||
QXL_IO_ATTACH_PRIMARY,
|
||||
QXL_IO_CREATE_PRIMARY,
|
||||
QXL_IO_DESTROY_PRIMARY,
|
||||
QXL_IO_DESTROY_SURFACE_WAIT,
|
||||
QXL_IO_DESTROY_ALL_SURFACES,
|
||||
/* appended for qxl-3 */
|
||||
QXL_IO_UPDATE_AREA_ASYNC,
|
||||
QXL_IO_MEMSLOT_ADD_ASYNC,
|
||||
QXL_IO_CREATE_PRIMARY_ASYNC,
|
||||
QXL_IO_DESTROY_PRIMARY_ASYNC,
|
||||
QXL_IO_DESTROY_SURFACE_ASYNC,
|
||||
QXL_IO_DESTROY_ALL_SURFACES_ASYNC,
|
||||
QXL_IO_FLUSH_SURFACES_ASYNC,
|
||||
QXL_IO_FLUSH_RELEASE,
|
||||
/* appended for qxl-4 */
|
||||
QXL_IO_MONITORS_CONFIG_ASYNC,
|
||||
|
||||
QXL_IO_RANGE_SIZE
|
||||
};
|
||||
|
||||
typedef uint64_t QXLPHYSICAL;
|
||||
typedef int32_t QXLFIXED; //fixed 28.4
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPointFix {
|
||||
QXLFIXED x;
|
||||
QXLFIXED y;
|
||||
} QXLPointFix;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPoint {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
} QXLPoint;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPoint16 {
|
||||
int16_t x;
|
||||
int16_t y;
|
||||
} QXLPoint16;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLRect {
|
||||
int32_t top;
|
||||
int32_t left;
|
||||
int32_t bottom;
|
||||
int32_t right;
|
||||
} QXLRect;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLURect {
|
||||
uint32_t top;
|
||||
uint32_t left;
|
||||
uint32_t bottom;
|
||||
uint32_t right;
|
||||
} QXLURect;
|
||||
|
||||
/* qxl-1 compat: append only */
|
||||
typedef struct SPICE_ATTR_PACKED QXLRom {
|
||||
uint32_t magic;
|
||||
uint32_t id;
|
||||
uint32_t update_id;
|
||||
uint32_t compression_level;
|
||||
uint32_t log_level;
|
||||
uint32_t mode; /* qxl-1 */
|
||||
uint32_t modes_offset;
|
||||
uint32_t num_pages;
|
||||
uint32_t pages_offset; /* qxl-1 */
|
||||
uint32_t draw_area_offset; /* qxl-1 */
|
||||
uint32_t surface0_area_size; /* qxl-1 name: draw_area_size */
|
||||
uint32_t ram_header_offset;
|
||||
uint32_t mm_clock;
|
||||
/* appended for qxl-2 */
|
||||
uint32_t n_surfaces;
|
||||
uint64_t flags;
|
||||
uint8_t slots_start;
|
||||
uint8_t slots_end;
|
||||
uint8_t slot_gen_bits;
|
||||
uint8_t slot_id_bits;
|
||||
uint8_t slot_generation;
|
||||
/* appended for qxl-4 */
|
||||
uint8_t client_present;
|
||||
uint8_t client_capabilities[58];
|
||||
uint32_t client_monitors_config_crc;
|
||||
struct {
|
||||
uint16_t count;
|
||||
uint16_t padding;
|
||||
QXLURect heads[64];
|
||||
} client_monitors_config;
|
||||
} QXLRom;
|
||||
|
||||
#define CLIENT_MONITORS_CONFIG_CRC32_POLY 0xedb88320
|
||||
|
||||
/* qxl-1 compat: fixed */
|
||||
typedef struct SPICE_ATTR_PACKED QXLMode {
|
||||
uint32_t id;
|
||||
uint32_t x_res;
|
||||
uint32_t y_res;
|
||||
uint32_t bits;
|
||||
uint32_t stride;
|
||||
uint32_t x_mili;
|
||||
uint32_t y_mili;
|
||||
uint32_t orientation;
|
||||
} QXLMode;
|
||||
|
||||
/* qxl-1 compat: fixed */
|
||||
typedef struct SPICE_ATTR_PACKED QXLModes {
|
||||
uint32_t n_modes;
|
||||
QXLMode modes[0];
|
||||
} QXLModes;
|
||||
|
||||
/* qxl-1 compat: append only */
|
||||
typedef enum QXLCmdType {
|
||||
QXL_CMD_NOP,
|
||||
QXL_CMD_DRAW,
|
||||
QXL_CMD_UPDATE,
|
||||
QXL_CMD_CURSOR,
|
||||
QXL_CMD_MESSAGE,
|
||||
QXL_CMD_SURFACE,
|
||||
} QXLCmdType;
|
||||
|
||||
/* qxl-1 compat: fixed */
|
||||
typedef struct SPICE_ATTR_PACKED QXLCommand {
|
||||
QXLPHYSICAL data;
|
||||
uint32_t type;
|
||||
uint32_t padding;
|
||||
} QXLCommand;
|
||||
|
||||
#define QXL_COMMAND_FLAG_COMPAT (1<<0)
|
||||
#define QXL_COMMAND_FLAG_COMPAT_16BPP (2<<0)
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCommandExt {
|
||||
QXLCommand cmd;
|
||||
uint32_t group_id;
|
||||
uint32_t flags;
|
||||
} QXLCommandExt;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLMemSlot {
|
||||
uint64_t mem_start;
|
||||
uint64_t mem_end;
|
||||
} QXLMemSlot;
|
||||
|
||||
#define QXL_SURF_TYPE_PRIMARY 0
|
||||
|
||||
#define QXL_SURF_FLAG_KEEP_DATA (1 << 0)
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLSurfaceCreate {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
int32_t stride;
|
||||
uint32_t format;
|
||||
uint32_t position;
|
||||
uint32_t mouse_mode;
|
||||
uint32_t flags;
|
||||
uint32_t type;
|
||||
QXLPHYSICAL mem;
|
||||
} QXLSurfaceCreate;
|
||||
|
||||
#define QXL_COMMAND_RING_SIZE 32
|
||||
#define QXL_CURSOR_RING_SIZE 32
|
||||
#define QXL_RELEASE_RING_SIZE 8
|
||||
|
||||
SPICE_RING_DECLARE(QXLCommandRing, QXLCommand, QXL_COMMAND_RING_SIZE);
|
||||
SPICE_RING_DECLARE(QXLCursorRing, QXLCommand, QXL_CURSOR_RING_SIZE);
|
||||
|
||||
SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, QXL_RELEASE_RING_SIZE);
|
||||
|
||||
#define QXL_LOG_BUF_SIZE 4096
|
||||
|
||||
#define QXL_INTERRUPT_DISPLAY (1 << 0)
|
||||
#define QXL_INTERRUPT_CURSOR (1 << 1)
|
||||
#define QXL_INTERRUPT_IO_CMD (1 << 2)
|
||||
#define QXL_INTERRUPT_ERROR (1 << 3)
|
||||
#define QXL_INTERRUPT_CLIENT (1 << 4)
|
||||
#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG (1 << 5)
|
||||
|
||||
/* qxl-1 compat: append only */
|
||||
typedef struct SPICE_ATTR_ALIGNED(4) SPICE_ATTR_PACKED QXLRam {
|
||||
uint32_t magic;
|
||||
uint32_t int_pending;
|
||||
uint32_t int_mask;
|
||||
uint8_t log_buf[QXL_LOG_BUF_SIZE];
|
||||
QXLCommandRing cmd_ring;
|
||||
QXLCursorRing cursor_ring;
|
||||
QXLReleaseRing release_ring;
|
||||
QXLRect update_area;
|
||||
/* appended for qxl-2 */
|
||||
uint32_t update_surface;
|
||||
QXLMemSlot mem_slot;
|
||||
QXLSurfaceCreate create_surface;
|
||||
uint64_t flags;
|
||||
|
||||
/* appended for qxl-4 */
|
||||
|
||||
/* used by QXL_IO_MONITORS_CONFIG_ASYNC */
|
||||
QXLPHYSICAL monitors_config;
|
||||
|
||||
} QXLRam;
|
||||
|
||||
typedef union QXLReleaseInfo {
|
||||
uint64_t id; // in
|
||||
uint64_t next; // out
|
||||
} QXLReleaseInfo;
|
||||
|
||||
typedef struct QXLReleaseInfoExt {
|
||||
QXLReleaseInfo *info;
|
||||
uint32_t group_id;
|
||||
} QXLReleaseInfoExt;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLDataChunk {
|
||||
uint32_t data_size;
|
||||
QXLPHYSICAL prev_chunk;
|
||||
QXLPHYSICAL next_chunk;
|
||||
uint8_t data[0];
|
||||
} QXLDataChunk;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLMessage {
|
||||
QXLReleaseInfo release_info;
|
||||
uint8_t data[0];
|
||||
} QXLMessage;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCompatUpdateCmd {
|
||||
QXLReleaseInfo release_info;
|
||||
QXLRect area;
|
||||
uint32_t update_id;
|
||||
} QXLCompatUpdateCmd;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLUpdateCmd {
|
||||
QXLReleaseInfo release_info;
|
||||
QXLRect area;
|
||||
uint32_t update_id;
|
||||
uint32_t surface_id;
|
||||
} QXLUpdateCmd;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCursorHeader {
|
||||
uint64_t unique;
|
||||
uint16_t type;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint16_t hot_spot_x;
|
||||
uint16_t hot_spot_y;
|
||||
} QXLCursorHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCursor {
|
||||
QXLCursorHeader header;
|
||||
uint32_t data_size;
|
||||
QXLDataChunk chunk;
|
||||
} QXLCursor;
|
||||
|
||||
enum {
|
||||
QXL_CURSOR_SET,
|
||||
QXL_CURSOR_MOVE,
|
||||
QXL_CURSOR_HIDE,
|
||||
QXL_CURSOR_TRAIL,
|
||||
};
|
||||
|
||||
#define QXL_CURSUR_DEVICE_DATA_SIZE 128
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCursorCmd {
|
||||
QXLReleaseInfo release_info;
|
||||
uint8_t type;
|
||||
union {
|
||||
struct SPICE_ATTR_PACKED {
|
||||
QXLPoint16 position;
|
||||
uint8_t visible;
|
||||
QXLPHYSICAL shape;
|
||||
} set;
|
||||
struct SPICE_ATTR_PACKED {
|
||||
uint16_t length;
|
||||
uint16_t frequency;
|
||||
} trail;
|
||||
QXLPoint16 position;
|
||||
} u;
|
||||
uint8_t device_data[QXL_CURSUR_DEVICE_DATA_SIZE]; //todo: dynamic size from rom
|
||||
} QXLCursorCmd;
|
||||
|
||||
enum {
|
||||
QXL_DRAW_NOP,
|
||||
QXL_DRAW_FILL,
|
||||
QXL_DRAW_OPAQUE,
|
||||
QXL_DRAW_COPY,
|
||||
QXL_COPY_BITS,
|
||||
QXL_DRAW_BLEND,
|
||||
QXL_DRAW_BLACKNESS,
|
||||
QXL_DRAW_WHITENESS,
|
||||
QXL_DRAW_INVERS,
|
||||
QXL_DRAW_ROP3,
|
||||
QXL_DRAW_STROKE,
|
||||
QXL_DRAW_TEXT,
|
||||
QXL_DRAW_TRANSPARENT,
|
||||
QXL_DRAW_ALPHA_BLEND,
|
||||
QXL_DRAW_COMPOSITE
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLRasterGlyph {
|
||||
QXLPoint render_pos;
|
||||
QXLPoint glyph_origin;
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint8_t data[0];
|
||||
} QXLRasterGlyph;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLString {
|
||||
uint32_t data_size;
|
||||
uint16_t length;
|
||||
uint16_t flags;
|
||||
QXLDataChunk chunk;
|
||||
} QXLString;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCopyBits {
|
||||
QXLPoint src_pos;
|
||||
} QXLCopyBits;
|
||||
|
||||
typedef enum QXLEffectType
|
||||
{
|
||||
QXL_EFFECT_BLEND = 0,
|
||||
QXL_EFFECT_OPAQUE = 1,
|
||||
QXL_EFFECT_REVERT_ON_DUP = 2,
|
||||
QXL_EFFECT_BLACKNESS_ON_DUP = 3,
|
||||
QXL_EFFECT_WHITENESS_ON_DUP = 4,
|
||||
QXL_EFFECT_NOP_ON_DUP = 5,
|
||||
QXL_EFFECT_NOP = 6,
|
||||
QXL_EFFECT_OPAQUE_BRUSH = 7
|
||||
} QXLEffectType;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPattern {
|
||||
QXLPHYSICAL pat;
|
||||
QXLPoint pos;
|
||||
} QXLPattern;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLBrush {
|
||||
uint32_t type;
|
||||
union {
|
||||
uint32_t color;
|
||||
QXLPattern pattern;
|
||||
} u;
|
||||
} QXLBrush;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLQMask {
|
||||
uint8_t flags;
|
||||
QXLPoint pos;
|
||||
QXLPHYSICAL bitmap;
|
||||
} QXLQMask;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLFill {
|
||||
QXLBrush brush;
|
||||
uint16_t rop_descriptor;
|
||||
QXLQMask mask;
|
||||
} QXLFill;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLOpaque {
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
QXLBrush brush;
|
||||
uint16_t rop_descriptor;
|
||||
uint8_t scale_mode;
|
||||
QXLQMask mask;
|
||||
} QXLOpaque;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCopy {
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
uint16_t rop_descriptor;
|
||||
uint8_t scale_mode;
|
||||
QXLQMask mask;
|
||||
} QXLCopy, QXLBlend;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLTransparent {
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
uint32_t src_color;
|
||||
uint32_t true_color;
|
||||
} QXLTransparent;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLAlphaBlend {
|
||||
uint16_t alpha_flags;
|
||||
uint8_t alpha;
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
} QXLAlphaBlend;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCompatAlphaBlend {
|
||||
uint8_t alpha;
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
} QXLCompatAlphaBlend;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLRop3 {
|
||||
QXLPHYSICAL src_bitmap;
|
||||
QXLRect src_area;
|
||||
QXLBrush brush;
|
||||
uint8_t rop3;
|
||||
uint8_t scale_mode;
|
||||
QXLQMask mask;
|
||||
} QXLRop3;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLLineAttr {
|
||||
uint8_t flags;
|
||||
uint8_t join_style;
|
||||
uint8_t end_style;
|
||||
uint8_t style_nseg;
|
||||
QXLFIXED width;
|
||||
QXLFIXED miter_limit;
|
||||
QXLPHYSICAL style;
|
||||
} QXLLineAttr;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLStroke {
|
||||
QXLPHYSICAL path;
|
||||
QXLLineAttr attr;
|
||||
QXLBrush brush;
|
||||
uint16_t fore_mode;
|
||||
uint16_t back_mode;
|
||||
} QXLStroke;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLText {
|
||||
QXLPHYSICAL str;
|
||||
QXLRect back_area;
|
||||
QXLBrush fore_brush;
|
||||
QXLBrush back_brush;
|
||||
uint16_t fore_mode;
|
||||
uint16_t back_mode;
|
||||
} QXLText;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLBlackness {
|
||||
QXLQMask mask;
|
||||
} QXLBlackness, QXLInvers, QXLWhiteness;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLClip {
|
||||
uint32_t type;
|
||||
QXLPHYSICAL data;
|
||||
} QXLClip;
|
||||
|
||||
typedef enum {
|
||||
QXL_OP_CLEAR = 0x00,
|
||||
QXL_OP_SOURCE = 0x01,
|
||||
QXL_OP_DST = 0x02,
|
||||
QXL_OP_OVER = 0x03,
|
||||
QXL_OP_OVER_REVERSE = 0x04,
|
||||
QXL_OP_IN = 0x05,
|
||||
QXL_OP_IN_REVERSE = 0x06,
|
||||
QXL_OP_OUT = 0x07,
|
||||
QXL_OP_OUT_REVERSE = 0x08,
|
||||
QXL_OP_ATOP = 0x09,
|
||||
QXL_OP_ATOP_REVERSE = 0x0a,
|
||||
QXL_OP_XOR = 0x0b,
|
||||
QXL_OP_ADD = 0x0c,
|
||||
QXL_OP_SATURATE = 0x0d,
|
||||
/* Note the jump here from 0x0d to 0x30 */
|
||||
QXL_OP_MULTIPLY = 0x30,
|
||||
QXL_OP_SCREEN = 0x31,
|
||||
QXL_OP_OVERLAY = 0x32,
|
||||
QXL_OP_DARKEN = 0x33,
|
||||
QXL_OP_LIGHTEN = 0x34,
|
||||
QXL_OP_COLOR_DODGE = 0x35,
|
||||
QXL_OP_COLOR_BURN = 0x36,
|
||||
QXL_OP_HARD_LIGHT = 0x37,
|
||||
QXL_OP_SOFT_LIGHT = 0x38,
|
||||
QXL_OP_DIFFERENCE = 0x39,
|
||||
QXL_OP_EXCLUSION = 0x3a,
|
||||
QXL_OP_HSL_HUE = 0x3b,
|
||||
QXL_OP_HSL_SATURATION = 0x3c,
|
||||
QXL_OP_HSL_COLOR = 0x3d,
|
||||
QXL_OP_HSL_LUMINOSITY = 0x3e
|
||||
} QXLOperator;
|
||||
|
||||
typedef struct {
|
||||
uint32_t t00;
|
||||
uint32_t t01;
|
||||
uint32_t t02;
|
||||
uint32_t t10;
|
||||
uint32_t t11;
|
||||
uint32_t t12;
|
||||
} QXLTransform;
|
||||
|
||||
/* The flags field has the following bit fields:
|
||||
*
|
||||
* operator: [ 0 - 7 ]
|
||||
* src_filter: [ 8 - 10 ]
|
||||
* mask_filter: [ 11 - 13 ]
|
||||
* src_repeat: [ 14 - 15 ]
|
||||
* mask_repeat: [ 16 - 17 ]
|
||||
* component_alpha: [ 18 - 18 ]
|
||||
* reserved: [ 19 - 31 ]
|
||||
*
|
||||
* The repeat and filter values are those of pixman:
|
||||
* REPEAT_NONE = 0
|
||||
* REPEAT_NORMAL = 1
|
||||
* REPEAT_PAD = 2
|
||||
* REPEAT_REFLECT = 3
|
||||
*
|
||||
* The filter values are:
|
||||
* FILTER_NEAREST = 0
|
||||
* FILTER_BILINEAR = 1
|
||||
*/
|
||||
typedef struct SPICE_ATTR_PACKED QXLComposite {
|
||||
uint32_t flags;
|
||||
|
||||
QXLPHYSICAL src;
|
||||
QXLPHYSICAL src_transform; /* May be NULL */
|
||||
QXLPHYSICAL mask; /* May be NULL */
|
||||
QXLPHYSICAL mask_transform; /* May be NULL */
|
||||
QXLPoint16 src_origin;
|
||||
QXLPoint16 mask_origin;
|
||||
} QXLComposite;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLCompatDrawable {
|
||||
QXLReleaseInfo release_info;
|
||||
uint8_t effect;
|
||||
uint8_t type;
|
||||
uint16_t bitmap_offset;
|
||||
QXLRect bitmap_area;
|
||||
QXLRect bbox;
|
||||
QXLClip clip;
|
||||
uint32_t mm_time;
|
||||
union {
|
||||
QXLFill fill;
|
||||
QXLOpaque opaque;
|
||||
QXLCopy copy;
|
||||
QXLTransparent transparent;
|
||||
QXLCompatAlphaBlend alpha_blend;
|
||||
QXLCopyBits copy_bits;
|
||||
QXLBlend blend;
|
||||
QXLRop3 rop3;
|
||||
QXLStroke stroke;
|
||||
QXLText text;
|
||||
QXLBlackness blackness;
|
||||
QXLInvers invers;
|
||||
QXLWhiteness whiteness;
|
||||
} u;
|
||||
} QXLCompatDrawable;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLDrawable {
|
||||
QXLReleaseInfo release_info;
|
||||
uint32_t surface_id;
|
||||
uint8_t effect;
|
||||
uint8_t type;
|
||||
uint8_t self_bitmap;
|
||||
QXLRect self_bitmap_area;
|
||||
QXLRect bbox;
|
||||
QXLClip clip;
|
||||
uint32_t mm_time;
|
||||
int32_t surfaces_dest[3];
|
||||
QXLRect surfaces_rects[3];
|
||||
union {
|
||||
QXLFill fill;
|
||||
QXLOpaque opaque;
|
||||
QXLCopy copy;
|
||||
QXLTransparent transparent;
|
||||
QXLAlphaBlend alpha_blend;
|
||||
QXLCopyBits copy_bits;
|
||||
QXLBlend blend;
|
||||
QXLRop3 rop3;
|
||||
QXLStroke stroke;
|
||||
QXLText text;
|
||||
QXLBlackness blackness;
|
||||
QXLInvers invers;
|
||||
QXLWhiteness whiteness;
|
||||
QXLComposite composite;
|
||||
} u;
|
||||
} QXLDrawable;
|
||||
|
||||
typedef enum QXLSurfaceCmdType {
|
||||
QXL_SURFACE_CMD_CREATE,
|
||||
QXL_SURFACE_CMD_DESTROY,
|
||||
} QXLSurfaceCmdType;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLSurface {
|
||||
uint32_t format;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
int32_t stride;
|
||||
QXLPHYSICAL data;
|
||||
} QXLSurface;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLSurfaceCmd {
|
||||
QXLReleaseInfo release_info;
|
||||
uint32_t surface_id;
|
||||
uint8_t type;
|
||||
uint32_t flags;
|
||||
union {
|
||||
QXLSurface surface_create;
|
||||
} u;
|
||||
} QXLSurfaceCmd;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLClipRects {
|
||||
uint32_t num_rects;
|
||||
QXLDataChunk chunk;
|
||||
} QXLClipRects;
|
||||
|
||||
enum {
|
||||
QXL_PATH_BEGIN = (1 << 0),
|
||||
QXL_PATH_END = (1 << 1),
|
||||
QXL_PATH_CLOSE = (1 << 3),
|
||||
QXL_PATH_BEZIER = (1 << 4),
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPathSeg {
|
||||
uint32_t flags;
|
||||
uint32_t count;
|
||||
QXLPointFix points[0];
|
||||
} QXLPathSeg;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPath {
|
||||
uint32_t data_size;
|
||||
QXLDataChunk chunk;
|
||||
} QXLPath;
|
||||
|
||||
enum {
|
||||
QXL_IMAGE_GROUP_DRIVER,
|
||||
QXL_IMAGE_GROUP_DEVICE,
|
||||
QXL_IMAGE_GROUP_RED,
|
||||
QXL_IMAGE_GROUP_DRIVER_DONT_CACHE,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLImageID {
|
||||
uint32_t group;
|
||||
uint32_t unique;
|
||||
} QXLImageID;
|
||||
|
||||
typedef union {
|
||||
QXLImageID id;
|
||||
uint64_t value;
|
||||
} QXLImageIDUnion;
|
||||
|
||||
typedef enum QXLImageFlags {
|
||||
QXL_IMAGE_CACHE = (1 << 0),
|
||||
QXL_IMAGE_HIGH_BITS_SET = (1 << 1),
|
||||
} QXLImageFlags;
|
||||
|
||||
typedef enum QXLBitmapFlags {
|
||||
QXL_BITMAP_DIRECT = (1 << 0),
|
||||
QXL_BITMAP_UNSTABLE = (1 << 1),
|
||||
QXL_BITMAP_TOP_DOWN = (1 << 2), // == SPICE_BITMAP_FLAGS_TOP_DOWN
|
||||
} QXLBitmapFlags;
|
||||
|
||||
#define QXL_SET_IMAGE_ID(image, _group, _unique) { \
|
||||
(image)->descriptor.id = (((uint64_t)_unique) << 32) | _group; \
|
||||
}
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLImageDescriptor {
|
||||
uint64_t id;
|
||||
uint8_t type;
|
||||
uint8_t flags;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
} QXLImageDescriptor;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLPalette {
|
||||
uint64_t unique;
|
||||
uint16_t num_ents;
|
||||
uint32_t ents[0];
|
||||
} QXLPalette;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLBitmap {
|
||||
uint8_t format;
|
||||
uint8_t flags;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t stride;
|
||||
QXLPHYSICAL palette;
|
||||
QXLPHYSICAL data; //data[0] ?
|
||||
} QXLBitmap;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLSurfaceId {
|
||||
uint32_t surface_id;
|
||||
} QXLSurfaceId;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLQUICData {
|
||||
uint32_t data_size;
|
||||
uint8_t data[0];
|
||||
} QXLQUICData, QXLLZRGBData, QXLJPEGData;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLImage {
|
||||
QXLImageDescriptor descriptor;
|
||||
union { // variable length
|
||||
QXLBitmap bitmap;
|
||||
QXLQUICData quic;
|
||||
QXLSurfaceId surface_image;
|
||||
};
|
||||
} QXLImage;
|
||||
|
||||
/* A QXLHead is a single monitor output backed by a QXLSurface.
|
||||
* x and y offsets are unsigned since they are used in relation to
|
||||
* the given surface, not the same as the x, y coordinates in the guest
|
||||
* screen reference frame. */
|
||||
typedef struct SPICE_ATTR_PACKED QXLHead {
|
||||
uint32_t id;
|
||||
uint32_t surface_id;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t flags;
|
||||
} QXLHead;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
|
||||
uint16_t count;
|
||||
uint16_t max_allowed; /* If it is 0 no fixed limit is given by the driver */
|
||||
QXLHead heads[0];
|
||||
} QXLMonitorsConfig;
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif /* _H_QXL_DEV */
|
21
spice-protocol/spice/qxl_windows.h
Normal file
21
spice-protocol/spice/qxl_windows.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef _H_QXL_WINDOWS
|
||||
#define _H_QXL_WINDOWS
|
||||
|
||||
#include <spice/types.h>
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
enum {
|
||||
QXL_ESCAPE_SET_CUSTOM_DISPLAY = 0x10001,
|
||||
QXL_ESCAPE_MONITOR_CONFIG
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED QXLEscapeSetCustomDisplay {
|
||||
uint32_t xres;
|
||||
uint32_t yres;
|
||||
uint32_t bpp;
|
||||
} QXLEscapeSetCustomDisplay;
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif /* _H_QXL_WINDOWS */
|
66
spice-protocol/spice/start-packed.h
Normal file
66
spice-protocol/spice/start-packed.h
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Ideally this should all have been macros in a common headers, but
|
||||
* its not possible to put pragmas into header files, so we have
|
||||
* to use include magic.
|
||||
*
|
||||
* Use it like this:
|
||||
*
|
||||
* #include <spice/start-packed.h>
|
||||
*
|
||||
* typedef struct SPICE_ATTR_PACKED {
|
||||
* ...
|
||||
* } Type;
|
||||
*
|
||||
* #include <spice/end-packed.h>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define SPICE_ATTR_PACKED __attribute__ ((__packed__))
|
||||
#define SPICE_ATTR_ALIGNED(n) __attribute__ ((__aligned__ (n)))
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#pragma pack(push,1)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
#define SPICE_ATTR_PACKED
|
||||
#define SPICE_ATTR_ALIGNED(n) __declspec (align (n))
|
||||
#pragma warning(disable:4200)
|
||||
#pragma warning(disable:4103)
|
||||
|
||||
#endif
|
68
spice-protocol/spice/stats.h
Normal file
68
spice-protocol/spice/stats.h
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_STATS
|
||||
#define _H_SPICE_STATS
|
||||
|
||||
#include <spice/macros.h>
|
||||
#include <spice/types.h>
|
||||
|
||||
#define SPICE_STAT_SHM_NAME "/spice.%u"
|
||||
#define SPICE_STAT_NODE_NAME_MAX 20
|
||||
#define SPICE_STAT_MAGIC SPICE_MAGIC_CONST("STAT")
|
||||
#define SPICE_STAT_VERSION 1
|
||||
|
||||
enum {
|
||||
SPICE_STAT_NODE_FLAG_ENABLED = (1 << 0),
|
||||
SPICE_STAT_NODE_FLAG_VISIBLE = (1 << 1),
|
||||
SPICE_STAT_NODE_FLAG_VALUE = (1 << 2),
|
||||
};
|
||||
|
||||
#define SPICE_STAT_NODE_MASK_SHOW (SPICE_STAT_NODE_FLAG_ENABLED | SPICE_STAT_NODE_FLAG_VISIBLE)
|
||||
#define SPICE_STAT_NODE_MASK_SHOW_VALUE (SPICE_STAT_NODE_MASK_SHOW | SPICE_STAT_NODE_FLAG_VALUE)
|
||||
|
||||
typedef struct SpiceStatNode {
|
||||
uint64_t value;
|
||||
uint32_t flags;
|
||||
uint32_t next_sibling_index;
|
||||
uint32_t first_child_index;
|
||||
char name[SPICE_STAT_NODE_NAME_MAX];
|
||||
} SpiceStatNode;
|
||||
|
||||
typedef struct SpiceStat {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
uint32_t generation;
|
||||
uint32_t num_of_nodes;
|
||||
uint32_t root_index;
|
||||
SpiceStatNode nodes[];
|
||||
} SpiceStat;
|
||||
|
||||
#endif /* _H_SPICE_STATS */
|
218
spice-protocol/spice/stream-device.h
Normal file
218
spice-protocol/spice/stream-device.h
Normal file
@ -0,0 +1,218 @@
|
||||
/*
|
||||
Copyright (C) 2017-2018 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This header contains definition for the device that
|
||||
* allows to send streamed data to the server.
|
||||
*
|
||||
* The device is currently implemented as a VirtIO port inside the
|
||||
* guest. The guest should open that device to use this protocol to
|
||||
* communicate with the host.
|
||||
*/
|
||||
|
||||
#ifndef SPICE_STREAM_DEVICE_H_
|
||||
#define SPICE_STREAM_DEVICE_H_
|
||||
|
||||
#include <spice/types.h>
|
||||
|
||||
/*
|
||||
* Structures are all "naturally aligned"
|
||||
* containing integers up to 64 bit.
|
||||
* All numbers are in little endian format.
|
||||
*
|
||||
* For security reasons structures should not contain implicit paddings.
|
||||
*
|
||||
* The protocol can be defined by these states:
|
||||
* - Initial. Device just opened. Guest should wait
|
||||
* for a message from the host;
|
||||
* - Idle. No streaming allowed;
|
||||
* - Ready. Server sent list of possible codecs;
|
||||
* - Streaming. Stream active, enabled by the guest.
|
||||
*/
|
||||
|
||||
/* version of the protocol */
|
||||
#define STREAM_DEVICE_PROTOCOL 1
|
||||
|
||||
typedef struct StreamDevHeader {
|
||||
/* should be STREAM_DEVICE_PROTOCOL */
|
||||
uint8_t protocol_version;
|
||||
/* reserved, should be set to 0 */
|
||||
uint8_t padding;
|
||||
/* as defined in StreamMsgType enumeration */
|
||||
uint16_t type;
|
||||
/* size of the following message.
|
||||
* A message of type STREAM_TYPE_XXX_YYY is represented with a
|
||||
* corresponding StreamMsgXxxYyy structure. */
|
||||
uint32_t size;
|
||||
} StreamDevHeader;
|
||||
|
||||
typedef enum StreamMsgType {
|
||||
/* invalid, do not use */
|
||||
STREAM_TYPE_INVALID = 0,
|
||||
/* allows to send version information */
|
||||
STREAM_TYPE_CAPABILITIES,
|
||||
/* send screen resolution */
|
||||
STREAM_TYPE_FORMAT,
|
||||
/* stream data */
|
||||
STREAM_TYPE_DATA,
|
||||
/* server ask to start a new stream */
|
||||
STREAM_TYPE_START_STOP,
|
||||
/* server notify errors to guest */
|
||||
STREAM_TYPE_NOTIFY_ERROR,
|
||||
/* guest cursor */
|
||||
STREAM_TYPE_CURSOR_SET,
|
||||
/* guest cursor position */
|
||||
STREAM_TYPE_CURSOR_MOVE,
|
||||
} StreamMsgType;
|
||||
|
||||
typedef enum StreamCapabilities {
|
||||
STREAM_CAP_END // this must be the last
|
||||
} StreamCapabilities;
|
||||
|
||||
/* Generic extension capabilities.
|
||||
* This is a set of bits to specify which capabilities host and guest support.
|
||||
* This message is sent by the host to the guest or by the guest to the host.
|
||||
* Should be sent as first message.
|
||||
* If it is not sent, it means that guest/host doesn't support any extension.
|
||||
* Guest should send this as a reply from same type of message
|
||||
* from the host.
|
||||
* This message should be limited to STREAM_MSG_CAPABILITIES_MAX_BYTES. This
|
||||
* allows plenty of negotiations.
|
||||
*
|
||||
* States allowed: Initial(host), Idle(guest)
|
||||
* state will change to Idle.
|
||||
*/
|
||||
typedef struct StreamMsgCapabilities {
|
||||
uint8_t capabilities[0];
|
||||
} StreamMsgCapabilities;
|
||||
|
||||
#define STREAM_MSG_CAPABILITIES_MAX_BYTES 1024
|
||||
|
||||
/* Define the format of the stream, start a new stream.
|
||||
* This message is sent by the guest to the host to
|
||||
* tell the host the new stream format.
|
||||
*
|
||||
* States allowed: Ready
|
||||
* state will change to Streaming.
|
||||
*/
|
||||
typedef struct StreamMsgFormat {
|
||||
/* screen resolution/stream size */
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
/* as defined in SpiceVideoCodecType enumeration */
|
||||
uint8_t codec;
|
||||
uint8_t padding1[3];
|
||||
} StreamMsgFormat;
|
||||
|
||||
/* This message contains just raw data stream.
|
||||
* This message is sent by the guest to the host.
|
||||
*
|
||||
* States allowed: Streaming
|
||||
*/
|
||||
typedef struct StreamMsgData {
|
||||
uint8_t data[0];
|
||||
} StreamMsgData;
|
||||
|
||||
/* Tell to stop current stream and possibly start a new one.
|
||||
* This message is sent by the host to the guest.
|
||||
* Allows to communicate the codecs supported by the clients.
|
||||
* The agent should stop the old stream and if any codec in the
|
||||
* list is supported start streaming (as Mjpeg is always supported
|
||||
* agent should stop only on a real stop request).
|
||||
*
|
||||
* States allowed: any
|
||||
* state will change to Idle (no codecs) or Ready
|
||||
*/
|
||||
typedef struct StreamMsgStartStop {
|
||||
/* supported codecs, 0 to stop streaming */
|
||||
uint8_t num_codecs;
|
||||
/* as defined in SpiceVideoCodecType enumeration */
|
||||
uint8_t codecs[0];
|
||||
} StreamMsgStartStop;
|
||||
|
||||
/* Tell guest about invalid protocol.
|
||||
* This message is sent by the host to the guest.
|
||||
* The server will stop processing data from the guest.
|
||||
*
|
||||
* States allowed: any
|
||||
*/
|
||||
typedef struct StreamMsgNotifyError {
|
||||
/* numeric error code.
|
||||
* Currently not defined, set to 0.
|
||||
*/
|
||||
uint32_t error_code;
|
||||
/* String message, UTF-8 encoded.
|
||||
* This field terminate with the message.
|
||||
* Not necessary NUL-terminated.
|
||||
*/
|
||||
uint8_t msg[0];
|
||||
} StreamMsgNotifyError;
|
||||
|
||||
#define STREAM_MSG_CURSOR_SET_MAX_WIDTH 1024
|
||||
#define STREAM_MSG_CURSOR_SET_MAX_HEIGHT 1024
|
||||
|
||||
/* Guest cursor.
|
||||
* This message is sent by the guest to the host.
|
||||
*
|
||||
* States allowed: Streaming
|
||||
*/
|
||||
typedef struct StreamMsgCursorSet {
|
||||
/* basic cursor information */
|
||||
/* for security reasons width and height should
|
||||
* be limited to STREAM_MSG_CURSOR_SET_MAX_WIDTH and
|
||||
* STREAM_MSG_CURSOR_SET_MAX_HEIGHT */
|
||||
uint16_t width;
|
||||
uint16_t height;
|
||||
uint16_t hot_spot_x;
|
||||
uint16_t hot_spot_y;
|
||||
/* Cursor type, as defined by SpiceCursorType.
|
||||
* Only ALPHA, COLOR24 and COLOR32 are allowed by this protocol
|
||||
*/
|
||||
uint8_t type;
|
||||
|
||||
uint8_t padding1[3];
|
||||
|
||||
/* cursor data.
|
||||
* Format and size depends on cursor_header type and size
|
||||
*/
|
||||
uint8_t data[0];
|
||||
} StreamMsgCursorSet;
|
||||
|
||||
/* Guest cursor position
|
||||
* This message is sent by the guest to the host.
|
||||
*
|
||||
* States allowed: Streaming
|
||||
*/
|
||||
typedef struct StreamMsgCursorMove {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
} StreamMsgCursorMove;
|
||||
|
||||
#endif /* SPICE_STREAM_DEVICE_H_ */
|
41
spice-protocol/spice/types.h
Normal file
41
spice-protocol/spice/types.h
Normal file
@ -0,0 +1,41 @@
|
||||
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_SPICE_TYPES
|
||||
#define _H_SPICE_TYPES
|
||||
|
||||
/* We always want the standard int types
|
||||
* If they are not in stdint.h on your system,
|
||||
* include the right one here. */
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
|
||||
#endif /* _H_SPICE_TYPES */
|
293
spice-protocol/spice/vd_agent.h
Normal file
293
spice-protocol/spice/vd_agent.h
Normal file
@ -0,0 +1,293 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_VD_AGENT
|
||||
#define _H_VD_AGENT
|
||||
|
||||
#include <spice/types.h>
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
enum {
|
||||
VDP_CLIENT_PORT = 1,
|
||||
VDP_SERVER_PORT,
|
||||
VDP_END_PORT
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDIChunkHeader {
|
||||
uint32_t port;
|
||||
uint32_t size;
|
||||
} VDIChunkHeader;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentMessage {
|
||||
uint32_t protocol;
|
||||
uint32_t type;
|
||||
uint64_t opaque;
|
||||
uint32_t size;
|
||||
uint8_t data[0];
|
||||
} VDAgentMessage;
|
||||
|
||||
#define VD_AGENT_PROTOCOL 1
|
||||
#define VD_AGENT_MAX_DATA_SIZE 2048
|
||||
|
||||
#ifdef SPICE_DEPRECATED
|
||||
#define VD_AGENT_CLIPBOARD_MAX_SIZE_DEFAULT 1024
|
||||
#define VD_AGENT_CLIPBOARD_MAX_SIZE_ENV "SPICE_CLIPBOARD_MAX_SIZE"
|
||||
#endif
|
||||
|
||||
enum {
|
||||
VD_AGENT_MOUSE_STATE = 1,
|
||||
VD_AGENT_MONITORS_CONFIG,
|
||||
VD_AGENT_REPLY,
|
||||
/* Set clipboard data (both directions).
|
||||
* Message comes with type and data.
|
||||
* See VDAgentClipboard structure.
|
||||
*/
|
||||
VD_AGENT_CLIPBOARD,
|
||||
VD_AGENT_DISPLAY_CONFIG,
|
||||
VD_AGENT_ANNOUNCE_CAPABILITIES,
|
||||
/* Asks to listen for clipboard changes (both directions).
|
||||
* Remote should empty clipboard and wait for one
|
||||
* of the types passed.
|
||||
* See VDAgentClipboardGrab structure.
|
||||
*/
|
||||
VD_AGENT_CLIPBOARD_GRAB,
|
||||
/* Asks for clipboard data (both directions).
|
||||
* Request comes with a specific type.
|
||||
* See VDAgentClipboardRequest structure.
|
||||
*/
|
||||
VD_AGENT_CLIPBOARD_REQUEST,
|
||||
VD_AGENT_CLIPBOARD_RELEASE,
|
||||
VD_AGENT_FILE_XFER_START,
|
||||
VD_AGENT_FILE_XFER_STATUS,
|
||||
VD_AGENT_FILE_XFER_DATA,
|
||||
VD_AGENT_CLIENT_DISCONNECTED,
|
||||
VD_AGENT_MAX_CLIPBOARD,
|
||||
VD_AGENT_AUDIO_VOLUME_SYNC,
|
||||
VD_AGENT_END_MESSAGE,
|
||||
};
|
||||
|
||||
enum {
|
||||
VD_AGENT_FILE_XFER_STATUS_CAN_SEND_DATA,
|
||||
VD_AGENT_FILE_XFER_STATUS_CANCELLED,
|
||||
VD_AGENT_FILE_XFER_STATUS_ERROR,
|
||||
VD_AGENT_FILE_XFER_STATUS_SUCCESS,
|
||||
VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE,
|
||||
VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED,
|
||||
VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED,
|
||||
VD_AGENT_FILE_XFER_STATUS_DISABLED,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStatusMessage {
|
||||
uint32_t id;
|
||||
uint32_t result;
|
||||
/* Used to send additional data for detailed error messages
|
||||
* to clients with VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS capability.
|
||||
* Type of data varies with the result:
|
||||
* result : data type (NULL if no data)
|
||||
* VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE : uint64_t
|
||||
* VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED : NULL
|
||||
* VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED : NULL
|
||||
* VD_AGENT_FILE_XFER_STATUS_DISABLED : NULL
|
||||
*/
|
||||
uint8_t data[0];
|
||||
} VDAgentFileXferStatusMessage;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStartMessage {
|
||||
uint32_t id;
|
||||
uint8_t data[0];
|
||||
} VDAgentFileXferStartMessage;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentFileXferDataMessage {
|
||||
uint32_t id;
|
||||
uint64_t size;
|
||||
uint8_t data[0];
|
||||
} VDAgentFileXferDataMessage;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentMonConfig {
|
||||
/*
|
||||
* Note a width and height of 0 can be used to indicate a disabled
|
||||
* monitor, this may only be used with agents with the
|
||||
* VD_AGENT_CAP_SPARSE_MONITORS_CONFIG capability.
|
||||
*/
|
||||
uint32_t height;
|
||||
uint32_t width;
|
||||
uint32_t depth;
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
} VDAgentMonConfig;
|
||||
|
||||
enum {
|
||||
VD_AGENT_CONFIG_MONITORS_FLAG_USE_POS = (1 << 0),
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentMonitorsConfig {
|
||||
uint32_t num_of_monitors;
|
||||
uint32_t flags;
|
||||
VDAgentMonConfig monitors[0];
|
||||
} VDAgentMonitorsConfig;
|
||||
|
||||
enum {
|
||||
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_WALLPAPER = (1 << 0),
|
||||
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_FONT_SMOOTH = (1 << 1),
|
||||
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_ANIMATION = (1 << 2),
|
||||
VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH = (1 << 3),
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentDisplayConfig {
|
||||
uint32_t flags;
|
||||
uint32_t depth;
|
||||
} VDAgentDisplayConfig;
|
||||
|
||||
#define VD_AGENT_LBUTTON_MASK (1 << 1)
|
||||
#define VD_AGENT_MBUTTON_MASK (1 << 2)
|
||||
#define VD_AGENT_RBUTTON_MASK (1 << 3)
|
||||
#define VD_AGENT_UBUTTON_MASK (1 << 4)
|
||||
#define VD_AGENT_DBUTTON_MASK (1 << 5)
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentMouseState {
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t buttons;
|
||||
uint8_t display_id;
|
||||
} VDAgentMouseState;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentReply {
|
||||
uint32_t type;
|
||||
uint32_t error;
|
||||
} VDAgentReply;
|
||||
|
||||
enum {
|
||||
VD_AGENT_SUCCESS = 1,
|
||||
VD_AGENT_ERROR,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentClipboard {
|
||||
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
|
||||
uint8_t selection;
|
||||
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
|
||||
#endif
|
||||
uint32_t type;
|
||||
uint8_t data[0];
|
||||
} VDAgentClipboard;
|
||||
|
||||
enum {
|
||||
VD_AGENT_CLIPBOARD_NONE = 0,
|
||||
VD_AGENT_CLIPBOARD_UTF8_TEXT,
|
||||
VD_AGENT_CLIPBOARD_IMAGE_PNG, /* All clients with image support should support this one */
|
||||
VD_AGENT_CLIPBOARD_IMAGE_BMP, /* optional */
|
||||
VD_AGENT_CLIPBOARD_IMAGE_TIFF, /* optional */
|
||||
VD_AGENT_CLIPBOARD_IMAGE_JPG, /* optional */
|
||||
};
|
||||
|
||||
enum {
|
||||
VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD = 0,
|
||||
VD_AGENT_CLIPBOARD_SELECTION_PRIMARY,
|
||||
VD_AGENT_CLIPBOARD_SELECTION_SECONDARY,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentClipboardGrab {
|
||||
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
|
||||
uint8_t selection;
|
||||
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
|
||||
#endif
|
||||
uint32_t types[0];
|
||||
} VDAgentClipboardGrab;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentClipboardRequest {
|
||||
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
|
||||
uint8_t selection;
|
||||
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
|
||||
#endif
|
||||
uint32_t type;
|
||||
} VDAgentClipboardRequest;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentClipboardRelease {
|
||||
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
|
||||
uint8_t selection;
|
||||
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
|
||||
#endif
|
||||
uint8_t dummy_empty_field[0]; /* C/C++ compatibility */
|
||||
} VDAgentClipboardRelease;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentMaxClipboard {
|
||||
int32_t max;
|
||||
} VDAgentMaxClipboard;
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentAudioVolumeSync {
|
||||
uint8_t is_playback;
|
||||
uint8_t mute;
|
||||
uint8_t nchannels;
|
||||
uint16_t volume[0];
|
||||
} VDAgentAudioVolumeSync;
|
||||
|
||||
enum {
|
||||
VD_AGENT_CAP_MOUSE_STATE = 0,
|
||||
VD_AGENT_CAP_MONITORS_CONFIG,
|
||||
VD_AGENT_CAP_REPLY,
|
||||
VD_AGENT_CAP_CLIPBOARD,
|
||||
VD_AGENT_CAP_DISPLAY_CONFIG,
|
||||
VD_AGENT_CAP_CLIPBOARD_BY_DEMAND,
|
||||
VD_AGENT_CAP_CLIPBOARD_SELECTION,
|
||||
VD_AGENT_CAP_SPARSE_MONITORS_CONFIG,
|
||||
VD_AGENT_CAP_GUEST_LINEEND_LF,
|
||||
VD_AGENT_CAP_GUEST_LINEEND_CRLF,
|
||||
VD_AGENT_CAP_MAX_CLIPBOARD,
|
||||
VD_AGENT_CAP_AUDIO_VOLUME_SYNC,
|
||||
VD_AGENT_CAP_MONITORS_CONFIG_POSITION,
|
||||
VD_AGENT_CAP_FILE_XFER_DISABLED,
|
||||
VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS,
|
||||
VD_AGENT_END_CAP,
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDAgentAnnounceCapabilities {
|
||||
uint32_t request;
|
||||
uint32_t caps[0];
|
||||
} VDAgentAnnounceCapabilities;
|
||||
|
||||
#define VD_AGENT_CAPS_SIZE_FROM_MSG_SIZE(msg_size) \
|
||||
(((msg_size) - sizeof(VDAgentAnnounceCapabilities)) / sizeof(uint32_t))
|
||||
|
||||
#define VD_AGENT_CAPS_SIZE ((VD_AGENT_END_CAP + 31) / 32)
|
||||
|
||||
#define VD_AGENT_CAPS_BYTES (((VD_AGENT_END_CAP + 31) / 8) & ~3)
|
||||
|
||||
#define VD_AGENT_HAS_CAPABILITY(caps, caps_size, index) \
|
||||
((index) < (caps_size * 32) && ((caps)[(index) / 32] & (1 << ((index) % 32))))
|
||||
|
||||
#define VD_AGENT_SET_CAPABILITY(caps, index) \
|
||||
{ (caps)[(index) / 32] |= (1 << ((index) % 32)); }
|
||||
|
||||
#define VD_AGENT_CLEAR_CAPABILITY(caps, index) \
|
||||
{ (caps)[(index) / 32] &= ~(1 << ((index) % 32)); }
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif /* _H_VD_AGENT */
|
87
spice-protocol/spice/vdi_dev.h
Normal file
87
spice-protocol/spice/vdi_dev.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
Copyright (C) 2009 Red Hat, Inc.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _H_VDI_DEV
|
||||
#define _H_VDI_DEV
|
||||
|
||||
#include <spice/types.h>
|
||||
#include <spice/barrier.h>
|
||||
#include <spice/ipc_ring.h>
|
||||
#include <spice/macros.h>
|
||||
|
||||
#include <spice/start-packed.h>
|
||||
|
||||
#ifndef SPICE_DISABLE_DEPRECATED
|
||||
#error "This SPICE interface is deprecated"
|
||||
#endif
|
||||
|
||||
#define REDHAT_PCI_VENDOR_ID 0x1b36
|
||||
|
||||
#define VDI_PORT_DEVICE_ID 0x0105
|
||||
#define VDI_PORT_REVISION 0x01
|
||||
|
||||
#define VDI_PORT_INTERRUPT (1 << 0)
|
||||
|
||||
#define VDI_PORT_MAGIC SPICE_MAGIC_CONST("VDIP")
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDIPortPacket {
|
||||
uint32_t gen;
|
||||
uint32_t size;
|
||||
uint8_t data[512 - 2 * sizeof(uint32_t)];
|
||||
} VDIPortPacket;
|
||||
|
||||
SPICE_RING_DECLARE(VDIPortRing, VDIPortPacket, 32);
|
||||
|
||||
enum {
|
||||
VDI_PORT_IO_RANGE_INDEX,
|
||||
VDI_PORT_RAM_RANGE_INDEX,
|
||||
};
|
||||
|
||||
enum {
|
||||
VDI_PORT_IO_CONNECTION,
|
||||
VDI_PORT_IO_NOTIFY = 4,
|
||||
VDI_PORT_IO_UPDATE_IRQ = 8,
|
||||
|
||||
VDI_PORT_IO_RANGE_SIZE = 12
|
||||
};
|
||||
|
||||
typedef struct SPICE_ATTR_PACKED VDIPortRam {
|
||||
uint32_t magic;
|
||||
uint32_t generation;
|
||||
uint32_t int_pending;
|
||||
uint32_t int_mask;
|
||||
VDIPortRing input;
|
||||
VDIPortRing output;
|
||||
uint32_t reserv[32];
|
||||
} VDIPortRam;
|
||||
|
||||
#include <spice/end-packed.h>
|
||||
|
||||
#endif /* _H_VDI_DEV */
|
@ -1,32 +1,28 @@
|
||||
--- spiceterm/Makefile.alt 2018-11-21 13:04:57.511676425 +0300
|
||||
+++ spiceterm/Makefile 2018-11-21 13:44:23.865951494 +0300
|
||||
@@ -14,9 +14,9 @@ PROGRAMS=spiceterm
|
||||
--- spiceterm/src/Makefile.alt 2019-08-05 10:09:25.590066489 +0000
|
||||
+++ spiceterm/src/Makefile 2019-08-05 10:13:10.830105629 +0000
|
||||
@@ -3,7 +3,7 @@ PROGRAMS=spiceterm
|
||||
HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h
|
||||
SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c
|
||||
|
||||
-PKGS := glib-2.0 spice-protocol spice-server libsasl2
|
||||
-CFLAGS += `pkg-config --cflags $(PKGS)`
|
||||
-LIBS += `pkg-config --libs $(PKGS)`
|
||||
+PKGS := gobject-2.0 gio-2.0 spice-protocol libsasl2 pixman-1
|
||||
+CFLAGS = $(shell pkg-config --cflags $(PKGS))
|
||||
+LIBS = $(shell pkg-config --libs $(PKGS))
|
||||
-PKGS := glib-2.0 spice-protocol spice-server
|
||||
+PKGS := gobject-2.0 gio-2.0 libsasl2 pixman-1
|
||||
CFLAGS += `pkg-config --cflags $(PKGS)`
|
||||
LIBS += `pkg-config --libs $(PKGS)`
|
||||
|
||||
#export G_MESSAGES_DEBUG=all
|
||||
#export SPICE_DEBUG=1
|
||||
@@ -24,7 +24,10 @@ LIBS += `pkg-config --libs $(PKGS)`
|
||||
@@ -13,7 +13,10 @@ LIBS += `pkg-config --libs $(PKGS)`
|
||||
all: ${PROGRAMS}
|
||||
|
||||
spiceterm: ${SOURCES} ${HEADERS} spiceterm.c
|
||||
spiceterm: ${SOURCES} ${HEADERS} spiceterm.c
|
||||
- gcc -Werror -Wall -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) -o $@ -lutil $(LIBS)
|
||||
+ gcc -Werror -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) \
|
||||
+ -I$(shell pwd)/spice/server -o $@ \
|
||||
+ $(shell pwd)/spice/server/.libs/libspice-server.a \
|
||||
+ -I$(shell pwd)/../spice-protocol -I$(shell pwd)/../spice/server -o $@ \
|
||||
+ $(shell pwd)/../spice/server/.libs/libspice-server.a \
|
||||
+ $(LIBS) -lutil -lpthread -lm -llz4 -lopus -ljpeg -lssl -lcrypto -lz
|
||||
|
||||
genfont: genfont.c
|
||||
gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
|
||||
--- spiceterm/input.c.alt 2017-12-01 12:20:31.000000000 +0300
|
||||
+++ spiceterm/input.c 2018-11-21 13:04:57.511676425 +0300
|
||||
--- spiceterm/src/input.c.alt 2019-05-23 16:19:12.000000000 +0000
|
||||
+++ spiceterm/src/input.c 2019-08-05 10:09:25.590066489 +0000
|
||||
@@ -732,7 +732,7 @@ parse_keymap(const char *language)
|
||||
}
|
||||
}
|
||||
@ -36,9 +32,9 @@
|
||||
FILE *f = fopen(filename, "r");
|
||||
g_free(filename);
|
||||
if (!f) {
|
||||
--- spiceterm/spiceterm.pod.alt 2017-12-01 12:20:31.000000000 +0300
|
||||
+++ spiceterm/spiceterm.pod 2018-11-21 13:04:57.511676425 +0300
|
||||
@@ -55,7 +55,7 @@ the C<SPICE_TICKET> environment variable
|
||||
--- spiceterm/src/spiceterm.pod.alt 2019-05-23 16:19:12.000000000 +0000
|
||||
+++ spiceterm/src/spiceterm.pod 2019-08-05 10:09:25.590066489 +0000
|
||||
@@ -49,7 +49,7 @@ the C<SPICE_TICKET> environment variable
|
||||
|
||||
Due to SPICE protocol limitation, you need to specify the keyboard
|
||||
layout used by the client. We currently use the keymap files from kvm
|
||||
|
@ -1,80 +1,42 @@
|
||||
RELEASE=5.0
|
||||
include /usr/share/dpkg/pkg-info.mk
|
||||
include /usr/share/dpkg/architecture.mk
|
||||
|
||||
PACKAGE=spiceterm
|
||||
VERSION=3.0
|
||||
PACKAGERELEASE=5
|
||||
|
||||
ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||
GITVERSION:=$(shell cat .git/refs/heads/master)
|
||||
BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
|
||||
|
||||
DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb
|
||||
export VERSION=$(DEB_VERSION_UPSTREAM)
|
||||
|
||||
PROGRAMS=spiceterm
|
||||
DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
|
||||
DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
|
||||
|
||||
HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h
|
||||
SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c
|
||||
${BUILDDIR}: src/ debian/
|
||||
rm -rf $(BUILDDIR)
|
||||
rsync -a src/ debian $(BUILDDIR)
|
||||
echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout ${GITVERSION}" > $(BUILDDIR)/debian/SOURCE
|
||||
|
||||
PKGS := glib-2.0 spice-protocol spice-server libsasl2
|
||||
CFLAGS += `pkg-config --cflags $(PKGS)`
|
||||
LIBS += `pkg-config --libs $(PKGS)`
|
||||
|
||||
#export G_MESSAGES_DEBUG=all
|
||||
#export SPICE_DEBUG=1
|
||||
|
||||
all: ${PROGRAMS}
|
||||
|
||||
spiceterm: ${SOURCES} ${HEADERS} spiceterm.c
|
||||
gcc -Werror -Wall -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) -o $@ -lutil $(LIBS)
|
||||
|
||||
genfont: genfont.c
|
||||
gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
|
||||
|
||||
keysyms.h: genkeysym.pl
|
||||
./genkeysym.pl >$@
|
||||
|
||||
.PHONY: glyphs
|
||||
glyphs: genfont
|
||||
./genfont > glyphs.h
|
||||
|
||||
spiceterm.1: spiceterm.pod
|
||||
rm -f $@
|
||||
pod2man -n $< -s 1 -r ${VERSION} <$< >$@
|
||||
|
||||
.PHONY: install
|
||||
install: spiceterm spiceterm.1
|
||||
mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE}
|
||||
install -m 0644 copyright ${DESTDIR}/usr/share/doc/${PACKAGE}
|
||||
mkdir -p ${DESTDIR}/usr/share/man/man1
|
||||
install -m 0644 spiceterm.1 ${DESTDIR}/usr/share/man/man1
|
||||
mkdir -p ${DESTDIR}/usr/bin
|
||||
install -s -m 0755 spiceterm ${DESTDIR}/usr/bin
|
||||
.PHONY: dsc
|
||||
dsc: ${DSC}
|
||||
${DSC}: $(BUILDDIR)
|
||||
cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
|
||||
lintian ${DSC}
|
||||
|
||||
.PHONY: deb
|
||||
deb: ${DEB}
|
||||
${DEB}:
|
||||
make clean
|
||||
rsync -a . --exclude build build
|
||||
echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
|
||||
cd build; dpkg-buildpackage -rfakeroot -b -us -uc
|
||||
${DEB}: $(BUILDDIR)
|
||||
cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
|
||||
lintian ${DEB}
|
||||
|
||||
.PHONY: dinstall
|
||||
dinstall: ${DEB}
|
||||
dpkg -i ${DEB}
|
||||
|
||||
|
||||
.PHONY: upload
|
||||
upload: ${DEB}
|
||||
tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
|
||||
tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist buster --arch ${ARCH}
|
||||
|
||||
.PHONY: test
|
||||
test: spiceterm
|
||||
./spiceterm --noauth --keymap de & remote-viewer spice://localhost?tls-port=5900
|
||||
#G_MESSAGES_DEBUG=all SPICE_DEBUG=1 SPICE_TICKET=test ./spiceterm & G_MESSAGES_DEBUG=all SPICE_DEBUG=1 remote-viewer --debug 'spice://localhost?tls-port=5900' --spice-ca-file /etc/pve/pve-root-ca.pem --spice-secure-channels=all
|
||||
|
||||
.PHONY: distclean
|
||||
.PHONY: distclean clean
|
||||
distclean: clean
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf *~ ${PROGRAMS} build *.deb *.changes genfont
|
||||
rm -rf *~ $(PACKAGE)-*/ *.deb *.changes genfont *.buildinfo *.dsc *.tar.gz
|
||||
|
@ -1,3 +1,9 @@
|
||||
spiceterm (3.1-1) pve; urgency=medium
|
||||
|
||||
* rebuild for PVE 6.0 / Debian Buster
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 22 May 2019 17:49:23 +0200
|
||||
|
||||
spiceterm (3.0-5) unstable; urgency=medium
|
||||
|
||||
* fix add_keymap_entry for non us keymaps
|
||||
|
@ -1 +1 @@
|
||||
8
|
||||
11
|
||||
|
@ -1,17 +1,16 @@
|
||||
Source: spiceterm
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Priority: optional
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Build-Depends: debhelper (>= 8.0.0),
|
||||
Build-Depends: debhelper (>= 11),
|
||||
libglib2.0-dev,
|
||||
libsasl2-dev,
|
||||
libspice-protocol-dev,
|
||||
pve-libspice-server-dev,
|
||||
Standards-Version: 3.9.3
|
||||
libspice-server-dev,
|
||||
Standards-Version: 4.1.3
|
||||
|
||||
Package: spiceterm
|
||||
Architecture: any
|
||||
Depends: pve-libspice-server1,
|
||||
Depends: libspice-server1,
|
||||
pve-qemu-kvm,
|
||||
${misc:Depends},
|
||||
${shlibs:Depends},
|
||||
|
1
spiceterm/debian/source/format
Normal file
1
spiceterm/debian/source/format
Normal file
@ -0,0 +1 @@
|
||||
1.0
|
47
spiceterm/src/Makefile
Normal file
47
spiceterm/src/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
PROGRAMS=spiceterm
|
||||
|
||||
HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h
|
||||
SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c
|
||||
|
||||
PKGS := glib-2.0 spice-protocol spice-server
|
||||
CFLAGS += `pkg-config --cflags $(PKGS)`
|
||||
LIBS += `pkg-config --libs $(PKGS)`
|
||||
|
||||
#export G_MESSAGES_DEBUG=all
|
||||
#export SPICE_DEBUG=1
|
||||
|
||||
all: ${PROGRAMS}
|
||||
|
||||
spiceterm: ${SOURCES} ${HEADERS} spiceterm.c
|
||||
gcc -Werror -Wall -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) -o $@ -lutil $(LIBS)
|
||||
|
||||
genfont: genfont.c
|
||||
gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz
|
||||
|
||||
keysyms.h: genkeysym.pl
|
||||
./genkeysym.pl >$@
|
||||
|
||||
.PHONY: glyphs
|
||||
glyphs: genfont
|
||||
./genfont > glyphs.h
|
||||
|
||||
spiceterm.1: spiceterm.pod
|
||||
rm -f $@
|
||||
pod2man -n $< -s 1 -r ${VERSION} <$< >$@
|
||||
|
||||
.PHONY: install
|
||||
install: spiceterm spiceterm.1
|
||||
mkdir -p ${DESTDIR}/usr/share/man/man1
|
||||
install -m 0644 spiceterm.1 ${DESTDIR}/usr/share/man/man1
|
||||
mkdir -p ${DESTDIR}/usr/bin
|
||||
install -s -m 0755 spiceterm ${DESTDIR}/usr/bin
|
||||
|
||||
.PHONY: test
|
||||
test: spiceterm
|
||||
./spiceterm --noauth --keymap de & remote-viewer spice://localhost?tls-port=5900
|
||||
#G_MESSAGES_DEBUG=all SPICE_DEBUG=1 SPICE_TICKET=test ./spiceterm & G_MESSAGES_DEBUG=all SPICE_DEBUG=1 remote-viewer --debug 'spice://localhost?tls-port=5900' --spice-ca-file /etc/pve/pve-root-ca.pem --spice-secure-channels=all
|
||||
|
||||
.PHONY: distclean clean
|
||||
distclean: clean
|
||||
clean:
|
||||
rm -rf *~ *.deb genfont $(PROGRAMS) spiceterm.1
|
@ -74,8 +74,8 @@ pve_auth_verify(const char *clientip, const char *username, const char *passwd)
|
||||
goto err;
|
||||
}
|
||||
|
||||
char buf[8192];
|
||||
char form[8192];
|
||||
char buf[8292];
|
||||
char form[8092];
|
||||
|
||||
char *p = form;
|
||||
p = urlencode(p, "username");
|
@ -40,7 +40,6 @@
|
||||
#include <spice/macros.h>
|
||||
#include <spice/qxl_dev.h>
|
||||
#include <spice/vd_agent.h>
|
||||
#include <sasl/sasl.h>
|
||||
|
||||
#include "glyphs.h"
|
||||
|
||||
@ -713,50 +712,6 @@ spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar2 ch,
|
||||
push_command(spice_screen, &update->ext);
|
||||
}
|
||||
|
||||
static int
|
||||
sasl_checkpass_cb(sasl_conn_t *conn,
|
||||
void *context,
|
||||
const char *user,
|
||||
const char *pass,
|
||||
unsigned passlen,
|
||||
struct propctx *propctx)
|
||||
{
|
||||
const void *remoteport = NULL;
|
||||
char *clientip = NULL;
|
||||
if (sasl_getprop(conn, SASL_IPREMOTEPORT, &remoteport) == SASL_OK) {
|
||||
clientip = strtok(g_strdup(remoteport), ";");
|
||||
} else {
|
||||
clientip = g_strdup("unknown");
|
||||
}
|
||||
|
||||
int res = pve_auth_verify(clientip, user, pass);
|
||||
|
||||
g_free(clientip);
|
||||
|
||||
return (res == 0) ? SASL_OK : SASL_NOAUTHZ;
|
||||
}
|
||||
|
||||
static int
|
||||
sasl_getopt_cb(void *context, const char *plugin_name,
|
||||
const char *option,
|
||||
const char **result, unsigned *len)
|
||||
{
|
||||
if (strcmp(option, "mech_list") == 0) {
|
||||
*result = "plain";
|
||||
len = NULL;
|
||||
return SASL_OK;
|
||||
}
|
||||
|
||||
return SASL_FAIL;
|
||||
}
|
||||
|
||||
typedef int sasl_cb_fn(void);
|
||||
static sasl_callback_t sasl_callbacks[] = {
|
||||
{ SASL_CB_GETOPT, (sasl_cb_fn *)sasl_getopt_cb, NULL },
|
||||
{ SASL_CB_SERVER_USERDB_CHECKPASS, (sasl_cb_fn *)sasl_checkpass_cb, NULL },
|
||||
{ SASL_CB_LIST_END, NULL, NULL },
|
||||
};
|
||||
|
||||
SpiceScreen *
|
||||
spice_screen_new(SpiceCoreInterface *core, uint32_t width, uint32_t height,
|
||||
SpiceTermOptions *opts)
|
||||
@ -806,15 +761,9 @@ spice_screen_new(SpiceCoreInterface *core, uint32_t width, uint32_t height,
|
||||
if (opts->noauth) {
|
||||
spice_server_set_noauth(server);
|
||||
} else {
|
||||
if (opts->sasl) {
|
||||
spice_server_set_sasl(server, 1);
|
||||
spice_server_set_sasl_appname(server, NULL); // enforce pve auth
|
||||
spice_server_set_sasl_callbacks(server, sasl_callbacks);
|
||||
} else {
|
||||
char *ticket = getenv("SPICE_TICKET");
|
||||
if (ticket) {
|
||||
spice_server_set_ticket(server, ticket, 300, 0, 0);
|
||||
}
|
||||
char *ticket = getenv("SPICE_TICKET");
|
||||
if (ticket) {
|
||||
spice_server_set_ticket(server, ticket, 300, 0, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1601,7 +1601,6 @@ spiceterm_print_usage(const char *msg)
|
||||
fprintf(stderr, " --permission <perm> Required permissions (PVE AUTH)\n");
|
||||
fprintf(stderr, " --port <port> Bind to port <port>\n");
|
||||
fprintf(stderr, " --addr <addr> Bind to address <addr>\n");
|
||||
fprintf(stderr, " --sasl Enable SASL based authentication\n");
|
||||
fprintf(stderr, " --noauth Disable authentication\n");
|
||||
fprintf(stderr, " --keymap Spefify keymap (uses kvm keymap files)\n");
|
||||
}
|
||||
@ -1621,7 +1620,6 @@ main (int argc, char** argv)
|
||||
.port = 5900,
|
||||
.addr = NULL,
|
||||
.noauth = FALSE,
|
||||
.sasl = FALSE,
|
||||
};
|
||||
|
||||
static struct option long_options[] = {
|
||||
@ -1632,19 +1630,14 @@ main (int argc, char** argv)
|
||||
{ "addr", required_argument, 0, 'a' },
|
||||
{ "keymap", required_argument, 0, 'k' },
|
||||
{ "noauth", no_argument, 0, 'n' },
|
||||
{ "sasl", no_argument, 0, 's' },
|
||||
{ NULL, 0, 0, 0 },
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "nkst:a:p:P:", long_options, NULL)) != -1) {
|
||||
|
||||
while ((c = getopt_long(argc, argv, "nkt:a:p:P:", long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'n':
|
||||
opts.noauth = TRUE;
|
||||
break;
|
||||
case 's':
|
||||
opts.sasl = TRUE;
|
||||
break;
|
||||
case 'k':
|
||||
opts.keymap = optarg;
|
||||
break;
|
@ -30,7 +30,6 @@ typedef struct SpiceTermOptions {
|
||||
char *addr;
|
||||
char *keymap;
|
||||
gboolean noauth;
|
||||
gboolean sasl;
|
||||
} SpiceTermOptions;
|
||||
|
||||
typedef struct SpiceScreen SpiceScreen;
|
@ -12,7 +12,6 @@ spiceterm - SPICE Terminal Emulator
|
||||
--permission <perm> Required permissions (PVE AUTH)
|
||||
--port <port> Bind to port <port>
|
||||
--addr <addr> Bind to address <addr>
|
||||
--sasl Enable SASL based authentication
|
||||
--noauth Disable authentication
|
||||
--keymap Spefify keymap (uses kvm keymap files)
|
||||
|
||||
@ -31,8 +30,6 @@ using the SPICE protocol. Implements a 'xterm' compatible terminal.
|
||||
|
||||
=item screen resize (vdagent)
|
||||
|
||||
=item SASL support
|
||||
|
||||
=item use TLS to encrypt all traffic
|
||||
|
||||
=item use Proxmox VE authentication
|
||||
@ -41,10 +38,7 @@ using the SPICE protocol. Implements a 'xterm' compatible terminal.
|
||||
|
||||
=head1 Authentication
|
||||
|
||||
You can disable authentication using the C<--noauth> option.
|
||||
|
||||
Please use C<--sasl> if you want to connect with username and password
|
||||
(password if verified using the Proxmox VE auth framework).
|
||||
You can disable authentication using the C<--noauth> option.
|
||||
|
||||
Ticket authentication is default, and you should pass the ticket using
|
||||
the C<SPICE_TICKET> environment variable.
|
Loading…
Reference in New Issue
Block a user