-/* $Id: mac_res.r,v 1.1.2.17 1999/04/02 12:58:02 ben Exp $ */
+/* $Id: mac_res.r,v 1.1.2.18 1999/09/01 22:16:15 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
no_implicit_copy,
#define PREF_strings 1024
PREF_strings, 1, /* host 'STR#' */
- 23, prot_telnet, /* port, protocol */
+ 7, prot_telnet, /* port, protocol */
PREF_strings, 2, /* termtype 'STR#' */
PREF_strings, 3, /* termspeed 'STR#' */
PREF_strings, 4, /* environmt 'STR#' */
resource 'STR#' (PREF_strings, "strings", purgeable) {
{
- "nowhere.loopback.edu",
+ "172.17.11.11",
"xterm",
"38400,38400",
"\000",
-/* $Id: macterm.c,v 1.1.2.35 1999/07/24 15:51:12 ben Exp $ */
+/* $Id: macterm.c,v 1.1.2.36 1999/09/01 22:16:15 ben Exp $ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999 Ben Harris
s = smalloc(sizeof(*s));
memset(s, 0, sizeof(*s));
mac_loadconfig(&s->cfg);
- s->back = &null_backend;
+ s->back = &rawtcp_backend;
/* XXX: Own storage management? */
if (HAVE_COLOR_QD())
}
ShowWindow(s->window);
s->back->init(s);
+#if 0
starttime = TickCount();
display_resource(s, 'pTST', 128);
sprintf(msg, "Elapsed ticks: %d\015\012", TickCount() - starttime);
inbuf_putstr(s, msg);
term_out(s);
+#endif
}
static void mac_initfont(Session *s) {
-/* $Id: testback.c,v 1.1.2.7 1999/08/02 08:04:31 ben Exp $ */
+/* $Id: testback.c,v 1.1.2.8 1999/09/01 22:16:15 ben Exp $ */
/*
* Copyright (c) 1999 Simon Tatham
* Copyright (c) 1999 Ben Harris
static void hexdump_send(Session *, char *, int);
static void null_size(Session *);
static void null_special(Session *, Telnet_Special);
+static char *rawtcp_init(Session *);
+static int rawtcp_msg(Session *, SOCKET, Net_Event_Type);
Backend null_backend = {
null_init, null_msg, null_send, null_size, null_special
null_init, null_msg, hexdump_send, null_size, null_special
};
+Backend rawtcp_backend = {
+ rawtcp_init, rawtcp_msg, null_send, null_size, null_special
+};
+
static char *null_init(Session *s) {
return NULL;
}
+struct rawtcp_private {
+ SOCKET s;
+};
+
+static char *rawtcp_init(Session *sess) {
+ struct rawtcp_private *rp;
+
+ sess->back_priv = smalloc(sizeof(struct rawtcp_private));
+ rp = (struct rawtcp_private *)sess->back_priv;
+ rp->s = net_open(sess, sess->cfg.host, sess->cfg.port);
+ if (rp->s == INVALID_SOCKET)
+ fatalbox("Open failed");
+}
+
+static int rawtcp_msg(Session *sess, SOCKET sock, Net_Event_Type ne) {
+ struct rawtcp_private *rp = (struct rawtcp_private *)sess->back_priv;
+
+ switch (ne) {
+ case NE_NULL:
+ break;
+ case NE_OPEN:
+ break;
+ case NE_NOHOST:
+ case NE_REFUSED:
+ case NE_NOOPEN:
+ rp->s = INVALID_SOCKET;
+ fatalbox("Open failed");
+ break;
+ case NE_DATA:
+ break;
+ case NE_URGENT:
+ break;
+ case NE_CLOSING:
+ /* net_close(rp->s);*/
+ break;
+ case NE_CLOSED:
+ rp->s = INVALID_SOCKET;
+ fatalbox("Connection closed");
+ break;
+ case NE_TIMEOUT:
+ case NE_ABORT:
+ case NE_DIED:
+ fatalbox("Connection died");
+ rp->s = INVALID_SOCKET;
+ break;
+ }
+}
+
+
+
/*
* Emacs magic:
* Local Variables: