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
25class ARP;
26
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 */
Address Resolution Protocol (ARP) socket.
Definition ARPSocket.h:41
virtual FileSystem::Result process(const NetworkQueue::Packet *pkt)
Process incoming network packet.
Definition ARPSocket.cpp:85
Ethernet::Address m_ethAddr
Ethernet address for reply.
Definition ARPSocket.h:104
ARP * m_arp
ARP protocol instance.
Definition ARPSocket.h:98
virtual FileSystem::Result read(IOBuffer &buffer, Size &size, const Size offset)
Receive ARP response.
Definition ARPSocket.cpp:37
virtual ~ARPSocket()
Destructor.
Definition ARPSocket.cpp:33
IPV4::Address m_ipAddr
IPV4 address for request.
Definition ARPSocket.h:101
virtual FileSystem::Result write(IOBuffer &buffer, Size &size, const Size offset)
Send ARP request.
Definition ARPSocket.cpp:65
Address Resolution Protocol.
Definition ARP.h:43
Abstract Input/Output buffer.
Definition IOBuffer.h:38
u32 Address
IP-address.
Definition IPV4.h:47
Network socket represents a single logical connection on a protocol.
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Result
Result code for filesystem Actions.
Definition FileSystem.h:53
Ethernet network address.
Definition Ethernet.h:53
Represents a network packet.