diff options
author | Keith Packard <keithp@keithp.com> | 2017-12-13 15:12:26 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-12-13 15:12:26 -0800 |
commit | ff6788773350194cbbec8681a29b83bacc462542 (patch) | |
tree | 75ec0ef9bb3f5684502c249712964447ac655e08 | |
parent | 9e8bdf489bf973edbaeea0e662fc9421e25089be (diff) | |
parent | e4917e1b3f52b0ec5279fc46d568b9fa5e6b5025 (diff) |
Merge pmproto
-rw-r--r-- | .gitignore | 14 | ||||
-rw-r--r-- | COPYING | 24 | ||||
-rw-r--r-- | Makefile.am | 21 | ||||
-rw-r--r-- | PM.h | 54 | ||||
-rw-r--r-- | PM_spec | 153 | ||||
-rw-r--r-- | PMproto.h | 74 | ||||
-rw-r--r-- | README | 26 | ||||
-rwxr-xr-x | autogen.sh | 12 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | xproxymngproto.pc.in | 9 |
10 files changed, 399 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21be2ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.log +config.status +configure +install-sh +missing +xproxymngproto.pc +*~ +xproxymanagementprotocol-*.tar.* +ChangeLog +tags @@ -0,0 +1,24 @@ +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..4781d1f --- /dev/null +++ b/Makefile.am @@ -0,0 +1,21 @@ +xproxymngdir = $(includedir)/X11/PM +xproxymng_HEADERS = \ + PM.h \ + PMproto.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = xproxymngproto.pc + +dist_doc_DATA = PM_spec + +EXTRA_DIST = xproxymngproto.pc.in + +EXTRA_DIST += ChangeLog +MAINTAINERCLEANFILES = ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog @@ -0,0 +1,54 @@ +/* $Xorg: PM.h,v 1.4 2001/02/09 02:05:34 xorgcvs Exp $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ + +/* Proxy Management Protocol */ + +#ifndef _PM_H_ +#define _PM_H_ + +#define PM_PROTOCOL_NAME "PROXY_MANAGEMENT" + +#define PM_MAJOR_VERSION 1 +#define PM_MINOR_VERSION 0 + +/* + * PM minor opcodes + */ +#define PM_Error ICE_Error /* == 0 */ +#define PM_GetProxyAddr 1 +#define PM_GetProxyAddrReply 2 +#define PM_StartProxy 3 + +/* + * status return codes for GetProxyAddrReply + */ +#define PM_Unable 0 +#define PM_Success 1 +#define PM_Failure 2 + +#endif /* _PM_H_ */ @@ -0,0 +1,153 @@ + Proxy Management Protocol + Draft Version 1.0 + Ralph Mor, X Consortium + + +The Proxy Management Protocol is an ICE based protocol that provides a way +for application servers to easily locate proxy services available to them. + +Typically, a service called a "proxy manager" is responsible for resolving +requests for proxy services, starting new proxies when appropriate, and +keeping track of all of the available proxy services. The proxy manager +strives to reuse existing proxies whenever possible. + +In order to request a proxy service, the GET_PROXY_ADDR message is sent to +the proxy manager. The proxy manager will in turn forward this message to +a proxy that it thinks can satisfy the request. + +GET_PROXY_ADDR + proxy-service : STRING + server-address : STRING + host-address : STRING + options : STRING + auth-data-len : CARD16 + auth-name : STRING or None + auth-data : LISTofCARD8 or None + + --> + + status : CARD8 + proxy-address : STRING + failure-reason : STRING + + +proxy-service is the name of the proxy service to be requested, for example +"LBX". proxy-service is a case insensitive string. + +server-address is the network address of the target server. The format of +the address is specific to proxy-service. For example, for a proxy service +of "LBX", the address would be an X display address (e.g, "wkstn.x.org:0"). + +host-address is the network address of the host on which the proxied +application will run. This information might be used by the proxy to +restrict access to a specific host. + +options are proxy specific options that will be passed to the proxy. The +details of these options are not specified here. Their syntax and +semantics are defined by each proxy service. + +If auth-data-len is nonzero, then auth-name and auth-data contain +authentication or authorization information that should be passed to +the proxy. The proxy will typically use this to authenticate and +authorize itself to the target server. The details of how the +auth fields are used are specific to each proxy service. + + +After sending GET_PROXY_ADDR the proxy manager expects a reply from +the proxy. The status field of the reply indicates if the request can +be satisfied. + +If status is Success, proxy-address will contain the network address of the +proxy willing to handle this request. The format of the proxy address is +specific to the proxy service being used. For example, for a proxy service +of "LBX", the proxy address would be the X display address of the proxy +(e.g, "gateway.x.org:63"). The proxy manager will forward the successful +GET_PROXY_ADDR reply to whomever requested the proxy service. + +If status is Unable, the proxy is not able to satisfy the request but +it believes some other proxy might be able to do so. Proxy-address is +the empty string and failure-reason indicates the reason for failure. +The proxy manager may choose to forward the original GET_PROXY_ADDR to +another already running proxy, or it may choose to start up a new +proxy. In the event that the proxy manager can not find or start a +proxy, it will send a GET_PROXY_ADDR reply (with status Failure and an +appropriate failure-reason) to whomever requested the proxy service. + +If status is Failure, the proxy is not able to satisfy the request and +in addition is informing the requester that the request is invalid in +some way and should not be retried. + + +If the proxy manager starts up a new proxy, the proxy manager will +need an indication from the proxy that it is ready to accept +requests. The proxy is required to send a START_PROXY message to the +proxy manager to identify itself and signal its readiness to receive +requests. + +START_PROXY + proxy-service : STRING (name of proxy service, e.g. "LBX") + + +When the proxy manager receives the START_PROXY message from the +proxy it checks that the proxy-service is the one that it's expecting. +If the proxy-service is incorrect, an IceBadValue error will be sent +to the proxy. Otherwise, the proxy manager will forward the original +GET_PROXY_ADDR request to the proxy and the proxy will respond to the +GET_PROXY_ADDR request in the same way as discussed above. + + +Protocol +-------- + +ICE protocol name is "PROXY_MANAGEMENT". +The major opcode is assigned at run-time by ICE. + + +Types +----- + +STRING + 2 CARD16 length + n LISTofCARD8 the string + p p = pad(2+n,8) + + + +Encoding +-------- + +GET_PROXY_ADDR + + 1 ? PROXY_MANAGEMENT + 1 1 opcode + 2 n auth-data-len (in bytes) + 4 (a+b+c+d+e+n+p)/8 length of remaining data in 8-byte units + a STRING proxy-service + b STRING server-address + c STRING host-address + d STRING options + e STRING auth-name (if auth-data-len > 0) + n LISTofCARD8 auth-data (if auth-data-len > 0) + p unused, p=pad(n,8) + +GET_PROXY_ADDR_REPLY + + 1 ? PROXY_MANAGEMENT + 1 2 opcode + 1 CARD8 status + 0 Unable + 1 Success + 2 Failure + 1 unused + 4 (a+b)/8 length of remaining data in 8-byte units + a STRING proxy-address + b STRING failure-reason + + +START_PROXY + + 1 ? PROXY_MANAGEMENT + 1 3 opcode + 2 unused + 4 a/8 length of remaining data in 8-byte units + a STRING proxy-service diff --git a/PMproto.h b/PMproto.h new file mode 100644 index 0000000..754e460 --- /dev/null +++ b/PMproto.h @@ -0,0 +1,74 @@ +/* $Xorg: PMproto.h,v 1.4 2001/02/09 02:05:34 xorgcvs Exp $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ + +/* Proxy Management Protocol */ + +#ifndef _PMPROTO_H_ +#define _PMPROTO_H_ + +typedef struct { + CARD8 majorOpcode; + CARD8 minorOpcode; /* == 1 */ + CARD16 authLen B16; + CARD32 length B32; + /* STRING proxy-service */ + /* STRING server-address */ + /* STRING host-address */ + /* STRING start-options */ + /* STRING auth-name (if authLen > 0) */ + /* LISTofCARD8 auth-data (if authLen > 0) */ +} pmGetProxyAddrMsg; + +#define sz_pmGetProxyAddrMsg 8 + + +typedef struct { + CARD8 majorOpcode; + CARD8 minorOpcode; /* == 2 */ + CARD8 status; + CARD8 unused; + CARD32 length B32; + /* STRING proxy-address */ + /* STRING failure-reason */ +} pmGetProxyAddrReplyMsg; + +#define sz_pmGetProxyAddrReplyMsg 8 + + +typedef struct { + CARD8 majorOpcode; + CARD8 minorOpcode; /* == 3 */ + CARD16 unused B16; + CARD32 length B32; + /* STRING proxy-service */ +} pmStartProxyMsg; + +#define sz_pmStartProxyMsg 8 + + +#endif /* _PMPROTO_H_ */ @@ -0,0 +1,26 @@ +The Proxy Management Protocol is an ICE based protocol that provides a way +for application servers to easily locate proxy services available to them. + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +Please submit bug reports to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/proto/pmproto + + http://cgit.freedesktop.org/xorg/proto/pmproto + +For patch submission instructions, see: + + http://www.x.org/wiki/Development/Documentation/SubmittingPatches + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage + diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..904cd67 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..966bc5d --- /dev/null +++ b/configure.ac @@ -0,0 +1,12 @@ +AC_PREREQ([2.57]) +AC_INIT([XProxyManagementProtocol], [1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) + +# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.3) +XORG_DEFAULT_OPTIONS + +AC_OUTPUT([Makefile + xproxymngproto.pc]) diff --git a/xproxymngproto.pc.in b/xproxymngproto.pc.in new file mode 100644 index 0000000..4c4afcc --- /dev/null +++ b/xproxymngproto.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: XProxyManagementProtocol +Description: X Proxy Management Protocol headers +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} |