Coder Social home page Coder Social logo

kazdragon / telnetpp Goto Github PK

View Code? Open in Web Editor NEW
62.0 6.0 10.0 3.31 MB

A C++ library for interacting with Telnet streams

License: MIT License

CMake 5.84% C++ 93.69% Shell 0.27% Dockerfile 0.20%
telnet telnet-protocol rfc-1153 rfc-857 rfc-1950 rfc-1073 rfc-1572 rfc-858 rfc-1091 telnet-session

telnetpp's People

Contributors

bitdeli-chef avatar kazdragon avatar mbeutel avatar pktiuk avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

telnetpp's Issues

Add a converter from vector<variant<token, any>> to vector<token>

At the bottom of the protocol stack, it is necessary to output just a straightforward stream of bytes. But, before that takes place, it is necessary to filter out the boost::any tags/objects that may be in the vector of tokens.

This filter should be supplied by the library, rather than having every user of the library re-implement it.

Note: all boost::any objects should have been consumed by this point in time, so these can be treated as errors if they remain present.

Documentation (especially the readme, which states to do this manually) should be updated to reflect this feature.

Create Client and Server Option Structures

An option should be able to:

  • register with routers to receive negotiations and subnegotiations that target the option
  • know and pro-actively report on the state of the option.

Create Subnegotiationless Client, Server

A subnegotiationless option implements only basic functionality. In general, this is used to enable or disable a feature in another layer of the application (e.g. echo, suppress go-ahead, etc.)

Investigate improvements to interface

The vector<token, any> interface is still somewhat clunky, and could do with investigating to see if it can be made cleaner.

Ideally, this would occur after the implementation of the MCCP option, since the clunkiness exists to serve that particular option in the first place.

Document Intent and Usage

In particular:

  • Overall intent of library
  • Datastream-agnosticism
  • How to use the library in other code

Don't Assume Text

At the moment, it is assumed that everything that is transmitted to and from the layer below is a stream of bytes.

Although it must be that a stream of bytes is indeed received and transmitted, other types should be passed through.

Provide helper for parser

At the moment, parser only knows about vectors. And it should stay that way.

It needs a helper, though, since telnetpp will require a stream of (vector | any), and those anys must be passed through.

Therefore, we need a parser helper that accepts the compound type and returns a vector, where all the vectors have been buffered up and parsed into elements, and all the anys have been passed through.

Note: the anys must be passed through as close to their reception point as necessary. It's expected that these will always occur on element boundaries within the streams, but it's not necessarily true.

Create NAWS Client

A NAWS Client is responsible for interpreting subnegotiations from a server and reporting any changes in screen size that it sends.

Consider using container with SBO for byte arrays

std::vector cannot implement any kind of small buffer optimization. This means that every non-0-length vector requires a memory allocation.

Consider replacing usages std::vector with an alternative type that uses SBO. For example:

  • boost::containers::small_buffer<T, S>
  • std::basic_string

Cache GTest build

Now that #95 is complete, it should be possible to cache the GTest build so that it doesn't need to be done every time.

Allow options to be "activatable"

Activatable options will be dormant by default, but will respond positively to requests to active that originate from the remote end.

Integrate into Paradice

Not a specific task of the library itself, but it's really necessary to have this working in a product before release.

Add a convenience header

Add something like telnetpp/telnetpp.hpp which includes all the main headers (e.g. routers, parser, generator, etc.)

Create TELNET Parser

Must be capable of transforming a stream of bytes into a stream of commands, negotiations, and subnegotiations.

Migrate away from CppUnit

It's difficult to use CppUnit with Clang's memory sanitizer. Therefore, it may be of more use to move to a different testing infrastructure.

Create Command, Negotiation, Subnegotiation structures

According to the TELNET Standard, Commands are initiated by bytes from 0xEF (239) to 0xFF (255). For the purposes of this issue, this will exclude the bytes between 0xFA (250) and 0xFE (254), since these represent SB, WILL, WONT, DO and DONT, which are for Subnegotiations and Negotiations.

Create Router Framework

The Router Framework would allow a user to set handlers for the different Telnet token types, and for default handling of unregistered options. This would also include a method for passing a token from a stream of tokens to an appropriate router (e.g. command router, negotiation router).

Move protocol constants into detail namespace

Most protocol headers expose constants to do with the protocol: option numbers, constants, etc. However, users never have to deal with these, so they should be private to the library.

Create NAWS Server

The NAWS Server is responsible for maintaining a screen size, sending it upon activation and thence whenever it is set.

Create TELNET Generator

Must be capable of transforming a stream of TELNET commands, negotiations, subnegotiations and ordinary text into a stream of bytes.

Create Terminal Type Client

A TT Client is responsible for querying a server's terminal types. Upon receipt of these types, they should be reported to an upper layer. There should be no more logic than this, since the way in which this data is received may differ from application to application - some may wish to cycle through all types, some may be satisfied with only one type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.