Skip to content

Conversation

@sirzooro
Copy link

Added TCP support to vnet. Github Copilot/GPT-5.2 did a good job :)

Ref: #27

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 75.99487% with 187 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.01%. Comparing base (70835a8) to head (dd0273d).

Files with missing lines Patch % Lines
vnet/net.go 52.35% 54 Missing and 27 partials ⚠️
vnet/tcp_conn.go 79.86% 44 Missing and 14 partials ⚠️
vnet/tcp_listener.go 73.52% 11 Missing and 7 partials ⚠️
vnet/nat.go 87.06% 9 Missing and 6 partials ⚠️
vnet/tcp_map.go 88.46% 10 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #375      +/-   ##
==========================================
- Coverage   84.67%   83.01%   -1.67%     
==========================================
  Files          38       41       +3     
  Lines        3074     3756     +682     
==========================================
+ Hits         2603     3118     +515     
- Misses        339      446     +107     
- Partials      132      192      +60     
Flag Coverage Δ
go 83.01% <75.99%> (-1.67%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sirzooro sirzooro force-pushed the tcp_support branch 11 times, most recently from 25aba74 to fb434b0 Compare January 15, 2026 06:11
@sirzooro sirzooro requested a review from Copilot January 15, 2026 06:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TCP support to the vnet package, implementing virtual TCP connections, listeners, NAT translation, and comprehensive test coverage. The implementation includes TCP connection state machine, handshake logic, data transfer with ACK mechanism, and integration with the existing virtual network infrastructure.

Changes:

  • Added TCP connection (TCPConn) and listener (TCPListener) implementations with full handshake and state management
  • Extended NAT to support TCP translation for both NAPT and 1:1 NAT modes
  • Added comprehensive test coverage for TCP functionality including connection tests, NAT behavior tests, and integration tests

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
vnet/tcp_conn.go Core TCP connection implementation with state machine, handshake, read/write operations
vnet/tcp_listener.go TCP listener implementation for accepting incoming connections
vnet/tcp_map.go Port mapping structures for TCP listeners and connections
vnet/tcp_test.go Integration test for TCP dial/listen functionality
vnet/tcp_conn_test.go Unit tests for TCP connection behavior
vnet/tcp_nat_test.go Comprehensive NAT behavior tests for TCP
vnet/tcp_map_test.go Unit tests for TCP mapping structures
vnet/net.go Extended Net to support TCP operations, added constants and routing logic
vnet/nat.go Extended NAT translator to support TCP in addition to UDP
vnet/chunk.go Enhanced TCP chunk structure with sequence/ACK numbers
vnet/net_test.go Added TCP loopback and dial tests
vnet/chunk_test.go Updated test to use tcp constant
vnet/errors.go Added nolint directive for single-use function
vnet/udpproxy_direct_test.go Updated to use network constants instead of string literals

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sirzooro sirzooro force-pushed the tcp_support branch 5 times, most recently from 1078635 to 29d1733 Compare January 16, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants