3e453b1bab7c1a0b2a2a3a9b91714434b19542ea
1 {$DEFINE LIBMINIUPNPC_WINDOZE_STATIC}
3 {$MODE OBJFPC}
4 {$PACKRECORDS C}
6 {$IFDEF WIN32}
7 {$DEFINE MSWINDOWS}
8 {$ENDIF}
10 {$LONGSTRINGS ON}
11 {$MACRO ON}
17 interface
19 {$IFDEF MSWINDOWS}
20 {$IFDEF LIBMINIUPNPC_WINDOZE_STATIC}
21 {$LINKLIB libminiupnpc.a}
22 {$LINKLIB libiphlpapi.a}
23 {$DEFINE MINIUPNPC_IMPL := cdecl; external}
24 {$ELSE}
26 {$ENDIF}
27 {$ELSE}
29 {$ENDIF}
32 Type
56 //char devicetype[MINIUPNPC_URL_MAXSIZE];
65 //int state;
66 //"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"
68 // "urn:schemas-upnp-org:service:WANIPConnection:1"
69 // "urn:schemas-upnp-org:service:WANPPPConnection:1"
71 //if both WANIPConnection and WANPPPConnection are present
73 //"urn:schemas-upnp-org:service:WANIPv6FirewallControl:1"
75 // tmp
79 (* upnpDiscover()
80 * discover UPnP devices on the network.
81 * The discovered devices are returned as a chained list.
82 * It is up to the caller to free the list with freeUPNPDevlist().
83 * delay (in millisecond) is the maximum time for waiting any device
84 * response.
85 * If available, device list will be obtained from MiniSSDPd.
86 * Default path for minissdpd socket will be used if minissdpdsock argument
87 * is NULL.
88 * If multicastif is not NULL, it will be used instead of the default
89 * multicast interface for sending SSDP discover packets.
90 * If sameport is not null, SSDP packets will be sent from the source port
91 * 1900 (same as destination port) otherwise system assign a source port. *)
101 (* UPNP_GetValidIGD() :
102 * return values :
103 * 0 = NO IGD found
104 * 1 = A valid connected IGD has been found
105 * 2 = A valid IGD has been found but it reported as
106 * not connected
107 * 3 = an UPnP device has been found but was not recognized as an IGD
108 *
109 * In any non zero return case, the urls and data structures
110 * passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
111 * free allocated memory.
112 *)
121 (* UPNP_GetExternalIPAddress() call the corresponding UPNP method.
122 * if the third arg is not null the value is copied to it.
123 * at least 16 bytes must be available
124 *
125 * Return values :
126 * 0 : SUCCESS
127 * NON ZERO : ERROR Either an UPnP error code or an unknown error.
128 *
129 * possible UPnP Errors :
130 * 402 Invalid Args - See UPnP Device Architecture section on Control.
131 * 501 Action Failed - See UPnP Device Architecture section on Control. *)
138 (* UPNP_AddPortMapping()
139 * if desc is NULL, it will be defaulted to "libminiupnpc"
140 * remoteHost is usually NULL because IGD don't support it.
141 *
142 * Return values :
143 * 0 : SUCCESS
144 * NON ZERO : ERROR. Either an UPnP error code or an unknown error.
145 *
146 * List of possible UPnP errors for AddPortMapping :
147 * errorCode errorDescription (short) - Description (long)
148 * 402 Invalid Args - See UPnP Device Architecture section on Control.
149 * 501 Action Failed - See UPnP Device Architecture section on Control.
150 * 715 WildCardNotPermittedInSrcIP - The source IP address cannot be
151 * wild-carded
152 * 716 WildCardNotPermittedInExtPort - The external port cannot be wild-carded
153 * 718 ConflictInMappingEntry - The port mapping entry specified conflicts
154 * with a mapping assigned previously to another client
155 * 724 SamePortValuesRequired - Internal and External port values
156 * must be the same
157 * 725 OnlyPermanentLeasesSupported - The NAT implementation only supports
158 * permanent lease times on port mappings
159 * 726 RemoteHostOnlySupportsWildcard - RemoteHost must be a wildcard
160 * and cannot be a specific IP address or DNS name
161 * 727 ExternalPortOnlySupportsWildcard - ExternalPort must be a wildcard and
162 * cannot be a specific port value *)
175 (* UPNP_DeletePortMapping()
176 * Use same argument values as what was used for AddPortMapping().
177 * remoteHost is usually NULL because IGD don't support it.
178 * Return Values :
179 * 0 : SUCCESS
180 * NON ZERO : error. Either an UPnP error code or an undefined error.
181 *
182 * List of possible UPnP errors for DeletePortMapping :
183 * 402 Invalid Args - See UPnP Device Architecture section on Control.
184 * 714 NoSuchEntryInArray - The specified value does not exist in the array *)
211 implementation