/usr/include/libvdemgmt.h is in libvde-dev 2.3.2+r586-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | /*
* Copyright (C) 2007 - Luca Bigliardi
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* @file libvdemgmt.h
* @brief Functions for console management handling, client side.
* @author Luca Bigliardi
* @date 2007-05-16
*/
#ifndef _LIBVDEMGMT_H_
#define _LIBVDEMGMT_H_
/** A console management connection */
struct vdemgmt;
/**
* @brief vdemgmt_open - Connect to console management socket.
*
* @param path of console management socket
* @return pointer to a struct vdemgmt, NULL if error
*/
extern struct vdemgmt *vdemgmt_open(const char *path);
/**
* @brief vdemgmt_close - Close a console management connection.
*
* @param conn structure of connection that you want to close
*/
extern void vdemgmt_close(struct vdemgmt *conn);
/**
* @brief vdemgmt_getfd - Extract file descriptor of a console connection.
*
* @param conn structure of connection
*
* @return integer representing file descriptor, -1 if error
*/
extern int vdemgmt_getfd(struct vdemgmt *conn);
/** Container of output from a synchronous command. */
struct vdemgmt_out {
char *buf;
size_t sz;
};
/**
* @brief vdemgmt_freeout - Free vdemgmt_out data structure
*
* @param out data structure
*/
extern void vdemgmt_freeout(struct vdemgmt_out *out);
/**
* @brief vdemgmt_rstout - Empty vdemgmt_out data structure
*
* @param out data structure
*/
extern void vdemgmt_rstout(struct vdemgmt_out *out);
/**
* @brief vdemgmt_sendcmd - Send a synchronous command
*
* @param conn structure of connection to send command to
* @param cmd command to send
* @param out pointer to an output container, if NULL the output is discarded
*
* @return the same return value of command executed
*/
extern int vdemgmt_sendcmd(struct vdemgmt *conn, const char *cmd, struct vdemgmt_out *out);
/**
* @brief vdemgmt_asyncreg - Register func handler for async output from debug events
*
* @param conn structure of connection to activate debug events to
* @param event debug feature to activate
* @param callback the handler
*
* @return 0 on success, error code otherwise
*/
extern int vdemgmt_asyncreg(struct vdemgmt *conn, const char *event, void (*callback)(const char *event, const int tag, const char *data) );
/**
* @brief vdemgmt_asyncunreg - Unregister func handler for async output from debug events
*
* @param conn structure of connection to deactivate debug events to
* @param event debug feature to deactivate
*
* @return 0 on success, error code otherwise
*/
extern void vdemgmt_asyncunreg(struct vdemgmt *conn, const char *event);
/**
* @brief vdemgmt_asyncrecv - Call appropriate handler when an asynchronous output is incoming
*
* @param conn connection from whom asynchronous data is incoming
*/
extern void vdemgmt_asyncrecv(struct vdemgmt *conn);
/**
* @brief vdemgmt_getbanner - Get banner received from management socket
*
* @param conn structure of connection
*
* @return const pointer to banner string
*/
extern const char *vdemgmt_getbanner(struct vdemgmt *conn);
/**
* @brief vdemgmt_getprompt - Get prompt received from management socket
*
* @param conn structure of connection
*
* @return const pointer to prompt string
*/
extern const char *vdemgmt_getprompt(struct vdemgmt *conn);
/**
* @brief vdemgmt_getversion - Get version received from management socket
*
* @param conn structure of connection
*
* @return const pointer to version string
*/
extern const char *vdemgmt_getversion(struct vdemgmt *conn);
/**
* @brief vdemgmt_commandlist - Retrieve list of commands available from management socket
*
* @param conn structure of connection
*
* @return array of string NULL terminated, NULL if error
*/
extern char **vdemgmt_commandlist(struct vdemgmt *conn);
/**
* @brief vdemgmt_freecommandlist - Free array returned from vdemgmt_commandlist
*
* @param *cl array of string NULL terminated
*/
extern void vdemgmt_freecommandlist(char **cl);
#endif
|