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) 2006 Georgia Tech Research Corporation | 3 * Copyright (c) 2006 Georgia Tech Research Corporation |
4 * 2007 INRIA | 4 * 2007 INRIA |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 NS_LOG_FUNCTION_NOARGS (); | 166 NS_LOG_FUNCTION_NOARGS (); |
167 Ptr<Packet> p = RecvFrom (size, flags, fromAddress);· | 167 Ptr<Packet> p = RecvFrom (size, flags, fromAddress);· |
168 if (p == 0) | 168 if (p == 0) |
169 { | 169 { |
170 return 0; | 170 return 0; |
171 } | 171 } |
172 memcpy (buf, p->PeekData (), p->GetSize()); | 172 memcpy (buf, p->PeekData (), p->GetSize()); |
173 return p->GetSize (); | 173 return p->GetSize (); |
174 } | 174 } |
175 | 175 |
| 176 void |
| 177 Socket::SetIfIndex(uint32_t ifIndex)· |
| 178 { |
| 179 NS_ASSERT(0); |
| 180 } |
| 181 |
176 | 182 |
177 void· | 183 void· |
178 Socket::NotifyConnectionSucceeded (void) | 184 Socket::NotifyConnectionSucceeded (void) |
179 { | 185 { |
180 NS_LOG_FUNCTION_NOARGS (); | 186 NS_LOG_FUNCTION_NOARGS (); |
181 if (!m_connectionSucceeded.IsNull ()) | 187 if (!m_connectionSucceeded.IsNull ()) |
182 { | 188 { |
183 m_connectionSucceeded (this); | 189 m_connectionSucceeded (this); |
184 } | 190 } |
185 } | 191 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 SocketSetDontFragmentTag::Deserialize (TagBuffer i) | 414 SocketSetDontFragmentTag::Deserialize (TagBuffer i) |
409 { | 415 { |
410 m_dontFragment = (i.ReadU8 () == 1)?true:false; | 416 m_dontFragment = (i.ReadU8 () == 1)?true:false; |
411 } | 417 } |
412 void· | 418 void· |
413 SocketSetDontFragmentTag::Print (std::ostream &os) const | 419 SocketSetDontFragmentTag::Print (std::ostream &os) const |
414 { | 420 { |
415 os << (m_dontFragment?"true":"false"); | 421 os << (m_dontFragment?"true":"false"); |
416 } | 422 } |
417 | 423 |
| 424 |
| 425 SocketRecvIfTag::SocketRecvIfTag ()·· |
| 426 { |
| 427 } |
| 428 |
| 429 void· |
| 430 SocketRecvIfTag::SetRecvIf (uint32_t ifindex) |
| 431 { |
| 432 m_ifindex = ifindex; |
| 433 } |
| 434 |
| 435 uint32_t· |
| 436 SocketRecvIfTag::GetRecvIf (void) const |
| 437 { |
| 438 return m_ifindex; |
| 439 } |
| 440 |
| 441 |
| 442 TypeId |
| 443 SocketRecvIfTag::GetTypeId (void) |
| 444 { |
| 445 static TypeId tid = TypeId ("ns3::SocketRecvIfTag") |
| 446 .SetParent<Tag> () |
| 447 .AddConstructor<SocketRecvIfTag> () |
| 448 ; |
| 449 return tid; |
| 450 } |
| 451 TypeId |
| 452 SocketRecvIfTag::GetInstanceTypeId (void) const |
| 453 { |
| 454 return GetTypeId (); |
| 455 } |
| 456 |
| 457 uint32_t· |
| 458 SocketRecvIfTag::GetSerializedSize (void) const |
| 459 {· |
| 460 return sizeof(uint32_t); |
| 461 } |
| 462 void· |
| 463 SocketRecvIfTag::Serialize (TagBuffer i) const |
| 464 {· |
| 465 i.WriteU32 (m_ifindex); |
| 466 } |
| 467 void· |
| 468 SocketRecvIfTag::Deserialize (TagBuffer i) |
| 469 {· |
| 470 m_ifindex = i.ReadU32 (); |
| 471 } |
| 472 void |
| 473 SocketRecvIfTag::Print (std::ostream &os) const |
| 474 { |
| 475 os << "RecvIf=" << (uint32_t) m_ifindex; |
| 476 } |
| 477 |
418 }//namespace ns3 | 478 }//namespace ns3 |
OLD | NEW |