LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2016 Universita' di Firenze, Italy | 3 * Copyright (c) 2016 Universita' di Firenze, Italy |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 InetSocketAddress local = InetSocketAddress (RIP_ALL_NODE, RIP_PORT); | 166 InetSocketAddress local = InetSocketAddress (RIP_ALL_NODE, RIP_PORT); |
167 m_recvSocket->Bind (local); | 167 m_recvSocket->Bind (local); |
168 m_recvSocket->SetRecvCallback (MakeCallback (&Rip::Receive, this)); | 168 m_recvSocket->SetRecvCallback (MakeCallback (&Rip::Receive, this)); |
169 m_recvSocket->SetIpRecvTtl (true); | 169 m_recvSocket->SetIpRecvTtl (true); |
170 m_recvSocket->SetRecvPktInfo (true); | 170 m_recvSocket->SetRecvPktInfo (true); |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 if (addedGlobal) | 174 if (addedGlobal) |
175 { | 175 { |
176 Time delay1 = Seconds (m_rng->GetValue (m_minTriggeredUpdateDelay.GetSecon
ds (), m_maxTriggeredUpdateDelay.GetSeconds ())); | 176 delay = Seconds (m_rng->GetValue (m_minTriggeredUpdateDelay.GetSeconds (),
m_maxTriggeredUpdateDelay.GetSeconds ())); |
177 m_nextTriggeredUpdate = Simulator::Schedule (delay1, &Rip::DoSendRouteUpda
te, this, false); | 177 m_nextTriggeredUpdate = Simulator::Schedule (delay, &Rip::DoSendRouteUpdat
e, this, false); |
178 } | 178 } |
179 | 179 |
180 delay = Seconds (m_rng->GetValue (0.01, m_startupDelay.GetSeconds ())); | 180 delay = Seconds (m_rng->GetValue (0.01, m_startupDelay.GetSeconds ())); |
181 m_nextTriggeredUpdate = Simulator::Schedule (delay, &Rip::SendRouteRequest, th
is); | 181 m_nextTriggeredUpdate = Simulator::Schedule (delay, &Rip::SendRouteRequest, th
is); |
182 | 182 |
183 Ipv4RoutingProtocol::DoInitialize (); | 183 Ipv4RoutingProtocol::DoInitialize (); |
184 } | 184 } |
185 | 185 |
186 Ptr<Ipv4Route> Rip::RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<Ne
tDevice> oif, Socket::SocketErrno &sockerr) | 186 Ptr<Ipv4Route> Rip::RouteOutput (Ptr<Packet> p, const Ipv4Header &header, Ptr<Ne
tDevice> oif, Socket::SocketErrno &sockerr) |
187 { | 187 { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 670 |
671 void Rip::InvalidateRoute (RipRoutingTableEntry *route) | 671 void Rip::InvalidateRoute (RipRoutingTableEntry *route) |
672 { | 672 { |
673 NS_LOG_FUNCTION (this << *route); | 673 NS_LOG_FUNCTION (this << *route); |
674 | 674 |
675 for (RoutesI it = m_routes.begin (); it != m_routes.end (); it++) | 675 for (RoutesI it = m_routes.begin (); it != m_routes.end (); it++) |
676 { | 676 { |
677 if (it->first == route) | 677 if (it->first == route) |
678 { | 678 { |
679 route->SetRouteStatus (RipRoutingTableEntry::RIP_INVALID); | 679 route->SetRouteStatus (RipRoutingTableEntry::RIP_INVALID); |
680 route->SetRouteMetric (static_cast<uint8_t>(m_linkDown)); | 680 route->SetRouteMetric (m_linkDown); |
681 route->SetRouteChanged (true); | 681 route->SetRouteChanged (true); |
682 if (it->second.IsRunning ()) | 682 if (it->second.IsRunning ()) |
683 { | 683 { |
684 it->second.Cancel (); | 684 it->second.Cancel (); |
685 } | 685 } |
686 it->second = Simulator::Schedule (m_garbageCollectionDelay, &Rip::Dele
teRoute, this, route); | 686 it->second = Simulator::Schedule (m_garbageCollectionDelay, &Rip::Dele
teRoute, this, route); |
687 return; | 687 return; |
688 } | 688 } |
689 } | 689 } |
690 NS_ABORT_MSG ("RIP::InvalidateRoute - cannot find the route to update"); | 690 NS_ABORT_MSG ("RIP::InvalidateRoute - cannot find the route to update"); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 { | 777 { |
778 if (rtes.begin ()->GetPrefix () == Ipv4Address::GetAny () && | 778 if (rtes.begin ()->GetPrefix () == Ipv4Address::GetAny () && |
779 rtes.begin ()->GetSubnetMask ().GetPrefixLength () == 0 && | 779 rtes.begin ()->GetSubnetMask ().GetPrefixLength () == 0 && |
780 rtes.begin ()->GetRouteMetric () == m_linkDown) | 780 rtes.begin ()->GetRouteMetric () == m_linkDown) |
781 { | 781 { |
782 // Output whole thing. Use Split Horizon | 782 // Output whole thing. Use Split Horizon |
783 if (m_interfaceExclusions.find (incomingInterface) == m_interfaceExclu
sions.end ()) | 783 if (m_interfaceExclusions.find (incomingInterface) == m_interfaceExclu
sions.end ()) |
784 { | 784 { |
785 // we use one of the sending sockets, as they're bound to the righ
t interface | 785 // we use one of the sending sockets, as they're bound to the righ
t interface |
786 // and the local address might be used on different interfaces. | 786 // and the local address might be used on different interfaces. |
787 Ptr<Socket> sendingSoket; | 787 Ptr<Socket> sendingSocket; |
788 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendS
ocketList.end (); iter++ ) | 788 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendS
ocketList.end (); iter++ ) |
789 { | 789 { |
790 if (iter->second == incomingInterface) | 790 if (iter->second == incomingInterface) |
791 { | 791 { |
792 sendingSoket = iter->first; | 792 sendingSocket = iter->first; |
793 } | 793 } |
794 } | 794 } |
795 NS_ASSERT_MSG (sendingSoket, "HandleRequest - Impossible to find a
socket to send the reply"); | 795 NS_ASSERT_MSG (sendingSocket, "HandleRequest - Impossible to find
a socket to send the reply"); |
796 | 796 |
797 uint16_t mtu = m_ipv4->GetMtu (incomingInterface); | 797 uint16_t mtu = m_ipv4->GetMtu (incomingInterface); |
798 uint16_t maxRte = static_cast<uint16_t>((mtu - Ipv4Header ().GetSe
rializedSize () - UdpHeader ().GetSerializedSize () - RipHeader ().GetSerialized
Size ()) / RipRte ().GetSerializedSize ()); | 798 uint16_t maxRte = static_cast<uint16_t> ((mtu - Ipv4Header ().GetS
erializedSize () - UdpHeader ().GetSerializedSize () - RipHeader ().GetSerialize
dSize ()) / RipRte ().GetSerializedSize ()); |
799 | 799 |
800 Ptr<Packet> p = Create<Packet> (); | 800 Ptr<Packet> p = Create<Packet> (); |
801 SocketIpTtlTag tag; | 801 SocketIpTtlTag tag; |
802 p->RemovePacketTag (tag); | 802 p->RemovePacketTag (tag); |
803 if (senderAddress == Ipv4Address(RIP_ALL_NODE)) | 803 if (senderAddress == Ipv4Address(RIP_ALL_NODE)) |
804 { | 804 { |
805 tag.SetTtl (1); | 805 tag.SetTtl (1); |
806 } | 806 } |
807 else | 807 else |
808 { | 808 { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 if ((m_splitHorizonStrategy != SPLIT_HORIZON) || | 842 if ((m_splitHorizonStrategy != SPLIT_HORIZON) || |
843 (m_splitHorizonStrategy == SPLIT_HORIZON && !splitHori
zoning)) | 843 (m_splitHorizonStrategy == SPLIT_HORIZON && !splitHori
zoning)) |
844 { | 844 { |
845 hdr.AddRte (rte); | 845 hdr.AddRte (rte); |
846 } | 846 } |
847 } | 847 } |
848 if (hdr.GetRteNumber () == maxRte) | 848 if (hdr.GetRteNumber () == maxRte) |
849 { | 849 { |
850 p->AddHeader (hdr); | 850 p->AddHeader (hdr); |
851 NS_LOG_DEBUG ("SendTo: " << *p); | 851 NS_LOG_DEBUG ("SendTo: " << *p); |
852 sendingSoket->SendTo (p, 0, InetSocketAddress (senderAddre
ss, RIP_PORT)); | 852 sendingSocket->SendTo (p, 0, InetSocketAddress (senderAddr
ess, RIP_PORT)); |
853 p->RemoveHeader (hdr); | 853 p->RemoveHeader (hdr); |
854 hdr.ClearRtes (); | 854 hdr.ClearRtes (); |
855 } | 855 } |
856 } | 856 } |
857 if (hdr.GetRteNumber () > 0) | 857 if (hdr.GetRteNumber () > 0) |
858 { | 858 { |
859 p->AddHeader (hdr); | 859 p->AddHeader (hdr); |
860 NS_LOG_DEBUG ("SendTo: " << *p); | 860 NS_LOG_DEBUG ("SendTo: " << *p); |
861 sendingSoket->SendTo (p, 0, InetSocketAddress (senderAddress,
RIP_PORT)); | 861 sendingSocket->SendTo (p, 0, InetSocketAddress (senderAddress,
RIP_PORT)); |
862 } | 862 } |
863 } | 863 } |
864 } | 864 } |
865 } | 865 } |
866 else | 866 else |
867 { | 867 { |
868 // note: we got the request as a single packet, so no check is necessary f
or MTU limit | 868 // note: we got the request as a single packet, so no check is necessary f
or MTU limit |
869 | 869 |
870 Ptr<Packet> p = Create<Packet> (); | 870 Ptr<Packet> p = Create<Packet> (); |
871 SocketIpTtlTag tag; | 871 SocketIpTtlTag tag; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 Ipv4Mask rtePrefixMask = iter->GetSubnetMask (); | 961 Ipv4Mask rtePrefixMask = iter->GetSubnetMask (); |
962 Ipv4Address rteAddr = iter->GetPrefix ().CombineMask (rtePrefixMask); | 962 Ipv4Address rteAddr = iter->GetPrefix ().CombineMask (rtePrefixMask); |
963 | 963 |
964 NS_LOG_LOGIC ("Processing RTE " << *iter); | 964 NS_LOG_LOGIC ("Processing RTE " << *iter); |
965 | 965 |
966 uint32_t interfaceMetric = 1; | 966 uint32_t interfaceMetric = 1; |
967 if (m_interfaceMetrics.find (incomingInterface) != m_interfaceMetrics.end
()) | 967 if (m_interfaceMetrics.find (incomingInterface) != m_interfaceMetrics.end
()) |
968 { | 968 { |
969 interfaceMetric = m_interfaceMetrics[incomingInterface]; | 969 interfaceMetric = m_interfaceMetrics[incomingInterface]; |
970 } | 970 } |
971 uint64_t rteMetric = iter->GetRouteMetric () + interfaceMetric; | 971 uint32_t rteMetric = iter->GetRouteMetric () + interfaceMetric; |
972 if (rteMetric > m_linkDown) | 972 if (rteMetric > m_linkDown) |
973 { | 973 { |
974 rteMetric = m_linkDown; | 974 rteMetric = m_linkDown; |
975 } | 975 } |
976 | 976 |
977 RoutesI it; | 977 RoutesI it; |
978 bool found = false; | 978 bool found = false; |
979 for (it = m_routes.begin (); it != m_routes.end (); it++) | 979 for (it = m_routes.begin (); it != m_routes.end (); it++) |
980 { | 980 { |
981 if (it->first->GetDestNetwork () == rteAddr && | 981 if (it->first->GetDestNetwork () == rteAddr && |
982 it->first->GetDestNetworkMask () == rtePrefixMask) | 982 it->first->GetDestNetworkMask () == rtePrefixMask) |
983 { | 983 { |
984 found = true; | 984 found = true; |
985 if (rteMetric < it->first->GetRouteMetric ()) | 985 if (rteMetric < it->first->GetRouteMetric ()) |
986 { | 986 { |
987 if (senderAddress != it->first->GetGateway ()) | 987 if (senderAddress != it->first->GetGateway ()) |
988 { | 988 { |
989 RipRoutingTableEntry* route = new RipRoutingTableEntry (rt
eAddr, rtePrefixMask, senderAddress, incomingInterface); | 989 RipRoutingTableEntry* route = new RipRoutingTableEntry (rt
eAddr, rtePrefixMask, senderAddress, incomingInterface); |
990 delete it->first; | 990 delete it->first; |
991 it->first = route; | 991 it->first = route; |
992 } | 992 } |
993 it->first->SetRouteMetric (static_cast<uint8_t>(rteMetric)); | 993 it->first->SetRouteMetric (rteMetric); |
994 it->first->SetRouteStatus (RipRoutingTableEntry::RIP_VALID); | 994 it->first->SetRouteStatus (RipRoutingTableEntry::RIP_VALID); |
995 it->first->SetRouteTag (iter->GetRouteTag ()); | 995 it->first->SetRouteTag (iter->GetRouteTag ()); |
996 it->first->SetRouteChanged (true); | 996 it->first->SetRouteChanged (true); |
997 it->second.Cancel (); | 997 it->second.Cancel (); |
998 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::Invali
dateRoute, this, it->first); | 998 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::Invali
dateRoute, this, it->first); |
999 changed = true; | 999 changed = true; |
1000 } | 1000 } |
1001 else if (rteMetric == it->first->GetRouteMetric ()) | 1001 else if (rteMetric == it->first->GetRouteMetric ()) |
1002 { | 1002 { |
1003 if (senderAddress == it->first->GetGateway ()) | 1003 if (senderAddress == it->first->GetGateway ()) |
1004 { | 1004 { |
1005 it->second.Cancel (); | 1005 it->second.Cancel (); |
1006 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::In
validateRoute, this, it->first); | 1006 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::In
validateRoute, this, it->first); |
1007 } | 1007 } |
1008 else | 1008 else |
1009 { | 1009 { |
1010 if (Simulator::GetDelayLeft (it->second) < m_timeoutDelay/
2) | 1010 if (Simulator::GetDelayLeft (it->second) < m_timeoutDelay/
2) |
1011 { | 1011 { |
1012 RipRoutingTableEntry* route = new RipRoutingTableEntry
(rteAddr, rtePrefixMask, senderAddress, incomingInterface); | 1012 RipRoutingTableEntry* route = new RipRoutingTableEntry
(rteAddr, rtePrefixMask, senderAddress, incomingInterface); |
1013 route->SetRouteMetric (static_cast<uint8_t>(rteMetric)
); | 1013 route->SetRouteMetric (rteMetric); |
1014 route->SetRouteStatus (RipRoutingTableEntry::RIP_VALID
); | 1014 route->SetRouteStatus (RipRoutingTableEntry::RIP_VALID
); |
1015 route->SetRouteTag (iter->GetRouteTag ()); | 1015 route->SetRouteTag (iter->GetRouteTag ()); |
1016 route->SetRouteChanged (true); | 1016 route->SetRouteChanged (true); |
1017 delete it->first; | 1017 delete it->first; |
1018 it->first = route; | 1018 it->first = route; |
1019 it->second.Cancel (); | 1019 it->second.Cancel (); |
1020 it->second = Simulator::Schedule (m_timeoutDelay, &Rip
::InvalidateRoute, this, route); | 1020 it->second = Simulator::Schedule (m_timeoutDelay, &Rip
::InvalidateRoute, this, route); |
1021 changed = true; | 1021 changed = true; |
1022 } | 1022 } |
1023 } | 1023 } |
1024 } | 1024 } |
1025 else if (rteMetric > it->first->GetRouteMetric () && senderAddress
== it->first->GetGateway ()) | 1025 else if (rteMetric > it->first->GetRouteMetric () && senderAddress
== it->first->GetGateway ()) |
1026 { | 1026 { |
1027 it->second.Cancel (); | 1027 it->second.Cancel (); |
1028 if (rteMetric < m_linkDown) | 1028 if (rteMetric < m_linkDown) |
1029 { | 1029 { |
1030 it->first->SetRouteMetric (static_cast<uint8_t>(rteMetric)
); | 1030 it->first->SetRouteMetric (rteMetric); |
1031 it->first->SetRouteStatus (RipRoutingTableEntry::RIP_VALID
); | 1031 it->first->SetRouteStatus (RipRoutingTableEntry::RIP_VALID
); |
1032 it->first->SetRouteTag (iter->GetRouteTag ()); | 1032 it->first->SetRouteTag (iter->GetRouteTag ()); |
1033 it->first->SetRouteChanged (true); | 1033 it->first->SetRouteChanged (true); |
1034 it->second.Cancel (); | 1034 it->second.Cancel (); |
1035 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::In
validateRoute, this, it->first); | 1035 it->second = Simulator::Schedule (m_timeoutDelay, &Rip::In
validateRoute, this, it->first); |
1036 } | 1036 } |
1037 else | 1037 else |
1038 { | 1038 { |
1039 InvalidateRoute (it->first); | 1039 InvalidateRoute (it->first); |
1040 } | 1040 } |
1041 changed = true; | 1041 changed = true; |
1042 } | 1042 } |
1043 } | 1043 } |
1044 } | 1044 } |
1045 if (!found && rteMetric != m_linkDown) | 1045 if (!found && rteMetric != m_linkDown) |
1046 { | 1046 { |
1047 NS_LOG_LOGIC ("Received a RTE with new route, adding."); | 1047 NS_LOG_LOGIC ("Received a RTE with new route, adding."); |
1048 | 1048 |
1049 RipRoutingTableEntry* route = new RipRoutingTableEntry (rteAddr, rtePr
efixMask, senderAddress, incomingInterface); | 1049 RipRoutingTableEntry* route = new RipRoutingTableEntry (rteAddr, rtePr
efixMask, senderAddress, incomingInterface); |
1050 route->SetRouteMetric (static_cast<uint8_t>(rteMetric)); | 1050 route->SetRouteMetric (rteMetric); |
1051 route->SetRouteStatus (RipRoutingTableEntry::RIP_VALID); | 1051 route->SetRouteStatus (RipRoutingTableEntry::RIP_VALID); |
1052 route->SetRouteChanged (true); | 1052 route->SetRouteChanged (true); |
1053 m_routes.push_front (std::make_pair (route, EventId ())); | 1053 m_routes.push_front (std::make_pair (route, EventId ())); |
1054 EventId invalidateEvent = Simulator::Schedule (m_timeoutDelay, &Rip::I
nvalidateRoute, this, route); | 1054 EventId invalidateEvent = Simulator::Schedule (m_timeoutDelay, &Rip::I
nvalidateRoute, this, route); |
1055 (m_routes.begin ())->second = invalidateEvent; | 1055 (m_routes.begin ())->second = invalidateEvent; |
1056 changed = true; | 1056 changed = true; |
1057 } | 1057 } |
1058 } | 1058 } |
1059 | 1059 |
1060 if (changed) | 1060 if (changed) |
1061 { | 1061 { |
1062 SendTriggeredRouteUpdate (); | 1062 SendTriggeredRouteUpdate (); |
1063 } | 1063 } |
1064 } | 1064 } |
1065 | 1065 |
1066 void Rip::DoSendRouteUpdate (bool periodic) | 1066 void Rip::DoSendRouteUpdate (bool periodic) |
1067 { | 1067 { |
1068 NS_LOG_FUNCTION (this << (periodic ? " periodic" : " triggered")); | 1068 NS_LOG_FUNCTION (this << (periodic ? " periodic" : " triggered")); |
1069 | 1069 |
1070 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocketList.en
d (); iter++ ) | 1070 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocketList.en
d (); iter++ ) |
1071 { | 1071 { |
1072 uint32_t interface = iter->second; | 1072 uint32_t interface = iter->second; |
1073 | 1073 |
1074 if (m_interfaceExclusions.find (interface) == m_interfaceExclusions.end ()
) | 1074 if (m_interfaceExclusions.find (interface) == m_interfaceExclusions.end ()
) |
1075 { | 1075 { |
1076 uint16_t mtu = m_ipv4->GetMtu (interface); | 1076 uint16_t mtu = m_ipv4->GetMtu (interface); |
1077 uint16_t maxRte = static_cast<uint16_t>((mtu - Ipv4Header ().GetSerial
izedSize () - UdpHeader ().GetSerializedSize () - RipHeader ().GetSerializedSize
()) / RipRte ().GetSerializedSize ()); | 1077 uint16_t maxRte = static_cast<uint16_t> ((mtu - Ipv4Header ().GetSeria
lizedSize () - UdpHeader ().GetSerializedSize () - RipHeader ().GetSerializedSiz
e ()) / RipRte ().GetSerializedSize ()); |
1078 | 1078 |
1079 Ptr<Packet> p = Create<Packet> (); | 1079 Ptr<Packet> p = Create<Packet> (); |
1080 SocketIpTtlTag tag; | 1080 SocketIpTtlTag tag; |
1081 tag.SetTtl (1); | 1081 tag.SetTtl (1); |
1082 p->AddPacketTag (tag); | 1082 p->AddPacketTag (tag); |
1083 | 1083 |
1084 RipHeader hdr; | 1084 RipHeader hdr; |
1085 hdr.SetCommand (RipHeader::RESPONSE); | 1085 hdr.SetCommand (RipHeader::RESPONSE); |
1086 | 1086 |
1087 for (RoutesI rtIter = m_routes.begin (); rtIter != m_routes.end (); rt
Iter++) | 1087 for (RoutesI rtIter = m_routes.begin (); rtIter != m_routes.end (); rt
Iter++) |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 m_tag = routeTag; | 1307 m_tag = routeTag; |
1308 m_changed = true; | 1308 m_changed = true; |
1309 } | 1309 } |
1310 } | 1310 } |
1311 | 1311 |
1312 uint16_t RipRoutingTableEntry::GetRouteTag () const | 1312 uint16_t RipRoutingTableEntry::GetRouteTag () const |
1313 { | 1313 { |
1314 return m_tag; | 1314 return m_tag; |
1315 } | 1315 } |
1316 | 1316 |
1317 void RipRoutingTableEntry::SetRouteMetric (uint8_t routeMetric) | 1317 void RipRoutingTableEntry::SetRouteMetric (uint32_t routeMetric) |
1318 { | 1318 { |
1319 if (m_metric != routeMetric) | 1319 if (m_metric != routeMetric) |
1320 { | 1320 { |
1321 m_metric = routeMetric; | 1321 m_metric = routeMetric; |
1322 m_changed = true; | 1322 m_changed = true; |
1323 } | 1323 } |
1324 } | 1324 } |
1325 | 1325 |
1326 uint8_t RipRoutingTableEntry::GetRouteMetric () const | 1326 uint32_t RipRoutingTableEntry::GetRouteMetric () const |
1327 { | 1327 { |
1328 return m_metric; | 1328 return m_metric; |
1329 } | 1329 } |
1330 | 1330 |
1331 void RipRoutingTableEntry::SetRouteStatus (Status_e status) | 1331 void RipRoutingTableEntry::SetRouteStatus (Status_e status) |
1332 { | 1332 { |
1333 if (m_status != status) | 1333 if (m_status != status) |
1334 { | 1334 { |
1335 m_status = status; | 1335 m_status = status; |
1336 m_changed = true; | 1336 m_changed = true; |
(...skipping 20 matching lines...) Expand all Loading... |
1357 { | 1357 { |
1358 os << static_cast<const Ipv4RoutingTableEntry &>(rte); | 1358 os << static_cast<const Ipv4RoutingTableEntry &>(rte); |
1359 os << ", metric: " << int (rte.GetRouteMetric ()) << ", tag: " << int (rte.Get
RouteTag ()); | 1359 os << ", metric: " << int (rte.GetRouteMetric ()) << ", tag: " << int (rte.Get
RouteTag ()); |
1360 | 1360 |
1361 return os; | 1361 return os; |
1362 } | 1362 } |
1363 | 1363 |
1364 | 1364 |
1365 } | 1365 } |
1366 | 1366 |
LEFT | RIGHT |