aboutsummaryrefslogtreecommitdiffstats
path: root/src/ipc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipc.c')
-rw-r--r--src/ipc.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 720cadd..5da5721 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.7 2008/03/03 18:15:19 james
+ * *** empty log message ***
+ *
* Revision 1.6 2008/02/28 16:57:51 james
* *** empty log message ***
*
@@ -243,3 +246,49 @@ ipc_msg_send_reset (Socket * s)
m.type = IPC_MSG_TYPE_RESET;
return ipc_msg_send (s, (IPC_Msg *) & m);
}
+
+void
+ipc_execute_message (IPC_Msg * m, Context * c)
+{
+ switch (m->hdr.type)
+ {
+ case IPC_MSG_TYPE_NOOP:
+ break;
+ case IPC_MSG_TYPE_DEBUG:
+ log_f (c->l, "<debug message %s>", m->debug.msg);
+ break;
+ case IPC_MSG_TYPE_KEY:
+ vt102_send (c, m->key.key);
+ break;
+ case IPC_MSG_TYPE_SETBAUD:
+ tty_set_baud (c->t, m->setbaud.baud);
+ tty_parse_reset (c);
+ log_f (c->l, "<baud changed to %d>", m->setbaud.baud);
+ break;
+ case IPC_MSG_TYPE_SENDBREAK:
+ log_f (c->l, "<break sent>");
+ tty_send_break (c->t);
+ break;
+ case IPC_MSG_TYPE_SETFLOW:
+ log_f (c->l, "<flow control turned %s>",m->setflow.flow?"on":"off");
+ tty_set_flow (c->t, m->setflow.flow);
+ break;
+ case IPC_MSG_TYPE_SETANSI:
+ vt102_set_ansi (c->v, m->setansi.ansi);
+ break;
+ case IPC_MSG_TYPE_HANGUP:
+ log_f (c->l, "<hangup initiated>");
+ tty_hangup (c->t);
+ break;
+ case IPC_MSG_TYPE_SETSIZE:
+ vt102_resize (c, m->setsize.winsize);
+ break;
+ case IPC_MSG_TYPE_RESET:
+ vt102_reset (c);
+ break;
+ default:
+ log_f(c->l,"<Unhandled message type %d>", m->hdr.type);
+ }
+}
+
+