* Update to version 2.19.1
[alpine.git] / imap / src / osdep / vms / tcp_vmsn.c
blob6ae12803ca988c0502ff3af1ddcf6fc6b09beed8
1 /* ========================================================================
2 * Copyright 2008-2010 Mark Crispin
3 * ========================================================================
4 */
6 /*
7 * Program: Dummy VMS TCP/IP routines for non-TCP/IP systems
9 * Author: Mark Crispin
11 * Date: 2 August 1994
12 * Last Edited: 3 April 2010
14 * Previous versions of this file were:
16 * Copyright 1988-2008 University of Washington
18 * Licensed under the Apache License, Version 2.0 (the "License");
19 * you may not use this file except in compliance with the License.
20 * You may obtain a copy of the License at
22 * http://www.apache.org/licenses/LICENSE-2.0
24 \f
25 /* TCP/IP manipulate parameters
26 * Accepts: function code
27 * function-dependent value
28 * Returns: function-dependent return value
31 void *tcp_parameters (long function,void *value)
33 return NIL;
37 /* TCP/IP open
38 * Accepts: host name
39 * contact service name
40 * contact port number
41 * Returns: TCP/IP stream if success else NIL
44 TCPSTREAM *tcp_open (char *host,char *service,unsigned long port)
46 char tmp[MAILTMPLEN];
47 port &= 0xffff; /* erase flags */
48 if (port) sprintf (tmp,"Can't connect to %.80s,%d: no TCP",host,port);
49 else sprintf (tmp,"Can't connect to %.80s,%s: no TCP",host,service);
50 mm_log (tmp,ERROR);
51 return NIL;
55 /* TCP/IP authenticated open
56 * Accepts: NETMBX specifier
57 * service name
58 * returned user name buffer
59 * Returns: TCP/IP stream if success else NIL
62 TCPSTREAM *tcp_aopen (NETMBX *mb,char *service,char *usrbuf)
64 return NIL;
67 /* TCP/IP receive line
68 * Accepts: TCP/IP stream
69 * Returns: text line string or NIL if failure
72 char *tcp_getline (TCPSTREAM *stream)
74 return NIL;
78 /* TCP/IP receive buffer
79 * Accepts: TCP/IP stream
80 * size in bytes
81 * buffer to read into
82 * Returns: T if success, NIL otherwise
85 long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *buffer)
87 return NIL;
91 /* TCP/IP receive data
92 * Accepts: TCP/IP stream
93 * Returns: T if success, NIL otherwise
96 long tcp_getdata (TCPSTREAM *stream)
98 return NIL;
101 /* TCP/IP send string as record
102 * Accepts: TCP/IP stream
103 * string pointer
104 * Returns: T if success else NIL
107 long tcp_soutr (TCPSTREAM *stream,char *string)
109 return NIL;
113 /* TCP/IP send string
114 * Accepts: TCP/IP stream
115 * string pointer
116 * byte count
117 * Returns: T if success else NIL
120 long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size)
122 return NIL;
126 /* TCP/IP close
127 * Accepts: TCP/IP stream
130 void tcp_close (TCPSTREAM *stream)
135 /* TCP/IP abort stream
136 * Accepts: TCP/IP stream
137 * Returns: NIL always
140 long tcp_abort (TCPSTREAM *stream)
142 return NIL;
145 /* TCP/IP get host name
146 * Accepts: TCP/IP stream
147 * Returns: host name for this stream
150 char *tcp_host (TCPSTREAM *stream)
152 return NIL;
156 /* TCP/IP get remote host name
157 * Accepts: TCP/IP stream
158 * Returns: host name for this stream
161 char *tcp_remotehost (TCPSTREAM *stream)
163 return NIL;
167 /* TCP/IP get local host name
168 * Accepts: TCP/IP stream
169 * Returns: local host name
172 char *tcp_localhost (TCPSTREAM *stream)
174 return NIL;
178 /* TCP/IP return port for this stream
179 * Accepts: TCP/IP stream
180 * Returns: port number for this stream
183 unsigned long tcp_port (TCPSTREAM *stream)
185 return 0xffffffff; /* return port number */
189 /* Return my local host name
190 * Returns: my local host name
193 char *mylocalhost ()
195 /* have local host yet? */
196 if (!myLocalHost) myLocalHost = cpystr (getenv ("SYS$NODE"));
197 return myLocalHost;
200 /* TCP/IP return canonical form of host name
201 * Accepts: host name
202 * Returns: canonical form of host name
205 char *tcp_canonical (char *name)
207 return cpystr (name);
211 /* TCP/IP get client host name (server calls only)
212 * Returns: client host name
215 char *tcp_clienthost ()
217 return "UNKNOWN";