diff options
author | Diadlo <polsha3@gmail.com> | 2017-03-18 22:22:28 +0300 |
---|---|---|
committer | Diadlo <polsha3@gmail.com> | 2017-08-24 21:09:40 +0300 |
commit | f084f2c621b75a146ccefecbffa9be5f514297e3 (patch) | |
tree | 5613f5a66c3c37f3c5982c08b54ed45cfa9d209a /toxcore/network.c | |
parent | 491d03c229d5fe684a38bac2abc4ef2617da2bba (diff) |
Add loopback and broadcast constants
Diffstat (limited to 'toxcore/network.c')
-rw-r--r-- | toxcore/network.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index c5596ad6..151986d9 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -138,6 +138,10 @@ static int inet_pton(Family family, const char *addrString, void *addrbuf) | |||
138 | 138 | ||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #if !defined(INADDR_LOOPBACK) | ||
142 | #define INADDR_LOOPBACK 0x7f000001 | ||
143 | #endif | ||
144 | |||
141 | const IP4 IP4_LOOPBACK = { INADDR_LOOPBACK }; | 145 | const IP4 IP4_LOOPBACK = { INADDR_LOOPBACK }; |
142 | const IP6 IP6_LOOPBACK = { | 146 | const IP6 IP6_LOOPBACK = { |
143 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } | 147 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } |
@@ -154,7 +158,7 @@ const IP6 IP6_BROADCAST = { | |||
154 | #endif | 158 | #endif |
155 | 159 | ||
156 | #if TOX_INET_ADDRSTRLEN < INET_ADDRSTRLEN | 160 | #if TOX_INET_ADDRSTRLEN < INET_ADDRSTRLEN |
157 | #error TOX_INET_ADDRSTRLEN should be egreater or qual to INET_ADDRSTRLEN (#INET_ADDRSTRLEN) | 161 | #error TOX_INET_ADDRSTRLEN should be greater or equal to INET_ADDRSTRLEN (#INET_ADDRSTRLEN) |
158 | #endif | 162 | #endif |
159 | 163 | ||
160 | static int make_proto(int proto); | 164 | static int make_proto(int proto); |