aboutsummaryrefslogtreecommitdiff
path: root/src/nat/miniupnp/miniupnpc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nat/miniupnp/miniupnpc.h')
-rw-r--r--src/nat/miniupnp/miniupnpc.h120
1 files changed, 0 insertions, 120 deletions
diff --git a/src/nat/miniupnp/miniupnpc.h b/src/nat/miniupnp/miniupnpc.h
deleted file mode 100644
index 8aa047b64..000000000
--- a/src/nat/miniupnp/miniupnpc.h
+++ /dev/null
@@ -1,120 +0,0 @@
1/* $Id: miniupnpc.h,v 1.18 2008/09/25 18:02:50 nanard Exp $ */
2/* Project: miniupnp
3 * http://miniupnp.free.fr/
4 * Author: Thomas Bernard
5 * Copyright (c) 2005-2006 Thomas Bernard
6 * This software is subjects to the conditions detailed
7 * in the LICENCE file provided within this distribution */
8#ifndef __MINIUPNPC_H__
9#define __MINIUPNPC_H__
10
11#include "declspec.h"
12#include "igd_desc_parse.h"
13
14#ifdef WIN32
15#include <winsock2.h>
16#else
17#include <sys/socket.h>
18#endif
19
20#ifdef __cplusplus
21extern "C"
22{
23#endif
24
25/* Structures definitions : */
26 struct UPNParg
27 {
28 const char *elt;
29 const char *val;
30 };
31
32 int simpleUPnPcommand (int s, const char *, const char *,
33 const char *, struct UPNParg *, char *, int *);
34
35 struct UPNPDev
36 {
37 struct UPNPDev *pNext;
38 char *descURL;
39 char *st;
40 char buffer[2];
41 };
42
43/* upnpDiscover()
44 * discover UPnP devices on the network.
45 * The discovered devices are returned as a chained list.
46 * It is up to the caller to free the list with freeUPNPDevlist().
47 * delay (in millisecond) is the maximum time for waiting any device
48 * response.
49 * If available, device list will be obtained from MiniSSDPd.
50 * Default path for minissdpd socket will be used if minissdpdsock argument
51 * is NULL.
52 * If multicastif is not NULL, it will be used instead of the default
53 * multicast interface for sending SSDP discover packets.
54 * If sameport is not null, SSDP packets will be sent from the source port
55 * 1900 (same as destination port) otherwise system assign a source port. */
56 LIBSPEC struct UPNPDev *upnpDiscover (int delay, const char *multicastif, const struct sockaddr *addr,
57 const char *minissdpdsock, int sameport);
58/* freeUPNPDevlist()
59 * free list returned by upnpDiscover() */
60 LIBSPEC void freeUPNPDevlist (struct UPNPDev *devlist);
61
62/* parserootdesc() :
63 * parse root XML description of a UPnP device and fill the IGDdatas
64 * structure. */
65 LIBSPEC void parserootdesc (const char *, int, struct IGDdatas *);
66
67/* structure used to get fast access to urls
68 * controlURL: controlURL of the WANIPConnection
69 * ipcondescURL: url of the description of the WANIPConnection
70 * controlURL_CIF: controlURL of the WANCommonInterfaceConfig
71 */
72 struct UPNPUrls
73 {
74 char *controlURL;
75 char *ipcondescURL;
76 char *controlURL_CIF;
77 };
78
79/* UPNP_GetValidIGD() :
80 * return values :
81 * 0 = NO IGD found
82 * 1 = A valid connected IGD has been found
83 * 2 = A valid IGD has been found but it reported as
84 * not connected
85 * 3 = an UPnP device has been found but was not recognized as an IGD
86 *
87 * In any non zero return case, the urls and data structures
88 * passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
89 * free allocated memory.
90 */
91 LIBSPEC int
92 UPNP_GetValidIGD (struct UPNPDev *devlist,
93 struct UPNPUrls *urls,
94 struct IGDdatas *data, char *lanaddr, int lanaddrlen);
95
96/* UPNP_GetIGDFromUrl()
97 * Used when skipping the discovery process.
98 * return value :
99 * 0 - Not ok
100 * 1 - OK */
101 LIBSPEC int
102 UPNP_GetIGDFromUrl (const char *rootdescurl,
103 struct UPNPUrls *urls,
104 struct IGDdatas *data, char *lanaddr, int lanaddrlen);
105
106 LIBSPEC void GetUPNPUrls (struct UPNPUrls *, struct IGDdatas *,
107 const char *);
108
109 LIBSPEC void FreeUPNPUrls (struct UPNPUrls *);
110
111/* Reads data from the specified socket.
112 * Returns the number of bytes read if successful, zero if no bytes were
113 * read or if we timed out. Returns negative if there was an error. */
114 int ReceiveData (int socket, char *data, int length, int timeout);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif