equal
deleted
inserted
replaced
31 #include "ns3/enum.h" |
31 #include "ns3/enum.h" |
32 #include "ns3/ipv4.h" |
32 #include "ns3/ipv4.h" |
33 #include "ns3/simulator.h" |
33 #include "ns3/simulator.h" |
34 #include "ns3/realtime-simulator-impl.h" |
34 #include "ns3/realtime-simulator-impl.h" |
35 #include "ns3/system-thread.h" |
35 #include "ns3/system-thread.h" |
|
36 #include "ns3/uinteger.h" |
36 |
37 |
37 #include <sys/wait.h> |
38 #include <sys/wait.h> |
38 #include <sys/stat.h> |
39 #include <sys/stat.h> |
39 #include <sys/socket.h> |
40 #include <sys/socket.h> |
40 #include <sys/un.h> |
41 #include <sys/un.h> |
72 TapBridge::GetTypeId (void) |
73 TapBridge::GetTypeId (void) |
73 { |
74 { |
74 static TypeId tid = TypeId ("ns3::TapBridge") |
75 static TypeId tid = TypeId ("ns3::TapBridge") |
75 .SetParent<NetDevice> () |
76 .SetParent<NetDevice> () |
76 .AddConstructor<TapBridge> () |
77 .AddConstructor<TapBridge> () |
|
78 .AddAttribute ("Mtu", "The MAC-level Maximum Transmission Unit", |
|
79 UintegerValue (0), |
|
80 MakeUintegerAccessor (&TapBridge::SetMtu, |
|
81 &TapBridge::GetMtu), |
|
82 MakeUintegerChecker<uint16_t> ()) |
77 .AddAttribute ("DeviceName", |
83 .AddAttribute ("DeviceName", |
78 "The name of the tap device to create.", |
84 "The name of the tap device to create.", |
79 StringValue (""), |
85 StringValue (""), |
80 MakeStringAccessor (&TapBridge::m_tapDeviceName), |
86 MakeStringAccessor (&TapBridge::m_tapDeviceName), |
81 MakeStringChecker ()) |
87 MakeStringChecker ()) |
124 } |
130 } |
125 |
131 |
126 TapBridge::TapBridge () |
132 TapBridge::TapBridge () |
127 : m_node (0), |
133 : m_node (0), |
128 m_ifIndex (0), |
134 m_ifIndex (0), |
129 m_mtu (0), |
|
130 m_sock (-1), |
135 m_sock (-1), |
131 m_startEvent (), |
136 m_startEvent (), |
132 m_stopEvent (), |
137 m_stopEvent (), |
133 m_readThread (0), |
138 m_readThread (0), |
134 m_ns3AddressRewritten (false) |
139 m_ns3AddressRewritten (false) |