FreeNOS
NetworkProtocol.cpp
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#include "NetworkDevice.h"
19#include "NetworkProtocol.h"
20#include "NetworkServer.h"
21
23 NetworkDevice &device,
24 NetworkProtocol &parent)
25 : Directory(server.getNextInode())
26 , m_server(server)
27 , m_device(device)
28 , m_parent(parent)
29{
30}
31
35
40
42 const void *address,
43 const Size addressSize,
44 const NetworkProtocol::Identifier protocol,
45 const Size payloadSize)
46{
48}
Directory File functionality.
Definition Directory.h:60
Network Device abstract class.
const Size getMaximumPacketSize() const
Get maximum packet size.
Network protocol abstraction class.
Identifier
List of known network protocol identifiers.
NetworkProtocol(NetworkServer &server, NetworkDevice &device, NetworkProtocol &parent)
Constructor.
NetworkDevice & m_device
Network device instance.
virtual ~NetworkProtocol()
Destructor.
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.
virtual const Size getMaximumPacketSize() const
Get maximum packet size.
Networking server.
unsigned int Size
Any sane size indicator cannot go negative.
Definition Types.h:128
Result
Result code for filesystem Actions.
Definition FileSystem.h:53
Represents a network packet.