X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a27340a44ca0010cef5e5134627dd7774cc911c3..b46a15116e3ab14c03a7aad88cce834b40b90a2b:/include/simgrid/kernel/routing/WifiZone.hpp diff --git a/include/simgrid/kernel/routing/WifiZone.hpp b/include/simgrid/kernel/routing/WifiZone.hpp new file mode 100644 index 0000000000..2227093323 --- /dev/null +++ b/include/simgrid/kernel/routing/WifiZone.hpp @@ -0,0 +1,42 @@ +/* Copyright (c) 2013-2020. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#ifndef SIMGRID_ROUTING_WIFI_HPP_ +#define SIMGRID_ROUTING_WIFI_HPP_ + +#include + +namespace simgrid { +namespace kernel { +namespace routing { + +/** @ingroup ROUTING_API + * @brief NetZone modeling a Wifi zone + * + * This routing has only one link, representing the wifi medium (ie, the air). + * That link is used for all communications within the zone. + */ +class XBT_PRIVATE WifiZone : public RoutedZone { +public: + explicit WifiZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel); + WifiZone(const WifiZone&) = delete; + WifiZone& operator=(const WifiZone) = delete; + ~WifiZone() = default; + + void seal() override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + s4u::Link* create_link(const std::string& name, const std::vector& bandwidths, double latency, + s4u::Link::SharingPolicy policy, + const std::unordered_map* props) override; + +private: + resource::LinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3) + NetPoint* access_point_ = nullptr; // Zone's gateway to the external world +}; +} // namespace routing +} // namespace kernel +} // namespace simgrid + +#endif /* SIMGRID_ROUTING_WIFI_HPP_ */