summaryrefslogtreecommitdiffstats
path: root/sock_stuff.h
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-02-20 11:24:52 +0100
committerGravatar Nikias Bassen2009-02-20 11:24:52 +0100
commit71d8775f865b431135cd3c178763d0a294b8ff9e (patch)
tree2d6ea791e24db2d206ad943dce42b3cec5557d43 /sock_stuff.h
downloadusbmuxd-71d8775f865b431135cd3c178763d0a294b8ff9e.tar.gz
usbmuxd-71d8775f865b431135cd3c178763d0a294b8ff9e.tar.bz2
initial import
Diffstat (limited to 'sock_stuff.h')
-rw-r--r--sock_stuff.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sock_stuff.h b/sock_stuff.h
new file mode 100644
index 0000000..01082d1
--- /dev/null
+++ b/sock_stuff.h
@@ -0,0 +1,27 @@
+#ifndef __SOCK_STUFF_H
+#define __SOCK_STUFF_H
+
+#include <stdint.h>
+
+enum fd_mode
+{
+ fdread,
+ fdwrite,
+ fdexcept
+};
+typedef enum fd_mode fd_mode;
+
+int create_unix_socket(const char *filename);
+int connect_unix_socket(const char *filename);
+int create_socket(uint16_t port);
+int connect_socket(const char *addr, uint16_t port);
+int check_fd(int fd, fd_mode fdm, unsigned int timeout);
+
+int recv_buf(int fd, void *data, size_t size);
+int peek_buf(int fd, void *data, size_t size);
+int recv_buf_timeout(int fd, void *data, size_t size, int flags, unsigned int timeout);
+
+int send_buf(int fd, void *data, size_t size);
+
+#endif /* __SOCK_STUFF_H */
+