Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: sa_family_t and socklen_t types #1041

Closed
Thomasdezeeuw opened this issue Aug 13, 2022 · 3 comments
Closed

Feature request: sa_family_t and socklen_t types #1041

Thomasdezeeuw opened this issue Aug 13, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Thomasdezeeuw
Copy link

Motivation

We need them in Socket2:
https://github.com/rust-lang/socket2/blob/66690648402e7d6cff33192f353bfe372b7245c9/src/sys/windows.rs#L60-L63. We currently work around it with defining it ourselves.

Drawbacks

No response

Rationale and alternatives

No response

Additional context

No response

@Thomasdezeeuw Thomasdezeeuw added the enhancement New feature or request label Aug 13, 2022
@rylev
Copy link

rylev commented Aug 15, 2022

@riverar I believe this is an issue with the metadata, and we should transfer the issue there.

@riverar riverar transferred this issue from microsoft/windows-rs Aug 15, 2022
@mikebattista mikebattista self-assigned this Nov 4, 2022
@mikebattista
Copy link
Contributor

[NativeTypedef]
public struct socklen_t
{
	public int Value;
}

[NativeTypedef]
public struct sa_family_t
{
	public ushort Value;
}

Windows.Win32.Networking.WinSock.Apis.getnameinfo : SockaddrLength...Int32 => socklen_t
Windows.Win32.Networking.WinSock.Apis.GetNameInfoW : SockaddrLength...Int32 => socklen_t
Windows.Win32.Networking.WinSock.sa_family_t added
Windows.Win32.Networking.WinSock.socklen_t added

Is this what you had in mind?

@Thomasdezeeuw
Copy link
Author

@mikebattista I'm not familiar with the syntax, nor the Windows API, but in case the question was aimed at me, yes socklen_t as signed 32 bit integer and sa_famility_t as 16 bit unsigned integer is what I would expect (and what Socket2 currently uses).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants