From a5a04ef3de6ad3f81d37a04fede23eb3b4b348b1 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 18 Nov 2020 17:53:31 +0100 Subject: Added browser and many networking things --- libc/inc/socket.h | 11 ++++++++--- libc/inc/sys.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'libc/inc') diff --git a/libc/inc/socket.h b/libc/inc/socket.h index 651bba0..e5e23ad 100644 --- a/libc/inc/socket.h +++ b/libc/inc/socket.h @@ -4,6 +4,7 @@ #define SOCKET_H #include +#include // TODO: Use actual socket types (stream etc) enum socket_type { S_TCP, S_UDP }; @@ -15,15 +16,19 @@ struct tcp_socket { u32 state; }; +struct socket_data { + u8 *data; + u32 length; +}; + struct socket { + u32 pid; u32 ip_addr; u32 dst_port; u32 src_port; enum socket_state state; enum socket_type type; - u32 bytes_available; - u32 bytes_read; - void *current_packet; + struct list *packets; union { struct tcp_socket tcp; /* struct udp_socket udp; */ diff --git a/libc/inc/sys.h b/libc/inc/sys.h index 4e52ac1..42b1c8a 100644 --- a/libc/inc/sys.h +++ b/libc/inc/sys.h @@ -26,6 +26,7 @@ enum sys { SYS_NET_CLOSE, // Close network socket SYS_NET_CONNECT, // Connect to destination SYS_NET_SEND, // Send to socket + SYS_NET_RECEIVE, // Receive data from socket }; enum event_type { EVENT_KEYBOARD, EVENT_MOUSE, EVENT_MAX }; -- cgit v1.2.3