using System.Net; namespace PCC.App.Tpm; public record TPM_EVT_LISTENER_STATUS_CHANGED(string LocalPeerId, TPM_EVT_INBOUND_LISTEN_STATUS Status, Exception? Exception = null); public enum TPM_EVT_INBOUND_LISTEN_STATUS { INVALID = 0, STARTING, START_FAIL, STARTED, STOPPING, STOP_FAIL, STOPPED, } public record TPM_EVT_INBOUND_CON_ACCEPTED(string LocalPeerId, string ConnectionId, EndPoint? RemoteEndpoint); public record TPM_EVT_INBOUND_CON_ERROR(string LocalPeerId, string ConnectionId, string? RemotePeerId, Exception? Exception = null); public record TPM_EVT_INBOUND_CON_STATUS_CHANGED(TPM_EVT_INBOUND_CON_STATUS Status, string LocalPeerId, string ConnectionId, string? RemotePeerId); public enum TPM_EVT_INBOUND_CON_STATUS { INVALID = 0, HANDSHAKE_FAIL_NOT_TRUSTED, HANDSHAKE_OK, SECURE_ALERT_REPLAY_ATTACK_DETECT, SECURE_WARN_TIMESTAMP_SKEW, DISCONNECTED } public record TPM_EVT_OUTBOUND_CON_ERROR(string LocalPeerId, string? RemotePeerId, Exception? Exception = null); public record TPM_EVT_OUTBOUND_CON_STATUS_CHANGED(TPM_EVT_OUTBOUND_CON_STATUS Status, string LocalPeerId, string? RemotePeerId); public enum TPM_EVT_OUTBOUND_CON_STATUS { INVALID = 0, CONNECTION_ATTEMPT, HANDSHAKE_ATTEMPT, HANDSHAKE_FAIL_ACK_NOT_MATCHED, HANDSHAKE_OK, SECURE_ALERT_REPLAY_ATTACK_DETECT, SECURE_WARN_TIMESTAMP_SKEW, DISCONNECTED } public record TPM_EVT_INBOUND_RX(string LocalPeerId, string RemotePeerId, DateTimeOffset senderTimestamp, ReadOnlyMemory payload); public record TPM_EVT_INBOUND_TX(string LocalPeerId, string RemotePeerId, DateTimeOffset senderTimestamp, ReadOnlyMemory payload); public record TPM_EVT_OUTBOUND_RX(string LocalPeerId, string RemotePeerId, DateTimeOffset senderTimestamp, ReadOnlyMemory payload); public record TPM_EVT_OUTBOUND_TX(string LocalPeerId, string RemotePeerId, DateTimeOffset senderTimestamp, ReadOnlyMemory payload);