1 /* Copyright (c) 2013-2023. 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>
11 namespace simgrid::kernel::routing {
13 /** @ingroup ROUTING_API
14 * @brief NetZone modeling a Wifi zone
16 * This routing has only one link, representing the wifi medium (ie, the air).
17 * That link is used for all communications within the zone.
19 class XBT_PRIVATE WifiZone : public RoutedZone {
20 resource::StandardLinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
21 NetPoint* access_point_ = nullptr; // Zone's gateway to the external world
23 void do_seal() override;
24 resource::StandardLinkImpl* do_create_link(const std::string& name, const std::vector<double>& bandwidths) override;
27 using RoutedZone::RoutedZone;
28 WifiZone(const WifiZone&) = delete;
29 WifiZone& operator=(const WifiZone) = delete;
31 void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
32 NetPoint* get_access_point() const { return access_point_; }
34 } // namespace simgrid::kernel::routing
36 #endif /* SIMGRID_ROUTING_WIFI_HPP_ */