From 384cc9500f4100b48664f4d455cb15d7d8e74104 Mon Sep 17 00:00:00 2001 From: ridethepig Date: Sat, 18 Feb 2023 08:54:40 +0000 Subject: [PATCH] lab5 done right --- apps/webget.cc | 2 +- libsponge/network_interface.hh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/webget.cc b/apps/webget.cc index e24af2f..95fe7a2 100644 --- a/apps/webget.cc +++ b/apps/webget.cc @@ -17,7 +17,7 @@ void get_URL(const string &host, const string &path) { // Then you'll need to print out everything the server sends back, // (not just one call to read() -- everything) until you reach // the "eof" (end of file). - CS144TCPSocket sock; + FullStackSocket sock; sock.connect(Address(host, "http")); string request = "GET " + path + " HTTP/1.1\r\nHost: " + host + "\r\nConnection: close\r\n\r\n"; sock.write(request); diff --git a/libsponge/network_interface.hh b/libsponge/network_interface.hh index 8a0885e..adbc2cc 100644 --- a/libsponge/network_interface.hh +++ b/libsponge/network_interface.hh @@ -5,11 +5,11 @@ #include "tcp_over_ip.hh" #include "tun.hh" +#include +#include #include #include -#include #include -#include //! \brief A "network interface" that connects IP (the internet layer, or network layer) //! with Ethernet (the network access layer, or link layer). @@ -45,10 +45,10 @@ class NetworkInterface { //! internal map as arp cache, holding mapping from ipv4(numerical form) to MAC addr with expire time. //! if optinal has no value, it means that a ARP has been sent for the IP within 5 seconds - std::map, size_t> > _arp_cache{}; + std::map, size_t>> _arp_cache{}; //! queue the IP datagrams waiting for ARP reply - std::list >_suspended_datagrams{}; + std::list> _suspended_datagrams{}; public: //! \brief Construct a network interface with given Ethernet (network-access-layer) and IP (internet-layer) addresses