summaryrefslogtreecommitdiffstats
path: root/src/core/network/network.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* core: Remove unused includesameerj2021-11-041-1/+0
|
* network: retrieve subnet mask and gateway infoSönke Holz2021-08-161-0/+19
|
* configuration: add option to select network interfacespholz2021-08-121-2/+3
| | | | This commit renames the "Services" tab to "Network" and adds a combobox that allows the user to select the network interface that yuzu should use. This new setting is now used to get the local IP address in Network::GetHostIPv4Address. This prevents yuzu from selecting the wrong network interface and thus using the wrong IP address. The return type of Network::GetHostIPv4Adress has also been changed.
* [network] Error handling reformcomex2021-02-281-0/+6
| | | | | | | | | | | | | | | | | | | | | `network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
* network, sockets: Replace `POLL_IN`, `POLL_OUT`, etc. constants with an `enum class PollEvents`comex2020-12-071-9/+15
| | | | | | | | | | | | | | | | | | | | Actually, two enum classes, since for some reason there are two separate yet identical `PollFD` types used in the codebase. I get that one is ABI-compatible with the Switch while the other is an abstract type used for the host, but why not use `WSAPOLLFD` directly for the latter? Anyway, why make this change? Because on Apple platforms, `POLL_IN`, `POLL_OUT`, etc. (with an underscore) are defined as macros in <sys/signal.h>. (This is inherited from FreeBSD.) So defining a variable with the same name causes a compile error. I could just rename the variables, but while I was at it I thought I might as well switch to an enum for stronger typing. Also, change the type used for values copied directly to/from the `events` and `revents` fields of the host *native* `pollfd`/`WSASPOLLFD`, from `u32` to `short`, as `short` is the correct canonical type on both Unix and Windows.
* Revert "core: Fix clang build"bunnei2020-10-211-6/+6
|
* core: Fix clang buildLioncash2020-10-181-6/+6
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* core/network: Add network abstractionReinUsesLisp2020-07-191-0/+87
This commit adds a network abstraction designed to implement bsd:s but at the same time work as a generic abstraction to implement any networking code we have to use from core. This is implemented on top of BSD sockets on Unix systems and winsock on Windows. The code is designed around winsocks having compatibility definitions to support both BSD and Windows sockets.