xsecurelock  1.7.0
XSecureLock is an X11 screen lock utility.
Macros | Functions
authproto.h File Reference

Go to the source code of this file.

Macros

#define PTYPE_INFO_MESSAGE   'i'
 
#define PTYPE_ERROR_MESSAGE   'e'
 
#define PTYPE_PROMPT_LIKE_USERNAME   'U'
 
#define PTYPE_PROMPT_LIKE_PASSWORD   'P'
 
#define PTYPE_RESPONSE_LIKE_USERNAME   'u'
 
#define PTYPE_RESPONSE_LIKE_PASSWORD   'p'
 
#define PTYPE_RESPONSE_CANCELLED   'x'
 

Functions

void WritePacket (int fd, char type, const char *message)
 Writes a packet in above form. More...
 
char ReadPacket (int fd, char **message, int eof_permitted)
 Reads a packet in above form. More...
 

Macro Definition Documentation

◆ PTYPE_ERROR_MESSAGE

#define PTYPE_ERROR_MESSAGE   'e'

◆ PTYPE_INFO_MESSAGE

#define PTYPE_INFO_MESSAGE   'i'

◆ PTYPE_PROMPT_LIKE_PASSWORD

#define PTYPE_PROMPT_LIKE_PASSWORD   'P'

◆ PTYPE_PROMPT_LIKE_USERNAME

#define PTYPE_PROMPT_LIKE_USERNAME   'U'

◆ PTYPE_RESPONSE_CANCELLED

#define PTYPE_RESPONSE_CANCELLED   'x'

◆ PTYPE_RESPONSE_LIKE_PASSWORD

#define PTYPE_RESPONSE_LIKE_PASSWORD   'p'

◆ PTYPE_RESPONSE_LIKE_USERNAME

#define PTYPE_RESPONSE_LIKE_USERNAME   'u'

Function Documentation

◆ ReadPacket()

char ReadPacket ( int  fd,
char **  message,
int  eof_permitted 
)

Reads a packet in above form.

Parameters
fdThe file descriptor to write to.
messageA pointer to store the message (will be mlock()d). Will always be set if function returns nonzero; caller must free it.
eof_permittedIf enabled, encountering EOF at the beginning will not count as an error but return 0 silently.
Returns
The packet type, or 0 if no packet has been read. Errors are logged.

◆ WritePacket()

void WritePacket ( int  fd,
char  type,
const char *  message 
)

Writes a packet in above form.

Parameters
fdThe file descriptor to write to.
typeThe packet type from above macros.
messageThe message to include with the packet (NUL-terminated).