~freenx-team/nx-x11/nxcomp-ubuntu

« back to all changes in this revision

Viewing changes to ClientProxy.h

  • Committer: Marcelo Boveto Shima
  • Date: 2009-03-28 22:24:56 UTC
  • Revision ID: mshima@ufserv-20090328222456-rdtaq3oedfyq890c
Import nxcomp 3.3.0-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************/
 
2
/*                                                                        */
 
3
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/.         */
 
4
/*                                                                        */
 
5
/* NXCOMP, NX protocol compression and NX extensions to this software     */
 
6
/* are copyright of NoMachine. Redistribution and use of the present      */
 
7
/* software is allowed according to terms specified in the file LICENSE   */
 
8
/* which comes in the source distribution.                                */
 
9
/*                                                                        */
 
10
/* Check http://www.nomachine.com/licensing.html for applicability.       */
 
11
/*                                                                        */
 
12
/* NX and NoMachine are trademarks of NoMachine S.r.l.                    */
 
13
/*                                                                        */
 
14
/* All rights reserved.                                                   */
 
15
/*                                                                        */
 
16
/**************************************************************************/
 
17
 
 
18
#ifndef ClientProxy_H
 
19
#define ClientProxy_H
 
20
 
 
21
#include "Proxy.h"
 
22
 
 
23
//
 
24
// Set the verbosity level.
 
25
//
 
26
 
 
27
#undef  TEST
 
28
#undef  DEBUG
 
29
 
 
30
class ClientProxy : public Proxy
 
31
{
 
32
  public:
 
33
 
 
34
  ClientProxy(int proxyFD);
 
35
 
 
36
  virtual ~ClientProxy();
 
37
 
 
38
  virtual void handleDisplayConfiguration(const char *xServerDisplay, int xServerAddrFamily,
 
39
                                              sockaddr *xServerAddr, unsigned int xServerAddrLength);
 
40
 
 
41
  virtual void handlePortConfiguration(int cupsServerPort, int smbServerPort, int mediaServerPort,
 
42
                                           int httpServerPort, const char *fontServerPort);
 
43
 
 
44
  protected:
 
45
 
 
46
  //
 
47
  // Create a new channel.
 
48
  //
 
49
 
 
50
  virtual int handleNewConnection(T_channel_type type, int clientFd);
 
51
 
 
52
  virtual int handleNewConnectionFromProxy(T_channel_type type, int channelId);
 
53
 
 
54
  virtual int handleNewAgentConnection(Agent *agent);
 
55
 
 
56
  virtual int handleNewXConnection(int clientFd);
 
57
 
 
58
  virtual int handleNewXConnectionFromProxy(int channelId);
 
59
 
 
60
  //
 
61
  // Implement persistence according
 
62
  // to our proxy mode.
 
63
  //
 
64
 
 
65
  virtual int handleLoad(T_load_type type);
 
66
  virtual int handleSave();
 
67
 
 
68
  virtual int handleAsyncEvents();
 
69
 
 
70
  virtual int handleLoadFromProxy();
 
71
  virtual int handleSaveFromProxy();
 
72
 
 
73
  virtual int handleSaveAllStores(ostream *cachefs, md5_state_t *md5StateStream,
 
74
                                      md5_state_t *md5StateClient) const;
 
75
 
 
76
  virtual int handleLoadAllStores(istream *cachefs, md5_state_t *md5StateStream) const;
 
77
 
 
78
  //
 
79
  // Utility function used to realize
 
80
  // a new connection.
 
81
  //
 
82
 
 
83
  protected:
 
84
 
 
85
  virtual int checkLocalChannelMap(int channelId)
 
86
  {
 
87
    if (control -> isProtoStep7() == 1)
 
88
    {
 
89
      return ((channelId & control -> ChannelMask) != 0);
 
90
    }
 
91
    else
 
92
    {
 
93
      return 1;
 
94
    }
 
95
  }
 
96
 
 
97
  //
 
98
  // Ports where to forward extended services'
 
99
  // TCP connections.
 
100
  //
 
101
 
 
102
  private:
 
103
 
 
104
  char *fontServerPort_;
 
105
};
 
106
 
 
107
 
 
108
#endif /* ClientProxy_H */