diff options
author | Jens Georg <mail@jensge.org> | 2021-10-27 10:57:35 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2021-10-28 17:45:41 +0200 |
commit | 723f24ab3c5ee4db1b5e25f7c05ab18862a58e33 (patch) | |
tree | 0ab55c87a899c8ea50f0c1f2df106533fac6c900 | |
parent | a958026be309cfd29358fc8419fe5e1b116312b6 (diff) | |
download | gssdp-723f24ab3c5ee4db1b5e25f7c05ab18862a58e33.tar.gz |
Client: Deprecate msearch-port property
-rw-r--r-- | libgssdp/gssdp-client.c | 36 | ||||
-rw-r--r-- | libgssdp/gssdp-client.h | 3 |
2 files changed, 39 insertions, 0 deletions
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c index 105ca5d..c9f6e90 100644 --- a/libgssdp/gssdp-client.c +++ b/libgssdp/gssdp-client.c @@ -123,6 +123,7 @@ enum { PROP_UDA_VERSION, PROP_BOOT_ID, PROP_CONFIG_ID, + PROP_PORT, }; enum { @@ -333,6 +334,7 @@ gssdp_client_get_property (GObject *object, g_value_set_uint (value, priv->socket_ttl); break; case PROP_MSEARCH_PORT: + case PROP_PORT: g_value_set_uint (value, priv->msearch_port); break; case PROP_ADDRESS_FAMILY: @@ -392,6 +394,7 @@ gssdp_client_set_property (GObject *object, priv->socket_ttl = g_value_get_uint (value); break; case PROP_MSEARCH_PORT: + case PROP_PORT: priv->msearch_port = g_value_get_uint (value); break; case PROP_ADDRESS_FAMILY: @@ -602,6 +605,8 @@ gssdp_client_class_init (GSSDPClientClass *klass) * 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. + * + * Deprecated: 1.6.0: Use GSSDPClient:port instead */ g_object_class_install_property (object_class, @@ -617,6 +622,27 @@ gssdp_client_class_init (GSSDPClientClass *klass) G_PARAM_STATIC_STRINGS)); /** + * GSSDPClient:port: + * + * 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. + * + * Deprecated: 1.6.0 + */ + g_object_class_install_property + (object_class, + PROP_PORT, + g_param_spec_uint + ("port", + "M-SEARCH port", + "UDP port to use for M-SEARCH requests", + 0, G_MAXUINT16, + 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** * GSSDPClient:address-family:(attributes org.gtk.Property.get=gssdp_client_get_family): * * The IP protocol address family this client works on. When specified @@ -1295,6 +1321,16 @@ gssdp_client_can_reach (GSSDPClient *client, GInetSocketAddress *address) return g_inet_address_mask_matches (priv->device.host_mask, addr); } +guint +gssdp_client_get_port (GSSDPClient *client) +{ + g_return_val_if_fail (GSSDP_IS_CLIENT (client), 0); + + GSSDPClientPrivate *priv = gssdp_client_get_instance_private (client); + + return priv->msearch_port; +} + /** * _gssdp_client_send_message: * @client: A #GSSDPClient diff --git a/libgssdp/gssdp-client.h b/libgssdp/gssdp-client.h index e0e36c7..9b2fb8c 100644 --- a/libgssdp/gssdp-client.h +++ b/libgssdp/gssdp-client.h @@ -88,6 +88,9 @@ gssdp_client_get_index (GSSDPClient *client); GSocketFamily gssdp_client_get_family (GSSDPClient *client); +guint +gssdp_client_get_port (GSSDPClient *client); + GInetAddressMask * gssdp_client_get_address_mask (GSSDPClient *client); |