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, 2008 University of Washington | 3 * Copyright (c) 2007, 2008 University of Washington |
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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 */ | 17 */ |
18 | 18 |
19 #include "ns3/log.h" | 19 #include "ns3/log.h" |
20 #include "ns3/queue.h" | 20 #include "ns3/queue.h" |
21 #include "ns3/simulator.h" | 21 #include "ns3/simulator.h" |
22 #include "ns3/mac48-address.h" | 22 #include "ns3/mac48-address.h" |
23 #include "ns3/llc-snap-header.h" | 23 #include "ns3/llc-snap-header.h" |
24 #include "ns3/error-model.h" | 24 #include "ns3/error-model.h" |
25 #include "ns3/trace-source-accessor.h" | 25 #include "ns3/trace-source-accessor.h" |
26 #include "ns3/uinteger.h" | 26 #include "ns3/uinteger.h" |
27 #include "ns3/pointer.h" | 27 #include "ns3/pointer.h" |
| 28 #include "ns3/class-of-service-tag.h" |
28 #include "point-to-point-net-device.h" | 29 #include "point-to-point-net-device.h" |
29 #include "point-to-point-channel.h" | 30 #include "point-to-point-channel.h" |
30 #include "ppp-header.h" | 31 #include "ppp-header.h" |
31 | 32 |
32 namespace ns3 { | 33 namespace ns3 { |
33 | 34 |
34 NS_LOG_COMPONENT_DEFINE ("PointToPointNetDevice"); | 35 NS_LOG_COMPONENT_DEFINE ("PointToPointNetDevice"); |
35 | 36 |
36 NS_OBJECT_ENSURE_REGISTERED (PointToPointNetDevice); | 37 NS_OBJECT_ENSURE_REGISTERED (PointToPointNetDevice); |
37 | 38 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 bool | 508 bool |
508 PointToPointNetDevice::Send ( | 509 PointToPointNetDevice::Send ( |
509 Ptr<Packet> packet,· | 510 Ptr<Packet> packet,· |
510 const Address &dest,· | 511 const Address &dest,· |
511 uint16_t protocolNumber) | 512 uint16_t protocolNumber) |
512 { | 513 { |
513 NS_LOG_FUNCTION (this << packet << dest << protocolNumber); | 514 NS_LOG_FUNCTION (this << packet << dest << protocolNumber); |
514 NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest); | 515 NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest); |
515 NS_LOG_LOGIC ("UID is " << packet->GetUid ()); | 516 NS_LOG_LOGIC ("UID is " << packet->GetUid ()); |
516 | 517 |
| 518 // Class of Service is ignored by this NetDevice |
| 519 ClassOfServiceTag cosTag; |
| 520 packet->RemovePacketTag (cosTag); |
| 521 |
517 // | 522 // |
518 // If IsLinkUp() is false it means there is no channel to send any packet· | 523 // If IsLinkUp() is false it means there is no channel to send any packet· |
519 // over so we just hit the drop trace on the packet and return an error. | 524 // over so we just hit the drop trace on the packet and return an error. |
520 // | 525 // |
521 if (IsLinkUp () == false) | 526 if (IsLinkUp () == false) |
522 { | 527 { |
523 m_macTxDropTrace (packet); | 528 m_macTxDropTrace (packet); |
524 return false; | 529 return false; |
525 } | 530 } |
526 | 531 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 { | 670 { |
666 case 0x0800: return 0x0021; //IPv4 | 671 case 0x0800: return 0x0021; //IPv4 |
667 case 0x86DD: return 0x0057; //IPv6 | 672 case 0x86DD: return 0x0057; //IPv6 |
668 default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!"); | 673 default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!"); |
669 } | 674 } |
670 return 0; | 675 return 0; |
671 } | 676 } |
672 | 677 |
673 | 678 |
674 } // namespace ns3 | 679 } // namespace ns3 |
OLD | NEW |