changeset 8756 | 9a34e618f40b |
parent 8753 | 8d84b96e26bf |
child 8792 | 8f15de62d18e |
8755:78bf735a3d5e | 8756:9a34e618f40b |
---|---|
619 PrintVector (m_finalRoute); |
619 PrintVector (m_finalRoute); |
620 Ipv4Address dst = m_finalRoute.back (); |
620 Ipv4Address dst = m_finalRoute.back (); |
621 bool addRoute = false; |
621 bool addRoute = false; |
622 if (numberAddress > 0) |
622 if (numberAddress > 0) |
623 { |
623 { |
624 RouteCacheEntry toSource (/*IP_VECTOR=*/m_finalRoute, /*dst=*/ |
624 RouteCacheEntry toSource (/*IP_VECTOR=*/ m_finalRoute, /*dst=*/ |
625 dst, /*expire time=*/ActiveRouteTimeout); |
625 dst, /*expire time=*/ ActiveRouteTimeout); |
626 if (dsr->IsLinkCache ()) |
626 if (dsr->IsLinkCache ()) |
627 { |
627 { |
628 addRoute = dsr->AddRoute_Link (m_finalRoute, ipv4Address); |
628 addRoute = dsr->AddRoute_Link (m_finalRoute, ipv4Address); |
629 } |
629 } |
630 else |
630 else |
982 * \\ "srcAddress" + "intermediate node address" + "targetAddress" |
982 * \\ "srcAddress" + "intermediate node address" + "targetAddress" |
983 */ |
983 */ |
984 RouteCacheEntry toDestination (/*IP_VECTOR=*/ nodeList, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout); |
984 RouteCacheEntry toDestination (/*IP_VECTOR=*/ nodeList, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout); |
985 NS_ASSERT (nodeList.front () == ipv4Address); |
985 NS_ASSERT (nodeList.front () == ipv4Address); |
986 bool addRoute = false; |
986 bool addRoute = false; |
987 if(dsr->IsLinkCache()) |
987 if (dsr->IsLinkCache ()) |
988 { |
988 { |
989 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address); |
989 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address); |
990 } |
990 } |
991 else |
991 else |
992 { |
992 { |
1049 Ipv4Address dst = cutRoute.back (); |
1049 Ipv4Address dst = cutRoute.back (); |
1050 NS_LOG_DEBUG ("The route destination after cut " << dst); |
1050 NS_LOG_DEBUG ("The route destination after cut " << dst); |
1051 RouteCacheEntry toDestination (/*IP_VECTOR=*/ cutRoute, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout); |
1051 RouteCacheEntry toDestination (/*IP_VECTOR=*/ cutRoute, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout); |
1052 NS_ASSERT (cutRoute.front () == ipv4Address); |
1052 NS_ASSERT (cutRoute.front () == ipv4Address); |
1053 bool addRoute = false; |
1053 bool addRoute = false; |
1054 if(dsr->IsLinkCache()) |
1054 if (dsr->IsLinkCache ()) |
1055 { |
1055 { |
1056 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address); |
1056 addRoute = dsr->AddRoute_Link (nodeList, ipv4Address); |
1057 } |
1057 } |
1058 else |
1058 else |
1059 { |
1059 { |
1205 uint32_t size = p->GetSize (); |
1205 uint32_t size = p->GetSize (); |
1206 uint8_t *data = new uint8_t[size]; |
1206 uint8_t *data = new uint8_t[size]; |
1207 p->CopyData (data, size); |
1207 p->CopyData (data, size); |
1208 uint8_t optionType = 0; |
1208 uint8_t optionType = 0; |
1209 optionType = *(data); |
1209 optionType = *(data); |
1210 NS_LOG_DEBUG ("The packet size over here " << p->GetSize()); |
1210 NS_LOG_DEBUG ("The packet size over here " << p->GetSize ()); |
1211 |
1211 |
1212 NS_LOG_DEBUG ("The option type over here " << (uint32_t)optionType); |
1212 NS_LOG_DEBUG ("The option type over here " << (uint32_t)optionType); |
1213 if (optionType == 160) |
1213 if (optionType == 160) |
1214 { |
1214 { |
1215 NS_LOG_DEBUG ("Here we remove the ack request header and add ack header to the packet"); |
1215 NS_LOG_DEBUG ("Here we remove the ack request header and add ack header to the packet"); |
1287 m_dropTrace (packet); |
1287 m_dropTrace (packet); |
1288 return 0; |
1288 return 0; |
1289 } |
1289 } |
1290 // Set the route and forward the data packet |
1290 // Set the route and forward the data packet |
1291 SetRoute (nextAddress, ipv4Address); |
1291 SetRoute (nextAddress, ipv4Address); |
1292 NS_LOG_DEBUG ("dsr packet size " << dsrP->GetSize()); |
1292 NS_LOG_DEBUG ("dsr packet size " << dsrP->GetSize ()); |
1293 dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol, m_ipv4Route); |
1293 dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol, m_ipv4Route); |
1294 } |
1294 } |
1295 return sourceRoute.GetSerializedSize (); |
1295 return sourceRoute.GetSerializedSize (); |
1296 } |
1296 } |
1297 |
1297 |