FreeNOS
ARPSocket.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __LIB_LIBNET_ARPSOCKET_H
19 #define __LIB_LIBNET_ARPSOCKET_H
20 
21 #include "IPV4.h"
22 #include "NetworkSocket.h"
23 #include "NetworkQueue.h"
24 
25 class ARP;
26 
40 class ARPSocket : public NetworkSocket
41 {
42  public:
43 
50  ARPSocket(const u32 inode,
51  ARP *arp);
52 
56  virtual ~ARPSocket();
57 
68  virtual FileSystem::Result read(IOBuffer & buffer,
69  Size & size,
70  const Size offset);
71 
82  virtual FileSystem::Result write(IOBuffer & buffer,
83  Size & size,
84  const Size offset);
85 
94 
95  private:
96 
99 
102 
105 };
106 
112 #endif /* __LIB_LIBNET_ARPSOCKET_H */
ARPSocket::~ARPSocket
virtual ~ARPSocket()
Destructor.
Definition: ARPSocket.cpp:33
ARPSocket::process
virtual FileSystem::Result process(const NetworkQueue::Packet *pkt)
Process incoming network packet.
Definition: ARPSocket.cpp:85
ARPSocket
Address Resolution Protocol (ARP) socket.
Definition: ARPSocket.h:40
NetworkQueue.h
ARPSocket::m_ethAddr
Ethernet::Address m_ethAddr
Ethernet address for reply.
Definition: ARPSocket.h:104
Ethernet::Address
Ethernet network address.
Definition: Ethernet.h:52
ARPSocket::m_ipAddr
IPV4::Address m_ipAddr
IPV4 address for request.
Definition: ARPSocket.h:101
IOBuffer
Abstract Input/Output buffer.
Definition: IOBuffer.h:37
u32
unsigned int u32
Unsigned 32-bit number.
Definition: Types.h:53
Size
unsigned int Size
Any sane size indicator cannot go negative.
Definition: Types.h:128
IPV4::Address
u32 Address
IP-address.
Definition: IPV4.h:47
IPV4.h
NetworkSocket
Network socket represents a single logical connection on a protocol.
Definition: NetworkSocket.h:37
FileSystem::Result
Result
Result code for filesystem Actions.
Definition: FileSystem.h:52
ARPSocket::write
virtual FileSystem::Result write(IOBuffer &buffer, Size &size, const Size offset)
Send ARP request.
Definition: ARPSocket.cpp:65
ARPSocket::m_arp
ARP * m_arp
ARP protocol instance.
Definition: ARPSocket.h:98
NetworkQueue::Packet
Represents a network packet.
Definition: NetworkQueue.h:50
ARP
Address Resolution Protocol.
Definition: ARP.h:42
ARPSocket::read
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Receive ARP response.
Definition: ARPSocket.cpp:37
ARPSocket::ARPSocket
ARPSocket(const u32 inode, ARP *arp)
Constructor.
Definition: ARPSocket.cpp:24
NetworkSocket.h