telnet.h 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Header declaring Telnet-handling functions.
  3. */
  4. #ifndef CYGTERMD_TELNET_H
  5. #define CYGTERMD_TELNET_H
  6. #include "sel.h"
  7. typedef struct Telnet Telnet;
  8. struct shell_data {
  9. char **envvars; /* array of "VAR=value" terms */
  10. int nenvvars;
  11. char *termtype;
  12. };
  13. /*
  14. * Create and destroy a Telnet structure.
  15. */
  16. Telnet *telnet_new(sel_wfd *net, sel_wfd *pty);
  17. void telnet_free(Telnet *telnet);
  18. /*
  19. * Process data read from the pty.
  20. */
  21. void telnet_from_pty(Telnet *telnet, char *buf, int len);
  22. /*
  23. * Process Telnet protocol data received from the network.
  24. */
  25. void telnet_from_net(Telnet *telnet, char *buf, int len);
  26. /*
  27. * Return true if pre-shell-startup negotiations are complete and
  28. * it's safe to start the shell subprocess now. On a true return,
  29. * also fills in the shell_data structure.
  30. */
  31. int telnet_shell_ok(Telnet *telnet, struct shell_data *shdata);
  32. #endif /* CYGTERMD_TELNET_H */