/*
 * tcp.h
 *
 * Copyright 2004, Minoru Murashima. All rights reserved.
 * Distributed under the terms of the BSD License.
 */


#ifndef tcp_h
#define tcp_h


#include<types.h>
#include<net/net.h>
#include<net/ip.h>
#include<mm.h>


#ifndef ASM_FILE


enum{
	TCP_MSS_SIZE = 1460,		/* セグメント最大サイズ。 */
};

typedef struct{
	uint16_t srcport;
	uint16_t dstport;
	uint32_t seqnum;
	uint32_t acknum;
	uint8_t  headlen;
	uint8_t  flag;
	uint16_t wndsize;
	uint16_t chksum;
	uint16_t urgpoint;
	uchar    option[0];
}TCP_HEADER;


extern int releaseSockFromConect(SOCKET*);
extern int receiveTcp(IP_HEADER*);
extern void doTcpService(SOCKET*, IP_HEADER*);
extern int initTcp();


#endif


#endif
