OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librw11/] [Rw11VirtTermTcp.hpp] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 wfjm
// $Id: Rw11VirtTermTcp.hpp 508 2013-04-20 18:43:28Z mueller $
2 19 wfjm
//
3
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
// 
14
// Revision History: 
15
// Date         Rev Version  Comment
16 20 wfjm
// 2013-04-20   508   1.0.1  add fSndPreConQue handling
17 19 wfjm
// 2013-03-06   495   1.0    Initial version
18
// 2013-02-13   488   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
 
22
/*!
23
  \file
24 20 wfjm
  \version $Id: Rw11VirtTermTcp.hpp 508 2013-04-20 18:43:28Z mueller $
25 19 wfjm
  \brief   Declaration of class Rw11VirtTermTcp.
26
*/
27
 
28
#ifndef included_Retro_Rw11VirtTermTcp
29
#define included_Retro_Rw11VirtTermTcp 1
30
 
31 20 wfjm
#include <deque>
32
 
33 19 wfjm
#include "Rw11VirtTerm.hpp"
34
 
35
namespace Retro {
36
 
37
  class Rw11VirtTermTcp : public Rw11VirtTerm {
38
    public:
39
 
40
      explicit      Rw11VirtTermTcp(Rw11Unit* punit);
41
                   ~Rw11VirtTermTcp();
42
 
43
      bool          Open(const std::string& url, RerrMsg& emsg);
44
 
45
      virtual bool  Snd(const uint8_t* data, size_t count, RerrMsg& emsg);
46
 
47
      virtual void  Dump(std::ostream& os, int ind=0, const char* text=0) const;
48
 
49
    // statistics counter indices
50
      enum stats {
51 20 wfjm
        kStatNVTPreConSave = Rw11VirtTerm::kDimStat,
52
        kStatNVTPreConDrop,
53
        kStatNVTListenPoll,
54 19 wfjm
        kStatNVTAccept,
55
        kStatNVTRcvRaw,
56
        kStatNVTSndRaw,
57
        kDimStat
58
      };
59
 
60
    protected:
61
 
62 20 wfjm
      bool          Connected() const;
63 19 wfjm
      int           ListenPollHandler(const pollfd& pfd);
64
      int           RcvPollHandler(const pollfd& pfd);
65
 
66
    // some constants (also defined in cpp)
67
      static const uint8_t  kCode_NULL =   0;
68
      static const uint8_t  kCode_LF   =  10;
69
      static const uint8_t  kCode_CR   =  13;
70
      static const uint8_t  kCode_ESC  =  27;
71
      static const uint8_t  kCode_SE   = 240;
72
      static const uint8_t  kCode_NOP  = 241;
73
      static const uint8_t  kCode_IP   = 244;
74
      static const uint8_t  kCode_GA   = 249;
75
      static const uint8_t  kCode_SB   = 250;
76
      static const uint8_t  kCode_WILL = 251;
77
      static const uint8_t  kCode_WONT = 252;
78
      static const uint8_t  kCode_DO   = 253;
79
      static const uint8_t  kCode_DONT = 254;
80
      static const uint8_t  kCode_IAC  = 255;
81
 
82
      static const uint8_t  kOpt_BIN   =   0;
83
      static const uint8_t  kOpt_ECHO  =   1;
84
      static const uint8_t  kOpt_SGA   =   3;
85
      static const uint8_t  kOpt_TTYP  =  24;
86
      static const uint8_t  kOpt_LINE  =  34;
87
 
88 20 wfjm
      static const size_t   kPreConQue_limit = 65536;
89
 
90 19 wfjm
      enum telnet_state {
91
        ts_Closed = 0,
92
        ts_Listen,
93
        ts_Stream,
94
        ts_Iac,
95
        ts_Cmd,
96
        ts_Subneg,
97
        ts_Subiac
98
      };
99
 
100
    protected:
101
      int           fFdListen;
102
      int           fFd;
103
      telnet_state  fState;
104
      bool          fTcpTrace;
105 20 wfjm
      std::deque<uint8_t> fSndPreConQue;
106 19 wfjm
  };
107
 
108
} // end namespace Retro
109
 
110 20 wfjm
#include "Rw11VirtTermTcp.ipp"
111 19 wfjm
 
112
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.