Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
32b081e
ICMP: Renamed icmpv4.hpp/cpp -> icmp4.hpp/cpp Ping functionality adde…
AnnikaH Mar 3, 2017
f2365b9
Statman: End-iterators now correct, next_available_ now correct if cr…
AnnikaH Mar 6, 2017
bc6b61b
ICMP4: Added RFC 1122 codes
AnnikaH Mar 6, 2017
0304287
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 6, 2017
6252d01
ICMP: Added more Destination Unreachable and Parameter Problem codes …
AnnikaH Mar 6, 2017
e4dc73d
Test CMakeLists.txt: icmpv4.cpp -> icmp4.cpp
AnnikaH Mar 7, 2017
2b920fd
Statman unit test: Filling statman with stats using statman_.size() i…
AnnikaH Mar 8, 2017
392499c
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 8, 2017
ce3fc68
Inet: Getter for ICMPv4 object
AnnikaH Mar 8, 2017
ef91337
Inet common and packet_icmp4: Moved icmp4 codes into inet_common.hpp …
AnnikaH Mar 8, 2017
bc9c5a1
IP4 Packet: Getter for TTL added
AnnikaH Mar 8, 2017
235ae06
ICMP4: Support for sending ping, destination unreachable and other IC…
AnnikaH Mar 8, 2017
6f08c0d
IP4 and UDP: Sending protocol unreachable and port unreachable (ICMP …
AnnikaH Mar 8, 2017
001563a
ICMP integration test: Files added
AnnikaH Mar 8, 2017
97b81b3
ICMP integration test: Added vm.exit to test.py
AnnikaH Mar 8, 2017
bfc797a
ICMP4 codes separated into its own file and included into inet_common…
AnnikaH Mar 8, 2017
9b6542d
ICMP4: Added method for getting destination unreachable payload in ic…
AnnikaH Mar 10, 2017
be46d50
ICMP4: Ping with callback, send response with and without id and sequ…
AnnikaH Mar 10, 2017
f7c75e6
ICMP integration test: ping with callback to validate sent and receiv…
AnnikaH Mar 10, 2017
6ba1e09
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 10, 2017
cf29a15
ICMP4 ping reply: Calling new method send_response_with_id when respo…
AnnikaH Mar 10, 2017
3a77b84
ICMP integration test: Printing out result from ping callback
AnnikaH Mar 10, 2017
bfb84da
Statman: end-iterator back to returning end of span, not last stat in…
AnnikaH Mar 10, 2017
b4b4301
ICMP integration test: Marked as intrusive and installing hping (just…
AnnikaH Mar 10, 2017
7552954
ICMP4 incl. integration test: Complete handling of ping-callbacks (re…
AnnikaH Mar 10, 2017
54d7574
ICMP integration test: -y added to install hping3
AnnikaH Mar 10, 2017
df60f52
ICMP4: Parameter problem (with pointer indicating the error) and time…
AnnikaH Mar 10, 2017
d8360bf
ICMP4: got_reply_ -> is_reply_, integration test pinging gateway (no …
AnnikaH Mar 14, 2017
92c5f80
Ethernet: Trailer nego and encapsulation (ethertype) added with counter
AnnikaH Mar 14, 2017
aa4cd69
ICMP_packet: to_string implementation moved to cpp file
AnnikaH Mar 14, 2017
6805695
Ethernet: Trailer encapsulation now taking byte order into account. C…
AnnikaH Mar 15, 2017
9d8465e
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 15, 2017
1f0d980
Test vm.json: Removed cpu host to be able to run boot . without getti…
AnnikaH Mar 16, 2017
54cb698
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 16, 2017
555046a
ICMP4: printf -> debug
AnnikaH Mar 17, 2017
523b84d
ICMP forwarding error messages to UDP and TCP through Inet
AnnikaH Mar 17, 2017
9f99b9e
Merge branch 'dev' of github.com:AnnikaH/IncludeOS into dev
AnnikaH Mar 17, 2017
f2d4863
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 17, 2017
82f84d7
Inet getter for dns added and DHCPD (server) now uses this. Services …
AnnikaH Mar 17, 2017
a74b134
Testing: Commented out tar unittests to check Jenkins' reaction - to …
AnnikaH Mar 17, 2017
733162a
ICMP integration test: Update test to reflect new to_string method in…
AnnikaH Mar 17, 2017
aea8c7f
ICMP_packet and integration test update: Added bool operator - no nee…
AnnikaH Mar 19, 2017
7cc24cb
IP4 and UDP sending ICMP dest unreachable: Only when destination is n…
AnnikaH Mar 19, 2017
ac5b0c6
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 20, 2017
72cfe98
Rename back: icmp4 -> icmpv4 to later do git move on this change instead
AnnikaH Mar 20, 2017
bfb7f76
Git mv icmpv4 -> icmp4 to keep history
AnnikaH Mar 20, 2017
69b0ec3
Inet, Inet4, ICMP4, PacketICMP4: error_report taking Packet_ptr inste…
AnnikaH Mar 20, 2017
13d64f6
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 21, 2017
ea4ca76
Ethernet: Merge fix (variable name miss)
AnnikaH Mar 21, 2017
aab718b
Merge branch 'dev' of github.com:hioa-cs/IncludeOS into dev
AnnikaH Mar 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/net/dhcp/dhcpd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace dhcp {
void clear_offered_ip(IP4::addr ip);
void clear_offered_ips();

void print(const dhcp_packet_t* msg, const dhcp_option_t* opts) {
void print(const dhcp_packet_t* /* msg */, const dhcp_option_t* opts) {
debug("Printing:\n");

debug("OP: %u\n", msg->op);
Expand Down
4 changes: 4 additions & 0 deletions api/net/ethernet/ethernet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ namespace net {
uint64_t get_packets_dropped()
{ return packets_dropped_; }

uint32_t get_trailer_packets_dropped()
{ return trailer_packets_dropped_; }

private:
const addr& mac_;

/** Stats */
uint64_t& packets_rx_;
uint64_t& packets_tx_;
uint32_t& packets_dropped_;
uint32_t& trailer_packets_dropped_;

/** Upstream OUTPUT connections */
upstream ip4_upstream_ = nullptr;
Expand Down
17 changes: 10 additions & 7 deletions api/net/ethernet/ethertype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ namespace net {
/** Little-endian ethertypes. More entries here:
http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml */
enum class Ethertype : uint16_t {
IP4 = 0x8,
ARP = 0x608,
WOL = 0x4208,
IP6 = 0xdd86,
FLOW = 0x888,
JUMBO = 0x7088,
VLAN = 0x81
IP4 = 0x8,
ARP = 0x608,
WOL = 0x4208,
IP6 = 0xdd86,
FLOW = 0x888,
JUMBO = 0x7088,
VLAN = 0x81,
TRAILER_NEGO = 0x0010, // RFC 893 Trailer negotiation
TRAILER_FIRST = 0x0110, // RFC 893, 1122 Trailer encapsulation
TRAILER_LAST = 0x0f10
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


}
Expand Down
30 changes: 22 additions & 8 deletions api/net/inet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,45 @@

namespace net {


class TCP;
class UDP;
class DHClient;
class TCP;
class UDP;
class DHClient;
struct ICMPv4;

/**
* An abstract IP-stack interface.
* Provides a common interface for IPv4 and (future) IPv6, simplified with
* no constructors etc.
**/
template <typename IPV >
template <typename IPV>
struct Inet {
using Stack = Inet<IPV>;
using Forward_delg = delegate<void(Stack& source, typename IPV::IP_packet_ptr)>;
using Route_checker = delegate<bool(typename IPV::addr)>;
using IP_packet_factory = delegate<typename IPV::IP_packet_ptr(Protocol)>;

using Error_type = icmp4::Type;
using Error_code = uint8_t;

template <typename IPv>
using resolve_func = delegate<void(typename IPv::addr)>;


///
/// NETWORK CONFIGURATION
///

/** Get IP address of this interface **/
virtual typename IPV::addr ip_addr() = 0;
virtual typename IPV::addr ip_addr() = 0;

/** Get netmask of this interface **/
virtual typename IPV::addr netmask() = 0;
virtual typename IPV::addr netmask() = 0;

/** Get default gateway for this interface **/
virtual typename IPV::addr gateway() = 0;

/** Get default dns for this interface **/
virtual typename IPV::addr dns() = 0;

/** Set default gateway for this interface */
virtual void set_gateway(typename IPV::addr server) = 0;

Expand Down Expand Up @@ -94,6 +99,15 @@ namespace net {
/** Get the UDP protocol object for this interface */
virtual UDP& udp() = 0;

/** Get the ICMP protocol object for this interface */
virtual ICMPv4& icmp() = 0;

/**
* Error report in accordance with RFC 1122
* An ICMP error message has been received - forward to transport layer (UDP or TCP)
*/
virtual void error_report(Error_type type, Error_code code, Packet_ptr orig_pckt) = 0;


///
/// DNS
Expand Down
18 changes: 15 additions & 3 deletions api/net/inet4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "ip4/arp.hpp"
#include "ip4/ip4.hpp"
#include "ip4/udp.hpp"
#include "ip4/icmpv4.hpp"
#include "ip4/icmp4.hpp"
#include "dns/client.hpp"
#include "tcp/tcp.hpp"
#include <vector>
Expand Down Expand Up @@ -53,6 +53,9 @@ namespace net {
IP4::addr gateway() override
{ return gateway_; }

IP4::addr dns() override
{ return dns_server; }

IP4& ip_obj() override
{ return ip4_; }

Expand All @@ -71,9 +74,18 @@ namespace net {
/** Get the UDP-object belonging to this stack */
UDP& udp() override { return udp_; }

/** Get the ICMP-object belonging to this stack */
ICMPv4& icmp() override { return icmp_; }

/** Get the DHCP client (if any) */
auto dhclient() { return dhcp_; }

/**
* Error report in accordance with RFC 1122
* An ICMP error message has been received - forward to transport layer (UDP or TCP)
*/
void error_report(Error_type type, Error_code code, Packet_ptr orig_pckt) override;

/**
* Set the forwarding delegate used by this stack.
* If set it will get all incoming packets not intended for this stack.
Expand Down Expand Up @@ -125,7 +137,7 @@ namespace net {
void resolve(const std::string& hostname,
resolve_func<IP4> func) override
{
dns.resolve(this->dns_server, hostname, func);
dns_.resolve(this->dns_server, hostname, func);
}

void set_gateway(IP4::addr gateway) override
Expand Down Expand Up @@ -253,7 +265,7 @@ namespace net {
TCP tcp_;

// we need this to store the cache per-stack
DNSClient dns;
DNSClient dns_;

std::shared_ptr<net::DHClient> dhcp_{};

Expand Down
4 changes: 2 additions & 2 deletions api/net/inet64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <vector>

#include <nic.hpp>
#include "ip4/icmpv4.hpp"
#include "ip4/icmp4.hpp"

namespace net {

Expand Down Expand Up @@ -96,7 +96,7 @@ namespace net {
static Inet& up()
{
if (_ip4_list.size() < 1)
printf("<Inet> Is bringing up an IP stack without any IP addresses");
printf("<Inet> Is bringing up an IP stack without any IP addresses");
static Inet instance;
return instance;
}
Expand Down
5 changes: 3 additions & 2 deletions api/net/inet_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <net/packet.hpp>
#include <hw/mac_addr.hpp>
#include <net/ethernet/ethertype.hpp>
#include <net/ip4/icmp4_common.hpp>

namespace net {
// Packet must be forward declared to avoid circular dependency
Expand Down Expand Up @@ -116,9 +117,9 @@ namespace net {
* http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
*/
enum class Protocol : uint8_t {
HOPOPT = 0,
HOPOPT = 0,
ICMPv4 = 1,
IP4v4 = 4, // IPv4 encapsulation
IPv4 = 4, // IPv4 encapsulation
TCP = 6,
UDP = 17,
IPv6 = 41, // IPv6 encapsulation
Expand Down
Loading