Esempio n. 1
0
static void mupnp_controlpoint_ssdplistner(mUpnpSSDPPacket *ssdpPkt)
{
	mUpnpControlPoint *ctrlPoint;
	MUPNP_SSDP_LISTNER listener;

	mupnp_log_debug_l4("Entering...\n");

	ctrlPoint = (mUpnpControlPoint *)mupnp_ssdp_packet_getuserdata(ssdpPkt);
	if (ctrlPoint == NULL)
		return;

	/* We filter out all but rootdevice, since it must be advertized by all
	 * devices. This way we avoid lots of device updates during advertizement
	 * cycle. */
	if (mupnp_ssdp_packet_isrootdevice(ssdpPkt) == true) {
		if (mupnp_ssdp_packet_isalive(ssdpPkt) == true)
			mupnp_controlpoint_adddevicebyssdppacket(ctrlPoint, ssdpPkt);
		else if (mupnp_ssdp_packet_isbyebye(ssdpPkt) == true)
			mupnp_controlpoint_removedevicebyssdppacket(ctrlPoint, ssdpPkt);
	}
				
	listener = mupnp_controlpoint_getssdplistener(ctrlPoint);
	if (listener != NULL)
		listener(ssdpPkt);

	mupnp_log_debug_l4("Leaving...\n");
}
Esempio n. 2
0
void mupnp_device_ssdplistener(mUpnpSSDPPacket *ssdpPkt)
{
	mUpnpDevice *dev;
	
	mupnp_log_debug_l4("Entering...\n");

	dev = (mUpnpDevice *)mupnp_ssdp_packet_getuserdata(ssdpPkt);
	mupnp_device_ssdpmessagereceived(dev, ssdpPkt, TRUE);

	mupnp_log_debug_l4("Leaving...\n");
}
Esempio n. 3
0
static void mupnp_controlpoint_ssdpresponselistner(mUpnpSSDPPacket *ssdpPkt)
{
	mUpnpControlPoint *ctrlPoint;
	MUPNP_SSDP_RESPONSE_LISTNER listener;

	mupnp_log_debug_l4("Entering...\n");

	ctrlPoint = (mUpnpControlPoint *)mupnp_ssdp_packet_getuserdata(ssdpPkt);
	if (ctrlPoint == NULL)
		return;

	mupnp_controlpoint_adddevicebyssdppacket(ctrlPoint, ssdpPkt);
				
	listener = mupnp_controlpoint_getssdpresponselistener(ctrlPoint);
	if (listener != NULL)
		listener(ssdpPkt);	

	mupnp_log_debug_l4("Leaving...\n");
}