Commit 6263a1e1 authored by Will Scott's avatar Will Scott Committed by Will

add js stub impl

parent 55bb74eb
// 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
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment