summaryrefslogtreecommitdiff
path: root/cmd/srv9p
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-15 21:03:18 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-15 21:03:18 -0600
commit32caa64b67b6f6a4c3c8a0b270a8b12b2f05389b (patch)
treea833402307974ee7d874dcd768a46b9cde0f81f8 /cmd/srv9p
parent3dcbd43ecd77c28762b0595475893ff052c0444a (diff)
wip
Diffstat (limited to 'cmd/srv9p')
-rw-r--r--cmd/srv9p/gnet.c10
-rw-r--r--cmd/srv9p/gnet.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/cmd/srv9p/gnet.c b/cmd/srv9p/gnet.c
index 5072428..2bed355 100644
--- a/cmd/srv9p/gnet.c
+++ b/cmd/srv9p/gnet.c
@@ -69,7 +69,7 @@ static inline bool RUN_PTHREAD(void *(*fn)(void *), void *args) {
return false;
}
-/* vtables ********************************************************************/
+/* init() ( AKA socket(3) + listen(3) )****************************************/
static struct libnet_conn *gnet_accept(struct libnet_listener *_listener);
static ssize_t gnet_read(struct libnet_conn *conn, void *buf, size_t count);
@@ -86,8 +86,6 @@ static struct libnet_conn_vtable gnet_conn_vtable = {
.close = gnet_close,
};
-/* listen() *******************************************************************/
-
void gnet_listener_init(struct gnet_listener *self, uint16_t port) {
int listenerfd;
union {
@@ -175,7 +173,7 @@ static void *_pthread_read(void *_args) {
};
static ssize_t gnet_read(struct libnet_conn *_conn, void *buf, size_t count) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
ssize_t ret;
@@ -225,7 +223,7 @@ static void *_pthread_write(void *_args) {
};
static ssize_t gnet_write(struct libnet_conn *_conn, void *buf, size_t count) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
ssize_t ret;
@@ -247,7 +245,7 @@ static ssize_t gnet_write(struct libnet_conn *_conn, void *buf, size_t count) {
/* close() ********************************************************************/
static int gnet_close(struct libnet_conn *_conn, bool rd, bool wr) {
- struct gnet_conn *conn = (struct gnet_conn *)_conn;
+ struct _gnet_conn *conn = (struct _gnet_conn *)_conn;
assert(conn);
int how;
diff --git a/cmd/srv9p/gnet.h b/cmd/srv9p/gnet.h
index a724128..549dd7b 100644
--- a/cmd/srv9p/gnet.h
+++ b/cmd/srv9p/gnet.h
@@ -11,7 +11,7 @@
#include <libnet/libnet.h>
-struct gnet_conn {
+struct _gnet_conn {
struct libnet_conn_vtable *vtable;
int fd;
@@ -21,7 +21,7 @@ struct gnet_listener {
struct libnet_listener_vtable *vtable;
int fd;
- struct gnet_conn active_conn;
+ struct _gnet_conn active_conn;
};
void gnet_listener_init(struct gnet_listener *self, uint16_t port);