Major re-work of the handleTcp() function, which had a fundamentally
wrong interpretation of how part of TCP works. Being an ACK and being a data packet are *not* mutually exclusive, though the old code assumed that they were. There are basically four things we might need to do: If outgoing (a) Handle an outgoing ACK (b) Handle an outgoing data packet If incoming (c) Handle an incoming ACK (d) Handle an incoming data packet Note that a and b can be done on the same packet, as well as c and d. Right now, however, our code only handles b and c. We will need to support a and d before we can model real applications, I think! Also, make handleTcp() more robust.
Showing with 82 additions and 27 deletions