<?xml version="1.0"?><%@ page import="com.ubnt.data.X" %><%
X upnp = (X) request.getAttribute("upnp");
String name = upnp.getString("name", "Product Name");
String serial = upnp.getString("key", "UniFi").toUpperCase()+request.getLocalAddr().replace(".", "");
%>
<root xmlns="urn:schemas-upnp-org:device-1-0"> 
	<specVersion>
		<major>1</major>
		<minor>0</minor>
	</specVersion>
	<device>
		<deviceType>urn:schemas-upnp-org:device:upnp:1</deviceType>
		<friendlyName><%=name%> (<%=request.getLocalAddr()%>)</friendlyName>
		<manufacturer>Ubiquiti Networks</manufacturer>
		<manufacturerURL>http://www.ubnt.com/</manufacturerURL>
		<modelDescription><%=name%></modelDescription>
		<modelName><%=name%></modelName>
		<modelNumber><%=upnp.getString("version", "version")%></modelNumber>
		<serialNumber><%=serial%></serialNumber>
		<UDN>uuid:<%=upnp.getString("uuid", "uuid")%></UDN>
		<serviceList>
			<service>
				<serviceType>urn:schemas-upnp-org:service:BasicSCPD:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:BasicSCPD1</serviceId>
				<SCPDURL>/BasicSCPD.xml</SCPDURL>
				<controlURL>/upnp/control?BasicSCPD</controlURL>
				<eventSubURL>/upnp/event?BasicSCPD</eventSubURL>
			</service>
		</serviceList>
		<presentationURL>https://<%=request.getLocalAddr()%>:<%=upnp.getInt("port")%>/manage</presentationURL>
	</device>
</root>
