~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to vio/VioSSL.h

  • Committer: bk at mysql
  • Date: 2000-07-31 19:29:14 UTC
  • Revision ID: sp1r-bk@work.mysql.com-20000731192914-08846
Import changeset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Concrete Vio around OpenSSL's SSL structure.
 
3
 */
 
4
 
 
5
#ifdef __GNUC__
 
6
#pragma interface                       /* gcc class implementation */
 
7
#endif
 
8
 
 
9
VIO_NS_BEGIN
 
10
 
 
11
class VioSocket;
 
12
 
 
13
class VioSSL : public Vio
 
14
{
 
15
public:
 
16
  enum {
 
17
    state_connect       = 1,
 
18
    state_accept        = 2
 
19
  };
 
20
public:
 
21
  VioSSL(int    fd, vio_ptr ssl_context, int    state);
 
22
  VioSSL(VioSocket* sd, vio_ptr ssl_context, int state);
 
23
  virtual               ~VioSSL();
 
24
  virtual bool          open() const;
 
25
  virtual int           read(   vio_ptr buf,    int     size);
 
26
  virtual int           write(  const vio_ptr   buf,    int     size);
 
27
  virtual bool          blocking() const;
 
28
  virtual int           blocking(bool onoff);
 
29
  virtual int           fastsend(bool onoff=true);
 
30
  virtual int           keepalive(bool onoff);
 
31
  virtual bool          fcntl() const;
 
32
  virtual bool          should_retry() const;
 
33
  virtual int           close();
 
34
  virtual const char*   description() const;
 
35
  virtual const char*   peer_addr() const;
 
36
  virtual const char*   peer_name() const;
 
37
  virtual const char*   cipher_description() const;
 
38
 
 
39
private:
 
40
  int init_bio_(int fd,
 
41
                vio_ptr ssl_context,
 
42
                int state,
 
43
                int bio_flags);
 
44
  vio_ptr bio_;
 
45
  vio_ptr ssl_con_;
 
46
  vio_ptr ssl_cip_;
 
47
  char  desc_[100];
 
48
  bool  open_;
 
49
  VioSocket* sd_;
 
50
};
 
51
 
 
52
VIO_NS_END
 
53
 
 
54
#endif /* VIO_HAVE_OPENSSL */