1/** \file
2 * \brief SKB server prototypes
3 */
4
5/*
6 * Copyright (c) 2007, 2008, 2009, ETH Zurich.
7 * All rights reserved.
8 *
9 * This file is distributed under the terms in the attached LICENSE file.
10 * If you do not find this file, copies can be found by writing to:
11 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
12 */
13
14
15#ifndef SKB_SERVER_H_
16#define SKB_SERVER_H_
17
18#include <barrelfish/barrelfish.h>
19#include <skb/skb.h>
20#include <if/skb_defs.h>
21
22#define POST_EXECUTE 1
23
24void skb_server_init(void);
25void post_and_execute_string(void);
26
27
28struct skb_query_state {
29    char output_buffer[skb__run_response_output_MAX_ARGUMENT_SIZE];
30    char error_buffer[skb__run_response_str_error_MAX_ARGUMENT_SIZE];
31    int output_length;
32    int error_output_length;
33    int exec_res;
34};
35
36struct skb_reply_state;
37
38typedef void(*rpc_reply_handler_fn)(struct skb_binding*, struct skb_reply_state*);
39//typedef void(*event_send_handler_fn)(struct skb_events_binding*, struct skb_reply_state*);
40
41struct skb_reply_state {
42	struct skb_query_state skb;
43	rpc_reply_handler_fn rpc_reply;
44	errval_t error;
45
46	struct skb_reply_state *next;
47};
48
49errval_t new_reply_state(struct skb_reply_state**, rpc_reply_handler_fn);
50void free_reply_state(void*);
51errval_t execute_query(const char*, struct skb_query_state*);
52
53#endif
54