1 from pybindgen import Module, FileCodeSink, param, retval, cppclass
3 def register_types(module):
4 root_module = module.get_root()
6 ## csma-channel.h: ns3::WireState [enumeration]
7 module.add_enum('WireState', ['IDLE', 'TRANSMITTING', 'PROPAGATING'])
8 ## backoff.h: ns3::Backoff [class]
9 module.add_class('Backoff')
10 ## csma-channel.h: ns3::CsmaDeviceRec [class]
11 module.add_class('CsmaDeviceRec')
12 ## csma-channel.h: ns3::CsmaChannel [class]
13 module.add_class('CsmaChannel', parent=root_module['ns3::Channel'])
14 ## csma-net-device.h: ns3::CsmaNetDevice [class]
15 module.add_class('CsmaNetDevice', parent=root_module['ns3::NetDevice'])
16 ## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode [enumeration]
17 module.add_enum('EncapsulationMode', ['ILLEGAL', 'DIX', 'LLC'], outer_class=root_module['ns3::CsmaNetDevice'])
19 ## Register a nested module for the namespace internal
21 nested_module = module.add_cpp_namespace('internal')
22 register_types_ns3_internal(nested_module)
25 ## Register a nested module for the namespace TimeStepPrecision
27 nested_module = module.add_cpp_namespace('TimeStepPrecision')
28 register_types_ns3_TimeStepPrecision(nested_module)
31 ## Register a nested module for the namespace Config
33 nested_module = module.add_cpp_namespace('Config')
34 register_types_ns3_Config(nested_module)
37 ## Register a nested module for the namespace olsr
39 nested_module = module.add_cpp_namespace('olsr')
40 register_types_ns3_olsr(nested_module)
43 def register_types_ns3_internal(module):
44 root_module = module.get_root()
47 def register_types_ns3_TimeStepPrecision(module):
48 root_module = module.get_root()
51 def register_types_ns3_Config(module):
52 root_module = module.get_root()
55 def register_types_ns3_olsr(module):
56 root_module = module.get_root()
59 def register_methods(root_module):
60 register_Ns3Backoff_methods(root_module, root_module['ns3::Backoff'])
61 register_Ns3CsmaDeviceRec_methods(root_module, root_module['ns3::CsmaDeviceRec'])
62 register_Ns3CsmaChannel_methods(root_module, root_module['ns3::CsmaChannel'])
63 register_Ns3CsmaNetDevice_methods(root_module, root_module['ns3::CsmaNetDevice'])
66 def register_Ns3Backoff_methods(root_module, cls):
67 ## backoff.h: ns3::Backoff::m_minSlots [variable]
68 cls.add_instance_attribute('m_minSlots', 'uint32_t', is_const=False)
69 ## backoff.h: ns3::Backoff::m_maxSlots [variable]
70 cls.add_instance_attribute('m_maxSlots', 'uint32_t', is_const=False)
71 ## backoff.h: ns3::Backoff::m_ceiling [variable]
72 cls.add_instance_attribute('m_ceiling', 'uint32_t', is_const=False)
73 ## backoff.h: ns3::Backoff::m_maxRetries [variable]
74 cls.add_instance_attribute('m_maxRetries', 'uint32_t', is_const=False)
75 ## backoff.h: ns3::Backoff::m_slotTime [variable]
76 cls.add_instance_attribute('m_slotTime', 'ns3::Time', is_const=False)
77 ## backoff.h: ns3::Backoff::Backoff(ns3::Backoff const & arg0) [copy constructor]
78 cls.add_constructor([param('ns3::Backoff const &', 'arg0')])
79 ## backoff.h: ns3::Backoff::Backoff() [constructor]
80 cls.add_constructor([])
81 ## backoff.h: ns3::Backoff::Backoff(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries) [constructor]
82 cls.add_constructor([param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'ceiling'), param('uint32_t', 'maxRetries')])
83 ## backoff.h: ns3::Time ns3::Backoff::GetBackoffTime() [member function]
84 cls.add_method('GetBackoffTime',
87 ## backoff.h: void ns3::Backoff::ResetBackoffTime() [member function]
88 cls.add_method('ResetBackoffTime',
91 ## backoff.h: bool ns3::Backoff::MaxRetriesReached() [member function]
92 cls.add_method('MaxRetriesReached',
95 ## backoff.h: void ns3::Backoff::IncrNumRetries() [member function]
96 cls.add_method('IncrNumRetries',
101 def register_Ns3CsmaDeviceRec_methods(root_module, cls):
102 ## csma-channel.h: ns3::CsmaDeviceRec::devicePtr [variable]
103 cls.add_instance_attribute('devicePtr', 'ns3::Ptr< ns3::CsmaNetDevice >', is_const=False)
104 ## csma-channel.h: ns3::CsmaDeviceRec::active [variable]
105 cls.add_instance_attribute('active', 'bool', is_const=False)
106 ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::CsmaDeviceRec const & arg0) [copy constructor]
107 cls.add_constructor([param('ns3::CsmaDeviceRec const &', 'arg0')])
108 ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec() [constructor]
109 cls.add_constructor([])
110 ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::Ptr<ns3::CsmaNetDevice> device) [constructor]
111 cls.add_constructor([param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
112 ## csma-channel.h: bool ns3::CsmaDeviceRec::IsActive() [member function]
113 cls.add_method('IsActive',
118 def register_Ns3CsmaChannel_methods(root_module, cls):
119 ## csma-channel.h: ns3::CsmaChannel::CsmaChannel(ns3::CsmaChannel const & arg0) [copy constructor]
120 cls.add_constructor([param('ns3::CsmaChannel const &', 'arg0')])
121 ## csma-channel.h: static ns3::TypeId ns3::CsmaChannel::GetTypeId() [member function]
122 cls.add_method('GetTypeId',
126 ## csma-channel.h: ns3::CsmaChannel::CsmaChannel() [constructor]
127 cls.add_constructor([])
128 ## csma-channel.h: int32_t ns3::CsmaChannel::Attach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
129 cls.add_method('Attach',
131 [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
132 ## csma-channel.h: bool ns3::CsmaChannel::Detach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
133 cls.add_method('Detach',
135 [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
136 ## csma-channel.h: bool ns3::CsmaChannel::Detach(uint32_t deviceId) [member function]
137 cls.add_method('Detach',
139 [param('uint32_t', 'deviceId')])
140 ## csma-channel.h: bool ns3::CsmaChannel::Reattach(uint32_t deviceId) [member function]
141 cls.add_method('Reattach',
143 [param('uint32_t', 'deviceId')])
144 ## csma-channel.h: bool ns3::CsmaChannel::Reattach(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
145 cls.add_method('Reattach',
147 [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
148 ## csma-channel.h: bool ns3::CsmaChannel::TransmitStart(ns3::Ptr<ns3::Packet> p, uint32_t srcId) [member function]
149 cls.add_method('TransmitStart',
151 [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'srcId')])
152 ## csma-channel.h: bool ns3::CsmaChannel::TransmitEnd() [member function]
153 cls.add_method('TransmitEnd',
156 ## csma-channel.h: void ns3::CsmaChannel::PropagationCompleteEvent() [member function]
157 cls.add_method('PropagationCompleteEvent',
160 ## csma-channel.h: int32_t ns3::CsmaChannel::GetDeviceNum(ns3::Ptr<ns3::CsmaNetDevice> device) [member function]
161 cls.add_method('GetDeviceNum',
163 [param('ns3::Ptr< ns3::CsmaNetDevice >', 'device')])
164 ## csma-channel.h: ns3::WireState ns3::CsmaChannel::GetState() [member function]
165 cls.add_method('GetState',
168 ## csma-channel.h: bool ns3::CsmaChannel::IsBusy() [member function]
169 cls.add_method('IsBusy',
172 ## csma-channel.h: bool ns3::CsmaChannel::IsActive(uint32_t deviceId) [member function]
173 cls.add_method('IsActive',
175 [param('uint32_t', 'deviceId')])
176 ## csma-channel.h: uint32_t ns3::CsmaChannel::GetNumActDevices() [member function]
177 cls.add_method('GetNumActDevices',
180 ## csma-channel.h: uint32_t ns3::CsmaChannel::GetNDevices() const [member function]
181 cls.add_method('GetNDevices',
184 is_const=True, is_virtual=True)
185 ## csma-channel.h: ns3::Ptr<ns3::NetDevice> ns3::CsmaChannel::GetDevice(uint32_t i) const [member function]
186 cls.add_method('GetDevice',
187 'ns3::Ptr< ns3::NetDevice >',
188 [param('uint32_t', 'i')],
189 is_const=True, is_virtual=True)
190 ## csma-channel.h: ns3::Ptr<ns3::CsmaNetDevice> ns3::CsmaChannel::GetCsmaDevice(uint32_t i) const [member function]
191 cls.add_method('GetCsmaDevice',
192 'ns3::Ptr< ns3::CsmaNetDevice >',
193 [param('uint32_t', 'i')],
195 ## csma-channel.h: ns3::DataRate ns3::CsmaChannel::GetDataRate() [member function]
196 cls.add_method('GetDataRate',
200 ## csma-channel.h: ns3::Time ns3::CsmaChannel::GetDelay() [member function]
201 cls.add_method('GetDelay',
207 def register_Ns3CsmaNetDevice_methods(root_module, cls):
208 ## csma-net-device.h: static ns3::TypeId ns3::CsmaNetDevice::GetTypeId() [member function]
209 cls.add_method('GetTypeId',
213 ## csma-net-device.h: ns3::CsmaNetDevice::CsmaNetDevice() [constructor]
214 cls.add_constructor([])
215 ## csma-net-device.h: void ns3::CsmaNetDevice::SetInterframeGap(ns3::Time t) [member function]
216 cls.add_method('SetInterframeGap',
218 [param('ns3::Time', 't')])
219 ## csma-net-device.h: void ns3::CsmaNetDevice::SetBackoffParams(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t maxRetries, uint32_t ceiling) [member function]
220 cls.add_method('SetBackoffParams',
222 [param('ns3::Time', 'slotTime'), param('uint32_t', 'minSlots'), param('uint32_t', 'maxSlots'), param('uint32_t', 'maxRetries'), param('uint32_t', 'ceiling')])
223 ## csma-net-device.h: bool ns3::CsmaNetDevice::Attach(ns3::Ptr<ns3::CsmaChannel> ch) [member function]
224 cls.add_method('Attach',
226 [param('ns3::Ptr< ns3::CsmaChannel >', 'ch')])
227 ## csma-net-device.h: void ns3::CsmaNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function]
228 cls.add_method('SetQueue',
230 [param('ns3::Ptr< ns3::Queue >', 'queue')])
231 ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function]
232 cls.add_method('SetReceiveErrorModel',
234 [param('ns3::Ptr< ns3::ErrorModel >', 'em')])
235 ## csma-net-device.h: void ns3::CsmaNetDevice::Receive(ns3::Ptr<ns3::Packet> p, ns3::Ptr<ns3::CsmaNetDevice> sender) [member function]
236 cls.add_method('Receive',
238 [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::CsmaNetDevice >', 'sender')])
239 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsSendEnabled() [member function]
240 cls.add_method('IsSendEnabled',
243 ## csma-net-device.h: void ns3::CsmaNetDevice::SetSendEnable(bool enable) [member function]
244 cls.add_method('SetSendEnable',
246 [param('bool', 'enable')])
247 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsReceiveEnabled() [member function]
248 cls.add_method('IsReceiveEnabled',
251 ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveEnable(bool enable) [member function]
252 cls.add_method('SetReceiveEnable',
254 [param('bool', 'enable')])
255 ## csma-net-device.h: void ns3::CsmaNetDevice::SetAddress(ns3::Mac48Address addr) [member function]
256 cls.add_method('SetAddress',
258 [param('ns3::Mac48Address', 'addr')])
259 ## csma-net-device.h: void ns3::CsmaNetDevice::SetFrameSize(uint16_t frameSize) [member function]
260 cls.add_method('SetFrameSize',
262 [param('uint16_t', 'frameSize')])
263 ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetFrameSize() const [member function]
264 cls.add_method('GetFrameSize',
268 ## csma-net-device.h: void ns3::CsmaNetDevice::SetEncapsulationMode(ns3::CsmaNetDevice::EncapsulationMode mode) [member function]
269 cls.add_method('SetEncapsulationMode',
271 [param('ns3::CsmaNetDevice::EncapsulationMode', 'mode')])
272 ## csma-net-device.h: ns3::CsmaNetDevice::EncapsulationMode ns3::CsmaNetDevice::GetEncapsulationMode() [member function]
273 cls.add_method('GetEncapsulationMode',
274 'ns3::CsmaNetDevice::EncapsulationMode',
276 ## csma-net-device.h: void ns3::CsmaNetDevice::SetName(std::string const name) [member function]
277 cls.add_method('SetName',
279 [param('std::string const', 'name')],
281 ## csma-net-device.h: std::string ns3::CsmaNetDevice::GetName() const [member function]
282 cls.add_method('GetName',
285 is_const=True, is_virtual=True)
286 ## csma-net-device.h: void ns3::CsmaNetDevice::SetIfIndex(uint32_t const index) [member function]
287 cls.add_method('SetIfIndex',
289 [param('uint32_t const', 'index')],
291 ## csma-net-device.h: uint32_t ns3::CsmaNetDevice::GetIfIndex() const [member function]
292 cls.add_method('GetIfIndex',
295 is_const=True, is_virtual=True)
296 ## csma-net-device.h: ns3::Ptr<ns3::Channel> ns3::CsmaNetDevice::GetChannel() const [member function]
297 cls.add_method('GetChannel',
298 'ns3::Ptr< ns3::Channel >',
300 is_const=True, is_virtual=True)
301 ## csma-net-device.h: bool ns3::CsmaNetDevice::SetMtu(uint16_t const mtu) [member function]
302 cls.add_method('SetMtu',
304 [param('uint16_t const', 'mtu')],
306 ## csma-net-device.h: uint16_t ns3::CsmaNetDevice::GetMtu() const [member function]
307 cls.add_method('GetMtu',
310 is_const=True, is_virtual=True)
311 ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetAddress() const [member function]
312 cls.add_method('GetAddress',
315 is_const=True, is_virtual=True)
316 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsLinkUp() const [member function]
317 cls.add_method('IsLinkUp',
320 is_const=True, is_virtual=True)
321 ## csma-net-device.h: void ns3::CsmaNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
322 cls.add_method('SetLinkChangeCallback',
324 [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
326 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsBroadcast() const [member function]
327 cls.add_method('IsBroadcast',
330 is_const=True, is_virtual=True)
331 ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetBroadcast() const [member function]
332 cls.add_method('GetBroadcast',
335 is_const=True, is_virtual=True)
336 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsMulticast() const [member function]
337 cls.add_method('IsMulticast',
340 is_const=True, is_virtual=True)
341 ## csma-net-device.h: ns3::Address ns3::CsmaNetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
342 cls.add_method('GetMulticast',
344 [param('ns3::Ipv4Address', 'multicastGroup')],
345 is_const=True, is_virtual=True)
346 ## csma-net-device.h: bool ns3::CsmaNetDevice::IsPointToPoint() const [member function]
347 cls.add_method('IsPointToPoint',
350 is_const=True, is_virtual=True)
351 ## csma-net-device.h: bool ns3::CsmaNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
352 cls.add_method('Send',
354 [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
356 ## csma-net-device.h: bool ns3::CsmaNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
357 cls.add_method('SendFrom',
359 [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
361 ## csma-net-device.h: ns3::Ptr<ns3::Node> ns3::CsmaNetDevice::GetNode() const [member function]
362 cls.add_method('GetNode',
363 'ns3::Ptr< ns3::Node >',
365 is_const=True, is_virtual=True)
366 ## csma-net-device.h: void ns3::CsmaNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
367 cls.add_method('SetNode',
369 [param('ns3::Ptr< ns3::Node >', 'node')],
371 ## csma-net-device.h: bool ns3::CsmaNetDevice::NeedsArp() const [member function]
372 cls.add_method('NeedsArp',
375 is_const=True, is_virtual=True)
376 ## csma-net-device.h: void ns3::CsmaNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function]
377 cls.add_method('SetReceiveCallback',
379 [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty >', 'cb')],
381 ## csma-net-device.h: void ns3::CsmaNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet const>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function]
382 cls.add_method('SetPromiscReceiveCallback',
384 [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType >', 'cb')],
386 ## csma-net-device.h: bool ns3::CsmaNetDevice::SupportsSendFrom() const [member function]
387 cls.add_method('SupportsSendFrom',
390 is_const=True, is_virtual=True)
391 ## csma-net-device.h: void ns3::CsmaNetDevice::DoDispose() [member function]
392 cls.add_method('DoDispose',
395 visibility='protected', is_virtual=True)
396 ## csma-net-device.h: ns3::Ptr<ns3::Queue> ns3::CsmaNetDevice::GetQueue() const [member function]
397 cls.add_method('GetQueue',
398 'ns3::Ptr< ns3::Queue >',
400 is_const=True, visibility='protected')
401 ## csma-net-device.h: void ns3::CsmaNetDevice::AddHeader(ns3::Ptr<ns3::Packet> p, ns3::Mac48Address source, ns3::Mac48Address dest, uint16_t protocolNumber) [member function]
402 cls.add_method('AddHeader',
404 [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Mac48Address', 'source'), param('ns3::Mac48Address', 'dest'), param('uint16_t', 'protocolNumber')],
405 visibility='protected')
406 ## csma-net-device.h: bool ns3::CsmaNetDevice::ProcessHeader(ns3::Ptr<ns3::Packet> p, uint16_t & param) [member function]
407 cls.add_method('ProcessHeader',
409 [param('ns3::Ptr< ns3::Packet >', 'p'), param('uint16_t &', 'param')],
410 visibility='protected')
413 def register_functions(root_module):
415 register_functions_ns3_internal(module.get_submodule('internal'), root_module)
416 register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module)
417 register_functions_ns3_Config(module.get_submodule('Config'), root_module)
418 register_functions_ns3_olsr(module.get_submodule('olsr'), root_module)
421 def register_functions_ns3_internal(module, root_module):
424 def register_functions_ns3_TimeStepPrecision(module, root_module):
427 def register_functions_ns3_Config(module, root_module):
430 def register_functions_ns3_olsr(module, root_module):