X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuhttpd.git;a=blobdiff_plain;f=uhttpd.h;h=12cfc287676d870c51d2c5587b6f160d3fe36cf5;hp=9ed6439aa17aa8664af341f38402157571e097dc;hb=0590256080feb5e8f8742938efa539f2aec90601;hpb=119244d9b13e84eb898f9fb97e83cac260c1a0b5 diff --git a/uhttpd.h b/uhttpd.h index 9ed6439..12cfc28 100644 --- a/uhttpd.h +++ b/uhttpd.h @@ -29,6 +29,10 @@ #include #include #include +#ifdef HAVE_UBUS +#include +#include +#endif #ifdef HAVE_TLS #include #endif @@ -49,6 +53,10 @@ struct config { const char *error_handler; const char *cgi_prefix; const char *cgi_path; + const char *lua_handler; + const char *lua_prefix; + const char *ubus_prefix; + const char *ubus_socket; int no_symlinks; int no_dirlists; int network_timeout; @@ -146,8 +154,29 @@ struct dispatch_handler { bool (*check_url)(const char *url); bool (*check_path)(struct path_info *pi, const char *url); - void (*handle_request)(struct client *cl, const char *url, struct path_info *pi); + void (*handle_request)(struct client *cl, char *url, struct path_info *pi); +}; + +#ifdef HAVE_UBUS +struct dispatch_ubus { + struct ubus_request req; + + struct uloop_timeout timeout; + struct json_tokener *jstok; + struct json_object *jsobj; + struct json_object *jsobj_cur; + int post_len; + + const char *sid; + uint32_t obj; + const char *func; + + struct blob_buf buf; + bool req_pending; + bool array; + int array_idx; }; +#endif struct dispatch { int (*data_send)(struct client *cl, const char *data, int len); @@ -163,6 +192,9 @@ struct dispatch { int fd; } file; struct dispatch_proc proc; +#ifdef HAVE_UBUS + struct dispatch_ubus ubus; +#endif }; }; @@ -235,7 +267,10 @@ void uh_relay_close(struct relay *r, int ret); void uh_relay_free(struct relay *r); struct env_var *uh_get_process_vars(struct client *cl, struct path_info *pi); -bool uh_create_process(struct client *cl, struct path_info *pi, - void (*cb)(struct client *cl, struct path_info *pi)); +bool uh_create_process(struct client *cl, struct path_info *pi, char *url, + void (*cb)(struct client *cl, struct path_info *pi, char *url)); + +int uh_plugin_init(const char *name); +void uh_plugin_post_init(void); #endif