diff options
| author | Rémi Verschelde | 2017-01-02 15:51:45 +0100 |
|---|---|---|
| committer | GitHub | 2017-01-02 15:51:45 +0100 |
| commit | 0b2771bd6561152cdb0e650538a572a242068f01 (patch) | |
| tree | b44c1ab2d50f14521cb7d9cafcee37b551871c66 /core/io/ip_address.h | |
| parent | 6428ebd91faa757aff419e3f6d1ccc63b699dd11 (diff) | |
| parent | d194e1c48e5d161f0310ee17e63f1951e2c50de6 (diff) | |
| download | godot-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.h | 21 |
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(); } }; |
