aboutsummaryrefslogtreecommitdiff
path: root/core/io/ip_address.h
diff options
context:
space:
mode:
authorRémi Verschelde2017-01-02 15:51:45 +0100
committerGitHub2017-01-02 15:51:45 +0100
commit0b2771bd6561152cdb0e650538a572a242068f01 (patch)
treeb44c1ab2d50f14521cb7d9cafcee37b551871c66 /core/io/ip_address.h
parent6428ebd91faa757aff419e3f6d1ccc63b699dd11 (diff)
parentd194e1c48e5d161f0310ee17e63f1951e2c50de6 (diff)
downloadgodot-0b2771bd6561152cdb0e650538a572a242068f01.tar.gz
godot-0b2771bd6561152cdb0e650538a572a242068f01.tar.zst
godot-0b2771bd6561152cdb0e650538a572a242068f01.zip
Merge pull request #7271 from Faless/ipv6_cleanup
Fixes and improvementes for IPv6 implementation.
Diffstat (limited to 'core/io/ip_address.h')
-rw-r--r--core/io/ip_address.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/core/io/ip_address.h b/core/io/ip_address.h
index e42e54def..87f32b0ac 100644
--- a/core/io/ip_address.h
+++ b/core/io/ip_address.h
@@ -33,16 +33,7 @@
struct IP_Address {
-public:
- enum AddrType {
- TYPE_NONE = 0,
- TYPE_IPV4 = 1,
- TYPE_IPV6 = 2,
-
- TYPE_ANY = 3,
- };
-
- AddrType type;
+private:
union {
uint8_t field8[16];
@@ -70,11 +61,17 @@ public:
}
void clear();
+ bool is_ipv4() const;
+ const uint8_t *get_ipv4() const;
+ void set_ipv4(const uint8_t *p_ip);
+
+ const uint8_t *get_ipv6() const;
+ void set_ipv6(const uint8_t *buf);
operator String() const;
IP_Address(const String& p_string);
- IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, AddrType p_type=TYPE_IPV4);
- IP_Address() { clear(); type=TYPE_NONE; }
+ IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, bool is_v6=false);
+ IP_Address() { clear(); }
};