Hi Pat,
Happy to help. First: what's the idea behind using gVisor? I may be misunderstanding, but if you want to test your TCP stack on a PC, you could use the following setup:
[ your TCP stack ] <---> [ AF_PACKET socket on veth device ] <---> [ test program with callback that opens a TCP socket on the other end of the veth ]
AF_PACKET lets you write a packet with ethernet headers. But if you need gVisor:
You're probably not looking for `pipefs.NewConnectedPipeFDs`. That's something that's called inside gVisor when a program makes a `pipe()` syscall, not something that you're likely to call directly.
The example is a good starting point for using gVisor's netstack, which can be used separately from the rest of gVisor. I'm guessing you just want the netstack.
But I'm not sure I totally understand your setup. Is this right? Lemme know if I'm off here:
[ your TCP stack ] <---> [ NIC interface ] <---> [ gVisor netstack ] <---> [ callback ]
This is probably doable but a bit awkward -- gVisor exposes "endpoints", but your stack wants to speak directly to a NIC. I'd suggest structuring the test more like this:
[ your TCP stack ] <---> [ AF_PACKET socket on veth device ] <---> [ gVisor netstack on the other end of the veth ] <---> [ callback ]
With gVisor netstack, you can create an endpoint to read from and write to for the callback. But also:
Hope that's helpful, but let us know if you have more questions and/or I got the test setup completely wrong :)
Kevin