equal
deleted
inserted
replaced
394 } |
394 } |
395 else if (ipv4->GetRoutingProtocol () != 0) |
395 else if (ipv4->GetRoutingProtocol () != 0) |
396 { |
396 { |
397 Ipv4Header header; |
397 Ipv4Header header; |
398 header.SetDestination (dest); |
398 header.SetDestination (dest); |
399 Socket::SocketErrno errno; |
399 Socket::SocketErrno errno_; |
400 Ptr<Ipv4Route> route; |
400 Ptr<Ipv4Route> route; |
401 uint32_t oif = 0; //specify non-zero if bound to a source address |
401 uint32_t oif = 0; //specify non-zero if bound to a source address |
402 // TBD-- we could cache the route and just check its validity |
402 // TBD-- we could cache the route and just check its validity |
403 route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno); |
403 route = ipv4->GetRoutingProtocol ()->RouteOutput (p, header, oif, errno_); |
404 if (route != 0) |
404 if (route != 0) |
405 { |
405 { |
406 NS_LOG_LOGIC ("Route exists"); |
406 NS_LOG_LOGIC ("Route exists"); |
407 header.SetSource (route->GetSource ()); |
407 header.SetSource (route->GetSource ()); |
408 m_udp->Send (p->Copy (), header.GetSource (), header.GetDestination (), |
408 m_udp->Send (p->Copy (), header.GetSource (), header.GetDestination (), |
411 return p->GetSize(); |
411 return p->GetSize(); |
412 } |
412 } |
413 else |
413 else |
414 { |
414 { |
415 NS_LOG_LOGIC ("No route to destination"); |
415 NS_LOG_LOGIC ("No route to destination"); |
416 NS_LOG_ERROR (errno); |
416 NS_LOG_ERROR (errno_); |
417 m_errno = errno; |
417 m_errno = errno_; |
418 return -1; |
418 return -1; |
419 } |
419 } |
420 } |
420 } |
421 else |
421 else |
422 { |
422 { |