| 1 | // Copyright (C) Microsoft Corporation. All rights reserved. |
| 2 | #pragma once |
| 3 | |
| 4 | #include <optional> |
| 5 | #include "address.h" |
| 6 | |
| 7 | struct Route |
| 8 | { |
| 9 | int family = -1; |
| 10 | std::optional<Address> via; |
| 11 | int dev = -1; |
| 12 | bool defaultRoute = false; |
| 13 | std::optional<Address> to; |
| 14 | int metric = 0; |
| 15 | bool isLoopbackRoute = false; |
| 16 | |
| 17 | Route(int routeFamily, const std::optional<Address>& routeNextHop, int routeInterface, bool isRouteDefault, const std::optional<Address>& routeDestination, int routeMetric); |
| 18 | |
| 19 | bool IsOnlink() const; |
| 20 | bool IsMulticast() const; |
| 21 | }; |
| 22 | |
| 23 | std::ostream& operator<<(std::ostream& out, const Route& route); |