2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief Telnet inline non-template implementation */
17 //#include "Telnet.ih"
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::term::BaseTelnetProtocol::OptInfo
27 prefix_ senf::term::BaseTelnetProtocol::OptInfo::OptInfo()
28 : local (false), option (0u), wantState (DISABLED), optionState (NONE), enabled (false)
31 prefix_ senf::term::BaseTelnetProtocol::OptInfo::OptInfo(bool l, option_type o)
32 : local (l), option (o), wantState (DISABLED), optionState (NONE), enabled (false)
35 //-/////////////////////////////////////////////////////////////////////////////////////////////////
36 // senf::term::BaseTelnetProtocol::TelnetHandler
38 prefix_ senf::term::BaseTelnetProtocol::TelnetHandler::~TelnetHandler()
41 prefix_ std::string const & senf::term::telnethandler::TerminalType::terminalType()
47 //-/////////////////////////////////////////////////////////////////////////////////////////////////
48 // senf::term::telnethandler::NAWS
50 prefix_ unsigned senf::term::telnethandler::NAWS::width()
56 prefix_ unsigned senf::term::telnethandler::NAWS::height()
62 //-/////////////////////////////////////////////////////////////////////////////////////////////////
63 // senf::term::BaseTelnetProtocol
65 prefix_ senf::term::BaseTelnetProtocol::~BaseTelnetProtocol()
68 prefix_ senf::term::BaseTelnetProtocol::Handle senf::term::BaseTelnetProtocol::handle()
73 prefix_ bool senf::term::BaseTelnetProtocol::requestsPending()
75 return pendingRequests_ > 0u;
78 prefix_ void senf::term::BaseTelnetProtocol::sendNOP()
84 prefix_ void senf::term::BaseTelnetProtocol::sendBRK()
90 prefix_ void senf::term::BaseTelnetProtocol::sendIP()
96 prefix_ void senf::term::BaseTelnetProtocol::sendAO()
102 prefix_ void senf::term::BaseTelnetProtocol::sendAYT()
108 prefix_ void senf::term::BaseTelnetProtocol::sendEC()
114 prefix_ void senf::term::BaseTelnetProtocol::sendEL()
120 prefix_ void senf::term::BaseTelnetProtocol::sendGA()
126 prefix_ void senf::term::BaseTelnetProtocol::requestLocalOption(option_type option,
129 request(getOption(true, option), enabled);
132 prefix_ void senf::term::BaseTelnetProtocol::acceptLocalOption(option_type option,
135 getOption(true, option).wantState = OptInfo::ACCEPTED;
138 prefix_ void senf::term::BaseTelnetProtocol::requestPeerOption(option_type option,
141 request(getOption(false, option), enabled);
144 prefix_ void senf::term::BaseTelnetProtocol::acceptPeerOption(option_type option,
147 getOption(false, option).wantState = OptInfo::ACCEPTED;
150 prefix_ bool senf::term::BaseTelnetProtocol::localOption(option_type option)
152 return getOption(true, option).enabled;
155 prefix_ bool senf::term::BaseTelnetProtocol::peerOption(option_type option)
157 return getOption(false, option).enabled;
160 prefix_ void senf::term::BaseTelnetProtocol::emit(char c)
165 //-/////////////////////////////////////////////////////////////////////////////////////////////////
172 // comment-column: 40
173 // c-file-style: "senf"
174 // indent-tabs-mode: nil
175 // ispell-local-dictionary: "american"
176 // compile-command: "scons -u test"