Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-netroute
Commits
6263a1e1
Commit
6263a1e1
authored
Sep 10, 2020
by
Will Scott
Committed by
Will
Sep 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add js stub impl
parent
55bb74eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
netroute_stub.go
netroute_stub.go
+22
-0
No files found.
netroute_stub.go
0 → 100644
View file @
6263a1e1
// A stub routing table conformant interface for js/wasm environments.
// +build js,wasm
package
netroute
import
(
"net"
"github.com/google/gopacket/routing"
)
func
New
()
(
routing
.
Router
,
error
)
{
rtr
:=
&
router
{}
rtr
.
ifaces
=
make
(
map
[
int
]
net
.
Interface
)
rtr
.
ifaces
[
0
]
=
net
.
Interface
{}
rtr
.
addrs
=
make
(
map
[
int
]
ipAddrs
)
rtr
.
addrs
[
0
]
=
ipAddrs
{}
rtr
.
v4
=
routeSlice
{
&
rtInfo
{}}
rtr
.
v6
=
routeSlice
{
&
rtInfo
{}}
return
rtr
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment