Imported Upstream version 0.20.12
[profile/ivi/GUPnP.git] / libgupnp / gupnp-acl-private.h
1 /*
2  * Copyright (C) 2013,2014 Jens Georg <mail@jensge.org>
3  *
4  * Author: Jens Georg <mail@jensge.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef __GUPNP_ACL_PRIVATE_H__
23 #define __GUPNP_ACL_PRIVATE_H__
24
25 #include <glib.h>
26 #include <glib-object.h>
27 #include <libsoup/soup-session.h>
28
29 #include "gupnp-acl.h"
30 #include "gupnp-context.h"
31
32 G_BEGIN_DECLS
33
34 /**
35  * AclServerHandler:
36  *
37  * Closure for the ACL server handler that adds
38  * a) Some data from the original server handler such as user_data and callback
39  * b) Saves information for later use to pass on to ACL such as the service and context
40  */
41 typedef struct _AclServerHandler
42 {
43         GUPnPService *service;
44         GUPnPContext *context;
45         SoupServerCallback callback;
46         gpointer user_data;
47         GDestroyNotify notify;
48 } AclServerHandler;
49
50 /**
51  * AclAsyncHandler:
52  *
53  * Closure when doing an async ACL request. Stores everything passed into the server handler
54  */
55 typedef struct _AclAsyncHandler
56 {
57         SoupServer *server;
58         SoupMessage *message;
59         char *path;
60         GHashTable *query;
61         SoupClientContext *client;
62         AclServerHandler *handler;
63 } AclAsyncHandler;
64
65 G_GNUC_INTERNAL AclServerHandler *
66 acl_server_handler_new (GUPnPService *service,
67                         GUPnPContext *context,
68                         SoupServerCallback callback,
69                         gpointer user_data,
70                         GDestroyNotify notify);
71
72 G_GNUC_INTERNAL void
73 acl_server_handler_free (AclServerHandler *handler);
74
75 G_GNUC_INTERNAL AclAsyncHandler *
76 acl_async_handler_new (SoupServer *server,
77                        SoupMessage *message,
78                        const char *path,
79                        GHashTable *query,
80                        SoupClientContext *client,
81                        AclServerHandler *handler);
82
83 G_GNUC_INTERNAL void
84 acl_async_handler_free (AclAsyncHandler *handler);
85
86
87 G_END_DECLS
88
89 #endif