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

Update davici to support Windows #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

KevinLussier
Copy link

These changes add in Windows support to davici. The main change involves using a TCP socket instead of a UNIX socket. Platform dependent types and macros were added:

  • sockerr because Windows does not use errno on socket errors but instead uses WSAGetLastError().
  • is_recoverable because Windows WSAE* instead of errno for socket errors.
  • closesocket because Windows does not support close() for sockets.
  • davici_fd because SOCKETs on Windows are different sizes depending on Win32 vs Win64.

Additionally:

  • some explicit casts were added to remove compiler warnings on Windows.
  • some variable types were changed for the same reason (e.g. signed/unsigned warnings)

KevinLussier and others added 4 commits November 20, 2017 14:15
…ici_connect_tcp call and use localhost when testing. Create new davici_fd to wrap fd/socket types. Replace read/write with corresponding recv/send functions. Add explicit casts where necessary to remove compiler warnings.
@martinwilli
Copy link
Collaborator

Generally, I'd prefer to see some platform abstraction header, where we can put away all the differences between Windows and Unix systems.

@martinwilli
Copy link
Collaborator

Also, it would be nice to have some integration testing for the Windows build, as otherwise we likely break it with future changes. For strongSwan we use MinGW on Travis Linux hosts, that would certainly be an option. AppVeyor would be a good alternative, which Tobias added to strongSwan, too.

@martinwilli
Copy link
Collaborator

I'm not so happy with all those added casts, as they make the code rather unreadable. They mostly just silence some warnings; but maybe we can disable just those compiler warnings?

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

Successfully merging this pull request may close these issues.

None yet

2 participants