1
/* ========================================================================
2
* Copyright 1988-2006 University of Washington
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
11
* ========================================================================
15
* Program: Dummy (no SSL) authentication/encryption module
17
* Author: Mark Crispin
18
* Networks and Distributed Computing
19
* Computing & Communications
20
* University of Washington
21
* Administration Building, AG-44
23
* Internet: MRC@CAC.Washington.EDU
25
* Date: 7 February 2001
26
* Last Edited: 30 August 2006
29
/* Init server for SSL
30
* Accepts: server name
33
void ssl_server_init (char *server)
35
syslog (LOG_ERR,"This server does not support SSL");
36
exit (1); /* punt this program too */
41
* Accepts: /etc/services service name
42
* Returns: cpystr'd error string if TLS failed, else NIL for success
45
char *ssl_start_tls (char *server)
47
return cpystr ("This server does not support TLS");
51
* Returns: character or EOF
61
* Accepts: destination string pointer
62
* number of bytes available
63
* Returns: destination string pointer or NIL if EOF
66
char *PSIN (char *s,int n)
68
return fgets (s,n,stdin);
73
* Accepts: destination string pointer
74
* number of bytes to read
75
* Returns: T if success, NIL otherwise
78
long PSINR (char *s,unsigned long n)
81
while (n && ((i = fread (s,1,n,stdin)) || (errno == EINTR))) s += i,n -= i;
82
return n ? NIL : LONGT;
87
* Accepts: timeout in seconds
88
* Returns: T if have input on stdin, else NIL
91
long INWAIT (long seconds)
93
return server_input_wait (seconds);
98
* Returns: character written or EOF
108
* Accepts: source string pointer
109
* Returns: 0 or EOF if error
114
return fputs (s,stdout);
119
* Accepts: source sized text
120
* Returns: 0 or EOF if error
123
int PSOUTR (SIZEDTEXT *s)
127
for (t = s->data,i = s->size;
128
(i && ((j = fwrite (t,1,i,stdout)) || (errno == EINTR)));
130
return i ? EOF : NIL;
135
* Returns: 0 or EOF if error
140
return fflush (stdout);