OLD | NEW |
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) 2007 Georgia Tech Research Corporation | 3 * Copyright (c) 2007 Georgia Tech Research Corporation |
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 uint32_t | 359 uint32_t |
360 TcpHeader::Deserialize (Buffer::Iterator start) | 360 TcpHeader::Deserialize (Buffer::Iterator start) |
361 { | 361 { |
362 m_optionsLen = 0; | 362 m_optionsLen = 0; |
363 Buffer::Iterator i = start; | 363 Buffer::Iterator i = start; |
364 m_sourcePort = i.ReadNtohU16 (); | 364 m_sourcePort = i.ReadNtohU16 (); |
365 m_destinationPort = i.ReadNtohU16 (); | 365 m_destinationPort = i.ReadNtohU16 (); |
366 m_sequenceNumber = i.ReadNtohU32 (); | 366 m_sequenceNumber = i.ReadNtohU32 (); |
367 m_ackNumber = i.ReadNtohU32 (); | 367 m_ackNumber = i.ReadNtohU32 (); |
368 uint16_t field = i.ReadNtohU16 (); | 368 uint16_t field = i.ReadNtohU16 (); |
369 m_flags = field & 0x3F; | 369 m_flags = field & 0xFF; |
370 m_length = field >> 12; | 370 m_length = field >> 12; |
371 m_windowSize = i.ReadNtohU16 (); | 371 m_windowSize = i.ReadNtohU16 (); |
372 i.Next (2); | 372 i.Next (2); |
373 m_urgentPointer = i.ReadNtohU16 (); | 373 m_urgentPointer = i.ReadNtohU16 (); |
374 | 374 |
375 // Deserialize options if they exist | 375 // Deserialize options if they exist |
376 m_options.clear (); | 376 m_options.clear (); |
377 uint32_t optionLen = (m_length - 5) * 4; | 377 uint32_t optionLen = (m_length - 5) * 4; |
378 if (optionLen > m_maxOptionsLen) | 378 if (optionLen > m_maxOptionsLen) |
379 { | 379 { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 | 539 |
540 std::ostream& | 540 std::ostream& |
541 operator<< (std::ostream& os, TcpHeader const & tc) | 541 operator<< (std::ostream& os, TcpHeader const & tc) |
542 { | 542 { |
543 tc.Print (os); | 543 tc.Print (os); |
544 return os; | 544 return os; |
545 } | 545 } |
546 | 546 |
547 } // namespace ns3 | 547 } // namespace ns3 |
OLD | NEW |