Go to the documentation of this file.
100 if (*ipAddr == 0xffffffff)
110 DEBUG(
"entry->time.ticks = " <<
entry->time.ticks <<
111 " entry->time.freq = " <<
entry->time.frequency <<
112 " kernelTimer.ticks = " << inf.
ticks <<
113 " kernelTimer.freq = " << inf.
frequency);
117 DEBUG(
"entry timeout: re-transmitting");
123 ERROR(
"failed to send request: result = " << (
int) result);
145 entry->valid =
false;
149 entry->retryCount = 0;
167 ERROR(
"failed to get transmit packet: result = " << (
int) result);
214 ERROR(
"failed to get transmit packet: result = " << (
int) result);
258 " ipAddr = " << *
IPV4::toString(ipAddr) <<
" operation = " << operation <<
265 if (ipTarget == ipAddr)
Network protocol abstraction class.
static Size copy(void *dest, const void *src, Size count)
Copy memory from one place to another.
FileSystem::Result lookupAddress(const IPV4::Address *ipAddr, Ethernet::Address *ethAddr)
Lookup Ethernet address for an IP.
const u32 readBe32(const void *data)
Read 32-bit big endian integer.
ARPSocket * m_sock
The single ARP socket.
virtual FileSystem::Result process(const NetworkQueue::Packet *pkt)
Process incoming network packet.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
const u16 readBe16(const void *data)
Read 16-bit big endian integer.
u32 getNextInode()
Get next unused inode.
void writeBe16(void *data, const u16 input)
Write 16-bit big endian integer.
virtual FileSystem::Result process(const NetworkQueue::Packet *pkt, const Size offset)
Process incoming network packet.
FileSystem::Result sendReply(const Ethernet::Address *ethaddr, const IPV4::Address ipAddr)
Send ARP reply.
Network Device abstract class.
Iterate through a HashTable.
NetworkProtocol & m_parent
Parent upper-layer protocol instance.
HashTable< IPV4::Address, ARPCache * > m_cache
Contains a cached mapping from IP to Ethernet addresses.
void setIP(::IPV4 *ip)
Set IPV4 instance.
Address Resolution Protocol (ARP) socket.
struct ARP::Header Header
ARP network packet header.
Timer information structure.
NetworkDevice & m_device
Network device instance.
KernelTimer m_kernelTimer
Provides access to the kernel timer.
ARPCache * getCacheEntry(const IPV4::Address ipAddr)
Retrieve cache entry by IP.
#define DEBUG(msg)
Output a debug message to standard output.
Ethernet network address.
virtual FileSystem::Result initialize()
Perform initialization.
unsigned short u16
Unsigned 16-bit number.
::IPV4 * m_ip
IPV4 instance object.
unsigned int u32
Unsigned 32-bit number.
unsigned int Size
Any sane size indicator cannot go negative.
void setTimeout(const uint msec)
Set a sleep timeout.
bool isExpired(const Info &info) const
Check if a timer value is expired.
Internet Protocol Version 4.
FileSystem::Result registerDirectory(Directory *dir, const char *path)
Register a new Directory.
virtual FileSystem::Result getTransmitPacket(NetworkQueue::Packet **pkt, const void *address, const Size addressSize, const Identifier protocol, const Size payloadSize)
Get a new packet for transmission.
static const String toString(const Address address)
Convert address to string.
void writeBe32(void *data, const u32 input)
Write 32-bit big endian integer.
NetworkServer & m_server
Network server instance.
#define ERROR(msg)
Output an error message.
virtual Result tick()
Process timer tick.
Result
Result code for filesystem Actions.
virtual FileSystem::Result getAddress(Address *address)
Get current IP address.
virtual FileSystem::Result transmit(NetworkQueue::Packet *packet)=0
Add a network packet to the transmit queue.
static const Size MaxRetries
Maximum number of retries for ARP lookup.
virtual bool hasCurrent() const
Check if there is a current item.
struct Ethernet::Address Address
Ethernet network address.
Represents a network packet.
void updateCacheEntry(const IPV4::Address ipAddr, const Ethernet::Address *ethAddr)
Update cache entry.
virtual ~ARP()
Destructor.
virtual Result getCurrent(Info *info, const Size msecOffset=0)
Get current timer info.
FileSystem::Result sendRequest(const IPV4::Address address)
Send ARP request.
struct ARP::ARPCache ARPCache
ARP table cache entry.
ARPCache * insertCacheEntry(const IPV4::Address ipAddr)
Insert a new entry to the ARP cache.
FileSystem::Result registerFile(File *file, const char *path)
Register a new File.