new: libvdehist and vdeterm
[vde.git] / vde-2 / include / libvdehist.h
blob4f8a0f099a6227e0de937765703fe7b8aa499179
1 /*
2 * libvdehist - A library to manage history and command completion for vde mgmt protocol
3 * Copyright (C) 2006 Renzo Davoli, University of Bologna
5 * This library is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation version 2.1 of the License, or (at
8 * your option) any later version.
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
13 * General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef _LIBVDEHIST_H
22 #define _LIBVDEHIST_H
25 typedef ssize_t (* ssize_fun)();
26 extern ssize_fun vdehist_vderead;
27 extern ssize_fun vdehist_vdewrite;
28 extern ssize_fun vdehist_termread;
29 extern ssize_fun vdehist_termwrite;
31 #define HIST_COMMAND 0x0
32 #define HIST_NOCMD 0x1
33 #define HIST_PASSWDFLAG 0x80
35 struct vdehiststat;
37 extern char *(* vdehist_logincmd)(char *cmd,int len,struct vdehiststat *st);
39 void vdehist_mgmt_to_term(struct vdehiststat *st);
40 int vdehist_term_to_mgmt(struct vdehiststat *st);
41 struct vdehiststat *vdehist_new(int termfd,int mgmtfd);
42 void vdehist_free(struct vdehiststat *st);
44 int vdehist_getstatus(struct vdehiststat *st);
45 void vdehist_setstatus(struct vdehiststat *st,int status);
47 int vdehist_gettermfd(struct vdehiststat *st);
49 int vdehist_getmgmtfd(struct vdehiststat *st);
50 void vdehist_setmgmtfd(struct vdehiststat *st,int mgmtfd);
52 #endif