ContextFilter


Object Hierarchy:

Object hierarchy for ContextFilter

Description:

[ CCode ( type_id = "gupnp_context_filter_get_type ()" ) ]
[ Version ( since = "1.4.0" ) ]
public class ContextFilter : Object

Network context filter, used by [class@GUPnP.

ContextManager]

ContextFilter handles network filtering. It provides API to manage a list of entries that will be used to positive filter networks. The ContextFilter could be enabled or not. If it's enabled but the entries list is empty, it behaves as if being disabled.

The GUPnPContextFilter is used with the [class@GUPnP.ContextManager] to narrow down the contexts that are notified by it.

Contexts can be filtered by the following criteria:

  • Their IP addresses
  • The network device they will live on
  • The name of the network the context would join

To add or modify a context filter, you need to retrieve the current context filter from the context manger using [ method@GUPnP.ContextManager.get_context_filter].

By default, a context filter is empty and disabled.

For example, to only react to contexts that are appearing on eth0 or when being in the WiFi network with the SSID "HomeNetwork", and on IPv6 localhost, you should do:

```c GUPnPContextFilter* filter;

filter = gupnp_context_manager_get_context_filter (manager); const char *filter_entries[] = { "eth0", "HomeNetwork", "::1", NULL }; gupnp_context_filter_add_entryv (filter, filter_entries); gupnp_context_filter_set_enabled (filter, TRUE); ```


Namespace: GUPnP
Package: gupnp-1.6

Content:

Properties:

Creation methods:

Methods:

Inherited Members: