2011-07-10 14:22:32 +00:00
|
|
|
/*
|
|
|
|
* Header declaring Telnet-handling functions.
|
|
|
|
*/
|
|
|
|
|
2018-10-06 10:55:56 +00:00
|
|
|
#ifndef CYGTERMD_TELNET_H
|
|
|
|
#define CYGTERMD_TELNET_H
|
2011-07-10 14:22:32 +00:00
|
|
|
|
|
|
|
#include "sel.h"
|
|
|
|
|
Get rid of lots of implicit pointer types.
All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.
All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.
A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
2018-10-04 18:10:23 +00:00
|
|
|
typedef struct Telnet Telnet;
|
2011-07-10 14:22:32 +00:00
|
|
|
|
|
|
|
struct shell_data {
|
2019-09-08 19:29:00 +00:00
|
|
|
char **envvars; /* array of "VAR=value" terms */
|
2011-07-10 14:22:32 +00:00
|
|
|
int nenvvars;
|
|
|
|
char *termtype;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Create and destroy a Telnet structure.
|
|
|
|
*/
|
Get rid of lots of implicit pointer types.
All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.
All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.
A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
2018-10-04 18:10:23 +00:00
|
|
|
Telnet *telnet_new(sel_wfd *net, sel_wfd *pty);
|
|
|
|
void telnet_free(Telnet *telnet);
|
2011-07-10 14:22:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Process data read from the pty.
|
|
|
|
*/
|
Get rid of lots of implicit pointer types.
All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.
All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.
A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
2018-10-04 18:10:23 +00:00
|
|
|
void telnet_from_pty(Telnet *telnet, char *buf, int len);
|
2011-07-10 14:22:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Process Telnet protocol data received from the network.
|
|
|
|
*/
|
Get rid of lots of implicit pointer types.
All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.
All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.
A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
2018-10-04 18:10:23 +00:00
|
|
|
void telnet_from_net(Telnet *telnet, char *buf, int len);
|
2011-07-10 14:22:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Return true if pre-shell-startup negotiations are complete and
|
|
|
|
* it's safe to start the shell subprocess now. On a true return,
|
|
|
|
* also fills in the shell_data structure.
|
|
|
|
*/
|
Get rid of lots of implicit pointer types.
All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.
All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.
A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
2018-10-04 18:10:23 +00:00
|
|
|
int telnet_shell_ok(Telnet *telnet, struct shell_data *shdata);
|
2011-07-10 14:22:32 +00:00
|
|
|
|
2018-10-06 10:55:56 +00:00
|
|
|
#endif /* CYGTERMD_TELNET_H */
|