From 194a7c203234e50d51fdd3b8bef646ca898507df Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 14 Feb 2024 18:45:35 +0100 Subject: [PATCH] os: move xdmcp prototypes to separate header The xdmcp handling isn't really OS specific, and only few sites actually need to call it, so at least it's prototypes are better off in some separate header. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- os/access.c | 1 + os/auth.c | 1 + os/connection.c | 1 + os/osdep.h | 26 -------------------------- os/utils.c | 1 + os/xdmauth.c | 1 + os/xdmcp.c | 1 + os/xdmcp.h | 27 +++++++++++++++++++++++++++ 8 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 os/xdmcp.h diff --git a/os/access.c b/os/access.c index 6f6aec14f..ef6147f03 100644 --- a/os/access.c +++ b/os/access.c @@ -192,6 +192,7 @@ SOFTWARE. #include "xace.h" #include "rpcauth.h" +#include "xdmcp.h" Bool defeatAccessControl = FALSE; diff --git a/os/auth.c b/os/auth.c index 49005f6b0..2518b5293 100644 --- a/os/auth.c +++ b/os/auth.c @@ -49,6 +49,7 @@ from The Open Group. #include /* for arc4random_buf() */ #include "rpcauth.h" +#include "xdmcp.h" struct protocol { unsigned short name_length; diff --git a/os/connection.c b/os/connection.c index 8d4b66061..d957ad661 100644 --- a/os/connection.c +++ b/os/connection.c @@ -117,6 +117,7 @@ SOFTWARE. #endif #include "probes.h" +#include "xdmcp.h" struct ospoll *server_poll; diff --git a/os/osdep.h b/os/osdep.h index a0e4d06ca..fb08d8588 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -169,32 +169,6 @@ extern int XdmAddCookie(AuthAddCArgs); extern int XdmFromID(AuthFromIDArgs); extern int XdmRemoveCookie(AuthRemCArgs); extern int XdmResetCookie(AuthRstCArgs); -#endif - -#ifdef XDMCP -/* in xdmcp.c */ -extern void XdmcpUseMsg(void); -extern int XdmcpOptions(int argc, char **argv, int i); -extern void XdmcpRegisterConnection(int type, const char *address, int addrlen); -extern void XdmcpRegisterAuthorizations(void); -extern void XdmcpRegisterAuthorization(const char *name, int namelen); -extern void XdmcpInit(void); -extern void XdmcpReset(void); -extern void XdmcpOpenDisplay(int sock); -extern void XdmcpCloseDisplay(int sock); -extern void XdmcpRegisterAuthentication(const char *name, - int namelen, - const char *data, - int datalen, - ValidatorFunc Validator, - GeneratorFunc Generator, - AddAuthorFunc AddAuth); - -struct sockaddr_in; -extern void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr); -#endif - -#ifdef HASXDMAUTH extern void XdmAuthenticationInit(const char *cookie, int cookie_length); #endif diff --git a/os/utils.c b/os/utils.c index 98f532d89..ddcfb629f 100644 --- a/os/utils.c +++ b/os/utils.c @@ -83,6 +83,7 @@ __stdcall unsigned long GetTickCount(void); #include #include "osdep.h" #include "bug.h" +#include "xdmcp.h" #include "extension.h" #include #ifndef WIN32 diff --git a/os/xdmauth.c b/os/xdmauth.c index ba446e013..aa1c113d2 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -45,6 +45,7 @@ from The Open Group. #include #include "os.h" #include "osdep.h" +#include "xdmcp.h" #include "dixstruct.h" #ifdef HASXDMAUTH diff --git a/os/xdmcp.c b/os/xdmcp.c index 2b7255644..a264d96af 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -40,6 +40,7 @@ #include #include "misc.h" #include "osdep.h" +#include "xdmcp.h" #include "input.h" #include "dixstruct.h" #include "opaque.h" diff --git a/os/xdmcp.h b/os/xdmcp.h new file mode 100644 index 000000000..e8b1a3c3e --- /dev/null +++ b/os/xdmcp.h @@ -0,0 +1,27 @@ +#ifndef _XSERVER_OS_XDMCP_H +#define _XSERVER_OS_XDMCP_H + +#include "osdep.h" + +/* in xdmcp.c */ +void XdmcpUseMsg(void); +int XdmcpOptions(int argc, char **argv, int i); +void XdmcpRegisterConnection(int type, const char *address, int addrlen); +void XdmcpRegisterAuthorizations(void); +void XdmcpRegisterAuthorization(const char *name, int namelen); +void XdmcpInit(void); +void XdmcpReset(void); +void XdmcpOpenDisplay(int sock); +void XdmcpCloseDisplay(int sock); +void XdmcpRegisterAuthentication(const char *name, + int namelen, + const char *data, + int datalen, + ValidatorFunc Validator, + GeneratorFunc Generator, + AddAuthorFunc AddAuth); + +struct sockaddr_in; +void XdmcpRegisterBroadcastAddress(const struct sockaddr_in *addr); + +#endif /* _XSERVER_OS_XDMCP_H */