mostly finish migration of IP stuff to core, tuntap is still responsible for ICMP PacketTooBig

This commit is contained in:
Arceliar 2021-06-13 04:54:06 -05:00
parent 1147ee1934
commit 816356ea65
7 changed files with 114 additions and 185 deletions

View file

@ -222,3 +222,28 @@ func (c *Core) RemovePeer(addr string, sintf string) error {
func (c *Core) CallPeer(u *url.URL, sintf string) error {
return c.links.call(u, sintf)
}
func (c *Core) PublicKey() ed25519.PublicKey {
return c.public
}
func (c *Core) MaxMTU() uint64 {
return c.store.maxSessionMTU()
}
// Implement io.ReadWriteCloser
func (c *Core) Read(p []byte) (n int, err error) {
n, err = c.store.readPC(p)
return
}
func (c *Core) Write(p []byte) (n int, err error) {
n, err = c.store.writePC(p)
return
}
func (c *Core) Close() error {
c.Stop()
return nil
}