Nut/OS  4.10.3
API Reference
tcp.h File Reference

TCP protocol definitions. More...

#include <sys/types.h>
#include <stdint.h>
Include dependency graph for tcp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcphdr
 TCP protocol header structure. More...
struct  _TCPPSEUDOHDR
 TCP pseudo header structure. More...

Defines

#define TH_FIN   0x01
 Finishing transmission.
#define TH_SYN   0x02
 Synchronizing sequence numbers.
#define TH_RST   0x04
 Reset connection.
#define TH_PUSH   0x08
 Push data to application level.
#define TH_ACK   0x10
 Acknowledge field is valid.
#define TH_URG   0x20
 Urgent data present.
#define TH_FLAGS   (TH_FIN | TH_SYN | TH_RST | TH_ACK | TH_URG)
 TCP flag mask.
#define TCPOPT_EOL   0
 End of options.
#define TCPOPT_NOP   1
 Nothing.
#define TCPOPT_MAXSEG   2
 Maximum segment size.
#define TCPOLEN_MAXSEG   4
 Maximum segment size length.
#define TCPOPT_WINDOW   3
 Receive window.
#define TCPOLEN_WINDOW   3
 Receive window length.
#define TCP_MSS   536
 Default maximum segment size. The maximum size of an IP datagram, that will not become fragmented, is 576. The maximum IP datagram for Ethernet is 1500. Reduce this number by 40, 20 bytes TCP header and 20 bytes IP header.
#define TCP_WINSIZE   3216
 Default window size. It's recommended to set this 6 times the maximum segment size.
#define TCP_MAXWIN   65535
 Largest value for (unscaled) window.
#define TTCP_CLIENT_SND_WND   4096
 Default send window for T/TCP client.
#define TCP_MAX_WINSHIFT   14
 Maximum window shift.
#define TCP_MAXHLEN   (0xf<<2)
 Maximum length of header in bytes.
#define TCP_MAXOLEN   (TCP_MAXHLEN - sizeof(struct tcphdr))
 Maximum space left for options.
#define TCP_NODELAY   0x01
 Don't delay send to coalesce segments.
#define TCP_MAXSEG   0x02
 Set maximum segment size.
#define TCP_NOPUSH   0x04
 Don't push last block of write.
#define TCP_NOOPT   0x08
 Don't use TCP options.

Typedefs

typedef struct tcphdr TCPHDR
 TCP protocol header type.
typedef struct _TCPPSEUDOHDR TCPPSEUDOHDR
 TCP pseudo header type.

Detailed Description

TCP protocol definitions.

Definition in file tcp.h.


Define Documentation

#define TH_FIN   0x01

Finishing transmission.

Definition at line 126 of file tcp.h.

Referenced by NutDumpTcpHeader(), and NutTcpOutput().

#define TH_SYN   0x02

Synchronizing sequence numbers.

Definition at line 127 of file tcp.h.

Referenced by NutDumpTcpHeader(), NutTcpOutput(), and NutTcpReject().

#define TH_RST   0x04

Reset connection.

Definition at line 128 of file tcp.h.

Referenced by NutDumpTcpHeader(), and NutTcpReject().

#define TH_PUSH   0x08

Push data to application level.

Definition at line 129 of file tcp.h.

Referenced by NutDumpTcpHeader(), and NutTcpOutput().

#define TH_ACK   0x10

Acknowledge field is valid.

Definition at line 130 of file tcp.h.

Referenced by NutDumpTcpHeader(), NutTcpOutput(), and NutTcpReject().

#define TH_URG   0x20

Urgent data present.

Definition at line 131 of file tcp.h.

Referenced by NutDumpTcpHeader().

#define TH_FLAGS   (TH_FIN | TH_SYN | TH_RST | TH_ACK | TH_URG)

TCP flag mask.

Definition at line 134 of file tcp.h.

#define TCPOPT_EOL   0

End of options.

Definition at line 167 of file tcp.h.

#define TCPOPT_NOP   1

Nothing.

Definition at line 168 of file tcp.h.

#define TCPOPT_MAXSEG   2

Maximum segment size.

Definition at line 169 of file tcp.h.

Referenced by NutTcpOutput().

#define TCPOLEN_MAXSEG   4

Maximum segment size length.

Definition at line 170 of file tcp.h.

Referenced by NutTcpOutput().

#define TCPOPT_WINDOW   3

Receive window.

Definition at line 171 of file tcp.h.

#define TCPOLEN_WINDOW   3

Receive window length.

Definition at line 172 of file tcp.h.

#define TCP_MSS   536

Default maximum segment size. The maximum size of an IP datagram, that will not become fragmented, is 576. The maximum IP datagram for Ethernet is 1500. Reduce this number by 40, 20 bytes TCP header and 20 bytes IP header.

Definition at line 192 of file tcp.h.

Referenced by NutTcpCreateSocket().

#define TCP_WINSIZE   3216

Default window size. It's recommended to set this 6 times the maximum segment size.

Definition at line 200 of file tcp.h.

Referenced by NutTcpCreateSocket().

#define TCP_MAXWIN   65535

Largest value for (unscaled) window.

Definition at line 206 of file tcp.h.

#define TTCP_CLIENT_SND_WND   4096

Default send window for T/TCP client.

Definition at line 207 of file tcp.h.

#define TCP_MAX_WINSHIFT   14

Maximum window shift.

Definition at line 209 of file tcp.h.

#define TCP_MAXHLEN   (0xf<<2)

Maximum length of header in bytes.

Definition at line 211 of file tcp.h.

#define TCP_MAXOLEN   (TCP_MAXHLEN - sizeof(struct tcphdr))

Maximum space left for options.

Definition at line 212 of file tcp.h.

#define TCP_NODELAY   0x01

Don't delay send to coalesce segments.

Definition at line 217 of file tcp.h.

#define TCP_MAXSEG   0x02

Set maximum segment size.

Examples:
ftpd/ftpserv.c.

Definition at line 218 of file tcp.h.

Referenced by NutFtpDataConnect(), NutTcpGetSockOpt(), and NutTcpSetSockOpt().

#define TCP_NOPUSH   0x04

Don't push last block of write.

Definition at line 219 of file tcp.h.

#define TCP_NOOPT   0x08

Don't use TCP options.

Definition at line 220 of file tcp.h.


Typedef Documentation

TCP protocol header type.

TCP pseudo header type.