src/node/net-device.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sun, 12 Aug 2007 16:28:29 +0200
changeset 1341 f685d4bf320f
parent 1333 c0d66de933e9
child 1376 ad7e61edfb9d
permissions -rw-r--r--
use the Object::GetTraceResolver tracing support rather than the old adhoc tracing code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     2
/*
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     3
 * Copyright (c) 2005,2006 INRIA
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     4
 * All rights reserved.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     5
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     6
 * This program is free software; you can redistribute it and/or modify
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     7
 * it under the terms of the GNU General Public License version 2 as
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     8
 * published by the Free Software Foundation;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
     9
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    10
 * This program is distributed in the hope that it will be useful,
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    13
 * GNU General Public License for more details.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    14
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    16
 * along with this program; if not, write to the Free Software
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
    20
 * Modified by Emmanuelle Laprise to remove dependance on LLC headers
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
 */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    22
#ifndef NET_DEVICE_H
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    23
#define NET_DEVICE_H
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    24
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    25
#include <string>
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    26
#include <stdint.h>
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    27
#include "ns3/callback.h"
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    28
#include "ns3/packet.h"
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 607
diff changeset
    29
#include "ns3/object.h"
582
b10ef84683a5 NetDevice and Channel now derive from Interface rather than Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 568
diff changeset
    30
#include "ns3/ptr.h"
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
    31
#include "address.h"
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    32
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
namespace ns3 {
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
728
95c426b1cb60 rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 710
diff changeset
    35
class Node;
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents: 247
diff changeset
    36
class TraceResolver;
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents: 247
diff changeset
    37
class TraceContext;
402
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    38
class Channel;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    40
/**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    41
 * \brief Network layer to device interface
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    42
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    43
 * This interface defines the API which the IP and ARP
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    44
 * layers need to access to manage an instance of a network device 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    45
 * layer. It currently does not support MAC-level 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    46
 * multicast but this should not be too hard to add by adding
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    47
 * extra methods to register MAC multicast addresses to
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    48
 * filter out unwanted packets before handing them to the
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    49
 * higher layers.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    50
 *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    51
 * In Linux, this interface is analogous to the interface
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    52
 * just above dev_queue_xmit() (i.e., IP packet is fully
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    53
 * constructed with destination MAC address already selected).
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
 * 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    55
 * If you want to write a new MAC layer, you need to subclass
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 345
diff changeset
    56
 * this base class and implement your own version of the
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    57
 * NetDevice::SendTo method.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    58
 */
710
2a9c061219a7 port code from Interface to Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 607
diff changeset
    59
class NetDevice : public Object
469
676b647fc960 derive from Object for proper refcounting
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 465
diff changeset
    60
{
676b647fc960 derive from Object for proper refcounting
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 465
diff changeset
    61
public:
582
b10ef84683a5 NetDevice and Channel now derive from Interface rather than Object
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 568
diff changeset
    62
  static const InterfaceId iid;
487
04c5878c0a61 apply ref/unref rules consistently for Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 469
diff changeset
    63
  virtual ~NetDevice();
345
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents: 247
diff changeset
    64
47b41507a45a move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents: 247
diff changeset
    65
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    66
  /**
402
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    67
   * \return the channel this NetDevice is connected to. The value
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    68
   *         returned can be zero if the NetDevice is not yet connected
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    69
   *         to any channel.
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    70
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 561
diff changeset
    71
  Ptr<Channel> GetChannel (void) const;
402
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    72
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 401
diff changeset
    73
  /**
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
    74
   * \return the current Address of this interface.
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    75
   */
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
    76
  Address GetAddress (void) const;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    77
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    78
   * \param mtu MTU value, in bytes, to set for the device
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    79
   * \return whether the MTU value was within legal bounds
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    80
   * 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    81
   * Override for default MTU defined on a per-type basis.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    82
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    83
  bool SetMtu (const uint16_t mtu);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    84
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    85
   * \return the link-level MTU in bytes for this interface.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    86
   * 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    87
   * This value is typically used by the IP layer to perform
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    88
   * IP fragmentation when needed.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    89
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    90
  uint16_t GetMtu (void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    91
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    92
   * \param name name of the device (e.g. "eth0")
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    93
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    94
  void SetName(const std::string name); 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    95
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    96
   * \return name name of the device (e.g. "eth0")
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    97
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    98
  std::string GetName(void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    99
  /**
535
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   100
   * \param index ifIndex of the device 
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   101
   */
592
f7e4beac3e31 fix dox warnings
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 582
diff changeset
   102
  void SetIfIndex(const uint32_t index);
535
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   103
  /**
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   104
   * \return index ifIndex of the device 
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   105
   */
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   106
  uint32_t GetIfIndex(void) const;
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   107
  /**
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   108
   * \return true if link is up; false otherwise
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   109
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   110
  bool IsLinkUp (void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   111
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   112
   * \param callback the callback to invoke
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   113
   *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   114
   * Register a callback invoked whenever the link 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   115
   * status changes to UP. This callback is typically used
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   116
   * by the IP/ARP layer to flush the ARP cache 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   117
   * whenever the link goes up.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   118
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   119
  void SetLinkChangeCallback (Callback<void> callback);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   120
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   121
   * \return true if this interface supports a broadcast address,
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   122
   *         false otherwise.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   123
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   124
  bool IsBroadcast (void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   125
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   126
   * \return the broadcast address supported by
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   127
   *         this netdevice.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   128
   *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   129
   * Calling this method is invalid if IsBroadcast returns
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   130
   * not true.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   131
   */
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   132
  Address const &GetBroadcast (void) const;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   133
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   134
   * \return value of m_isMulticast flag
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   135
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   136
  bool IsMulticast (void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   137
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   138
   * \return value of m_isPointToPoint flag
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   139
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   140
  bool IsPointToPoint (void) const;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   141
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   142
   * \param p packet sent from above down to Network Device
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   143
   * \param dest mac address of the destination (already resolved)
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   144
   * \param protocolNumber identifies the type of payload contained in
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   145
   *        this packet. Used to call the right L3Protocol when the packet
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   146
   *        is received.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   147
   * 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   148
   *  Called from higher layer to send packet into Network Device
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   149
   *  to the specified destination Address
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   150
   * 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   151
   * \return whether the Send operation succeeded 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   152
   */
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   153
  bool Send(Packet& p, const Address& dest, uint16_t protocolNumber);
535
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   154
  /**
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   155
   * \returns the node base class which contains this network
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   156
   *          interface.
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   157
   *
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   158
   * When a subclass needs to get access to the underlying node
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   159
   * base class to print the nodeid for example, it can invoke
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   160
   * this method.
fb6735f93868 Enable both ascii and pcap tracing
Tom Henderson <tomh@tomh.org>
parents: 517
diff changeset
   161
   */
728
95c426b1cb60 rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 710
diff changeset
   162
  Ptr<Node> GetNode (void) const;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   163
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   164
  /**
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   165
   * \returns true if ARP is needed, false otherwise.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   166
   *
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   167
   * Called by higher-layers to check if this NetDevice requires
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   168
   * ARP to be used.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   169
   */
445
10cd9049a0ad add NetDevice::NeedsArp method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 415
diff changeset
   170
  bool NeedsArp (void) const;
10cd9049a0ad add NetDevice::NeedsArp method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 415
diff changeset
   171
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   172
  /**
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   173
   * \param device a pointer to the net device which is calling this callback
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   174
   * \param packet the packet received
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   175
   * \param protocol the 16 bit protocol number associated with this packet.
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   176
   *        This protocol number is expected to be the same protocol number
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   177
   *        given to the Send method by the user on the sender side.
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   178
   * \param address the address of the sender
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   179
   * \returns true if the callback could handle the packet successfully, false
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   180
   *          otherwise.
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   181
   */
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   182
  typedef Callback<bool,Ptr<NetDevice>,const Packet &,uint16_t,const Address &> ReceiveCallback;
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   183
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   184
  /**
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   185
   * \param cb callback to invoke whenever a packet has been received and must
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   186
   *        be forwarded to the higher layers.
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   187
   *
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   188
   */
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   189
  void SetReceiveCallback (ReceiveCallback cb);
451
3fe2c883cb47 add NetDevice::SetReceiveCallback and use it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 445
diff changeset
   190
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   191
 protected:
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   192
  /**
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   193
   * \param node base class node pointer of device's node 
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   194
   * \param addr MAC address of this device.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   195
   */
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   196
  NetDevice(Ptr<Node> node, const Address& addr);
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   197
  /**
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   198
   * Enable broadcast support. This method should be
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   199
   * called by subclasses from their constructor
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   200
   */
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   201
  void EnableBroadcast (Address broadcast);
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   202
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   203
   * Set m_isBroadcast flag to false
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   204
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   205
  void DisableBroadcast (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   206
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   207
   * Set m_isMulticast flag to true
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   208
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   209
  void EnableMulticast (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   210
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   211
   * Set m_isMulticast flag to false
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   212
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   213
  void DisableMulticast (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   214
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   215
   * Set m_isPointToPoint flag to true
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   216
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   217
  void EnablePointToPoint (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   218
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   219
   * Set m_isPointToPoint flag to false
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   220
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   221
  void DisablePointToPoint (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   222
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   223
   * When a subclass notices that the link status has changed to up,
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   224
   * it notifies its parent class by calling this method. This method
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   225
   * is responsible for notifying any LinkUp callbacks. 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   226
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   227
  void NotifyLinkUp (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   228
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   229
   * When a subclass notices that the link status has changed to 
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   230
   * down, it notifies its parent class by calling this method.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   231
   */
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   232
  void NotifyLinkDown (void);
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   233
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   234
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   235
   * \param p packet sent from below up to Network Device
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
   236
   * \param param Extra parameter extracted from header and needed by
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
   237
   * some protocols
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   238
   * \param address the address of the sender of this packet.
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   239
   * \returns true if the packet was forwarded successfully,
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   240
   *          false otherwise.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   241
   *
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 345
diff changeset
   242
   * When a subclass gets a packet from the channel, it 
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   243
   * forwards it to the higher layers by calling this method
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   244
   * which is responsible for passing it up to the Rx callback.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   245
   */
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   246
  bool ForwardUp (const Packet& p, uint32_t param, const Address &address);
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
   247
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   248
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   249
  /**
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   250
   * The dispose method for this NetDevice class.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   251
   * Subclasses are expected to override this method _and_
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   252
   * to chain up to it by calling NetDevice::DoDispose
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   253
   * at the end of their own DoDispose method.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   254
   */
517
702e96b8960f finish Dispose -> DoDispose rework
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 487
diff changeset
   255
  virtual void DoDispose (void);
702e96b8960f finish Dispose -> DoDispose rework
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 487
diff changeset
   256
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   257
 private:
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   258
  /**
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   259
   * \param p packet to send
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   260
   * \param dest address of destination to which packet must be sent
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
   261
   * \param protocolNumber Number of the protocol (used with some protocols)
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   262
   * \returns true if the packet could be sent successfully, false
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   263
   *          otherwise.
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   264
   *
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   265
   * This is the private virtual target function of the public Send()
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   266
   * method.  When the link is Up, this method is invoked to ask 
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 345
diff changeset
   267
   * subclasses to forward packets. Subclasses MUST override this method.
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   268
   */
1167
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1161 975
diff changeset
   269
  virtual bool SendTo (Packet& p, const Address &dest, uint16_t protocolNumber) = 0;
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   270
  /**
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   271
   * \returns true if this NetDevice needs the higher-layers
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   272
   *          to perform ARP over it, false otherwise.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   273
   *
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   274
   * Subclasses must implement this method.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   275
   */
445
10cd9049a0ad add NetDevice::NeedsArp method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 415
diff changeset
   276
  virtual bool DoNeedsArp (void) const = 0;
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   277
  /**
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   278
   * \returns the channel associated to this NetDevice.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   279
   *
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   280
   * Subclasses must implement this method.
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   281
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 561
diff changeset
   282
  virtual Ptr<Channel> DoGetChannel (void) const = 0;
597
4c8f1400f629 complete dox doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 592
diff changeset
   283
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 728
diff changeset
   284
  Ptr<Node>     m_node;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   285
  std::string   m_name;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   286
  uint16_t      m_ifIndex;
1161
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   287
  Address       m_address;
bb72baff8b26 replace MacAddress by Address
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
   288
  Address       m_broadcast;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   289
  uint16_t      m_mtu;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   290
  bool          m_isUp;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   291
  bool          m_isBroadcast;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   292
  bool          m_isMulticast;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   293
  bool          m_isPointToPoint;
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   294
  Callback<void> m_linkChangeCallback;
1186
909e9eb2124e rework the NetDevice <-> Node interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1167
diff changeset
   295
  ReceiveCallback m_receiveCallback;
234
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   296
};
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   297
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   298
}; // namespace ns3
6124bda39cb3 code from all trees.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   299
#endif