Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (27 sloc) 0.8 kb
5f43a171 » Edwin Brady
2011-06-02 Added a thin layer over the C socket API in rawnet.idr
1 #ifndef _RAWNET_H
2 #define _RAWNET_H
3
4 #include <stdint.h>
5 #include <closure.h>
6 #include <sys/types.h>
7 #include <sys/socket.h>
8 #include <netinet/in.h>
9 #include <arpa/inet.h>
10 #include <unistd.h>
11 #include <fcntl.h>
12 #include <errno.h>
13
14 int prim_socket(int family, int socktype);
15 int prim_connect(int socket, char* host, int port);
16 int prim_bind(int socket, char* host, int port);
17 int prim_bind_any(int socket, int port);
18 int prim_listen(int socket, int maxconn);
19 // VAL is (Socket & SockAddr)
20 VAL prim_accept(int socket);
21
22 int prim_sendTo(int socket, char* host, int port, VAL stuff);
23 // VAL is RawPacket
24 int prim_send(int socket, VAL stuff);
25
26 // VAL is (RawPacket & SockAddr)
27 VAL prim_recvFrom(int socket);
28 // VAL is RawPacket
29 VAL prim_recv(int socket);
30
31 void prim_shutdown(int socket, int how);
32
33 #endif
Something went wrong with that request. Please try again.