imapext-2007

diff src/c-client/sslio.h @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/c-client/sslio.h	Mon Sep 14 15:17:45 2009 +0900
     1.3 @@ -0,0 +1,70 @@
     1.4 +/* ========================================================================
     1.5 + * Copyright 1988-2006 University of Washington
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *     http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * 
    1.14 + * ========================================================================
    1.15 + */
    1.16 +
    1.17 +/*
    1.18 + * Program:	SSL routines
    1.19 + *
    1.20 + * Author:	Mark Crispin
    1.21 + *		Networks and Distributed Computing
    1.22 + *		Computing & Communications
    1.23 + *		University of Washington
    1.24 + *		Administration Building, AG-44
    1.25 + *		Seattle, WA  98195
    1.26 + *		Internet: MRC@CAC.Washington.EDU
    1.27 + *
    1.28 + * Date:	7 February 2001
    1.29 + * Last Edited:	30 August 2006
    1.30 + */
    1.31 +
    1.32 +/* SSL driver */
    1.33 +
    1.34 +struct ssl_driver {		/* must parallel NETDRIVER in mail.h */
    1.35 +  SSLSTREAM *(*open) (char *host,char *service,unsigned long port);
    1.36 +  SSLSTREAM *(*aopen) (NETMBX *mb,char *service,char *usrbuf);
    1.37 +  char *(*getline) (SSLSTREAM *stream);
    1.38 +  long (*getbuffer) (SSLSTREAM *stream,unsigned long size,char *buffer);
    1.39 +  long (*soutr) (SSLSTREAM *stream,char *string);
    1.40 +  long (*sout) (SSLSTREAM *stream,char *string,unsigned long size);
    1.41 +  void (*close) (SSLSTREAM *stream);
    1.42 +  char *(*host) (SSLSTREAM *stream);
    1.43 +  char *(*remotehost) (SSLSTREAM *stream);
    1.44 +  unsigned long (*port) (SSLSTREAM *stream);
    1.45 +  char *(*localhost) (SSLSTREAM *stream);
    1.46 +};
    1.47 +
    1.48 +
    1.49 +/* SSL stdio stream */
    1.50 +
    1.51 +typedef struct ssl_stdiostream {
    1.52 +  SSLSTREAM *sslstream;		/* SSL stream */
    1.53 +  int octr;			/* output counter */
    1.54 +  char *optr;			/* output pointer */
    1.55 +  char obuf[SSLBUFLEN];		/* output buffer */
    1.56 +} SSLSTDIOSTREAM;
    1.57 +
    1.58 +
    1.59 +/* Function prototypes */
    1.60 +
    1.61 +SSLSTREAM *ssl_open (char *host,char *service,unsigned long port);
    1.62 +SSLSTREAM *ssl_aopen (NETMBX *mb,char *service,char *usrbuf);
    1.63 +char *ssl_getline (SSLSTREAM *stream);
    1.64 +long ssl_getbuffer (SSLSTREAM *stream,unsigned long size,char *buffer);
    1.65 +long ssl_getdata (SSLSTREAM *stream);
    1.66 +long ssl_soutr (SSLSTREAM *stream,char *string);
    1.67 +long ssl_sout (SSLSTREAM *stream,char *string,unsigned long size);
    1.68 +void ssl_close (SSLSTREAM *stream);
    1.69 +char *ssl_host (SSLSTREAM *stream);
    1.70 +char *ssl_remotehost (SSLSTREAM *stream);
    1.71 +unsigned long ssl_port (SSLSTREAM *stream);
    1.72 +char *ssl_localhost (SSLSTREAM *stream);
    1.73 +long ssl_server_input_wait (long seconds);

UW-IMAP'd extensions by yuuji