Skip to content
0.2.0-dev Download ZIP
80 lines ·3.7 KB Raw
1/**************************************************************************/
2/* upnp_device_miniupnp.h */
3/**************************************************************************/
4/* This file is part of: */
5/* GODOT ENGINE */
6/* https://godotengine.org */
7/**************************************************************************/
8/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10/* */
11/* Permission is hereby granted, free of charge, to any person obtaining */
12/* a copy of this software and associated documentation files (the */
13/* "Software"), to deal in the Software without restriction, including */
14/* without limitation the rights to use, copy, modify, merge, publish, */
15/* distribute, sublicense, and/or sell copies of the Software, and to */
16/* permit persons to whom the Software is furnished to do so, subject to */
17/* the following conditions: */
18/* */
19/* The above copyright notice and this permission notice shall be */
20/* included in all copies or substantial portions of the Software. */
21/* */
22/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29/**************************************************************************/
30
31#pragma once
32
33#ifndef WEB_ENABLED
34
35#include "upnp_device.h"
36
37class UPNPDeviceMiniUPNP : public UPNPDevice {
38 GDCLASS(UPNPDeviceMiniUPNP, UPNPDevice);
39
40private:
41 static UPNPDevice *_create(bool p_notify_postinitialize);
42
43 String description_url;
44 String service_type;
45 String igd_control_url;
46 String igd_service_type;
47 String igd_our_addr;
48 IGDStatus igd_status = IGD_STATUS_UNKNOWN_ERROR;
49
50public:
51 static void make_default();
52
53 virtual void set_description_url(const String &url) override;
54 virtual String get_description_url() const override;
55
56 virtual void set_service_type(const String &type) override;
57 virtual String get_service_type() const override;
58
59 virtual void set_igd_control_url(const String &url) override;
60 virtual String get_igd_control_url() const override;
61
62 virtual void set_igd_service_type(const String &type) override;
63 virtual String get_igd_service_type() const override;
64
65 virtual void set_igd_our_addr(const String &addr) override;
66 virtual String get_igd_our_addr() const override;
67
68 virtual void set_igd_status(IGDStatus status) override;
69 virtual IGDStatus get_igd_status() const override;
70
71 virtual bool is_valid_gateway() const override;
72 virtual String query_external_address() const override;
73 virtual int add_port_mapping(int port, int port_internal = 0, String desc = "", String proto = "UDP", int duration = 0) const override;
74 virtual int delete_port_mapping(int port, String proto = "UDP") const override;
75
76 UPNPDeviceMiniUPNP() {}
77 virtual ~UPNPDeviceMiniUPNP() {}
78};
79
80#endif // WEB_ENABLED