gvisor/pkg/tcpip/transport/raw
Sam Balana 82a5cada59 Add AfterFunc to tcpip.Clock
Changes the API of tcpip.Clock to also provide a method for scheduling and
rescheduling work after a specified duration. This change also implements the
AfterFunc method for existing implementations of tcpip.Clock.

This is the groundwork required to mock time within tests. All references to
CancellableTimer has been replaced with the tcpip.Job interface, allowing for
custom implementations of scheduling work.

This is a BREAKING CHANGE for clients that implement their own tcpip.Clock or
use tcpip.CancellableTimer. Migration plan:
 1. Add AfterFunc(d, f) to tcpip.Clock
 2. Replace references of tcpip.CancellableTimer with tcpip.Job
 3. Replace calls to tcpip.CancellableTimer#StopLocked with tcpip.Job#Cancel
 4. Replace calls to tcpip.CancellableTimer#Reset with tcpip.Job#Schedule
 5. Replace calls to tcpip.NewCancellableTimer with tcpip.NewJob.

PiperOrigin-RevId: 322906897
2020-07-23 18:00:43 -07:00
..
BUILD Move tcpip.PacketBuffer and IPTables to stack package. 2020-03-24 09:06:26 -07:00
endpoint.go Add AfterFunc to tcpip.Clock 2020-07-23 18:00:43 -07:00
endpoint_state.go AF_PACKET support for netstack (aka epsocket). 2019-10-21 13:23:18 -07:00
protocol.go AF_PACKET support for netstack (aka epsocket). 2019-10-21 13:23:18 -07:00