Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

811 lines
30 KiB

  1. /***************************************************************************
  2. *
  3. * Copyright (C) 2001-2002 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: upnpmsgs.h
  6. *
  7. * Content: Messages for UPnP (Universal Plug-and-Play). Strings
  8. * listed here are not to be localized.
  9. *
  10. * History:
  11. * Date By Reason
  12. * ======== ======== =========
  13. * 02/08/01 VanceO Created.
  14. *
  15. ***************************************************************************/
  16. //=============================================================================
  17. // Constant definitions
  18. //=============================================================================
  19. #define UPNP_DISCOVERY_MULTICAST_ADDRESS "239.255.255.250"
  20. #define UPNP_PORT 1900
  21. #define UPNP_PORT_A "1900"
  22. #define UPNP_WILDCARD ""
  23. #define UPNP_BOOLEAN_FALSE "0"
  24. #define UPNP_BOOLEAN_TRUE "1"
  25. #define HTTP_PREFIX "HTTP/"
  26. #define HTTP_VERSION HTTP_PREFIX "1.1"
  27. #define HTTP_VERSION_ALT HTTP_PREFIX "1.0"
  28. #define HTTP_PORT 80
  29. #define EOL "\r\n"
  30. //=============================================================================
  31. // XML standard names
  32. //=============================================================================
  33. #define XML_NAMESPACEDEFINITIONPREFIX "xmlns:"
  34. #define XML_DEVICEDESCRIPTION_SERVICETYPE "serviceType"
  35. #define XML_DEVICEDESCRIPTION_SERVICEID "serviceId"
  36. #define XML_DEVICEDESCRIPTION_CONTROLURL "controlURL"
  37. //=============================================================================
  38. // Standard namespaces
  39. //=============================================================================
  40. #define URI_CONTROL_A "urn:schemas-upnp-org:control-1-0"
  41. #define URL_SOAPENVELOPE_A "http://schemas.xmlsoap.org/soap/envelope/"
  42. #define URL_SOAPENCODING_A "http://schemas.xmlsoap.org/soap/encoding/"
  43. //=============================================================================
  44. // Devices
  45. //=============================================================================
  46. #define URI_DEVICE_WANCONNECTIONDEVICE_W L"urn:schemas-upnp-org:device:WANConnectionDevice:1"
  47. //=============================================================================
  48. // Services
  49. //=============================================================================
  50. #define URI_SERVICE_WANIPCONNECTION_A "urn:schemas-upnp-org:service:WANIPConnection:1"
  51. #define URI_SERVICE_WANPPPCONNECTION_A "urn:schemas-upnp-org:service:WANPPPConnection:1"
  52. //=============================================================================
  53. // Standard control variables
  54. //=============================================================================
  55. #define ARG_CONTROL_ERROR_ERRORCODE_A "errorCode"
  56. #define ARG_CONTROL_ERROR_ERRORDESCRIPTION_A "errorDescription"
  57. #define CONTROL_RESPONSESUFFIX_A "Response"
  58. /*
  59. //=============================================================================
  60. // State variable querying
  61. //=============================================================================
  62. #define CONTROL_QUERYSTATEVARIABLE_A "QueryStateVariable"
  63. // Input
  64. #define ARG_CONTROL_VARNAME_A "varName"
  65. // Output
  66. #define ARG_CONTROL_RETURN_A "return"
  67. // Variables
  68. #define VAR_EXTERNALIPADDRESS_A "ExternalIPAddress"
  69. */
  70. //=============================================================================
  71. // Actions
  72. //=============================================================================
  73. // Action
  74. /*
  75. GetExternalIPAddress?
  76. */
  77. #define ACTION_GETEXTERNALIPADDRESS_A "GetExternalIPAddress"
  78. // In args
  79. // Out args
  80. #define ARG_GETEXTERNALIPADDRESS_NEWEXTERNALIPADDRESS_A "NewExternalIPAddress"
  81. // Action
  82. /*
  83. 2.4.16. AddPortMapping
  84. This action creates a new port mapping or overwrites an existing mapping
  85. with the same internal client. If the ExternalPort and PortMappingProtocol
  86. pair is already mapped to another internal client, an error is returned.
  87. NOTE: Not all NAT implementations will support:
  88. * Wildcard values for ExternalPort
  89. * InternalPort values that are different from ExternalPort
  90. * Dynamic port mappings i.e. with non-Infinite PortMappingLeaseDuration
  91. */
  92. #define ACTION_ADDPORTMAPPING_A "AddPortMapping"
  93. // In args
  94. /*
  95. 2.2.15. RemoteHost
  96. This variable represents the source of inbound IP packets. This will be a
  97. wildcard in most cases. NAT vendors are only required to support wildcards.
  98. A non-wildcard value will allow for "narrow" port mappings, which may be
  99. desirable in some usage scenarios.When RemoteHost is a wildcard, all
  100. traffic sent to the ExternalPort on the WAN interface of the gateway is
  101. forwarded to the InternalClient on the InternalPort. When RemoteHost is
  102. specified as one external IP address as opposed to a wild card, the NAT
  103. will only forward inbound packets from this RemoteHost to the
  104. InternalClient, all other packets will be dropped.
  105. */
  106. #define ARG_ADDPORTMAPPING_NEWREMOTEHOST_A "NewRemoteHost"
  107. /*
  108. 2.2.16. ExternalPort
  109. This variable represents the external port that the NAT gateway would
  110. "listen" on for connection requests to a corresponding InternalPort on an
  111. InternalClient. A value of 0 essentially implies that the gateway should
  112. listen on the same port as InternalPort. Inbound packets to this external
  113. port on the WAN interface of the gateway should be forwarded to
  114. InternalClient on the InternalPort on which the message was received. If
  115. this value is specified as a wildcard, connection request on all external
  116. ports will be forwarded to InternalClient. Obviously only one such entry
  117. can exist in the NAT at any time and conflicts are handled with a "first
  118. write wins" behavior.
  119. */
  120. #define ARG_ADDPORTMAPPING_NEWEXTERNALPORT_A "NewExternalPort"
  121. /*
  122. 2.2.18. PortMappingProtocol
  123. This variable represents the protocol of the port mapping. Possible values
  124. are TCP or UDP.
  125. */
  126. #define ARG_ADDPORTMAPPING_NEWPROTOCOL_A "NewProtocol"
  127. /*
  128. 2.2.17. InternalPort
  129. This variable represents the port on InternalClient that the gateway should
  130. forward connection requests to. A value of 0 is not allowed. NAT
  131. implementations that do not permit different values for ExternalPort and
  132. InternalPort will return an error.
  133. */
  134. #define ARG_ADDPORTMAPPING_NEWINTERNALPORT_A "NewInternalPort"
  135. /*
  136. 2.2.19. InternalClient
  137. This variable represents the IP address or DNS host name of an internal
  138. client (on the residential LAN). Note that if the gateway does not support
  139. DHCP, it does not have to support DNS host names. Consequently, support for
  140. an IP address is mandatory and support for DNS host names is recommended.
  141. This value cannot be a wild card. It must be possible to set the
  142. InternalClient to the broadcast IP address 255.255.255.255 for UDP
  143. mappings. This is to enable multiple NAT clients to use the same well-
  144. known port simultaneously.
  145. */
  146. #define ARG_ADDPORTMAPPING_NEWINTERNALCLIENT_A "NewInternalClient"
  147. /*
  148. 2.2.13. PortMappingEnabled
  149. This variable allows security conscious users to disable and enable NAT
  150. port mappings. It can also support persistence of port mappings.
  151. */
  152. #define ARG_ADDPORTMAPPING_NEWENABLED_A "NewEnabled"
  153. /*
  154. 2.2.20. PortMappingDescription
  155. This is a string representation of a port mapping and is applicable for
  156. static and dynamic port mappings. The format of the description string is
  157. not specified and is application dependent. If specified, the description
  158. string can be displayed to a user via the UI of a control point, enabling
  159. easier management of port mappings. The description string for a port
  160. mapping (or a set of related port mappings) may or may not be unique across
  161. multiple instantiations of an application on multiple nodes in the
  162. residential LAN.
  163. */
  164. #define ARG_ADDPORTMAPPING_NEWPORTMAPPINGDESCRIPTION_A "NewPortMappingDescription"
  165. /*
  166. 2.2.14. PortMappingLeaseDuration
  167. This variable determines the time to live in seconds of a port-mapping
  168. lease. A value of 0 means the port mapping is static. Non-zero values will
  169. allow support for dynamic port mappings. Note that static port mappings do
  170. not necessarily mean persistence of these mappings across device resets or
  171. reboots. It is up to a gateway vendor to implement persistence as
  172. appropriate for their IGD device.
  173. */
  174. #define ARG_ADDPORTMAPPING_NEWLEASEDURATION_A "NewLeaseDuration"
  175. // Out args
  176. // Action
  177. /*
  178. 2.4.15. GetSpecificPortMappingEntry
  179. This action reports the Static Port Mapping specified by the unique tuple
  180. of RemoteHost, ExternalPort and PortMappingProtocol.
  181. */
  182. #define ACTION_GETSPECIFICPORTMAPPINGENTRY_A "GetSpecificPortMappingEntry"
  183. // In args
  184. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWREMOTEHOST_A ARG_ADDPORTMAPPING_NEWREMOTEHOST_A
  185. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWEXTERNALPORT_A ARG_ADDPORTMAPPING_NEWEXTERNALPORT_A
  186. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWPROTOCOL_A ARG_ADDPORTMAPPING_NEWPROTOCOL_A
  187. // Out args
  188. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWINTERNALPORT_A ARG_ADDPORTMAPPING_NEWINTERNALPORT_A
  189. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWINTERNALCLIENT_A ARG_ADDPORTMAPPING_NEWINTERNALCLIENT_A
  190. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWENABLED_A ARG_ADDPORTMAPPING_NEWENABLED_A
  191. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWPORTMAPPINGDESCRIPTION_A ARG_ADDPORTMAPPING_NEWPORTMAPPINGDESCRIPTION_A
  192. #define ARG_GETSPECIFICPORTMAPPINGENTRY_NEWLEASEDURATION_A ARG_ADDPORTMAPPING_NEWLEASEDURATION_A
  193. // Action
  194. /*
  195. 2.4.17. DeletePortMapping
  196. This action deletes a previously instantiated port mapping.
  197. Inbound connections are no longer permitted on the port mapping being
  198. deleted.
  199. */
  200. #define ACTION_DELETEPORTMAPPING_A "DeletePortMapping"
  201. // In args
  202. #define ARG_DELETEPORTMAPPING_NEWREMOTEHOST_A ARG_ADDPORTMAPPING_NEWREMOTEHOST_A
  203. #define ARG_DELETEPORTMAPPING_NEWEXTERNALPORT_A ARG_ADDPORTMAPPING_NEWEXTERNALPORT_A
  204. #define ARG_DELETEPORTMAPPING_NEWPROTOCOL_A ARG_ADDPORTMAPPING_NEWPROTOCOL_A
  205. // Out args
  206. //=============================================================================
  207. // HTTP/SSDP/SOAP/UPnP header strings (located in intfobj.cpp)
  208. //=============================================================================
  209. #define RESPONSEHEADERINDEX_CACHECONTROL 0
  210. #define RESPONSEHEADERINDEX_DATE 1
  211. #define RESPONSEHEADERINDEX_EXT 2
  212. #define RESPONSEHEADERINDEX_LOCATION 3
  213. #define RESPONSEHEADERINDEX_SERVER 4
  214. #define RESPONSEHEADERINDEX_ST 5
  215. #define RESPONSEHEADERINDEX_USN 6
  216. #define RESPONSEHEADERINDEX_CONTENTLANGUAGE 7
  217. #define RESPONSEHEADERINDEX_CONTENTLENGTH 8
  218. #define RESPONSEHEADERINDEX_CONTENTTYPE 9
  219. #define RESPONSEHEADERINDEX_TRANSFERENCODING 10
  220. #define RESPONSEHEADERINDEX_HOST 11
  221. #define RESPONSEHEADERINDEX_NT 12
  222. #define RESPONSEHEADERINDEX_NTS 13
  223. #define RESPONSEHEADERINDEX_MAN 14
  224. #define RESPONSEHEADERINDEX_MX 15
  225. #define RESPONSEHEADERINDEX_AL 16
  226. #define RESPONSEHEADERINDEX_CALLBACK 17
  227. #define RESPONSEHEADERINDEX_TIMEOUT 18
  228. #define RESPONSEHEADERINDEX_SCOPE 19
  229. #define RESPONSEHEADERINDEX_SID 20
  230. #define RESPONSEHEADERINDEX_SEQ 21
  231. #define NUM_RESPONSE_HEADERS 22
  232. extern const char * c_szResponseHeaders[NUM_RESPONSE_HEADERS];
  233. //=============================================================================
  234. // Pre-built UPnP message strings (located in intfobj.cpp)
  235. //=============================================================================
  236. /*
  237. 1.2.2 Discovery: Search: Request with M-SEARCH
  238. (No body for request with method M-SEARCH, but note that the message must have a blank line following the last HTTP header.)
  239. Request line
  240. M-SEARCH
  241. Method defined by SSDP for search requests.
  242. *
  243. Request applies generally and not to a specific resource. Must be *.
  244. HTTP/1.1
  245. HTTP version.
  246. Headers
  247. HOST
  248. Required. Multicast channel and port reserved for SSDP by Internet Assigned Numbers Authority (IANA). Must be 239.255.255.250:1900.
  249. MAN
  250. Required. Unlike the NTS and ST headers, the value of the MAN header is enclosed in double quotes. Must be "ssdp:discover".
  251. MX
  252. Required. Maximum wait. Device responses should be delayed a random duration between 0 and this many seconds to balance load for the control point when it processes responses. This value should be increased if a large number of devices are expected to respond or if network latencies are expected to be significant. Specified by UPnP vendor. Integer.
  253. ST
  254. Required header defined by SSDP. Search Target. Must be one of the following. (cf. NT header in NOTIFY with ssdp:alive above.) Single URI.
  255. ssdp:all
  256. Search for all devices and services.
  257. upnp:rootdevice
  258. Search for root devices only.
  259. uuid:device-UUID
  260. Search for a particular device. Device UUID specified by UPnP vendor.
  261. urn:schemas-upnp-org:device:deviceType:v
  262. Search for any device of this type. Device type and version defined by UPnP Forum working committee.
  263. urn:schemas-upnp-org:service:serviceType:v
  264. Search for any service of this type. Service type and version defined by UPnP Forum working committee.
  265. */
  266. extern const char c_szUPnPMsg_Discover_Service_WANIPConnection[];
  267. extern const char c_szUPnPMsg_Discover_Service_WANPPPConnection[];
  268. /*
  269. 1.2.3 Discovery: Search: Response
  270. (No body for a response to a request with method M-SEARCH, but note that the message must have a blank line following the last HTTP header.)
  271. Response line
  272. HTTP/1.1 200 OK
  273. Headers
  274. CACHE-CONTROL
  275. Required. Must have max-age directive that specifies number of seconds the advertisement is valid. After this duration, control points should assume the device (or service) is no longer available. Should be > 1800 seconds (30 minutes). Specified by UPnP vendor. Integer.
  276. DATE
  277. Recommended. When response was generated. RFC 1123 date.
  278. EXT
  279. Required. Confirms that the MAN header was understood. (Header only; no value.)
  280. LOCATION
  281. Required. Contains a URL to the UPnP description of the root device. In some unmanaged networks, host of this URL may contain an IP address (versus a domain name). Specified by UPnP vendor. Single URL.
  282. SERVER
  283. Required. Concatenation of OS name, OS version, UPnP/1.0, product name, and product version. Specified by UPnP vendor. String.
  284. ST
  285. Required header defined by SSDP. Search Target. Single URI. If ST header in request was,
  286. ssdp:all
  287. Respond 3+2d+k times for a root device with d embedded devices and s embedded services but only k distinct service types. Value for ST header must be the same as for the NT header in NOTIFY messages with ssdp:alive. (See above.) Single URI.
  288. upnp:rootdevice
  289. Respond once for root device. Must be upnp:rootdevice. Single URI.
  290. uuid:device-UUID
  291. Respond once for each device, root or embedded. Must be uuid:device-UUID. Device UUID specified by UPnP vendor. Single URI.
  292. urn:schemas-upnp-org:device:deviceType:v
  293. Respond once for each device, root or embedded. Must be urn:schemas-upnp-org:device:deviceType:v. Device type and version defined by UPnP Forum working committee.
  294. urn:schemas-upnp-org:service:serviceType:v
  295. Respond once for each service. Must be urn:schemas-upnp-org:service:serviceType:v. Service type and version defined by UPnP Forum working committee.
  296. USN
  297. Required header defined by SSDP. Unique Service Name. (See list of required values for USN header in NOTIFY with ssdp:alive above.) Single URI.
  298. */
  299. /*
  300. 2.9 Description: Retrieving a description: Request
  301. (No body for request to retrieve a description, but note that the message must have a blank line following the last HTTP header.)
  302. Request line
  303. GET
  304. Method defined by HTTP.
  305. path to description
  306. Path component of device description URL (LOCATION header in discovery message) or of service description URL (SCPDURL element in device description). Single, relative URL.
  307. HTTP/1.1
  308. HTTP version.
  309. Headers
  310. HOST
  311. Required. Domain name or IP address and optional port components of device description URL (LOCATION header in discovery message) or of service description URL (SCPDURL element of device description). If the port is empty or not given, port 80 is assumed.
  312. ACCEPT-LANGUAGE
  313. Recommended for retrieving device descriptions. Preferred language(s) for description. If no description is available in this language, device may return a description in a default language. RFC 1766 language tag(s).
  314. */
  315. /*
  316. 2.9 Description: Retrieving a description: Response
  317. The body of this response is a UPnP device or service XML description.
  318. Response line
  319. HTTP/1.1 200 OK
  320. Headers
  321. CONTENT-LANGUAGE
  322. Required if and only if request included an ACCEPT-LANGUAGE header. Language of description. RFC 1766 language tag(s).
  323. CONTENT-LENGTH
  324. Required. Length of body in Bytes. Integer.
  325. CONTENT-TYPE
  326. Required. Must be text/xml.
  327. DATE
  328. Recommended. When response was generated. RFC 1123 date.
  329. */
  330. //
  331. // Description response XML format (parts we're interested in, anyway):
  332. //
  333. // <?xml version="1.0"?>
  334. // <root xmlns="urn:schemas-upnp-org:device-1-0">
  335. // <device>
  336. // <serviceList>
  337. // <service>
  338. // <serviceType>urn:schemas-upnp-org:service:serviceType:v</serviceType>
  339. // <serviceId>urn:upnp-org:serviceId:serviceID</serviceId>
  340. // <controlURL>URL for control</controlURL>
  341. // </service>
  342. // </serviceList>
  343. // </device>
  344. // </root>
  345. //
  346. // i.e. the element stack is "?xml/root/device/serviceList/service".
  347. //
  348. extern const char * c_szElementStack_service[];
  349. /*
  350. 3.3.1 Control: Query: Invoke
  351. Request line
  352. POST
  353. Method defined by HTTP.
  354. path of control URL
  355. Path component of URL for control for this service (controlURL sub element of service element of device description). Single, relative URL.
  356. HTTP/1.1
  357. HTTP version.
  358. Headers
  359. HOST
  360. Required. Domain name or IP address and optional port components of URL for control for this service (controlURL sub element of service element of device description). If the port is empty or not given, port 80 is assumed.
  361. ACCEPT-LANGUAGE
  362. (No ACCEPT-LANGUAGE header is used in control messages.)
  363. CONTENT-LENGTH
  364. Required. Length of body in bytes. Integer.
  365. CONTENT-TYPE
  366. Required. Must be text/xlm. Should include character coding used, e.g., utf-8.
  367. MAN
  368. (No MAN header in request with method POST.)
  369. SOAPACTION
  370. Required header defined by SOAP. Must be "urn:schemas-upnp-org:control-1-0#QueryStateVariable". If used in a request with method M-POST, header name must be qualified with HTTP name space defined in MAN header. Single URI.
  371. Body
  372. Envelope
  373. Required element defined by SOAP. xmlns namespace attribute must be "http://schemas.xmlsoap.org/soap/envelope/". Must include encodingStyle attribute with value "http://schemas.xmlsoap.org/soap/encoding/". Contains the following sub elements:
  374. Body
  375. Required element defined by SOAP. Should be qualified with SOAP namespace. Contains the following sub element:
  376. QueryStateVariable
  377. Required element defined by UPnP. Action name. xmlns namespace attribute must be "urn:schemas-upnp-org:control-1-0". Must be the first sub element of Body. Contains the following, ordered sub element:
  378. varName
  379. Required element defined by UPnP. Variable name. Must be qualified by QueryStateVariable namespace. Values is name of state variable to be queried. String.
  380. */
  381. /*
  382. 3.3.2 Control: Query: Response: Success
  383. Response line
  384. HTTP/1.1
  385. HTTP version.
  386. 200 OK
  387. HTTP success code.
  388. Headers
  389. CONTENT-LANGUAGE
  390. (No CONTENT-LANGUAGE header is used in control messages.)
  391. CONTENT-LENGTH
  392. Required. Length of body in bytes. Integer.
  393. CONTENT-TYPE
  394. Required. Must be text/xlm. Should include character coding used, e.g., utf-8.
  395. DATE
  396. Recommended. When response was generated. RFC 1123 date.
  397. EXT
  398. Required. Confirms that the MAN header was understood. (Header only; no value.)
  399. SERVER
  400. Required. Concatenation of OS name, OS version, UPnP/1.0, product name, and product version. String.
  401. Body
  402. Envelope
  403. Required element defined by SOAP. xmlns namespace attribute must be "http://schemas.xmlsoap.org/soap/envelope/". Must include encodingStyle attribute with value "http://schemas.xmlsoap.org/soap/encoding/". Contains the following sub elements:
  404. Body
  405. Required element defined by SOAP. Should be qualified with SOAP namespace. Contains the following sub element:
  406. QueryStateVariableResponse
  407. Required element defined by UPnP and SOAP. xmlns namespace attribute must be "urn:schemas-upnp-org:control-1-0". Must be the first sub element of Body. Contains the following sub element:
  408. return
  409. Required element defined by UPnP. (Element name not qualified by a namespace; element nesting context is sufficient.) Value is current value of the state variable specified in varName element in request.
  410. */
  411. //
  412. // Control sucess response SOAP XML format (parts we're interested in, anyway):
  413. //
  414. // <s:Envelope
  415. // xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
  416. // s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  417. // <s:Body>
  418. // <u:QueryStateVariableResponse xmlns:u="urn:schemas-upnp-org:control-1-0">
  419. // <return>variable value</return>
  420. // </u:QueryStateVariableResponse>
  421. // </s:Body>
  422. // </s:Envelope>
  423. //
  424. // i.e. the element stack is "s:Envelope/s:Body/u:QueryStateVariableResponse".
  425. //
  426. //extern const char * c_szElementStack_QueryStateVariableResponse[];
  427. /*
  428. 3.2.1 Control: Action: Invoke
  429. Request line
  430. POST
  431. Method defined by HTTP.
  432. path control URL
  433. Path component of URL for control for this service (controlURL sub element of service element of device description). Single, relative URL.
  434. HTTP/1.1
  435. HTTP version.
  436. Headers
  437. HOST
  438. Required. Domain name or IP address and optional port components of URL for control for this service (controlURL sub element of service element of device description). If the port is empty or not given, port 80 is assumed.
  439. ACCEPT-LANGUAGE
  440. (No ACCEPT-LANGUAGE header is used in control messages.)
  441. CONTENT-LENGTH
  442. Required. Length of body in bytes. Integer.
  443. CONTENT-TYPE
  444. Required. Must be text/xlm. Should include character coding used, e.g., utf-8.
  445. SOAPACTION
  446. Required header defined by SOAP. Must be the service type, hash mark, and name of action to be invoked, all enclosed in double quotes. If used in a request with method M-POST, header name must be qualified with HTTP name space defined in MAN header. Single URI.
  447. Body
  448. Envelope
  449. Required element defined by SOAP. xmlns namespace attribute must be "http://schemas.xmlsoap.org/soap/envelope/". Must include encodingStyle attribute with value "http://schemas.xmlsoap.org/soap/encoding/". Contains the following sub elements:
  450. Body
  451. Required element defined by SOAP. Should be qualified with SOAP namespace. Contains the following sub element:
  452. actionName
  453. Required. Name of element is name of action to invoke. xmlns namespace attribute must be the service type enclosed in double quotes. Must be the first sub element of Body. Contains the following, ordered sub element(s):
  454. argumentName
  455. Required if and only if action has in arguments. Value to be passed to action. Repeat once for each in argument. (Element name not qualified by a namespace; element nesting context is sufficient.) Single data type as defined by UPnP service description.
  456. */
  457. /*
  458. 3.2.2 Control: Action: Response: Success
  459. Response line
  460. HTTP/1.1
  461. HTTP version.
  462. 200 OK
  463. HTTP success code.
  464. Headers
  465. CONTENT-LANGUAGE
  466. (No CONTENT-LANGUAGE header is used in control messages.)
  467. CONTENT-LENGTH
  468. Required. Length of body in bytes. Integer.
  469. CONTENT-TYPE
  470. Required. Must be text/xlm. Should include character coding used, e.g., utf-8.
  471. DATE
  472. Recommended. When response was generated. RFC 1123 date.
  473. EXT
  474. Required. Confirms that the MAN header was understood. (Header only; no value.)
  475. SERVER
  476. Required. Concatenation of OS name, OS version, UPnP/1.0, product name, and product version. String.
  477. Body
  478. Envelope
  479. Required element defined by SOAP. xmlns namespace attribute must be "http://schemas.xmlsoap.org/soap/envelope/". Must include encodingStyle attribute with value "http://schemas.xmlsoap.org/soap/encoding/". Contains the following sub elements:
  480. Body
  481. Required element defined by SOAP. Should be qualified with SOAP namespace. Contains the following sub element:
  482. actionNameResponse
  483. Required. Name of element is action name prepended to Response. xmlns namespace attribute must be service type enclosed in double quotes. Must be the first sub element of Body. Contains the following sub element:
  484. argumentName
  485. Required if and only if action has out arguments. Value returned from action. Repeat once for each out argument. If action has an argument marked as retval, this argument must be the first element. (Element name not qualified by a namespace; element nesting context is sufficient.) Single data type as defined by UPnP service description.
  486. */
  487. //
  488. // Control sucess response SOAP XML format (parts we're interested in, anyway):
  489. //
  490. // <s:Envelope
  491. // xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
  492. // s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  493. // <s:Body>
  494. // <u:actionNameResponse xmlns:u="urn:schemas-upnp-org:service:serviceType:v">
  495. // <argumentName>out arg value</argumentName>
  496. // </u:actionNameResponse>
  497. // </s:Body>
  498. // </s:Envelope>
  499. //
  500. // i.e. the element stack is "s:Envelope/s:Body/u:actionNameResponse".
  501. //
  502. extern const char * c_szElementStack_GetExternalIPAddressResponse[];
  503. extern const char * c_szElementStack_AddPortMappingResponse[];
  504. extern const char * c_szElementStack_GetSpecificPortMappingEntryResponse[];
  505. extern const char * c_szElementStack_DeletePortMappingResponse[];
  506. /*
  507. 3.2.2 Control: Action: Response: Failure
  508. Response line
  509. HTTP/1.1
  510. HTTP version.
  511. 500 Internal Server Error
  512. HTTP error code.
  513. Headers
  514. CONTENT-LANGUAGE
  515. (No CONTENT-LANGUAGE header is used in control messages.)
  516. CONTENT-LENGTH
  517. Required. Length of body in bytes. Integer.
  518. CONTENT-TYPE
  519. Required. Must be text/xlm. Should include character coding used, e.g., utf-8.
  520. DATE
  521. Recommended. When response was generated. RFC 1123 date.
  522. EXT
  523. Required. Confirms that the MAN header was understood. (Header only; no value.)
  524. SERVER
  525. Required. Concatenation of OS name, OS version, UPnP/1.0, product name, and product version. String.
  526. Body
  527. Envelope
  528. Required element defined by SOAP. xmlns namespace attribute must be "http://schemas.xmlsoap.org/soap/envelope/". Must include encodingStyle attribute with value "http://schemas.xmlsoap.org/soap/encoding/". Contains the following sub elements:
  529. Body
  530. Required element defined by SOAP. Should be qualified with SOAP namespace. Contains the following sub element:
  531. Fault
  532. Required element defined by SOAP. Error encountered while invoking action. Should be qualified with SOAP namespace. Contains the following sub elements:
  533. faultcode
  534. Required element defined by SOAP. Value must be qualified with the SOAP namespace. Must be Client.
  535. faultstring
  536. Required element defined by SOAP. Must be UPnPError.
  537. detail
  538. Required element defined by SOAP.
  539. UPnPError
  540. Required element defined by UPnP.
  541. errorCode
  542. Required element defined by UPnP. Code identifying what error was encountered. See table immediately below for values. Integer.
  543. errorDescription
  544. Recommended element defined by UPnP. Short description. See table immediately below for values. String. Recommend < 256 characters.
  545. */
  546. //
  547. // Control failure response SOAP XML format (parts we're interested in, anyway):
  548. //
  549. // <s:Envelope
  550. // xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
  551. // s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  552. // <s:Body>
  553. // <s:Fault>
  554. // <faultcode>s:Client</faultcode>
  555. // <faultstring>UPnPError</faultstring>
  556. // <detail>
  557. // <UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
  558. // <errorCode>error code</errorCode>
  559. // <errorDescription>error string</errorDescription>
  560. // </UPnPError>
  561. // </detail>
  562. // </s:Fault>
  563. // </s:Body>
  564. // </s:Envelope>
  565. //
  566. // i.e. the element stack is "s:Envelope/s:Body/s:Fault/detail/UPnPError".
  567. //
  568. extern const char * c_szElementStack_ControlResponseFailure[];
  569. //=============================================================================
  570. // Errors
  571. //=============================================================================
  572. //
  573. // See UPnP Device Architecture section on Control.
  574. //
  575. #define UPNPERR_INVALIDARGS 402
  576. //
  577. // The specified value does not exist in the array.
  578. //
  579. #define UPNPERR_IGD_NOSUCHENTRYINARRAY 714
  580. //
  581. // The source IP address cannot be wild-carded.
  582. //
  583. #define UPNPERR_IGD_WILDCARDNOTPERMITTEDINSRCIP 715
  584. //
  585. // The external port cannot be wild-carded.
  586. //
  587. #define UPNPERR_IGD_WILDCARDNOTPERMITTEDINEXTPORT 716
  588. //
  589. // The service mapping entry specified conflicts with a mapping assigned
  590. // previously to another client.
  591. //
  592. #define UPNPERR_IGD_CONFLICTINMAPPINGENTRY 718
  593. //
  594. // Internal and External port values must be the same.
  595. //
  596. #define UPNPERR_IGD_SAMEPORTVALUESREQUIRED 724
  597. //
  598. // The NAT implementation only supports permanent lease times on port mappings.
  599. //
  600. #define UPNPERR_IGD_ONLYPERMANENTLEASESSUPPORTED 725