You can look at the FlowMonitor class.
Waf: Entering directory `/home/dmitry/lena/build'
[ 736/1900] cxx: scratch/2.cc -> build/scratch/2.cc.2.o
../scratch/2.cc: In function ‘int main(int, char**)’:
../scratch/2.cc:5:55: error: ‘LOG_LEVEL_INFO’ was not declared in this scope
../scratch/2.cc:5:69: error: ‘LogComponentEnable’ was not declared in this scope
../scratch/2.cc:10:3: error: ‘string’ is not a member of ‘std’
../scratch/2.cc:10:15: error: expected ‘;’ before ‘phyMode’
../scratch/2.cc:14:3: error: ‘NodeContainer’ was not declared in this scope
../scratch/2.cc:14:17: error: expected ‘;’ before ‘wifiStaNodes’
../scratch/2.cc:16:3: error: ‘wifiStaNodes’ was not declared in this scope
../scratch/2.cc:19:3: error: ‘YansWifiChannelHelper’ was not declared in this scope
../scratch/2.cc:19:25: error: expected ‘;’ before ‘channel’
../scratch/2.cc:21:3: error: ‘YansWifiPhyHelper’ was not declared in this scope
../scratch/2.cc:21:21: error: expected ‘;’ before ‘phy’
../scratch/2.cc:23:3: error: ‘phy’ was not declared in this scope
../scratch/2.cc:23:19: error: ‘channel’ was not declared in this scope
../scratch/2.cc:27:3: error: ‘WifiHelper’ was not declared in this scope
../scratch/2.cc:27:14: error: expected ‘;’ before ‘wifi’
../scratch/2.cc:29:3: error: ‘wifi’ was not declared in this scope
../scratch/2.cc:29:21: error: ‘WIFI_PHY_STANDARD_80211b’ was not declared in this scope
../scratch/2.cc:33:3: error: ‘NqosWifiMacHelper’ was not declared in this scope
../scratch/2.cc:33:21: error: expected ‘;’ before ‘mac’
../scratch/2.cc:38:59: error: ‘phyMode’ was not declared in this scope
../scratch/2.cc:38:66: error: ‘StringValue’ was not declared in this scope
../scratch/2.cc:42:3: error: ‘Ssid’ was not declared in this scope
../scratch/2.cc:42:8: error: expected ‘;’ before ‘ssid’
../scratch/2.cc:44:3: error: ‘mac’ was not declared in this scope
../scratch/2.cc:46:37: error: ‘ssid’ was not declared in this scope
../scratch/2.cc:46:41: error: ‘SsidValue’ was not declared in this scope
../scratch/2.cc:49:3: error: ‘NetDeviceContainer’ was not declared in this scope
../scratch/2.cc:49:22: error: expected ‘;’ before ‘staDevices’
../scratch/2.cc:51:3: error: ‘staDevices’ was not declared in this scope
../scratch/2.cc:56:3: error: ‘MobilityHelper’ was not declared in this scope
../scratch/2.cc:56:18: error: expected ‘;’ before ‘mobility’
../scratch/2.cc:59:3: error: ‘mobility’ was not declared in this scope
../scratch/2.cc:61:58: error: ‘DoubleValue’ was not declared in this scope
../scratch/2.cc:69:63: error: ‘UintegerValue’ was not declared in this scope
../scratch/2.cc:80:5: error: ‘OlsrHelper’ was not declared in this scope
../scratch/2.cc:80:16: error: expected ‘;’ before ‘olsr’
../scratch/2.cc:84:5: error: ‘Ipv4StaticRoutingHelper’ was not declared in this scope
../scratch/2.cc:84:29: error: expected ‘;’ before ‘staticRouting’
../scratch/2.cc:88:5: error: ‘Ipv4ListRoutingHelper’ was not declared in this scope
../scratch/2.cc:88:27: error: expected ‘;’ before ‘list’
../scratch/2.cc:90:5: error: ‘list’ was not declared in this scope
../scratch/2.cc:90:15: error: ‘staticRouting’ was not declared in this scope
../scratch/2.cc:92:15: error: ‘olsr’ was not declared in this scope
../scratch/2.cc:96:5: error: ‘InternetStackHelper’ was not declared in this scope
../scratch/2.cc:96:25: error: expected ‘;’ before ‘internet’
../scratch/2.cc:98:5: error: ‘internet’ was not declared in this scope
../scratch/2.cc:103:3: error: ‘Ipv4AddressHelper’ was not declared in this scope
../scratch/2.cc:103:21: error: expected ‘;’ before ‘address’
../scratch/2.cc:106:3: error: ‘address’ was not declared in this scope
../scratch/2.cc:108:5: error: ‘Ipv4InterfaceContainer’ was not declared in this scope
../scratch/2.cc:108:28: error: expected ‘;’ before ‘wifiInterfaces’
../scratch/2.cc:110:5: error: ‘wifiInterfaces’ was not declared in this scope
../scratch/2.cc:113:3: error: ‘UdpEchoServerHelper’ was not declared in this scope
../scratch/2.cc:113:23: error: expected ‘;’ before ‘echoServer’
../scratch/2.cc:116:3: error: ‘ApplicationContainer’ was not declared in this scope
../scratch/2.cc:116:24: error: expected ‘;’ before ‘serverApps’
../scratch/2.cc:118:3: error: ‘serverApps’ was not declared in this scope
../scratch/2.cc:118:33: error: ‘Seconds’ was not declared in this scope
../scratch/2.cc:123:3: error: ‘UdpEchoClientHelper’ was not declared in this scope
../scratch/2.cc:123:23: error: expected ‘;’ before ‘echoClient’
../scratch/2.cc:125:3: error: ‘echoClient’ was not declared in this scope
../scratch/2.cc:127:64: error: ‘TimeValue’ was not declared in this scope
../scratch/2.cc:132:24: error: expected ‘;’ before ‘clientApps’
../scratch/2.cc:136:3: error: ‘clientApps’ was not declared in this scope
../scratch/2.cc:141:3: error: ‘Ipv4GlobalRoutingHelper’ has not been declared
../scratch/2.cc:144:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:148:3: error: ‘FlowMonitorHelper’ was not declared in this scope
../scratch/2.cc:148:21: error: expected ‘;’ before ‘flowmon_helper’
../scratch/2.cc:150:3: error: ‘Ptr’ was not declared in this scope
../scratch/2.cc:150:7: error: ‘FlowMonitor’ was not declared in this scope
../scratch/2.cc:150:20: error: ‘monitor’ was not declared in this scope
../scratch/2.cc:150:30: error: ‘flowmon_helper’ was not declared in this scope
../scratch/2.cc:161:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:163:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:165:11: error: expected ‘}’ at end of input
Waf: Leaving directory `/home/dmitry/lena/build'
Build failed
-> task in '2' failed (exit status 1):
{task 160606572: cxx 2.cc -> 2.cc.2.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-Ibuild', '-I.', '-I.', '-I/home/dmitry', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_PACKET_H=1', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '../scratch/2.cc', '-c', '-o', 'scratch/2.cc.2.o']
dmitry@dmitry-VPCEH2C5E:~/lena$ ./waf --run scratch/1
Waf: Entering directory `/home/dmitry/lena/build'
[ 744/1898] cxx: scratch/1.cc -> build/scratch/1.cc.10.o
../scratch/1.cc: In function ‘int main(int, char**)’:
../scratch/1.cc:85:1: error: ‘FlowMonitorHelper’ was not declared in this scope
../scratch/1.cc:85:19: error: expected ‘;’ before ‘flowmon_helper’
../scratch/1.cc:87:7: error: ‘FlowMonitor’ was not declared in this scope
../scratch/1.cc:87:18: error: template argument 1 is invalid
../scratch/1.cc:87:28: error: invalid type in declaration before ‘=’ token
../scratch/1.cc:87:30: error: ‘flowmon_helper’ was not declared in this scope
../scratch/1.cc:89:10: error: base operand of ‘->’ is not a pointer
../scratch/1.cc:91:10: error: base operand of ‘->’ is not a pointer
../scratch/1.cc:93:10: error: base operand of ‘->’ is not a pointer
../scratch/1.cc:95:10: error: base operand of ‘->’ is not a pointer
Waf: Leaving directory `/home/dmitry/lena/build'
Build failed
-> task in '1' failed (exit status 1):
{task 168740620: cxx 1.cc -> 1.cc.10.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-Ibuild', '-I.', '-I.', '-I/home/dmitry', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_PACKET_H=1', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '../scratch/1.cc', '-c', '-o', 'scratch/1.cc.10.o']
dmitry@dmitry-VPCEH2C5E:~/lena$ ./waf --run scratch/1
Waf: Entering directory `/home/dmitry/lena/build'
[ 736/1900] cxx: scratch/2.cc -> build/scratch/2.cc.2.o
../scratch/2.cc: In function ‘int main(int, char**)’:
../scratch/2.cc:5:55: error: ‘LOG_LEVEL_INFO’ was not declared in this scope
../scratch/2.cc:5:69: error: ‘LogComponentEnable’ was not declared in this scope
../scratch/2.cc:10:3: error: ‘string’ is not a member of ‘std’
../scratch/2.cc:10:15: error: expected ‘;’ before ‘phyMode’
../scratch/2.cc:14:3: error: ‘NodeContainer’ was not declared in this scope
../scratch/2.cc:14:17: error: expected ‘;’ before ‘wifiStaNodes’
../scratch/2.cc:16:3: error: ‘wifiStaNodes’ was not declared in this scope
../scratch/2.cc:19:3: error: ‘YansWifiChannelHelper’ was not declared in this scope
../scratch/2.cc:19:25: error: expected ‘;’ before ‘channel’
../scratch/2.cc:21:3: error: ‘YansWifiPhyHelper’ was not declared in this scope
../scratch/2.cc:21:21: error: expected ‘;’ before ‘phy’
../scratch/2.cc:23:3: error: ‘phy’ was not declared in this scope
../scratch/2.cc:23:19: error: ‘channel’ was not declared in this scope
../scratch/2.cc:27:3: error: ‘WifiHelper’ was not declared in this scope
../scratch/2.cc:27:14: error: expected ‘;’ before ‘wifi’
../scratch/2.cc:29:3: error: ‘wifi’ was not declared in this scope
../scratch/2.cc:29:21: error: ‘WIFI_PHY_STANDARD_80211b’ was not declared in this scope
../scratch/2.cc:33:3: error: ‘NqosWifiMacHelper’ was not declared in this scope
../scratch/2.cc:33:21: error: expected ‘;’ before ‘mac’
../scratch/2.cc:38:59: error: ‘phyMode’ was not declared in this scope
../scratch/2.cc:38:66: error: ‘StringValue’ was not declared in this scope
../scratch/2.cc:42:3: error: ‘Ssid’ was not declared in this scope
../scratch/2.cc:42:8: error: expected ‘;’ before ‘ssid’
../scratch/2.cc:44:3: error: ‘mac’ was not declared in this scope
../scratch/2.cc:46:37: error: ‘ssid’ was not declared in this scope
../scratch/2.cc:46:41: error: ‘SsidValue’ was not declared in this scope
../scratch/2.cc:49:3: error: ‘NetDeviceContainer’ was not declared in this scope
../scratch/2.cc:49:22: error: expected ‘;’ before ‘staDevices’
../scratch/2.cc:51:3: error: ‘staDevices’ was not declared in this scope
../scratch/2.cc:56:3: error: ‘MobilityHelper’ was not declared in this scope
../scratch/2.cc:56:18: error: expected ‘;’ before ‘mobility’
../scratch/2.cc:59:3: error: ‘mobility’ was not declared in this scope
../scratch/2.cc:61:58: error: ‘DoubleValue’ was not declared in this scope
../scratch/2.cc:69:63: error: ‘UintegerValue’ was not declared in this scope
../scratch/2.cc:80:5: error: ‘OlsrHelper’ was not declared in this scope
../scratch/2.cc:80:16: error: expected ‘;’ before ‘olsr’
../scratch/2.cc:84:5: error: ‘Ipv4StaticRoutingHelper’ was not declared in this scope
../scratch/2.cc:84:29: error: expected ‘;’ before ‘staticRouting’
../scratch/2.cc:88:5: error: ‘Ipv4ListRoutingHelper’ was not declared in this scope
../scratch/2.cc:88:27: error: expected ‘;’ before ‘list’
../scratch/2.cc:90:5: error: ‘list’ was not declared in this scope
../scratch/2.cc:90:15: error: ‘staticRouting’ was not declared in this scope
../scratch/2.cc:92:15: error: ‘olsr’ was not declared in this scope
../scratch/2.cc:96:5: error: ‘InternetStackHelper’ was not declared in this scope
../scratch/2.cc:96:25: error: expected ‘;’ before ‘internet’
../scratch/2.cc:98:5: error: ‘internet’ was not declared in this scope
../scratch/2.cc:103:3: error: ‘Ipv4AddressHelper’ was not declared in this scope
../scratch/2.cc:103:21: error: expected ‘;’ before ‘address’
../scratch/2.cc:106:3: error: ‘address’ was not declared in this scope
../scratch/2.cc:108:5: error: ‘Ipv4InterfaceContainer’ was not declared in this scope
../scratch/2.cc:108:28: error: expected ‘;’ before ‘wifiInterfaces’
../scratch/2.cc:110:5: error: ‘wifiInterfaces’ was not declared in this scope
../scratch/2.cc:113:3: error: ‘UdpEchoServerHelper’ was not declared in this scope
../scratch/2.cc:113:23: error: expected ‘;’ before ‘echoServer’
../scratch/2.cc:116:3: error: ‘ApplicationContainer’ was not declared in this scope
../scratch/2.cc:116:24: error: expected ‘;’ before ‘serverApps’
../scratch/2.cc:118:3: error: ‘serverApps’ was not declared in this scope
../scratch/2.cc:118:33: error: ‘Seconds’ was not declared in this scope
../scratch/2.cc:123:3: error: ‘UdpEchoClientHelper’ was not declared in this scope
../scratch/2.cc:123:23: error: expected ‘;’ before ‘echoClient’
../scratch/2.cc:125:3: error: ‘echoClient’ was not declared in this scope
../scratch/2.cc:127:64: error: ‘TimeValue’ was not declared in this scope
../scratch/2.cc:132:24: error: expected ‘;’ before ‘clientApps’
../scratch/2.cc:136:3: error: ‘clientApps’ was not declared in this scope
../scratch/2.cc:141:3: error: ‘Ipv4GlobalRoutingHelper’ has not been declared
../scratch/2.cc:144:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:148:3: error: ‘FlowMonitorHelper’ was not declared in this scope
../scratch/2.cc:148:21: error: expected ‘;’ before ‘flowmon_helper’
../scratch/2.cc:150:3: error: ‘Ptr’ was not declared in this scope
../scratch/2.cc:150:7: error: ‘FlowMonitor’ was not declared in this scope
../scratch/2.cc:150:20: error: ‘monitor’ was not declared in this scope
../scratch/2.cc:150:30: error: ‘flowmon_helper’ was not declared in this scope
../scratch/2.cc:161:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:163:3: error: ‘Simulator’ has not been declared
../scratch/2.cc:165:11: error: expected ‘}’ at end of input
Waf: Leaving directory `/home/dmitry/lena/build'
Build failed
-> task in '2' failed (exit status 1):
{task 154733036: cxx 2.cc -> 2.cc.2.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-Ibuild', '-I.', '-I.', '-I/home/dmitry', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_PACKET_H=1', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '../scratch/2.cc', '-c', '-o', 'scratch/2.cc.2.o']