diff options
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 */ |