A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
tcp/tcb.h@94:e2973a2c488e, 2018-12-05 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Dec 05 18:30:37 2018 +0000
- Revision:
- 94:e2973a2c488e
- Parent:
- 93:580fc113d9e9
- Child:
- 126:62edacc9f14d
Fixed bug - incorrect MSS being sent from a polled sync: expected 1440 but had -60. Traced to buffer datalength in EthPollForPacketToSend being set to zero instead of being calculated from the buffer length - headersize.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 74:c3756bfa960e | 1 | #ifndef TCB_H |
andrewboyson | 74:c3756bfa960e | 2 | #define TCB_H |
andrewboyson | 74:c3756bfa960e | 3 | |
andrewboyson | 61:aad055f1b0d1 | 4 | #include <stdint.h> |
andrewboyson | 61:aad055f1b0d1 | 5 | #include <stdbool.h> |
andrewboyson | 61:aad055f1b0d1 | 6 | |
andrewboyson | 74:c3756bfa960e | 7 | #define TCB_EMPTY 0 |
andrewboyson | 74:c3756bfa960e | 8 | #define TCB_SYN_RECEIVED 1 |
andrewboyson | 74:c3756bfa960e | 9 | #define TCB_ESTABLISHED 2 |
andrewboyson | 74:c3756bfa960e | 10 | #define TCB_CLOSE_FIN_WAIT 3 |
andrewboyson | 10:f0854784e960 | 11 | |
andrewboyson | 10:f0854784e960 | 12 | struct tcb |
andrewboyson | 10:f0854784e960 | 13 | { |
andrewboyson | 10:f0854784e960 | 14 | int state; |
andrewboyson | 79:f50e02fb5c94 | 15 | uint32_t timeSendsBeingAcked; //Used for RTO |
andrewboyson | 82:20781198d26d | 16 | int countSendsNotAcked; //Used for RTO |
andrewboyson | 79:f50e02fb5c94 | 17 | uint32_t timeLastRcvd; //Used for detect idle links |
andrewboyson | 74:c3756bfa960e | 18 | int ipType; |
andrewboyson | 80:4ef1500fca1d | 19 | int remArIndex; //Unique per remote ip when taken with the ipType |
andrewboyson | 80:4ef1500fca1d | 20 | int locIpScope; //Unique per local ip |
andrewboyson | 74:c3756bfa960e | 21 | uint16_t remPort; |
andrewboyson | 74:c3756bfa960e | 22 | uint16_t locPort; |
andrewboyson | 74:c3756bfa960e | 23 | uint32_t remMss; |
andrewboyson | 74:c3756bfa960e | 24 | uint32_t window; |
andrewboyson | 74:c3756bfa960e | 25 | |
andrewboyson | 74:c3756bfa960e | 26 | uint32_t remIsn; |
andrewboyson | 74:c3756bfa960e | 27 | uint32_t bytesRcvdFromRem; |
andrewboyson | 74:c3756bfa960e | 28 | uint32_t bytesAckdToRem; |
andrewboyson | 74:c3756bfa960e | 29 | bool rcvdFin; |
andrewboyson | 74:c3756bfa960e | 30 | |
andrewboyson | 54:84ef2b29cf7e | 31 | int32_t todo; |
andrewboyson | 74:c3756bfa960e | 32 | |
andrewboyson | 74:c3756bfa960e | 33 | uint32_t locIsn; |
andrewboyson | 74:c3756bfa960e | 34 | uint32_t bytesSentToRem; |
andrewboyson | 74:c3756bfa960e | 35 | uint32_t bytesAckdByRem; |
andrewboyson | 74:c3756bfa960e | 36 | bool sentFin; |
andrewboyson | 10:f0854784e960 | 37 | }; |
andrewboyson | 10:f0854784e960 | 38 | |
andrewboyson | 61:aad055f1b0d1 | 39 | extern uint32_t TcbGetIsn(void); |
andrewboyson | 80:4ef1500fca1d | 40 | extern struct tcb* TcbGetExisting(int ipType, int remArIndex, int locIpScope, uint16_t remPort, uint16_t locPort); |
andrewboyson | 61:aad055f1b0d1 | 41 | extern struct tcb* TcbGetEmpty(void); |
andrewboyson | 83:08c983006a6e | 42 | extern struct tcb* TcbGetNext(struct tcb* pTcb); |
andrewboyson | 74:c3756bfa960e | 43 | extern void TcbInit(void); |
andrewboyson | 74:c3756bfa960e | 44 | |
andrewboyson | 74:c3756bfa960e | 45 | #endif |