summaryrefslogtreecommitdiffstats
path: root/hw4/chttpd/chttpd-conn.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw4/chttpd/chttpd-conn.h')
-rw-r--r--hw4/chttpd/chttpd-conn.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/hw4/chttpd/chttpd-conn.h b/hw4/chttpd/chttpd-conn.h
new file mode 100644
index 0000000..d3e1f54
--- /dev/null
+++ b/hw4/chttpd/chttpd-conn.h
@@ -0,0 +1,30 @@
+#ifndef CHTTPD_CONN_H
+#define CHTTPD_CONN_H
+
+#include "chttpd-log.h"
+#include "chttpd-server.h"
+#include <l4list.h>
+#include <sys/types.h>
+
+typedef struct {
+ /* read-only */
+ unsigned long long id;
+ int connfd;
+ ChttpdLog* hlog;
+ ChttpdServer *server;
+ LbsListMeta *slist;
+ LbsList* conn_node; /* reference to the corresponding node in server->conn */
+
+ /* read-write and lock */
+ pthread_rwlock_t lock;
+ pid_t pid;
+} ChttpdConn;
+
+void* chttpd_conn_admin (void* ptr_to_ChttpdConn); /* TODO: implement this */
+void* chttpd_conn_http (void* ptr_to_ChttpdConn);
+
+void chttpd_conn_ctor (void* conn_generic, unsigned long long id, int connfd,
+ ChttpdLog* hlog, ChttpdServer* server, LbsListMeta* slist);
+void chttpd_conn_dtor (void* conn_generic);
+
+#endif /* CHTTTP_CONN_H */