mirror of
https://github.com/hyprspace/hyprspace.git
synced 2026-09-12 19:51:07 +05:00
* implement foundation for service network * update vendorHash * extract MkNetID * look up peers by NetID * implement proxy for remote services * support remote services (client side) * create Proxy abstraction * implement TCPServiceProxy * add a wrapper to make streams implement net.Conn * support remote services (server side) * implement services in config * create proxies from multiaddrs * register services defined in config * add description field to proxy * resolve service hostnames
17 lines
393 B
Go
17 lines
393 B
Go
package netstack
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"gvisor.dev/gvisor/pkg/tcpip"
|
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
|
)
|
|
|
|
func (tun *Net) AddProtocolAddress(protoAddr tcpip.ProtocolAddress) error {
|
|
tcpipErr := tun.stack.AddProtocolAddress(1, protoAddr, stack.AddressProperties{})
|
|
if tcpipErr != nil {
|
|
return fmt.Errorf("AddProtocolAddress(%v): %v", protoAddr.AddressWithPrefix, tcpipErr)
|
|
}
|
|
return nil
|
|
}
|