This commit is contained in:
jdl
2025-08-26 15:33:27 +02:00
parent d558ebbd14
commit ab246b2a90
28 changed files with 1093 additions and 447 deletions

View File

@@ -9,7 +9,7 @@ import (
)
func createLocalDiscoveryPacket(localIP byte, signingKey []byte) []byte {
h := header{
h := Header{
SourceIP: localIP,
DestIP: 255,
}
@@ -19,7 +19,7 @@ func createLocalDiscoveryPacket(localIP byte, signingKey []byte) []byte {
return sign.Sign(out[:0], buf, (*[64]byte)(signingKey))
}
func headerFromLocalDiscoveryPacket(pkt []byte) (h header, ok bool) {
func headerFromLocalDiscoveryPacket(pkt []byte) (h Header, ok bool) {
if len(pkt) != headerSize+signOverhead {
return
}
@@ -36,7 +36,7 @@ func verifyLocalDiscoveryPacket(pkt, buf []byte, pubSignKey []byte) bool {
// ----------------------------------------------------------------------------
func runMCWriter(localIP byte, signingKey []byte) {
func RunMCWriter(localIP byte, signingKey []byte) {
discoveryPacket := createLocalDiscoveryPacket(localIP, signingKey)
conn, err := net.ListenMulticastUDP("udp", nil, multicastAddr)