Top |
Functions
GSSDPClient * | gssdp_client_new () |
GSSDPClient * | gssdp_client_new_with_port () |
GMainContext * | gssdp_client_get_main_context () |
void | gssdp_client_set_server_id () |
const char * | gssdp_client_get_server_id () |
const char * | gssdp_client_get_interface () |
const char * | gssdp_client_get_host_ip () |
void | gssdp_client_set_network () |
const char * | gssdp_client_get_network () |
gboolean | gssdp_client_get_active () |
void | gssdp_client_append_header () |
void | gssdp_client_clear_headers () |
void | gssdp_client_remove_header () |
void | gssdp_client_add_cache_entry () |
const char * | gssdp_client_guess_user_agent () |
Properties
gboolean | active | Read / Write |
gchar * | host-ip | Read / Write / Construct |
gchar * | interface | Read / Write / Construct Only |
gpointer | main-context | Read / Write / Construct Only |
guint | msearch-port | Read / Write / Construct Only |
gchar * | network | Read / Write / Construct |
gchar * | server-id | Read / Write |
guint | socket-ttl | Read / Write / Construct Only |
Description
GSSDPClient wraps the SSDP "bus" as used by both GSSDPResourceBrowser and GSSDPResourceGroup.
Functions
gssdp_client_new ()
GSSDPClient * gssdp_client_new (GMainContext *main_context
,const char *iface
,GError **error
);
Parameters
main_context |
Deprecated: 0.11.2: Always set to NULL. If you want to
specify a context use |
[allow-none] |
iface |
The name of the network interface, or |
[allow-none] |
error |
Location to store error, or NULL |
gssdp_client_new_with_port ()
GSSDPClient * gssdp_client_new_with_port (const char *iface
,guint16 msearch_port
,GError **error
);
gssdp_client_get_main_context ()
GMainContext *
gssdp_client_get_main_context (GSSDPClient *client
);
gssdp_client_set_server_id ()
void gssdp_client_set_server_id (GSSDPClient *client
,const char *server_id
);
Sets the server ID of client
to server_id
.
gssdp_client_get_interface ()
const char *
gssdp_client_get_interface (GSSDPClient *client
);
Get the name of the network interface associated to client
.
gssdp_client_get_host_ip ()
const char *
gssdp_client_get_host_ip (GSSDPClient *client
);
Get the IP address we advertise ourselves as using.
gssdp_client_set_network ()
void gssdp_client_set_network (GSSDPClient *client
,const char *network
);
Sets the network identification of client
to network
.
gssdp_client_get_network ()
const char *
gssdp_client_get_network (GSSDPClient *client
);
Get the network this client is associated with.
gssdp_client_append_header ()
void gssdp_client_append_header (GSSDPClient *client
,const char *name
,const char *value
);
Adds a header field to the message sent by this client
. It is intended to
be used by clients requiring vendor specific header fields. (If there is an
existing header with name name , then this creates a second one).
gssdp_client_clear_headers ()
void
gssdp_client_clear_headers (GSSDPClient *client
);
Removes all the headers for this client
.
gssdp_client_remove_header ()
void gssdp_client_remove_header (GSSDPClient *client
,const char *name
);
Removes name
from the list of headers . If there are multiple values for
name
, they are all removed.
gssdp_client_add_cache_entry ()
void gssdp_client_add_cache_entry (GSSDPClient *client
,const char *ip_address
,const char *user_agent
);
gssdp_client_guess_user_agent ()
const char * gssdp_client_guess_user_agent (GSSDPClient *client
,const char *ip_address
);
Property Details
The “active”
property
“active” gboolean
Whether this client is active or not (passive). When active (default), the client sends messages on the network, otherwise not. In most cases, you don't want to touch this property.
Flags: Read / Write
Default value: TRUE
The “host-ip”
property
“host-ip” gchar *
The IP address of the assoicated network interface.
Flags: Read / Write / Construct
Default value: NULL
The “interface”
property
“interface” gchar *
The name of the network interface this client is associated with. Set to NULL to autodetect.
Flags: Read / Write / Construct Only
Default value: NULL
The “main-context”
property
“main-context” gpointer
The GMainContext to use. Set to NULL to use the default.
[skip]
GSSDPClient:main-context
has been deprecated since version 0.11.2 and should not be used in newly-written code.
Flags: Read / Write / Construct Only
The “msearch-port”
property
“msearch-port” guint
UDP port to use for sending multicast M-SEARCH requests on the network. If not set (or set to 0) a random port will be used. This property can be only set during object construction.
Flags: Read / Write / Construct Only
Allowed values: <= 65535
Default value: 0
The “network”
property
“network” gchar *
The network this client is currently connected to. You could set this to anything you want to identify the network this client is associated with. If you are using GUPnPContextManager and associated interface is a WiFi interface, this property is set to the ESSID of the network. Otherwise, expect this to be the network IP address by default.
Flags: Read / Write / Construct
Default value: NULL
The “server-id”
property
“server-id” gchar *
The SSDP server's identifier.
Flags: Read / Write
Default value: NULL
The “socket-ttl”
property
“socket-ttl” guint
Time-to-live value to use for all sockets created by this client. If not set (or set to 0) the value recommended by UPnP will be used. This property can only be set during object construction.
Flags: Read / Write / Construct Only
Allowed values: <= 255
Default value: 0
Signal Details
The “message-received”
signal
void user_function (GSSDPClient *client, gchar *from_ip, guint from_port, gint type, gpointer headers, gpointer user_data)
Internal signal.
[skip]
Parameters
client |
The GSSDPClient that received the message. |
|
from_ip |
The IP address of the source. |
|
from_port |
The UDP port used by the sender. |
|
type |
The _GSSDPMessageType. |
|
headers |
Parsed SoupMessageHeaders from the message. |
[type SoupMessageHeaders] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Stability Level: Private