[client] Extract Handshaker and Signaler into a signaling package

Move the signaling protocol out of the peer package into
client/internal/peer/signaling: OfferAnswer, IceCredentials, Handshaker
and Signaler. Break the peer<->signaling cycle by giving the Handshaker
a plain Config and an ICEWorker interface instead of *Conn/*WorkerICE,
and by passing the relay manager directly rather than the relay worker.
Combine the ICE worker's local-credentials and session-id accessors into
a single Credentials() returning a Credentials struct.

Move the ICE session id to the ice package as ice.SessionID, since it
identifies an ICE agent session and is minted there alongside
GenerateICECredentials; signaling only carries it.
This commit is contained in:
Zoltan Papp
2026-08-05 16:14:11 +02:00
committed by Zoltán Papp
parent 33cad89cea
commit 35c90be8ba
10 changed files with 129 additions and 83 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import (
"github.com/pion/ice/v4"
"github.com/netbirdio/netbird/client/internal/peer/signaling"
"github.com/netbirdio/netbird/route"
)
@@ -21,11 +22,11 @@ type evClose struct {
}
type evRemoteOffer struct {
offer OfferAnswer
offer signaling.OfferAnswer
}
type evRemoteAnswer struct {
answer OfferAnswer
answer signaling.OfferAnswer
}
type evRemoteCandidate struct {