senf::term::TelnetTerminal Class Referenceabstract

AbstractTerminal interface implementation based on telnet. More...

#include <senf/Utils/Termlib/TelnetTerminal.hh>

Inheritance diagram for senf::term::TelnetTerminal:

Public Member Functions

 TelnetTerminal ()
 
- Public Member Functions inherited from senf::term::telnethandler::TerminalType
void nextTerminalType ()
 Request another terminal type. More...
 
std::string const & terminalType () const
 Return current terminal type. More...
 
- Public Member Functions inherited from senf::term::BaseTelnetProtocol::TelnetHandler
virtual ~TelnetHandler ()
 
- Public Member Functions inherited from senf::term::BaseTelnetProtocol
void write (std::string const &s)
 Send string to peer. More...
 
void write (char c)
 Send single character to peer. More...
 
Handle handle ()
 Get socket handle. More...
 
void sendNOP ()
 Send NOP to peer. More...
 
void sendBRK ()
 Send BReaK to peer. More...
 
void sendIP ()
 Send InterruptProcess to peer. More...
 
void sendAO ()
 Send AbortOutput to peer. More...
 
void sendAYT ()
 Send AreYouThere to peer. More...
 
void sendEC ()
 Send EraseCharacter to peer. More...
 
void sendEL ()
 Send EraseLine to peer. More...
 
void sendGA ()
 Send GoAhead to peer. More...
 
void sendOptionParameters (option_type option, std::string const &data)
 Send extended option parameter to peer. More...
 
void requestLocalOption (option_type option, bool enabled=true)
 Request option to be enabled here. More...
 
void acceptLocalOption (option_type option, bool enabled=true)
 Accept a request for an option to be enabled here. More...
 
void requestPeerOption (option_type option, bool enabled=true)
 Request peer to enable an option. More...
 
void acceptPeerOption (option_type option, bool enabled=true)
 Accept a request by the peer to enable an option. More...
 
bool localOption (option_type option)
 true, if option locally enabled More...
 
bool peerOption (option_type option)
 true, if option enabled in peer More...
 
- Public Member Functions inherited from senf::term::telnethandler::NAWS
unsigned width () const
 Get current client window width. More...
 
unsigned height () const
 Get current client window height. More...
 
- Public Member Functions inherited from senf::term::AbstractTerminal
virtual ~AbstractTerminal ()
 

Protected Member Functions

virtual void v_setupFailed ()=0
 Called when the telnet setup has failed. More...
 
- Protected Member Functions inherited from senf::term::telnethandler::TerminalType
 TerminalType ()
 
- Protected Member Functions inherited from senf::term::BaseTelnetProtocol
 BaseTelnetProtocol (Handle handle)
 Construct telnet protocol handler. More...
 
 BaseTelnetProtocol ()
 Provided for TelnetHandler mixins only. More...
 
virtual ~BaseTelnetProtocol ()
 
template<class Handler >
void registerHandler (Handler *h, bool request=true)
 Register a TelnetHandler. More...
 
void incrementRequestCounter ()
 Increment request counter. More...
 
void decrementRequestCounter ()
 Decrement request counter. More...
 
bool requestsPending ()
 true, if there are pending requests More...
 
virtual void v_eof ()=0
 Called on input EOF. More...
 
virtual void v_handleNOP ()
 Called, when the peer sends a NOP. More...
 
virtual void v_handleBRK ()
 Called, when the peer sends a BReaK. More...
 
virtual void v_handleIP ()
 Called, when the peer sends an InterruptProcess. More...
 
virtual void v_handleAO ()
 Called, when the peer sends an AbortOutput. More...
 
virtual void v_handleAYT ()
 Called, when the peer sends an AreYouThere. More...
 
virtual void v_handleEC ()
 Called, when the peer sends an EraseCharacter. More...
 
virtual void v_handleEL ()
 Called, when the peer sends an EraseLine. More...
 
virtual void v_handleGA ()
 Called, when the peer sends a GoAhead. More...
 
- Protected Member Functions inherited from senf::term::telnethandler::NAWS
 NAWS ()
 

AbstractTerminal interface implementation

virtual void setCallbacks (AbstractTerminal::Callbacks &cb)
 Register terminal callbacks. More...
 
virtual std::string terminalType ()
 Get the terminal type. More...
 
virtual unsigned width () const
 Get current terminal window width. More...
 
virtual unsigned height () const
 Get current terminal window height. More...
 
virtual void write (char ch)
 Write character to terminal. More...
 

Additional Inherited Members

- Public Types inherited from senf::term::BaseTelnetProtocol
typedef ClientSocketHandle< senf::MakeSocketPolicy< ConnectedCommunicationPolicy, StreamFramingPolicy, ReadablePolicy, WriteablePolicy >::policy > Handle
 Type of socket handle required. More...
 
typedef unsigned char option_type
 Type of telnet option numbers. More...
 
- Static Public Attributes inherited from senf::term::telnethandler::TerminalType
static option_type const OPTION_CODE = telnetopt::TERMINAL_TYPE
 
- Static Public Attributes inherited from senf::term::BaseTelnetProtocol
static unsigned const DEFAULT_REQUEST_TIMEOUT_MS = 500u
 
- Static Public Attributes inherited from senf::term::telnethandler::NAWS
static option_type const OPTION_CODE = telnetopt::NAWS
 

Detailed Description

AbstractTerminal interface implementation based on telnet.

This class provides a telnet server implementation implementing the AbstractTerminal interface.

TelnetTerminal provides one additional callback which needs to be implemented in a derived class: v_setupFailed(). This member will be called, when not all required telnet options are supported by the telnet client. In this case, the communication will be switched back into line-oriented mode and v_setupFailed() is called.

Definition at line 43 of file TelnetTerminal.hh.

Constructor & Destructor Documentation

◆ TelnetTerminal()

senf::term::TelnetTerminal::TelnetTerminal ( )

Definition at line 26 of file TelnetTerminal.cc.

Member Function Documentation

◆ height()

unsigned senf::term::TelnetTerminal::height ( ) const
virtual

Get current terminal window height.

Implements senf::term::AbstractTerminal.

Definition at line 50 of file TelnetTerminal.cc.

◆ setCallbacks()

void senf::term::TelnetTerminal::setCallbacks ( AbstractTerminal::Callbacks cb)
virtual

Register terminal callbacks.

Implements senf::term::AbstractTerminal.

Definition at line 34 of file TelnetTerminal.cc.

◆ terminalType()

std::string senf::term::TelnetTerminal::terminalType ( )
virtual

Get the terminal type.

Implements senf::term::AbstractTerminal.

Definition at line 39 of file TelnetTerminal.cc.

◆ v_setupFailed()

virtual void senf::term::TelnetTerminal::v_setupFailed ( )
protectedpure virtual

Called when the telnet setup has failed.

◆ width()

unsigned senf::term::TelnetTerminal::width ( ) const
virtual

Get current terminal window width.

Implements senf::term::AbstractTerminal.

Definition at line 44 of file TelnetTerminal.cc.

◆ write()

void senf::term::TelnetTerminal::write ( char  ch)
virtual

Write character to terminal.

Implements senf::term::AbstractTerminal.

Definition at line 56 of file TelnetTerminal.cc.


The documentation for this class was generated from the following files: