1 /* Copyright (c) 2013-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_ROUTING_WIFI_HPP_
7 #define SIMGRID_ROUTING_WIFI_HPP_
9 #include <simgrid/kernel/routing/RoutedZone.hpp>
15 /** @ingroup ROUTING_API
16 * @brief NetZone modeling a Wifi zone
18 * This routing has only one link, representing the wifi medium (ie, the air).
19 * That link is used for all communications within the zone.
21 class XBT_PRIVATE WifiZone : public RoutedZone {
23 explicit WifiZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
24 WifiZone(const WifiZone&) = delete;
25 WifiZone& operator=(const WifiZone) = delete;
26 ~WifiZone() override = default;
29 void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
30 s4u::Link* create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
31 s4u::Link::SharingPolicy policy,
32 const std::unordered_map<std::string, std::string>* props) override;
33 NetPoint* get_access_point() {return access_point_;}
36 resource::LinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
37 NetPoint* access_point_ = nullptr; // Zone's gateway to the external world
39 } // namespace routing
41 } // namespace simgrid
43 #endif /* SIMGRID_ROUTING_WIFI_HPP_ */