miniupnpd/upnpsoap.c: make WANAccessType easier to configure

This commit is contained in:
Thomas Bernard 2014-11-27 13:25:45 +01:00
parent 4cae31c948
commit 33a5ebf367
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $Id: upnpsoap.c,v 1.128 2014/09/25 09:02:25 nanard Exp $ */
/* $Id: upnpsoap.c,v 1.129 2014/11/27 12:24:52 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2006-2014 Thomas Bernard
@ -170,8 +170,7 @@ GetCommonLinkProperties(struct upnphttp * h, const char * action)
static const char resp[] =
"<u:%sResponse "
"xmlns:u=\"%s\">"
/*"<NewWANAccessType>DSL</NewWANAccessType>"*/
"<NewWANAccessType>Cable</NewWANAccessType>"
"<NewWANAccessType>%s</NewWANAccessType>"
"<NewLayer1UpstreamMaxBitRate>%lu</NewLayer1UpstreamMaxBitRate>"
"<NewLayer1DownstreamMaxBitRate>%lu</NewLayer1DownstreamMaxBitRate>"
"<NewPhysicalLinkStatus>%s</NewPhysicalLinkStatus>"
@ -182,6 +181,7 @@ GetCommonLinkProperties(struct upnphttp * h, const char * action)
struct ifdata data;
const char * status = "Up"; /* Up, Down (Required),
* Initializing, Unavailable (Optional) */
const char * wan_access_type = "Cable"; /* DSL, POTS, Cable, Ethernet */
char ext_ip_addr[INET_ADDRSTRLEN];
if((downstream_bitrate == 0) || (upstream_bitrate == 0))
@ -197,6 +197,7 @@ GetCommonLinkProperties(struct upnphttp * h, const char * action)
}
bodylen = snprintf(body, sizeof(body), resp,
action, "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1",
wan_access_type,
upstream_bitrate, downstream_bitrate,
status, action);
BuildSendAndCloseSoapResp(h, body, bodylen);