aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2020-11-08 16:40:05 +0100
committerMarvin Borner2020-11-08 16:40:05 +0100
commita7eb632ea8e24ce4331c7da87fd8551a77ee4799 (patch)
tree348075ea8e24b2e5f1b786c684c00439d5d6a63c /kernel/inc
parentfba21262712be205df988131e9457a083d934b70 (diff)
Started socket implementation
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/net.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/inc/net.h b/kernel/inc/net.h
index 26ee1ef..d216fa2 100644
--- a/kernel/inc/net.h
+++ b/kernel/inc/net.h
@@ -137,6 +137,28 @@ struct arp_table_entry {
u64 mac_addr;
};
+struct tcp_socket {
+ u32 seq_no;
+ u32 ack_no;
+ u32 state;
+};
+
+struct socket {
+ u32 ip_addr;
+ u8 mac_addr[6];
+ u32 dst_port;
+ u32 src_port;
+ u32 status;
+ u32 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);
void net_install(void);