Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Comments.
  • Loading branch information
ManickaP committed Mar 18, 2021
commit 78e3981cf8f42d47f89dea2452d3ab54543a2f9d
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,17 @@ internal enum QuicSettingsEnabledFlagsFlags : byte
VersionNegotiationExtEnabled = 1 << 6,
}

// Mana: get back to this, define delegate for AsyncHandler, define types fro IntPtr Certificate (union in C, plat dependent) and
// make proper use of it.
[StructLayout(LayoutKind.Sequential)]
internal struct CredentialConfig
{
internal QUIC_CREDENTIAL_TYPE Type;
internal QUIC_CREDENTIAL_FLAGS Flags;
// CredentialConfigCertificateUnion*
internal IntPtr Certificate;
[MarshalAs(UnmanagedType.LPUTF8Str)]
internal string Principal;
internal IntPtr Reserved; // Currently unused
// Mana: define delegate for the async callback
// TODO: define delegate for AsyncHandler and make proper use of it.
internal IntPtr AsyncHandler;
}

Expand Down Expand Up @@ -361,10 +360,10 @@ internal struct ConnectionEventDataShutdownInitiatedByPeer
internal ulong ErrorCode;
}

// Mana: it's a trap, those are flags with fixed sized exactly 3 bits!!!
[StructLayout(LayoutKind.Sequential)]
internal struct ConnectionEventDataShutdownComplete
{
// The flags have fixed sized exactly 3 bits
internal ConnectionEventDataShutdownCompleteFlags Flags;
}

Expand Down Expand Up @@ -431,7 +430,7 @@ internal struct ConnectionEventDataUnion
[FieldOffset(0)]
internal ConnectionEventDataStreamsAvailable StreamsAvailable;

// Mana: missing IDEAL_PROCESSOR_CHANGED, ..., PEER_CERTIFICATE_RECEIVED (7 total)
// TODO: missing IDEAL_PROCESSOR_CHANGED, ..., PEER_CERTIFICATE_RECEIVED (7 total)
}

[StructLayout(LayoutKind.Sequential)]
Expand All @@ -447,7 +446,7 @@ internal delegate uint ConnectionCallbackDelegate(
IntPtr context,
ref ConnectionEvent connectionEvent);

// Mana: order is Open, Close, Shutdown, Start, SetConfiguration, SendResumptionTicket
// TODO: order is Open, Close, Shutdown, Start, SetConfiguration, SendResumptionTicket
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, that's my comment. The order (in the comment) is taken from msquic.h, we do not follow that in here. I didn't want to generate more diffs in this PR. I'll plan to do follow up that does not change the behavior at all, just shuffles things around to be more like msquic.h.

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate uint ConnectionOpenDelegate(
SafeMsQuicRegistrationHandle registration,
Expand Down Expand Up @@ -536,7 +535,7 @@ internal struct StreamEventDataUnion
[FieldOffset(0)]
internal StreamEventDataSendShutdownComplete SendShutdownComplete;

// Mana: missing IDEAL_SEND_BUFFER_SIZE
// TODO: missing IDEAL_SEND_BUFFER_SIZE
}

[StructLayout(LayoutKind.Sequential)]
Expand All @@ -546,7 +545,7 @@ internal struct StreamEvent
internal StreamEventDataUnion Data;
}

// Mana: rename to C#-like
// TODO: rename to C#-like
[StructLayout(LayoutKind.Sequential)]
internal struct SOCKADDR_IN
{
Expand All @@ -566,7 +565,7 @@ internal byte[] Address
}
}

// Mana: rename to C#-like
// TODO: rename to C#-like
[StructLayout(LayoutKind.Sequential)]
internal struct SOCKADDR_IN6
{
Expand Down Expand Up @@ -604,7 +603,7 @@ internal byte[] Address
}
}

// Mana: rename to C#-like
// TODO: rename to C#-like
[StructLayout(LayoutKind.Explicit)]
internal struct SOCKADDR_INET
{
Expand Down