|
100 |
{ |
100 |
{ |
101 |
case AODVTYPE_RREQ: |
101 |
case AODVTYPE_RREQ: |
102 |
{ |
102 |
{ |
103 |
os << "RREQ" << "\n"; |
103 |
os << "RREQ"; |
104 |
break; |
104 |
break; |
105 |
} |
105 |
} |
106 |
case AODVTYPE_RREP: |
106 |
case AODVTYPE_RREP: |
107 |
{ |
107 |
{ |
108 |
os << "RREP" << "\n"; |
108 |
os << "RREP"; |
109 |
break; |
109 |
break; |
110 |
} |
110 |
} |
111 |
case AODVTYPE_RERR: |
111 |
case AODVTYPE_RERR: |
112 |
{ |
112 |
{ |
113 |
os << "RERR" << "\n"; |
113 |
os << "RERR"; |
114 |
break; |
114 |
break; |
115 |
} |
115 |
} |
116 |
case AODVTYPE_RREP_ACK: |
116 |
case AODVTYPE_RREP_ACK: |
117 |
{ |
117 |
{ |
118 |
os << "RREP_ACK" << "\n"; |
118 |
os << "RREP_ACK"; |
119 |
break; |
119 |
break; |
120 |
} |
120 |
} |
121 |
default: |
121 |
default: |
|
204 |
void |
204 |
void |
205 |
RreqHeader::Print (std::ostream &os) const |
205 |
RreqHeader::Print (std::ostream &os) const |
206 |
{ |
206 |
{ |
207 |
os << "RREQ ID " << m_requestID << "\n" << "destination: ipv4 " << m_dst |
207 |
os << "RREQ ID " << m_requestID << " destination: ipv4 " << m_dst |
208 |
<< " " << "sequence number " << m_dstSeqNo << "\n" << "source: ipv4 " |
208 |
<< " sequence number " << m_dstSeqNo << " source: ipv4 " |
209 |
<< m_origin << " " << "sequence number " << m_originSeqNo << "\n" |
209 |
<< m_origin << " sequence number " << m_originSeqNo |
210 |
<< "flags:\n" << "Gratuitous RREP " << (*this).GetGratiousRrep () << "\n" |
210 |
<< " flags:" << " Gratuitous RREP " << (*this).GetGratiousRrep () |
211 |
<< "Destination only " << (*this).GetDestinationOnly () << "\n" |
211 |
<< " Destination only " << (*this).GetDestinationOnly () |
212 |
<< "Unknown sequence number " << (*this).GetUnknownSeqno () << "\n"; |
212 |
<< " Unknown sequence number " << (*this).GetUnknownSeqno (); |
213 |
} |
213 |
} |
214 |
|
214 |
|
215 |
std::ostream & |
215 |
std::ostream & |
|
342 |
void |
342 |
void |
343 |
RrepHeader::Print (std::ostream &os) const |
343 |
RrepHeader::Print (std::ostream &os) const |
344 |
{ |
344 |
{ |
345 |
os << "destination: ipv4 " << m_dst << "sequence number " << m_dstSeqNo; |
345 |
os << "destination: ipv4 " << m_dst << " sequence number " << m_dstSeqNo; |
346 |
if (m_prefixSize != 0) |
346 |
if (m_prefixSize != 0) |
347 |
os << "prefix size " << m_prefixSize << "\n"; |
347 |
{ |
348 |
else |
348 |
os << " prefix size " << m_prefixSize; |
349 |
os << "\n"; |
349 |
} |
350 |
os << "source ipv4 " << m_origin << "\n" << "life time " << m_lifeTime |
350 |
os << " source ipv4 " << m_origin << " lifetime " << m_lifeTime |
351 |
<< "\n" << "acknowledgment required flag " << (*this).GetAckRequired () |
351 |
<< " acknowledgment required flag " << (*this).GetAckRequired (); |
352 |
<< "\n"; |
|
|
353 |
} |
352 |
} |
354 |
|
353 |
|
355 |
void |
354 |
void |
|
556 |
void |
555 |
void |
557 |
RerrHeader::Print (std::ostream &os ) const |
556 |
RerrHeader::Print (std::ostream &os ) const |
558 |
{ |
557 |
{ |
559 |
os << "Unreachable destination (ipv4 address, seq. number):\n"; |
558 |
os << "Unreachable destination (ipv4 address, seq. number):"; |
560 |
std::map<Ipv4Address, uint32_t>::const_iterator j; |
559 |
std::map<Ipv4Address, uint32_t>::const_iterator j; |
561 |
for (j = m_unreachableDstSeqNo.begin (); j != m_unreachableDstSeqNo.end (); ++j) |
560 |
for (j = m_unreachableDstSeqNo.begin (); j != m_unreachableDstSeqNo.end (); ++j) |
562 |
{ |
561 |
{ |
563 |
os << (*j).first << ", " << (*j).second << "\n"; |
562 |
os << (*j).first << ", " << (*j).second; |
564 |
} |
563 |
} |
565 |
os << "No delete flag " << (*this).GetNoDelete () << "\n"; |
564 |
os << "No delete flag " << (*this).GetNoDelete (); |
566 |
} |
565 |
} |
567 |
|
566 |
|
568 |
void |
567 |
void |