summaryrefslogtreecommitdiff
path: root/toxcore/network.c
diff options
context:
space:
mode:
authorDiadlo <polsha3@gmail.com>2017-03-18 22:22:28 +0300
committerDiadlo <polsha3@gmail.com>2017-08-24 21:09:40 +0300
commitf084f2c621b75a146ccefecbffa9be5f514297e3 (patch)
tree5613f5a66c3c37f3c5982c08b54ed45cfa9d209a /toxcore/network.c
parent491d03c229d5fe684a38bac2abc4ef2617da2bba (diff)
Add loopback and broadcast constants
Diffstat (limited to 'toxcore/network.c')
-rw-r--r--toxcore/network.c6
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
141const IP4 IP4_LOOPBACK = { INADDR_LOOPBACK }; 145const IP4 IP4_LOOPBACK = { INADDR_LOOPBACK };
142const IP6 IP6_LOOPBACK = { 146const 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
160static int make_proto(int proto); 164static int make_proto(int proto);