Commit Graph

17 Commits

Author SHA1 Message Date
Pokechu22 6e5f4125e3 Use Common::ToLower and Common::ToUpper 2022-01-16 17:00:12 -08:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Sepalani 82bb5d9915 NetworkCaptureLogger: PCAP support added
Log TCP/UDP read/write with fake packet.
2021-01-30 19:35:09 +04:00
Lioncash 81edcca8db Common/Network: Use std::nullopt in StringToMacAddress
Prevents unnecessary zeroing out of std::optional's internal buffer in
some implementations.
2019-12-06 09:59:11 -05:00
Lioncash cbfacc41ba Common/Network: Remove unused header inclusions
Removes unused header dependencies.
2019-12-06 09:51:28 -05:00
Lioncash f06461d208 Common/Network: Make StringToMacAddress use a string_view
This function only ever reads the contents of the string in a non-owning
manner, so we can change the parameter over to being a string view.
2019-12-06 09:45:25 -05:00
Lioncash 5b92d5076a
Common: Use fmt where applicable
Begins the transition to using fmt for string formatting where
applicable. Given fmt supports formatting std::string instances out of
the box, we can remove now-unnecessary calls to .c_str() and .data().

Note that this change does not touch the actual logging subsystem aside
from converting the final StringFromFormat call in the process over to
fmt::format. Given our logging system is heavily used throughout the
entire codebase, and converting that over will be quite a large change
by itself, this will be tackled near the end of the conversion process.
2019-06-14 15:04:09 -04:00
Lioncash ce69201f33 Common/Network: Get rid of out parameters for MAC address utilities
Given we have std::array and std::optional, we can use these in
conjunction with one another to avoid the need for out parameters.
2018-06-10 15:43:26 -04:00
Léo Lam fff1db9730 Common: Add Random utilities
This makes it easier to generate random numbers or fill a buffer with
random data in a cryptographically secure way.

This also replaces existing usages of RNG functions in the codebase:

* <random> is pretty hard to use correctly, and std::random_device does
  not give enough guarantees about its results (it's
  implementation-defined, non cryptographically secure and could be
  deterministic on some platforms).
  Doing things correctly is error prone and verbose.

* rand() is terrible and should not be used especially in crypto code.
2018-05-31 17:54:43 +02:00
Lioncash f1542c8e5a Common: Namespace Network.h/.cpp
Necessary to avoid namespace clashes with IOS HLE's namespace name.
2017-01-17 20:46:48 -05:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Stenzek a870253cd6 Common: Use C++ random generator for generating MAC addresses 2016-01-31 23:52:47 +10:00
Ryan Houdek eb2d4935cd Including missing headers required for non-pch builds and other architectures 2015-12-22 18:20:48 -06:00
Rohit Nirmal 3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Matthew Parlane 57f2eda130 Fix MAC address reading on Windows. 2014-03-07 21:40:59 +13:00