mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -24,7 +24,7 @@ enum class IPv4PacketFlags : u16 {
|
|||
MoreFragments = 0x2000,
|
||||
};
|
||||
|
||||
NetworkOrdered<u16> internet_checksum(const void*, size_t);
|
||||
NetworkOrdered<u16> internet_checksum(void const*, size_t);
|
||||
|
||||
class [[gnu::packed]] IPv4Packet {
|
||||
public:
|
||||
|
@ -52,14 +52,14 @@ public:
|
|||
u16 checksum() const { return m_checksum; }
|
||||
void set_checksum(u16 checksum) { m_checksum = checksum; }
|
||||
|
||||
const IPv4Address& source() const { return m_source; }
|
||||
void set_source(const IPv4Address& address) { m_source = address; }
|
||||
IPv4Address const& source() const { return m_source; }
|
||||
void set_source(IPv4Address const& address) { m_source = address; }
|
||||
|
||||
const IPv4Address& destination() const { return m_destination; }
|
||||
void set_destination(const IPv4Address& address) { m_destination = address; }
|
||||
IPv4Address const& destination() const { return m_destination; }
|
||||
void set_destination(IPv4Address const& address) { m_destination = address; }
|
||||
|
||||
void* payload() { return this + 1; }
|
||||
const void* payload() const { return this + 1; }
|
||||
void const* payload() const { return this + 1; }
|
||||
|
||||
u16 flags_and_fragment() const { return m_flags_and_fragment; }
|
||||
u16 fragment_offset() const { return ((u16)m_flags_and_fragment & 0x1fff); }
|
||||
|
@ -106,10 +106,10 @@ private:
|
|||
|
||||
static_assert(AssertSize<IPv4Packet, 20>());
|
||||
|
||||
inline NetworkOrdered<u16> internet_checksum(const void* ptr, size_t count)
|
||||
inline NetworkOrdered<u16> internet_checksum(void const* ptr, size_t count)
|
||||
{
|
||||
u32 checksum = 0;
|
||||
auto* w = (const u16*)ptr;
|
||||
auto* w = (u16 const*)ptr;
|
||||
while (count > 1) {
|
||||
checksum += AK::convert_between_host_and_network_endian(*w++);
|
||||
if (checksum & 0x80000000)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue