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) 2010 TELEMATICS LAB, DEE - Politecnico di Bari | 3 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari |
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 14 matching lines...) Expand all Loading... |
25 #include "ns3/node.h" | 25 #include "ns3/node.h" |
26 #include "ns3/packet.h" | 26 #include "ns3/packet.h" |
27 #include "lte-net-device.h" | 27 #include "lte-net-device.h" |
28 #include "ns3/packet-burst.h" | 28 #include "ns3/packet-burst.h" |
29 #include "ns3/uinteger.h" | 29 #include "ns3/uinteger.h" |
30 #include "ns3/trace-source-accessor.h" | 30 #include "ns3/trace-source-accessor.h" |
31 #include "ns3/pointer.h" | 31 #include "ns3/pointer.h" |
32 #include "ns3/enum.h" | 32 #include "ns3/enum.h" |
33 #include "lte-amc.h" | 33 #include "lte-amc.h" |
34 #include "ns3/ipv4-header.h" | 34 #include "ns3/ipv4-header.h" |
| 35 #include "ns3/ipv4-l3-protocol.h" |
| 36 #include "ns3/ipv6-header.h" |
| 37 #include "ns3/ipv6-l3-protocol.h" |
35 #include <ns3/lte-radio-bearer-tag.h> | 38 #include <ns3/lte-radio-bearer-tag.h> |
36 #include <ns3/ipv4-l3-protocol.h> | |
37 #include <ns3/log.h> | 39 #include <ns3/log.h> |
38 | 40 |
39 namespace ns3 { | 41 namespace ns3 { |
40 | 42 |
41 NS_LOG_COMPONENT_DEFINE ("LteNetDevice"); | 43 NS_LOG_COMPONENT_DEFINE ("LteNetDevice"); |
42 | 44 |
43 NS_OBJECT_ENSURE_REGISTERED ( LteNetDevice); | 45 NS_OBJECT_ENSURE_REGISTERED ( LteNetDevice); |
44 | 46 |
45 //////////////////////////////// | 47 //////////////////////////////// |
46 // LteNetDevice | 48 // LteNetDevice |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 { | 242 { |
241 NS_LOG_FUNCTION (this << multicastGroup); | 243 NS_LOG_FUNCTION (this << multicastGroup); |
242 | 244 |
243 Mac48Address ad = Mac48Address::GetMulticast (multicastGroup); | 245 Mac48Address ad = Mac48Address::GetMulticast (multicastGroup); |
244 | 246 |
245 // | 247 // |
246 // Implicit conversion (operator Address ()) is defined for Mac48Address, so | 248 // Implicit conversion (operator Address ()) is defined for Mac48Address, so |
247 // use it by just returning the EUI-48 address which is automagically converte
d | 249 // use it by just returning the EUI-48 address which is automagically converte
d |
248 // to an Address. | 250 // to an Address. |
249 // | 251 // |
250 NS_LOG_LOGIC ("multicast address is " << ad); | 252 NS_LOG_LOGIC ("MAC IPv4 multicast address is " << ad); |
251 | 253 |
252 return ad; | 254 return ad; |
253 } | 255 } |
254 | 256 |
255 Address | 257 Address |
256 LteNetDevice::GetMulticast (Ipv6Address addr) const | 258 LteNetDevice::GetMulticast (Ipv6Address addr) const |
257 { | 259 { |
258 NS_LOG_FUNCTION (this << addr); | 260 NS_LOG_FUNCTION (this << addr); |
259 Mac48Address ad = Mac48Address::GetMulticast (addr); | 261 Mac48Address ad = Mac48Address::GetMulticast (addr); |
260 | 262 |
(...skipping 15 matching lines...) Expand all Loading... |
276 NS_LOG_FUNCTION (this); | 278 NS_LOG_FUNCTION (this); |
277 NS_LOG_WARN ("Promisc mode not supported"); | 279 NS_LOG_WARN ("Promisc mode not supported"); |
278 } | 280 } |
279 | 281 |
280 | 282 |
281 | 283 |
282 void | 284 void |
283 LteNetDevice::Receive (Ptr<Packet> p) | 285 LteNetDevice::Receive (Ptr<Packet> p) |
284 { | 286 { |
285 NS_LOG_FUNCTION (this << p); | 287 NS_LOG_FUNCTION (this << p); |
286 m_rxCallback (this, p, Ipv4L3Protocol::PROT_NUMBER, Address ()); | 288 if(ns3::lteUseIpv6) { |
| 289 Ipv6Header ipv6Header; |
| 290 Ptr<Packet> pCopy = p->Copy(); |
| 291 pCopy->RemoveHeader(ipv6Header); |
| 292 m_rxCallback (this, p, Ipv6L3Protocol::PROT_NUMBER, Address ()); |
| 293 ······ |
| 294 } else |
| 295 m_rxCallback (this, p, Ipv4L3Protocol::PROT_NUMBER, Address ()); |
287 } | 296 } |
288 | 297 |
289 | 298 |
290 } | 299 } |
OLD | NEW |