Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
tcp/tcb.h@74:c3756bfa960e, 2018-10-29 (annotated)
- Committer:
- andrewboyson
- Date:
- Mon Oct 29 09:33:44 2018 +0000
- Revision:
- 74:c3756bfa960e
- Parent:
- 71:736a5747ade1
- Child:
- 78:9d8fc88df405
Introduced the polling for and split Tcp into tcpSend and TcpRecv. Testied and working.
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 | 74:c3756bfa960e | 11 | #define TCB_CLOSE_ACK_WAIT 4 |
| andrewboyson | 10:f0854784e960 | 12 | |
| andrewboyson | 10:f0854784e960 | 13 | struct tcb |
| andrewboyson | 10:f0854784e960 | 14 | { |
| andrewboyson | 10:f0854784e960 | 15 | int state; |
| andrewboyson | 74:c3756bfa960e | 16 | uint32_t lastSendTime; |
| andrewboyson | 74:c3756bfa960e | 17 | int remArIndex; |
| andrewboyson | 74:c3756bfa960e | 18 | int ipType; |
| andrewboyson | 74:c3756bfa960e | 19 | uint16_t remPort; |
| andrewboyson | 74:c3756bfa960e | 20 | uint16_t locPort; |
| andrewboyson | 74:c3756bfa960e | 21 | uint32_t remMss; |
| andrewboyson | 74:c3756bfa960e | 22 | uint32_t window; |
| andrewboyson | 74:c3756bfa960e | 23 | |
| andrewboyson | 74:c3756bfa960e | 24 | uint32_t remIsn; |
| andrewboyson | 74:c3756bfa960e | 25 | uint32_t bytesRcvdFromRem; |
| andrewboyson | 74:c3756bfa960e | 26 | uint32_t bytesAckdToRem; |
| andrewboyson | 74:c3756bfa960e | 27 | bool rcvdFin; |
| andrewboyson | 74:c3756bfa960e | 28 | |
| andrewboyson | 54:84ef2b29cf7e | 29 | int32_t todo; |
| andrewboyson | 74:c3756bfa960e | 30 | |
| andrewboyson | 74:c3756bfa960e | 31 | uint32_t locIsn; |
| andrewboyson | 74:c3756bfa960e | 32 | uint32_t bytesSentToRem; |
| andrewboyson | 74:c3756bfa960e | 33 | uint32_t bytesAckdByRem; |
| andrewboyson | 74:c3756bfa960e | 34 | bool sentFin; |
| andrewboyson | 10:f0854784e960 | 35 | }; |
| andrewboyson | 10:f0854784e960 | 36 | |
| andrewboyson | 52:fbc5a46b5e16 | 37 | extern uint32_t TcbElapsed; |
| andrewboyson | 61:aad055f1b0d1 | 38 | extern uint32_t TcbGetIsn(void); |
| andrewboyson | 10:f0854784e960 | 39 | extern struct tcb* TcbGetExisting(uint16_t port); |
| andrewboyson | 61:aad055f1b0d1 | 40 | extern struct tcb* TcbGetEmpty(void); |
| andrewboyson | 74:c3756bfa960e | 41 | extern struct tcb* TcbGetNext(void); |
| andrewboyson | 61:aad055f1b0d1 | 42 | extern void TcbMain(void); |
| andrewboyson | 74:c3756bfa960e | 43 | extern void TcbInit(void); |
| andrewboyson | 74:c3756bfa960e | 44 | |
| andrewboyson | 74:c3756bfa960e | 45 | #endif |