Top | ![]() |
![]() |
![]() |
![]() |
GUPnPAcl provides either synchronous or asynchronous functions to check whether a peer sould be able to access a resource or not.
gboolean
gupnp_acl_can_sync (GUPnPAcl *self
);
Check whether gupnp_acl_is_allowed_async()
is supported.
self |
A GUPnPAcl
|
Since: 0.20.11
gboolean gupnp_acl_is_allowed (GUPnPAcl *self
,struct _GUPnPDevice *device
,struct _GUPnPService *service
,const char *path
,const char *address
,const char *agent
);
Check whether an IP address is allowed to access this resource.
self |
an instance of GUPnPAcl |
|
device |
The GUPnPDevice associated with |
[allow-none] |
service |
The GUPnPService associated with |
[allow-none] |
path |
The path being served. |
|
address |
IP address of the peer. |
|
agent |
The User-Agent header of the peer or |
[allow-none] |
Since: 0.20.11
void gupnp_acl_is_allowed_async (GUPnPAcl *self
,struct _GUPnPDevice *device
,struct _GUPnPService *service
,const char *path
,const char *address
,const char *agent
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Optional. Check asynchronously whether an IP address is allowed to access this resource. Use this function if the process of verifying the access right is expected to take some time, for example when using D-Bus etc.
If this function is supported, gupnp_acl_can_sync()
should return TRUE
.
Use gupnp_acl_is_allowed_finish()
to retrieve the result.
self |
a GUPnPAcl |
|
device |
The GUPnPDevice associated with |
[allow-none] |
service |
The GUPnPService associated with |
[allow-none] |
path |
The path being served. |
|
address |
IP address of the peer |
|
agent |
The User-Agent header of the peer or |
[allow-none] |
cancellable |
A GCancellable which can be used to cancel the operation. |
[allow-none] |
callback |
Callback to call after the function is done. |
|
user_data |
Some user data. |
Since: 0.20.11
gboolean gupnp_acl_is_allowed_finish (GUPnPAcl *self
,GAsyncResult *res
,GError **error
);
self |
An instance of GUPnPAcl |
|
res |
|
|
error |
A return location for a GError describing the failure
|
[allow-none] |
Since: 0.20.11
typedef struct _GUPnPAcl GUPnPAcl;
Handle to an object implementing the GUPnPAclInterface interface.
struct GUPnPAclInterface { GTypeInterface parent; gboolean (*is_allowed) (GUPnPAcl *self, struct _GUPnPDevice *device, struct _GUPnPService *service, const char *path, const char *address, const char *agent); void (*is_allowed_async) (GUPnPAcl *self, struct _GUPnPDevice *device, struct _GUPnPService *service, const char *path, const char *address, const char *agent, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean (*is_allowed_finish) (GUPnPAcl *self, GAsyncResult *res, GError **error); gboolean (*can_sync) (GUPnPAcl *self); };
Implement a simple access control list for GUPnP.
GTypeInterface |
The parent interface. |
|
Check whether access to the resource is granted. |
||
Asynchronously check whether the access is granted. |
||
Conclude the |
||
Whether the ACL can do sync queries. |
Since: 0.20.11