-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(netsim): move most code inside netsim/netstack
The top-level package should contain more specific code handling scenarios rather than the netstack stub network. Let's make this possibly by moving the netstack into its own package.
- Loading branch information
1 parent
6b72c0f
commit 68e2fa2
Showing
13 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// | ||
// Aliases | ||
// | ||
|
||
package netsim | ||
|
||
import ( | ||
"github.com/rbmk-project/x/netsim/link" | ||
"github.com/rbmk-project/x/netsim/netstack" | ||
) | ||
|
||
// Stack is an alias for [netstack.Stack]. | ||
type Stack = netstack.Stack | ||
|
||
// Link is an alias for [link.Link]. | ||
type Link = link.Link | ||
|
||
// NewStack is an alias for [netstack.New]. | ||
var NewStack = netstack.New | ||
|
||
// NewLink is an alias for [link.New]. | ||
var NewLink = link.New |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// net.Addr implementation. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"net" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// Deadline management. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"sync" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// Dialer implementation | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"context" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// UNIX errno definitions. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import "golang.org/x/sys/unix" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
// Windows errno definitions. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import "golang.org/x/sys/windows" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// TCP/UDP port implementation. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// TCP Conn/PacketConn. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"bytes" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// TCP Listener/PacketListener. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import ( | ||
"net" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// UDP Conn/PacketConn. | ||
// | ||
|
||
package netsim | ||
package netstack | ||
|
||
import "net" | ||
|
||
|