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 <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1311>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-02-14 18:45:35 +01:00 committed by Marge Bot
parent 664c3b6ba8
commit 194a7c2032
8 changed files with 33 additions and 26 deletions

View File

@ -192,6 +192,7 @@ SOFTWARE.
#include "xace.h" #include "xace.h"
#include "rpcauth.h" #include "rpcauth.h"
#include "xdmcp.h"
Bool defeatAccessControl = FALSE; Bool defeatAccessControl = FALSE;

View File

@ -49,6 +49,7 @@ from The Open Group.
#include <stdlib.h> /* for arc4random_buf() */ #include <stdlib.h> /* for arc4random_buf() */
#include "rpcauth.h" #include "rpcauth.h"
#include "xdmcp.h"
struct protocol { struct protocol {
unsigned short name_length; unsigned short name_length;

View File

@ -117,6 +117,7 @@ SOFTWARE.
#endif #endif
#include "probes.h" #include "probes.h"
#include "xdmcp.h"
struct ospoll *server_poll; struct ospoll *server_poll;

View File

@ -169,32 +169,6 @@ extern int XdmAddCookie(AuthAddCArgs);
extern int XdmFromID(AuthFromIDArgs); extern int XdmFromID(AuthFromIDArgs);
extern int XdmRemoveCookie(AuthRemCArgs); extern int XdmRemoveCookie(AuthRemCArgs);
extern int XdmResetCookie(AuthRstCArgs); 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); extern void XdmAuthenticationInit(const char *cookie, int cookie_length);
#endif #endif

View File

@ -83,6 +83,7 @@ __stdcall unsigned long GetTickCount(void);
#include <X11/fonts/libxfont2.h> #include <X11/fonts/libxfont2.h>
#include "osdep.h" #include "osdep.h"
#include "bug.h" #include "bug.h"
#include "xdmcp.h"
#include "extension.h" #include "extension.h"
#include <signal.h> #include <signal.h>
#ifndef WIN32 #ifndef WIN32

View File

@ -45,6 +45,7 @@ from The Open Group.
#include <X11/Xtrans/Xtrans.h> #include <X11/Xtrans/Xtrans.h>
#include "os.h" #include "os.h"
#include "osdep.h" #include "osdep.h"
#include "xdmcp.h"
#include "dixstruct.h" #include "dixstruct.h"
#ifdef HASXDMAUTH #ifdef HASXDMAUTH

View File

@ -40,6 +40,7 @@
#include <X11/Xmd.h> #include <X11/Xmd.h>
#include "misc.h" #include "misc.h"
#include "osdep.h" #include "osdep.h"
#include "xdmcp.h"
#include "input.h" #include "input.h"
#include "dixstruct.h" #include "dixstruct.h"
#include "opaque.h" #include "opaque.h"

27
os/xdmcp.h Normal file
View File

@ -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 */