Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git] / modules / wip / lanman / tcp.h
blobf2a0d47e7784b81a59ca154f69296b5471110832
1 /*
2 Copyright (c) 2010 jimmikaelkael <jimmikaelkael@wanadoo.fr>
3 Licenced under Academic Free License version 3.0
4 */
6 #ifndef TCP_H
7 #define TCP_H
9 #include <tamtypes.h>
11 #include "lanman.h"
12 #include "eth.h"
13 #include "ip.h"
15 #define TTL 255
16 #define TCPWND_SIZE 8192
17 #define IP_PROTO_TCP 0x06
18 #define TCP_MSS 1460
20 typedef struct {
21 // Ethernet (14)
22 eth_hdr_t eth;
24 // IP header (20)
25 ip_hdr_t ip;
27 // TCP header (20)
28 u16 tcp_port_src;
29 u16 tcp_port_dst;
30 u8 tcp_seq_num[4];
31 u8 tcp_ack_num[4];
32 u8 tcp_hdrlen;
33 u8 tcp_flags;
34 u16 tcp_wndsize;
35 u16 tcp_csum;
36 u16 tcp_urgp;
38 // Data goes here
39 } tcpip_pkt_t __attribute__((packed));
41 void tcp_init(g_param_t *gparam);
42 int tcp_input(void *buf, int size);
43 void tcp_connect(void);
44 void tcp_send_ack(void);
46 #endif /* TCP_H */