IPv4: Implement socket ioctls SIOCGIFADDR and SIOCSIFADDR

This allows userspace programs to get and set (superuser-only) the IPv4
address of a network adapter. :^)
This commit is contained in:
Andreas Kling 2019-09-23 19:06:03 +02:00
commit 2482fc3538
Notes: sideshowbarker 2024-07-19 11:59:51 +09:00
7 changed files with 117 additions and 1 deletions

View file

@ -34,6 +34,8 @@ public:
virtual KResult setsockopt(int level, int option, const void*, socklen_t) override;
virtual KResult getsockopt(int level, int option, void*, socklen_t*) override;
virtual int ioctl(FileDescription&, unsigned request, unsigned arg) override;
void did_receive(const IPv4Address& peer_address, u16 peer_port, KBuffer&&);
const IPv4Address& local_address() const { return m_local_address; }