Go to the documentation of this file.
18 #ifndef __LIB_LIBNET_UDP_H
19 #define __LIB_LIBNET_UDP_H
HashTable< u16, UDPSocket * > m_ports
Maps UDP ports to UDP sockets.
virtual ~UDP()
Destructor.
Network protocol abstraction class.
struct UDP::Header Header
Packet header format.
unsigned long ulong
Unsigned long number.
FileSystem::Result sendPacket(const NetworkClient::SocketInfo *src, const NetworkClient::SocketInfo *dest, IOBuffer &buffer, const Size size, const Size offset)
Send packet.
User Datagram Protocol (UDP).
static const ulong calculateSum(const u16 *ptr, const Size bytes)
Calculate sum of artibrary data.
Network Device abstract class.
Index< UDPSocket, MaxUdpSockets > m_sockets
Contains all UDP sockets.
User Datagram Protocol (UDP)
u32 ProcessID
Process Identification Number.
UDPSocket * createSocket(String &path, const ProcessID pid)
Creates an UDP socket.
virtual FileSystem::Result process(const NetworkQueue::Packet *pkt, const Size offset)
Process incoming network packet.
void unregisterSockets(const ProcessID pid)
Remove sockets for a process.
SystemDescriptorHeader header
unsigned short u16
Unsigned 16-bit number.
Abstract Input/Output buffer.
unsigned int Size
Any sane size indicator cannot go negative.
FileSystem::Result bind(UDPSocket *sock, const u16 port)
Bind to UDP port.
UDPFactory * m_factory
Factory for creating new UDP sockets.
Result
Result code for filesystem Actions.
static const Size MaxUdpSockets
static const u16 checksum(const IPV4::Header *ip, const Header *header, const Size datalen)
Calculate ICMP checksum.
Represents a network packet.
virtual FileSystem::Result initialize()
Perform initialization.
User Datagram Protocol (UDP) socket.