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) 2014 Universita' di Firenze, Italy | 3 * Copyright (c) 2014 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Inet6SocketAddress local = Inet6SocketAddress (RIPNG_ALL_NODE, RIPNG_PORT)
; | 161 Inet6SocketAddress local = Inet6SocketAddress (RIPNG_ALL_NODE, RIPNG_PORT)
; |
162 m_recvSocket->Bind (local); | 162 m_recvSocket->Bind (local); |
163 m_recvSocket->SetRecvCallback (MakeCallback (&RipNg::Receive, this)); | 163 m_recvSocket->SetRecvCallback (MakeCallback (&RipNg::Receive, this)); |
164 m_recvSocket->SetIpv6RecvHopLimit (true); | 164 m_recvSocket->SetIpv6RecvHopLimit (true); |
165 m_recvSocket->SetRecvPktInfo (true); | 165 m_recvSocket->SetRecvPktInfo (true); |
166 } | 166 } |
167 | 167 |
168 | 168 |
169 if (addedGlobal) | 169 if (addedGlobal) |
170 { | 170 { |
171 Time delay1 = Seconds (m_rng->GetValue (m_minTriggeredUpdateDelay.GetSecon
ds (), m_maxTriggeredUpdateDelay.GetSeconds ())); | 171 delay = Seconds (m_rng->GetValue (m_minTriggeredUpdateDelay.GetSeconds (),
m_maxTriggeredUpdateDelay.GetSeconds ())); |
172 m_nextTriggeredUpdate = Simulator::Schedule (delay1, &RipNg::DoSendRouteUp
date, this, false); | 172 m_nextTriggeredUpdate = Simulator::Schedule (delay, &RipNg::DoSendRouteUpd
ate, this, false); |
173 } | 173 } |
174 | 174 |
175 delay = Seconds (m_rng->GetValue (0.01, m_startupDelay.GetSeconds ())); | 175 delay = Seconds (m_rng->GetValue (0.01, m_startupDelay.GetSeconds ())); |
176 m_nextTriggeredUpdate = Simulator::Schedule (delay, &RipNg::SendRouteRequest,
this); | 176 m_nextTriggeredUpdate = Simulator::Schedule (delay, &RipNg::SendRouteRequest,
this); |
177 | 177 |
178 Ipv6RoutingProtocol::DoInitialize (); | 178 Ipv6RoutingProtocol::DoInitialize (); |
179 } | 179 } |
180 | 180 |
181 Ptr<Ipv6Route> RipNg::RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<
NetDevice> oif, Socket::SocketErrno &sockerr) | 181 Ptr<Ipv6Route> RipNg::RouteOutput (Ptr<Packet> p, const Ipv6Header &header, Ptr<
NetDevice> oif, Socket::SocketErrno &sockerr) |
182 { | 182 { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 { | 769 { |
770 if (rtes.begin ()->GetPrefix () == Ipv6Address::GetAny () && | 770 if (rtes.begin ()->GetPrefix () == Ipv6Address::GetAny () && |
771 rtes.begin ()->GetPrefixLen () == 0 && | 771 rtes.begin ()->GetPrefixLen () == 0 && |
772 rtes.begin ()->GetRouteMetric () == m_linkDown) | 772 rtes.begin ()->GetRouteMetric () == m_linkDown) |
773 { | 773 { |
774 // Output whole thing. Use Split Horizon | 774 // Output whole thing. Use Split Horizon |
775 if (m_interfaceExclusions.find (incomingInterface) == m_interfaceExclu
sions.end ()) | 775 if (m_interfaceExclusions.find (incomingInterface) == m_interfaceExclu
sions.end ()) |
776 { | 776 { |
777 // we use one of the sending sockets, as they're bound to the righ
t interface | 777 // we use one of the sending sockets, as they're bound to the righ
t interface |
778 // and the local address might be used on different interfaces. | 778 // and the local address might be used on different interfaces. |
779 Ptr<Socket> sendingSoket; | 779 Ptr<Socket> sendingSocket; |
780 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendS
ocketList.end (); iter++ ) | 780 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendS
ocketList.end (); iter++ ) |
781 { | 781 { |
782 if (iter->second == incomingInterface) | 782 if (iter->second == incomingInterface) |
783 { | 783 { |
784 sendingSoket = iter->first; | 784 sendingSocket = iter->first; |
785 } | 785 } |
786 } | 786 } |
787 NS_ASSERT_MSG (sendingSoket, "HandleRequest - Impossible to find a
socket to send the reply"); | 787 NS_ASSERT_MSG (sendingSocket, "HandleRequest - Impossible to find
a socket to send the reply"); |
788 | 788 |
789 uint16_t mtu = m_ipv6->GetMtu (incomingInterface); | 789 uint16_t mtu = m_ipv6->GetMtu (incomingInterface); |
790 uint16_t maxRte = static_cast<uint16_t>((mtu - Ipv6Header ().GetSe
rializedSize () - UdpHeader ().GetSerializedSize () - RipNgHeader ().GetSerializ
edSize ()) / RipNgRte ().GetSerializedSize ()); | 790 uint16_t maxRte = static_cast<uint16_t> ((mtu - Ipv6Header ().GetS
erializedSize () - UdpHeader ().GetSerializedSize () - RipNgHeader ().GetSeriali
zedSize ()) / RipNgRte ().GetSerializedSize ()); |
791 | 791 |
792 Ptr<Packet> p = Create<Packet> (); | 792 Ptr<Packet> p = Create<Packet> (); |
793 SocketIpv6HopLimitTag tag; | 793 SocketIpv6HopLimitTag tag; |
794 p->RemovePacketTag (tag); | 794 p->RemovePacketTag (tag); |
795 tag.SetHopLimit (255); | 795 tag.SetHopLimit (255); |
796 p->AddPacketTag (tag); | 796 p->AddPacketTag (tag); |
797 | 797 |
798 RipNgHeader hdr; | 798 RipNgHeader hdr; |
799 hdr.SetCommand (RipNgHeader::RESPONSE); | 799 hdr.SetCommand (RipNgHeader::RESPONSE); |
800 | 800 |
(...skipping 26 matching lines...) Expand all Loading... |
827 if ((m_splitHorizonStrategy != SPLIT_HORIZON) || | 827 if ((m_splitHorizonStrategy != SPLIT_HORIZON) || |
828 (m_splitHorizonStrategy == SPLIT_HORIZON && !splitHori
zoning)) | 828 (m_splitHorizonStrategy == SPLIT_HORIZON && !splitHori
zoning)) |
829 { | 829 { |
830 hdr.AddRte (rte); | 830 hdr.AddRte (rte); |
831 } | 831 } |
832 } | 832 } |
833 if (hdr.GetRteNumber () == maxRte) | 833 if (hdr.GetRteNumber () == maxRte) |
834 { | 834 { |
835 p->AddHeader (hdr); | 835 p->AddHeader (hdr); |
836 NS_LOG_DEBUG ("SendTo: " << *p); | 836 NS_LOG_DEBUG ("SendTo: " << *p); |
837 sendingSoket->SendTo (p, 0, Inet6SocketAddress (senderAddr
ess, RIPNG_PORT)); | 837 sendingSocket->SendTo (p, 0, Inet6SocketAddress (senderAdd
ress, RIPNG_PORT)); |
838 p->RemoveHeader (hdr); | 838 p->RemoveHeader (hdr); |
839 hdr.ClearRtes (); | 839 hdr.ClearRtes (); |
840 } | 840 } |
841 } | 841 } |
842 if (hdr.GetRteNumber () > 0) | 842 if (hdr.GetRteNumber () > 0) |
843 { | 843 { |
844 p->AddHeader (hdr); | 844 p->AddHeader (hdr); |
845 NS_LOG_DEBUG ("SendTo: " << *p); | 845 NS_LOG_DEBUG ("SendTo: " << *p); |
846 sendingSoket->SendTo (p, 0, Inet6SocketAddress (senderAddress,
RIPNG_PORT)); | 846 sendingSocket->SendTo (p, 0, Inet6SocketAddress (senderAddress
, RIPNG_PORT)); |
847 } | 847 } |
848 } | 848 } |
849 } | 849 } |
850 } | 850 } |
851 else | 851 else |
852 { | 852 { |
853 // note: we got the request as a single packet, so no check is necessary f
or MTU limit | 853 // note: we got the request as a single packet, so no check is necessary f
or MTU limit |
854 | 854 |
855 // we use one of the sending sockets, as they're bound to the right interf
ace | 855 // we use one of the sending sockets, as they're bound to the right interf
ace |
856 // and the local address might be used on different interfaces. | 856 // and the local address might be used on different interfaces. |
857 Ptr<Socket> sendingSoket; | 857 Ptr<Socket> sendingSocket; |
858 if (senderAddress.IsLinkLocal ()) | 858 if (senderAddress.IsLinkLocal ()) |
859 { | 859 { |
860 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocke
tList.end (); iter++ ) | 860 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocke
tList.end (); iter++ ) |
861 { | 861 { |
862 if (iter->second == incomingInterface) | 862 if (iter->second == incomingInterface) |
863 { | 863 { |
864 sendingSoket = iter->first; | 864 sendingSocket = iter->first; |
865 } | 865 } |
866 } | 866 } |
867 } | 867 } |
868 else | 868 else |
869 { | 869 { |
870 sendingSoket = m_recvSocket; | 870 sendingSocket = m_recvSocket; |
871 } | 871 } |
872 | 872 |
873 Ptr<Packet> p = Create<Packet> (); | 873 Ptr<Packet> p = Create<Packet> (); |
874 SocketIpv6HopLimitTag tag; | 874 SocketIpv6HopLimitTag tag; |
875 p->RemovePacketTag (tag); | 875 p->RemovePacketTag (tag); |
876 tag.SetHopLimit (255); | 876 tag.SetHopLimit (255); |
877 p->AddPacketTag (tag); | 877 p->AddPacketTag (tag); |
878 | 878 |
879 RipNgHeader hdr; | 879 RipNgHeader hdr; |
880 hdr.SetCommand (RipNgHeader::RESPONSE); | 880 hdr.SetCommand (RipNgHeader::RESPONSE); |
(...skipping 25 matching lines...) Expand all Loading... |
906 } | 906 } |
907 if (!found) | 907 if (!found) |
908 { | 908 { |
909 iter->SetRouteMetric (m_linkDown); | 909 iter->SetRouteMetric (m_linkDown); |
910 iter->SetRouteTag (0); | 910 iter->SetRouteTag (0); |
911 hdr.AddRte (*iter); | 911 hdr.AddRte (*iter); |
912 } | 912 } |
913 } | 913 } |
914 p->AddHeader (hdr); | 914 p->AddHeader (hdr); |
915 NS_LOG_DEBUG ("SendTo: " << *p); | 915 NS_LOG_DEBUG ("SendTo: " << *p); |
916 sendingSoket->SendTo (p, 0, Inet6SocketAddress (senderAddress, senderPort)
); | 916 sendingSocket->SendTo (p, 0, Inet6SocketAddress (senderAddress, senderPort
)); |
917 } | 917 } |
918 | 918 |
919 } | 919 } |
920 | 920 |
921 void RipNg::HandleResponses (RipNgHeader hdr, Ipv6Address senderAddress, uint32_
t incomingInterface, uint8_t hopLimit) | 921 void RipNg::HandleResponses (RipNgHeader hdr, Ipv6Address senderAddress, uint32_
t incomingInterface, uint8_t hopLimit) |
922 { | 922 { |
923 NS_LOG_FUNCTION (this << senderAddress << incomingInterface << int (hopLimit)
<< hdr); | 923 NS_LOG_FUNCTION (this << senderAddress << incomingInterface << int (hopLimit)
<< hdr); |
924 | 924 |
925 if (m_interfaceExclusions.find (incomingInterface) != m_interfaceExclusions.en
d ()) | 925 if (m_interfaceExclusions.find (incomingInterface) != m_interfaceExclusions.en
d ()) |
926 { | 926 { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 { | 994 { |
995 found = true; | 995 found = true; |
996 if (rteMetric < it->first->GetRouteMetric ()) | 996 if (rteMetric < it->first->GetRouteMetric ()) |
997 { | 997 { |
998 if (senderAddress != it->first->GetGateway ()) | 998 if (senderAddress != it->first->GetGateway ()) |
999 { | 999 { |
1000 RipNgRoutingTableEntry* route = new RipNgRoutingTableEntry
(rteAddr, rtePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny ()); | 1000 RipNgRoutingTableEntry* route = new RipNgRoutingTableEntry
(rteAddr, rtePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny ()); |
1001 delete it->first; | 1001 delete it->first; |
1002 it->first = route; | 1002 it->first = route; |
1003 } | 1003 } |
1004 it->first->SetRouteMetric (static_cast<uint8_t>(rteMetric)); | 1004 it->first->SetRouteMetric (rteMetric); |
1005 it->first->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_VALID
); | 1005 it->first->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_VALID
); |
1006 it->first->SetRouteTag (iter->GetRouteTag ()); | 1006 it->first->SetRouteTag (iter->GetRouteTag ()); |
1007 it->first->SetRouteChanged (true); | 1007 it->first->SetRouteChanged (true); |
1008 it->second.Cancel (); | 1008 it->second.Cancel (); |
1009 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::Inva
lidateRoute, this, it->first); | 1009 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::Inva
lidateRoute, this, it->first); |
1010 changed = true; | 1010 changed = true; |
1011 } | 1011 } |
1012 else if (rteMetric == it->first->GetRouteMetric ()) | 1012 else if (rteMetric == it->first->GetRouteMetric ()) |
1013 { | 1013 { |
1014 if (senderAddress == it->first->GetGateway ()) | 1014 if (senderAddress == it->first->GetGateway ()) |
1015 { | 1015 { |
1016 it->second.Cancel (); | 1016 it->second.Cancel (); |
1017 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::
InvalidateRoute, this, it->first); | 1017 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::
InvalidateRoute, this, it->first); |
1018 } | 1018 } |
1019 else | 1019 else |
1020 { | 1020 { |
1021 if (Simulator::GetDelayLeft (it->second) < m_timeoutDelay/
2) | 1021 if (Simulator::GetDelayLeft (it->second) < m_timeoutDelay/
2) |
1022 { | 1022 { |
1023 RipNgRoutingTableEntry* route = new RipNgRoutingTableE
ntry (rteAddr, rtePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny
()); | 1023 RipNgRoutingTableEntry* route = new RipNgRoutingTableE
ntry (rteAddr, rtePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny
()); |
1024 route->SetRouteMetric (static_cast<uint8_t>(rteMetric)
); | 1024 route->SetRouteMetric (rteMetric); |
1025 route->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_V
ALID); | 1025 route->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_V
ALID); |
1026 route->SetRouteTag (iter->GetRouteTag ()); | 1026 route->SetRouteTag (iter->GetRouteTag ()); |
1027 route->SetRouteChanged (true); | 1027 route->SetRouteChanged (true); |
1028 delete it->first; | 1028 delete it->first; |
1029 it->first = route; | 1029 it->first = route; |
1030 it->second.Cancel (); | 1030 it->second.Cancel (); |
1031 it->second = Simulator::Schedule (m_timeoutDelay, &Rip
Ng::InvalidateRoute, this, route); | 1031 it->second = Simulator::Schedule (m_timeoutDelay, &Rip
Ng::InvalidateRoute, this, route); |
1032 changed = true; | 1032 changed = true; |
1033 } | 1033 } |
1034 } | 1034 } |
1035 } | 1035 } |
1036 else if (rteMetric > it->first->GetRouteMetric () && senderAddress
== it->first->GetGateway ()) | 1036 else if (rteMetric > it->first->GetRouteMetric () && senderAddress
== it->first->GetGateway ()) |
1037 { | 1037 { |
1038 it->second.Cancel (); | 1038 it->second.Cancel (); |
1039 if (rteMetric < m_linkDown) | 1039 if (rteMetric < m_linkDown) |
1040 { | 1040 { |
1041 it->first->SetRouteMetric (static_cast<uint8_t>(rteMetric)
); | 1041 it->first->SetRouteMetric (rteMetric); |
1042 it->first->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_V
ALID); | 1042 it->first->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_V
ALID); |
1043 it->first->SetRouteTag (iter->GetRouteTag ()); | 1043 it->first->SetRouteTag (iter->GetRouteTag ()); |
1044 it->first->SetRouteChanged (true); | 1044 it->first->SetRouteChanged (true); |
1045 it->second.Cancel (); | 1045 it->second.Cancel (); |
1046 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::
InvalidateRoute, this, it->first); | 1046 it->second = Simulator::Schedule (m_timeoutDelay, &RipNg::
InvalidateRoute, this, it->first); |
1047 } | 1047 } |
1048 else | 1048 else |
1049 { | 1049 { |
1050 InvalidateRoute (it->first); | 1050 InvalidateRoute (it->first); |
1051 } | 1051 } |
1052 changed = true; | 1052 changed = true; |
1053 } | 1053 } |
1054 } | 1054 } |
1055 } | 1055 } |
1056 if (!found && rteMetric != m_linkDown) | 1056 if (!found && rteMetric != m_linkDown) |
1057 { | 1057 { |
1058 NS_LOG_LOGIC ("Received a RTE with new route, adding."); | 1058 NS_LOG_LOGIC ("Received a RTE with new route, adding."); |
1059 | 1059 |
1060 RipNgRoutingTableEntry* route = new RipNgRoutingTableEntry (rteAddr, r
tePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny ()); | 1060 RipNgRoutingTableEntry* route = new RipNgRoutingTableEntry (rteAddr, r
tePrefix, senderAddress, incomingInterface, Ipv6Address::GetAny ()); |
1061 route->SetRouteMetric (static_cast<uint8_t>(rteMetric)); | 1061 route->SetRouteMetric (rteMetric); |
1062 route->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_VALID); | 1062 route->SetRouteStatus (RipNgRoutingTableEntry::RIPNG_VALID); |
1063 route->SetRouteChanged (true); | 1063 route->SetRouteChanged (true); |
1064 m_routes.push_front (std::make_pair (route, EventId ())); | 1064 m_routes.push_front (std::make_pair (route, EventId ())); |
1065 EventId invalidateEvent = Simulator::Schedule (m_timeoutDelay, &RipNg:
:InvalidateRoute, this, route); | 1065 EventId invalidateEvent = Simulator::Schedule (m_timeoutDelay, &RipNg:
:InvalidateRoute, this, route); |
1066 (m_routes.begin ())->second = invalidateEvent; | 1066 (m_routes.begin ())->second = invalidateEvent; |
1067 changed = true; | 1067 changed = true; |
1068 } | 1068 } |
1069 } | 1069 } |
1070 | 1070 |
1071 if (changed) | 1071 if (changed) |
1072 { | 1072 { |
1073 SendTriggeredRouteUpdate (); | 1073 SendTriggeredRouteUpdate (); |
1074 } | 1074 } |
1075 } | 1075 } |
1076 | 1076 |
1077 void RipNg::DoSendRouteUpdate (bool periodic) | 1077 void RipNg::DoSendRouteUpdate (bool periodic) |
1078 { | 1078 { |
1079 NS_LOG_FUNCTION (this << (periodic ? " periodic" : " triggered")); | 1079 NS_LOG_FUNCTION (this << (periodic ? " periodic" : " triggered")); |
1080 | 1080 |
1081 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocketList.en
d (); iter++ ) | 1081 for (SocketListI iter = m_sendSocketList.begin (); iter != m_sendSocketList.en
d (); iter++ ) |
1082 { | 1082 { |
1083 uint32_t interface = iter->second; | 1083 uint32_t interface = iter->second; |
1084 | 1084 |
1085 if (m_interfaceExclusions.find (interface) == m_interfaceExclusions.end ()
) | 1085 if (m_interfaceExclusions.find (interface) == m_interfaceExclusions.end ()
) |
1086 { | 1086 { |
1087 uint16_t mtu = m_ipv6->GetMtu (interface); | 1087 uint16_t mtu = m_ipv6->GetMtu (interface); |
1088 uint16_t maxRte = static_cast<uint16_t>((mtu - Ipv6Header ().GetSerial
izedSize () - UdpHeader ().GetSerializedSize () - RipNgHeader ().GetSerializedSi
ze ()) / RipNgRte ().GetSerializedSize ()); | 1088 uint16_t maxRte = static_cast<uint16_t> ((mtu - Ipv6Header ().GetSeria
lizedSize () - UdpHeader ().GetSerializedSize () - RipNgHeader ().GetSerializedS
ize ()) / RipNgRte ().GetSerializedSize ()); |
1089 | 1089 |
1090 Ptr<Packet> p = Create<Packet> (); | 1090 Ptr<Packet> p = Create<Packet> (); |
1091 SocketIpv6HopLimitTag tag; | 1091 SocketIpv6HopLimitTag tag; |
1092 tag.SetHopLimit (255); | 1092 tag.SetHopLimit (255); |
1093 p->AddPacketTag (tag); | 1093 p->AddPacketTag (tag); |
1094 | 1094 |
1095 RipNgHeader hdr; | 1095 RipNgHeader hdr; |
1096 hdr.SetCommand (RipNgHeader::RESPONSE); | 1096 hdr.SetCommand (RipNgHeader::RESPONSE); |
1097 | 1097 |
1098 for (RoutesI rtIter = m_routes.begin (); rtIter != m_routes.end (); rt
Iter++) | 1098 for (RoutesI rtIter = m_routes.begin (); rtIter != m_routes.end (); rt
Iter++) |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 | 1316 |
1317 void RipNgRoutingTableEntry::SetRouteMetric (uint8_t routeMetric) | 1317 void RipNgRoutingTableEntry::SetRouteMetric (uint8_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 void RipNgRoutingTableEntry::SetRouteMetric(uint16_t routeMetric) |
| 1327 { |
| 1328 SetRouteMetric(static_cast<uint8_t> (routeMetric)); |
| 1329 } |
| 1330 |
| 1331 void RipNgRoutingTableEntry::SetRouteMetric(int routeMetric) |
| 1332 { |
| 1333 SetRouteMetric(static_cast<uint8_t> (routeMetric)); |
| 1334 } |
| 1335 |
1326 uint8_t RipNgRoutingTableEntry::GetRouteMetric () const | 1336 uint8_t RipNgRoutingTableEntry::GetRouteMetric () const |
1327 { | 1337 { |
1328 return m_metric; | 1338 return m_metric; |
1329 } | 1339 } |
1330 | 1340 |
1331 void RipNgRoutingTableEntry::SetRouteStatus (Status_e status) | 1341 void RipNgRoutingTableEntry::SetRouteStatus (Status_e status) |
1332 { | 1342 { |
1333 if (m_status != status) | 1343 if (m_status != status) |
1334 { | 1344 { |
1335 m_status = status; | 1345 m_status = status; |
(...skipping 21 matching lines...) Expand all Loading... |
1357 { | 1367 { |
1358 os << static_cast<const Ipv6RoutingTableEntry &>(rte); | 1368 os << static_cast<const Ipv6RoutingTableEntry &>(rte); |
1359 os << ", metric: " << int (rte.GetRouteMetric ()) << ", tag: " << int (rte.Get
RouteTag ()); | 1369 os << ", metric: " << int (rte.GetRouteMetric ()) << ", tag: " << int (rte.Get
RouteTag ()); |
1360 | 1370 |
1361 return os; | 1371 return os; |
1362 } | 1372 } |
1363 | 1373 |
1364 | 1374 |
1365 } | 1375 } |
1366 | 1376 |
LEFT | RIGHT |