feat: Working impl with offer / ack

This commit is contained in:
Adrian Rumpold
2022-02-06 12:14:50 +01:00
parent ed6198f71a
commit 9f83d6f3f5
7 changed files with 1307 additions and 53 deletions

18
util.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"encoding/binary"
"net"
)
func int2ip(nn uint32) net.IP {
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, nn)
return ip
}
func u32tob(u uint32) []byte {
buf := make([]byte, 4)
binary.BigEndian.PutUint32(buf, u)
return buf
}