diff options
author | Marvin Borner | 2020-11-18 13:49:19 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-18 13:49:19 +0100 |
commit | 431c88102153b8b41a15a1105e291ecf161c030e (patch) | |
tree | 63063babd988284871db7c27dbb96025d00f2444 /kernel/inc | |
parent | cc85ffd8a1c4703051655c7f5727157e7e1ce96a (diff) |
Started libnet
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/net.h | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/kernel/inc/net.h b/kernel/inc/net.h index 1111f22..5630e97 100644 --- a/kernel/inc/net.h +++ b/kernel/inc/net.h @@ -4,6 +4,7 @@ #define NET_H #include <def.h> +#include <socket.h> #define htonl(l) \ ((((l)&0xff) << 24) | (((l)&0xff00) << 8) | (((l)&0xff0000) >> 8) | \ @@ -164,31 +165,6 @@ struct arp_table_entry { u64 mac_addr; }; -struct tcp_socket { - u32 seq_no; - u32 ack_no; - u32 state; -}; - -// TODO: Use actual socket types (stream etc) -enum socket_type { S_TCP, S_UDP }; -enum socket_state { S_CONNECTING, S_CONNECTED, S_OPEN, S_CLOSED, S_FAILED }; - -struct socket { - 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; - union { - struct tcp_socket tcp; - /* struct udp_socket udp; */ - } prot; -}; - void ethernet_handle_packet(struct ethernet_packet *packet, int len); struct socket *net_open(enum socket_type type); |