2 * uhttpd - Tiny single-threaded httpd - ubus header
4 * Copyright (C) 2012 Jo-Philipp Wich <xm@subsignal.org>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <libubox/avl.h>
25 #include <libubox/blobmsg_json.h>
26 #include <json/json.h>
29 #define UH_UBUS_MAX_POST_SIZE 4096
32 struct uh_ubus_state
{
33 struct ubus_context
*ctx
;
34 struct ubus_object ubus
;
36 struct avl_tree sessions
;
40 struct uh_ubus_request_data
{
46 struct uh_ubus_session
{
52 struct timespec touched
;
55 struct uh_ubus_session_data
{
57 struct blob_attr attr
[];
60 struct uh_ubus_session_acl
{
66 struct uh_ubus_state
* uh_ubus_init(const struct config
*conf
);
67 bool uh_ubus_request(struct client
*cl
, struct uh_ubus_state
*state
);
68 void uh_ubus_close(struct uh_ubus_state
*state
);