| 68 int fd; |
68 int fd; |
| 69 struct addrinfo* info; /* NULL, if we are the server */ |
69 struct addrinfo* info; /* NULL, if we are the server */ |
| 70 Client *client; |
70 Client *client; |
| 71 } Server; |
71 } Server; |
| 72 |
72 |
| |
73 typedef struct { |
| |
74 uint32_t mtime_sec; |
| |
75 uint32_t mtime_usec; |
| |
76 uint8_t piece; |
| |
77 uint8_t fromfile; |
| |
78 uint8_t fromrow; |
| |
79 uint8_t tofile; |
| |
80 uint8_t torow; |
| |
81 uint8_t promotion; |
| |
82 } NetMove; |
| |
83 |
| |
84 #define NETMOVE_LEN 14 |
| |
85 |
| 73 int net_create_tcp(Server *server, short port); |
86 int net_create_tcp(Server *server, short port); |
| 74 int net_find_tcp(Server *server, char* host, short port); |
87 int net_find_tcp(Server *server, char* host, short port); |
| 75 |
88 |
| 76 int net_create_sock(Server *server, char *path); |
89 int net_create_sock(Server *server, char *path); |
| 77 int net_find_sock(Server *server, char* path); |
90 int net_find_sock(Server *server, char* path); |