summaryrefslogtreecommitdiff
path: root/toxcore/network.h
diff options
context:
space:
mode:
authorCoren[m] <Break@Ocean>2013-09-09 14:16:40 +0200
committerCoren[m] <Break@Ocean>2013-09-09 14:16:40 +0200
commit29d777ef67bc964229722db073a2abdd1eb737b6 (patch)
treeaaa91593de5c47199d1124456266e7da4483e2ad /toxcore/network.h
parenta128e3ff8f09250757ed4ed73fcc088cb5fd15ee (diff)
network.h:
- IP: add in_addr_t as part of the union - IP: rename IP to IP4
Diffstat (limited to 'toxcore/network.h')
-rw-r--r--toxcore/network.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/toxcore/network.h b/toxcore/network.h
index 8d494957..9991c4a4 100644
--- a/toxcore/network.h
+++ b/toxcore/network.h
@@ -86,11 +86,12 @@ typedef union {
86 uint8_t uint8[4]; 86 uint8_t uint8[4];
87 uint16_t uint16[2]; 87 uint16_t uint16[2];
88 uint32_t uint32; 88 uint32_t uint32;
89} IP; 89 in_addr_t in_addr;
90} IP4;
90 91
91typedef union { 92typedef union {
92 struct { 93 struct {
93 IP ip; 94 IP4 ip;
94 uint16_t port; 95 uint16_t port;
95 /* Not used for anything right now. */ 96 /* Not used for anything right now. */
96 uint16_t padding; 97 uint16_t padding;
@@ -101,7 +102,7 @@ typedef union {
101typedef struct { 102typedef struct {
102 int16_t family; 103 int16_t family;
103 uint16_t port; 104 uint16_t port;
104 IP ip; 105 IP4 ip;
105 uint8_t zeroes[8]; 106 uint8_t zeroes[8];
106#ifdef ENABLE_IPV6 107#ifdef ENABLE_IPV6
107 uint8_t zeroes2[12]; 108 uint8_t zeroes2[12];
@@ -155,7 +156,7 @@ void networking_poll(Networking_Core *net);
155 * return 0 if no problems. 156 * return 0 if no problems.
156 * return -1 if there were problems. 157 * return -1 if there were problems.
157 */ 158 */
158Networking_Core *new_networking(IP ip, uint16_t port); 159Networking_Core *new_networking(IP4 ip, uint16_t port);
159 160
160/* Function to cleanup networking stuff (doesn't do much right now). */ 161/* Function to cleanup networking stuff (doesn't do much right now). */
161void kill_networking(Networking_Core *net); 162void kill_networking(Networking_Core *net);