on d66da21 help sign in
Idris-dev/support/network.h
36 lines 790 B history raw
1#include <stdio.h>
2#include <sys/types.h>
3#include <sys/socket.h>
4#include <netinet/in.h>
5#include <arpa/inet.h>
6#include <unistd.h>
7#include <string.h>
8#include <closure.h>
10typedef struct {
11 int sock;
12 struct sockaddr_in addr;
13} Connection;
15typedef struct {
16 unsigned port;
17 char* buf;
18 char* server;
19} Recv;
21int netTest(char* strTest, int num);
22void* net_UDP_serverSocket(int port);
23void* net_UDP_clientSocket(char* server, int port);
25int nullPtr(void *ptr);
27int net_sendUDP(void* conn, char* server, int port, char* stuff);
28void* net_recvUDP(void* conn);
30char* get_recvBuf(void* recv);
31char* get_recvServer(void* recv);
32int get_recvPort(void* recv);
34void net_sendRaw(void* conn, char* server, int port, VAL pkt);
35VAL net_recvRaw(void* conn);
36void dumpPkt(VAL pkt);