mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
IPv4: Implement bind() for TCP and UDP sockets.
We can't accept connections just yet, but this patch makes it possible to bind() to a given source address/port.
This commit is contained in:
parent
6a5d92f0ad
commit
abb5c890e0
6 changed files with 34 additions and 2 deletions
|
@ -48,6 +48,7 @@ protected:
|
|||
|
||||
int allocate_source_port_if_needed();
|
||||
|
||||
virtual KResult protocol_bind() { return KSuccess; }
|
||||
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(FileDescriptor&, ShouldBlock) { return KSuccess; }
|
||||
|
@ -59,6 +60,8 @@ private:
|
|||
|
||||
bool m_bound { false };
|
||||
int m_attached_fds { 0 };
|
||||
|
||||
IPv4Address m_source_address;
|
||||
IPv4Address m_destination_address;
|
||||
|
||||
DoubleBuffer m_for_client;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue