* correctly handle VTY_READ/VTY_WRITE events and select loop integration of VTY
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 66cc13b..370d1f7 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -18,19 +18,6 @@
#include <vty/command.h>
#include <vty/buffer.h>
-/* Vty events */
-enum event {
- VTY_SERV,
- VTY_READ,
- VTY_WRITE,
- VTY_TIMEOUT_RESET,
-#ifdef VTYSH
- VTYSH_SERV,
- VTYSH_READ,
- VTYSH_WRITE
-#endif /* VTYSH */
-};
-
extern struct host host;
/* Vector which store each vty structure. */
@@ -235,6 +222,7 @@
{
char *p = vty_newline(vty);
buffer_put(vty->obuf, p, strlen(p));
+ return 0;
}
int vty_config_lock(struct vty *vty)
@@ -255,12 +243,6 @@
return vty->config;
}
-static void vty_event(enum event event, int sock, struct vty *vty)
-{
- fprintf(stdout, "vty_event(%d, %d, %p)\n", event, sock, vty);
- buffer_flush_all(vty->obuf, sock);
-}
-
/* Say hello to vty interface. */
void vty_hello(struct vty *vty)
{
@@ -1375,7 +1357,7 @@
/* Create new vty structure. */
struct vty *
-vty_create (int vty_sock)
+vty_create (int vty_sock, void *priv)
{
struct vty *vty;
@@ -1388,6 +1370,7 @@
/* Allocate new vty structure and set up default values. */
vty = vty_new ();
vty->fd = vty_sock;
+ vty->priv = priv;
vty->type = VTY_TERM;
if (no_password_check)
{