2016-08-25 15:48:53 +00:00
|
|
|
/*
|
2016-09-12 10:55:12 +00:00
|
|
|
* \brief Remember packets that wait for ARP replies at different interfaces
|
2016-08-25 15:48:53 +00:00
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2016-08-19
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2016-08-25 15:48:53 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2016-08-25 15:48:53 +00:00
|
|
|
*/
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
#ifndef _ARP_WAITER_H_
|
|
|
|
#define _ARP_WAITER_H_
|
|
|
|
|
2016-08-25 15:48:53 +00:00
|
|
|
/* Genode includes */
|
|
|
|
#include <net/ipv4.h>
|
|
|
|
#include <util/list.h>
|
2016-09-12 10:55:12 +00:00
|
|
|
#include <nic_session/nic_session.h>
|
2016-08-25 15:48:53 +00:00
|
|
|
|
|
|
|
namespace Net {
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
using Packet_descriptor = ::Nic::Packet_descriptor;
|
2016-08-25 15:48:53 +00:00
|
|
|
class Interface;
|
|
|
|
class Arp_waiter;
|
2016-09-12 10:55:12 +00:00
|
|
|
using Arp_waiter_list_element = Genode::List_element<Arp_waiter>;
|
|
|
|
using Arp_waiter_list = Genode::List<Arp_waiter_list_element >;
|
2016-08-25 15:48:53 +00:00
|
|
|
}
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
|
|
|
|
class Net::Arp_waiter
|
2016-08-25 15:48:53 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
Arp_waiter_list_element _src_le;
|
|
|
|
Interface &_src;
|
|
|
|
Arp_waiter_list_element _dst_le;
|
|
|
|
Interface &_dst;
|
|
|
|
Ipv4_address const _ip;
|
|
|
|
Packet_descriptor const _packet;
|
2016-08-25 15:48:53 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
Arp_waiter(Interface &src,
|
|
|
|
Interface &dst,
|
|
|
|
Ipv4_address const &ip,
|
|
|
|
Packet_descriptor const &packet);
|
2016-08-25 15:48:53 +00:00
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
~Arp_waiter();
|
2016-08-25 15:48:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
/***************
|
|
|
|
** Accessors **
|
|
|
|
***************/
|
|
|
|
|
2016-09-12 10:55:12 +00:00
|
|
|
Interface &src() const { return _src; }
|
|
|
|
Ipv4_address const &ip() const { return _ip; }
|
|
|
|
Packet_descriptor const &packet() const { return _packet; }
|
2016-08-25 15:48:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _ARP_WAITER_H_ */
|