summaryrefslogtreecommitdiffstats
path: root/server/agent-msg-filter.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-03-24 16:29:25 +0100
committerHans de Goede <hdegoede@redhat.com>2011-03-24 17:28:21 +0100
commitc2db6d1066bcb73c5ddf9e38c4ef30545706eae9 (patch)
treea8941330bc01f58443c0afbd08a15aa295171291 /server/agent-msg-filter.h
parent66dde82fee3c4eb5262d582aeb77935efd40def0 (diff)
downloadspice-c2db6d1066bcb73c5ddf9e38c4ef30545706eae9.tar.gz
spice-c2db6d1066bcb73c5ddf9e38c4ef30545706eae9.tar.xz
spice-c2db6d1066bcb73c5ddf9e38c4ef30545706eae9.zip
spice-server: Add the ability to filter agent messages
Diffstat (limited to 'server/agent-msg-filter.h')
-rw-r--r--server/agent-msg-filter.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/server/agent-msg-filter.h b/server/agent-msg-filter.h
new file mode 100644
index 00000000..99dbb8c5
--- /dev/null
+++ b/server/agent-msg-filter.h
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2011 Red Hat, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+ Red Hat Authors:
+ hdegoede@redhat.com
+*/
+
+#ifndef _H_AGENT_MSG_FILTER
+#define _H_AGENT_MSG_FILTER
+
+#include <spice/vd_agent.h>
+
+/* Possible return values for agent_msg_filter_process_data */
+enum {
+ AGENT_MSG_FILTER_OK,
+ AGENT_MSG_FILTER_DISCARD,
+ AGENT_MSG_FILTER_PROTO_ERROR,
+ AGENT_MSG_FILTER_END
+};
+
+typedef struct AgentMsgFilter {
+ struct VDAgentMessage msg_header;
+ int msg_data_to_read;
+ int result;
+ int copy_paste_enabled;
+} AgentMsgFilter;
+
+void agent_msg_filter_init(struct AgentMsgFilter *filter, int copy_paste);
+int agent_msg_filter_process_data(struct AgentMsgFilter *filter,
+ uint8_t *data, uint32_t len);
+
+#endif