diff options
author | Anton Kling <anton@kling.gg> | 2024-06-09 22:05:53 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-09 22:05:53 +0200 |
commit | 15003d1b0abccc8bcef84386c4a6da176e41f883 (patch) | |
tree | d4f8c4f1602ee9e6c4332f3b0585d0e284d0f695 /kernel/socket.h | |
parent | ddd796325c9c703f007f046ed9f6fd9eb0ba6383 (diff) |
Add UDP
Diffstat (limited to 'kernel/socket.h')
-rw-r--r-- | kernel/socket.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/socket.h b/kernel/socket.h index 3d1025d..ef5863d 100644 --- a/kernel/socket.h +++ b/kernel/socket.h @@ -1,3 +1,5 @@ +struct sockaddr; +typedef int socklen_t; #ifndef SOCKET_H #define SOCKET_H #include <fs/fifo.h> @@ -27,6 +29,17 @@ struct TcpListen { struct stack incoming_connections; }; +struct UdpConnection { + u16 incoming_port; + u32 incoming_ip; + u32 outgoing_ip; + u16 outgoing_port; + + int dead; + + struct ringbuffer incoming_buffer; +}; + struct TcpConnection { int dead; u16 incoming_port; @@ -52,6 +65,8 @@ struct TcpConnection *internal_tcp_incoming(u32 src_ip, u16 src_port, struct TcpConnection *tcp_find_connection(ipv4_t src_ip, u16 src_port, u16 dst_port); +struct UdpConnection *udp_find_connection(ipv4_t src_ip, u16 src_port, + u16 dst_port); typedef struct { vfs_fd_t *ptr_socket_fd; @@ -83,7 +98,6 @@ typedef struct { typedef u32 in_addr_t; typedef u16 in_port_t; typedef unsigned int sa_family_t; -typedef int socklen_t; struct sockaddr { sa_family_t sa_family; /* Address family */ |