author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Wed, 16 Jul 2008 16:06:50 +0100 | |
changeset 3460 | 99698bc858e8 |
parent 3457 | 2ff6f05b9467 |
child 3468 | 0bb5275704fc |
permissions | -rw-r--r-- |
3457 | 1 |
from pybindgen import Module, FileCodeSink, write_preamble, param, retval |
2 |
||
3 |
def register_types(module): |
|
4 |
root_module = module.get_root() |
|
5 |
||
6 |
## bridge-net-device.h: ns3::BridgeNetDevice [class] |
|
7 |
module.add_class('BridgeNetDevice', parent=root_module['ns3::NetDevice']) |
|
8 |
## bridge-channel.h: ns3::BridgeChannel [class] |
|
9 |
module.add_class('BridgeChannel', parent=root_module['ns3::Channel']) |
|
10 |
||
11 |
## Register a nested module for the namespace internal |
|
12 |
||
13 |
nested_module = module.add_cpp_namespace('internal') |
|
14 |
register_types_ns3_internal(nested_module) |
|
15 |
||
16 |
||
17 |
## Register a nested module for the namespace TimeStepPrecision |
|
18 |
||
19 |
nested_module = module.add_cpp_namespace('TimeStepPrecision') |
|
20 |
register_types_ns3_TimeStepPrecision(nested_module) |
|
21 |
||
22 |
||
23 |
## Register a nested module for the namespace Config |
|
24 |
||
25 |
nested_module = module.add_cpp_namespace('Config') |
|
26 |
register_types_ns3_Config(nested_module) |
|
27 |
||
28 |
||
29 |
## Register a nested module for the namespace olsr |
|
30 |
||
31 |
nested_module = module.add_cpp_namespace('olsr') |
|
32 |
register_types_ns3_olsr(nested_module) |
|
33 |
||
34 |
||
35 |
def register_types_ns3_internal(module): |
|
36 |
root_module = module.get_root() |
|
37 |
||
38 |
||
39 |
def register_types_ns3_TimeStepPrecision(module): |
|
40 |
root_module = module.get_root() |
|
41 |
||
42 |
||
43 |
def register_types_ns3_Config(module): |
|
44 |
root_module = module.get_root() |
|
45 |
||
46 |
||
47 |
def register_types_ns3_olsr(module): |
|
48 |
root_module = module.get_root() |
|
49 |
||
50 |
||
51 |
def register_methods(root_module): |
|
52 |
register_Ns3BridgeNetDevice_methods(root_module, root_module['ns3::BridgeNetDevice']) |
|
53 |
register_Ns3BridgeChannel_methods(root_module, root_module['ns3::BridgeChannel']) |
|
54 |
return |
|
55 |
||
56 |
def register_Ns3BridgeNetDevice_methods(root_module, cls): |
|
57 |
## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function] |
|
58 |
cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) |
|
59 |
## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice() [constructor] |
|
60 |
cls.add_constructor([], visibility='public') |
|
61 |
## bridge-net-device.h: void ns3::BridgeNetDevice::AddBridgePort(ns3::Ptr<ns3::NetDevice> bridgePort) [member function] |
|
62 |
cls.add_method('AddBridgePort', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'bridgePort')]) |
|
63 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetName(std::string const name) [member function] |
|
64 |
cls.add_method('SetName', 'void', [param('std::string', 'name', is_const=True)], is_virtual=True) |
|
65 |
## bridge-net-device.h: std::string ns3::BridgeNetDevice::GetName() const [member function] |
|
66 |
cls.add_method('GetName', 'std::string', [], is_const=True, is_virtual=True) |
|
67 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetIfIndex(uint32_t const index) [member function] |
|
68 |
cls.add_method('SetIfIndex', 'void', [param('uint32_t', 'index', is_const=True)], is_virtual=True) |
|
69 |
## bridge-net-device.h: uint32_t ns3::BridgeNetDevice::GetIfIndex() const [member function] |
|
70 |
cls.add_method('GetIfIndex', 'uint32_t', [], is_const=True, is_virtual=True) |
|
71 |
## bridge-net-device.h: ns3::Ptr<ns3::Channel> ns3::BridgeNetDevice::GetChannel() const [member function] |
|
72 |
cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_const=True, is_virtual=True) |
|
73 |
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetAddress() const [member function] |
|
74 |
cls.add_method('GetAddress', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
75 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::SetMtu(uint16_t const mtu) [member function] |
|
76 |
cls.add_method('SetMtu', 'bool', [param('uint16_t', 'mtu', is_const=True)], is_virtual=True) |
|
77 |
## bridge-net-device.h: uint16_t ns3::BridgeNetDevice::GetMtu() const [member function] |
|
78 |
cls.add_method('GetMtu', 'uint16_t', [], is_const=True, is_virtual=True) |
|
79 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsLinkUp() const [member function] |
|
80 |
cls.add_method('IsLinkUp', 'bool', [], is_const=True, is_virtual=True) |
|
81 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] |
|
82 |
cls.add_method('SetLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True) |
|
83 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsBroadcast() const [member function] |
|
84 |
cls.add_method('IsBroadcast', 'bool', [], is_const=True, is_virtual=True) |
|
85 |
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetBroadcast() const [member function] |
|
86 |
cls.add_method('GetBroadcast', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
87 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsMulticast() const [member function] |
|
88 |
cls.add_method('IsMulticast', 'bool', [], is_const=True, is_virtual=True) |
|
89 |
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::GetMulticast() const [member function] |
|
90 |
cls.add_method('GetMulticast', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
91 |
## bridge-net-device.h: ns3::Address ns3::BridgeNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function] |
|
92 |
cls.add_method('MakeMulticastAddress', 'ns3::Address', [param('ns3::Ipv4Address', 'multicastGroup')], is_const=True, is_virtual=True) |
|
93 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::IsPointToPoint() const [member function] |
|
94 |
cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True) |
|
95 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] |
|
96 |
cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True) |
|
97 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] |
|
98 |
cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True) |
|
99 |
## bridge-net-device.h: ns3::Ptr<ns3::Node> ns3::BridgeNetDevice::GetNode() const [member function] |
|
100 |
cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) |
|
101 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function] |
|
102 |
cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True) |
|
103 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::NeedsArp() const [member function] |
|
104 |
cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True) |
|
3460
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
105 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function] |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
106 |
cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
107 |
## bridge-net-device.h: void ns3::BridgeNetDevice::SetPromiscReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType> cb) [member function] |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
108 |
cls.add_method('SetPromiscReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::Address const&, ns3::NetDevice::PacketType >', 'cb')], is_virtual=True) |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
109 |
## bridge-net-device.h: bool ns3::BridgeNetDevice::SupportsPromiscuous() const [member function] |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
110 |
cls.add_method('SupportsPromiscuous', 'bool', [], is_const=True, is_virtual=True) |
3457 | 111 |
## bridge-net-device.h: void ns3::BridgeNetDevice::DoDispose() [member function] |
112 |
cls.add_method('DoDispose', 'void', [], visibility='protected', is_virtual=True) |
|
113 |
## bridge-net-device.h: void ns3::BridgeNetDevice::ReceiveFromDevice(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Address const & source, ns3::Address const & destination, ns3::NetDevice::PacketType packetType) [member function] |
|
114 |
cls.add_method('ReceiveFromDevice', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'destination', is_const=True), param('ns3::NetDevice::PacketType', 'packetType')], visibility='protected') |
|
115 |
## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardUnicast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] |
|
116 |
cls.add_method('ForwardUnicast', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], visibility='protected') |
|
117 |
## bridge-net-device.h: void ns3::BridgeNetDevice::ForwardBroadcast(ns3::Ptr<ns3::NetDevice> incomingPort, ns3::Ptr<ns3::Packet> packet, uint16_t protocol, ns3::Mac48Address src, ns3::Mac48Address dst) [member function] |
|
118 |
cls.add_method('ForwardBroadcast', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'incomingPort'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('uint16_t', 'protocol'), param('ns3::Mac48Address', 'src'), param('ns3::Mac48Address', 'dst')], visibility='protected') |
|
119 |
## bridge-net-device.h: void ns3::BridgeNetDevice::Learn(ns3::Mac48Address source, ns3::Ptr<ns3::NetDevice> port) [member function] |
|
120 |
cls.add_method('Learn', 'void', [param('ns3::Mac48Address', 'source'), param('ns3::Ptr< ns3::NetDevice >', 'port')], visibility='protected') |
|
121 |
## bridge-net-device.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeNetDevice::GetLearnedState(ns3::Mac48Address source) [member function] |
|
122 |
cls.add_method('GetLearnedState', 'ns3::Ptr< ns3::NetDevice >', [param('ns3::Mac48Address', 'source')], visibility='protected') |
|
123 |
return |
|
124 |
||
125 |
def register_Ns3BridgeChannel_methods(root_module, cls): |
|
126 |
## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function] |
|
127 |
cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) |
|
128 |
## bridge-channel.h: ns3::BridgeChannel::BridgeChannel() [constructor] |
|
129 |
cls.add_constructor([], visibility='public') |
|
130 |
## bridge-channel.h: void ns3::BridgeChannel::AddChannel(ns3::Ptr<ns3::Channel> bridgedChannel) [member function] |
|
131 |
cls.add_method('AddChannel', 'void', [param('ns3::Ptr< ns3::Channel >', 'bridgedChannel')]) |
|
132 |
## bridge-channel.h: uint32_t ns3::BridgeChannel::GetNDevices() const [member function] |
|
133 |
cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True) |
|
134 |
## bridge-channel.h: ns3::Ptr<ns3::NetDevice> ns3::BridgeChannel::GetDevice(uint32_t i) const [member function] |
|
135 |
cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) |
|
136 |
return |
|
137 |
||
138 |
def register_functions(root_module): |
|
139 |
module = root_module |
|
140 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module) |
|
141 |
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) |
|
142 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module) |
|
143 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) |
|
144 |
return |
|
145 |
||
146 |
def register_functions_ns3_internal(module, root_module): |
|
147 |
return |
|
148 |
||
149 |
def register_functions_ns3_TimeStepPrecision(module, root_module): |
|
150 |
return |
|
151 |
||
152 |
def register_functions_ns3_Config(module, root_module): |
|
153 |
return |
|
154 |
||
155 |
def register_functions_ns3_olsr(module, root_module): |
|
156 |
return |
|
157 |