1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

AK: Rename the common integer typedefs to make it obvious what they are.

These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
This commit is contained in:
Andreas Kling 2019-07-03 21:17:35 +02:00
parent c4c4bbc5ba
commit 27f699ef0c
208 changed files with 1603 additions and 1621 deletions

View file

@ -6,14 +6,14 @@
#include <Kernel/Net/MACAddress.h>
struct ARPOperation {
enum : word {
enum : u16 {
Request = 1,
Response = 2,
};
};
struct ARPHardwareType {
enum : word {
enum : u16 {
Ethernet = 1,
};
};
@ -21,20 +21,20 @@ struct ARPHardwareType {
class [[gnu::packed]] ARPPacket
{
public:
word hardware_type() const { return m_hardware_type; }
void set_hardware_type(word w) { m_hardware_type = w; }
u16 hardware_type() const { return m_hardware_type; }
void set_hardware_type(u16 w) { m_hardware_type = w; }
word protocol_type() const { return m_protocol_type; }
void set_protocol_type(word w) { m_protocol_type = w; }
u16 protocol_type() const { return m_protocol_type; }
void set_protocol_type(u16 w) { m_protocol_type = w; }
byte hardware_address_length() const { return m_hardware_address_length; }
void set_hardware_address_length(byte b) { m_hardware_address_length = b; }
u8 hardware_address_length() const { return m_hardware_address_length; }
void set_hardware_address_length(u8 b) { m_hardware_address_length = b; }
byte protocol_address_length() const { return m_protocol_address_length; }
void set_protocol_address_length(byte b) { m_protocol_address_length = b; }
u8 protocol_address_length() const { return m_protocol_address_length; }
void set_protocol_address_length(u8 b) { m_protocol_address_length = b; }
word operation() const { return m_operation; }
void set_operation(word w) { m_operation = w; }
u16 operation() const { return m_operation; }
void set_operation(u16 w) { m_operation = w; }
const MACAddress& sender_hardware_address() const { return m_sender_hardware_address; }
void set_sender_hardware_address(const MACAddress& address) { m_sender_hardware_address = address; }
@ -49,11 +49,11 @@ public:
void set_target_protocol_address(const IPv4Address& address) { m_target_protocol_address = address; }
private:
NetworkOrdered<word> m_hardware_type { ARPHardwareType::Ethernet };
NetworkOrdered<word> m_protocol_type { EtherType::IPv4 };
byte m_hardware_address_length { sizeof(MACAddress) };
byte m_protocol_address_length { sizeof(IPv4Address) };
NetworkOrdered<word> m_operation;
NetworkOrdered<u16> m_hardware_type { ARPHardwareType::Ethernet };
NetworkOrdered<u16> m_protocol_type { EtherType::IPv4 };
u8 m_hardware_address_length { sizeof(MACAddress) };
u8 m_protocol_address_length { sizeof(IPv4Address) };
NetworkOrdered<u16> m_operation;
MACAddress m_sender_hardware_address;
IPv4Address m_sender_protocol_address;
MACAddress m_target_hardware_address;