hyprspace/netstack/tun_extra.go
Max b32d496d21
Service Network (#15)
* 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
2024-05-14 17:14:42 +02:00

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
}