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

IPv4: Add simple pseudorandom ephemeral port allocators for TCP and UDP.

This commit is contained in:
Andreas Kling 2019-03-18 04:03:44 +01:00
parent 77a782a67e
commit c24d4b07db
8 changed files with 54 additions and 20 deletions

View file

@ -45,12 +45,12 @@ public:
protected:
IPv4Socket(int type, int protocol);
void allocate_source_port_if_needed();
int allocate_source_port_if_needed();
virtual int protocol_receive(const ByteBuffer&, void*, size_t, int, sockaddr*, socklen_t*) { return -ENOTIMPL; }
virtual int protocol_send(const void*, int) { return -ENOTIMPL; }
virtual KResult protocol_connect() { return KSuccess; }
virtual void protocol_allocate_source_port() { }
virtual int protocol_allocate_source_port() { return 0; }
virtual bool protocol_is_disconnected() const { return false; }
private: