author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Tue, 21 Apr 2009 12:32:05 +0200 | |
changeset 4390 | e2b87ce61cef |
parent 4289 | 2f5b0ec50102 |
child 5975 | c85cb9b073a0 |
permissions | -rw-r--r-- |
4163
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
1 |
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
2 |
|
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
3 |
def configure(conf): |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
4 |
if conf.env['ENABLE_THREADING']: |
4186
f1d57182d491
tighten up configuration reqs for tap and emu
Craig Dowell <craigdo@ee.washington.edu>
parents:
4164
diff
changeset
|
5 |
conf.env['ENABLE_TAP'] = conf.check(header_name='linux/if_tun.h', |
f1d57182d491
tighten up configuration reqs for tap and emu
Craig Dowell <craigdo@ee.washington.edu>
parents:
4164
diff
changeset
|
6 |
define_name='HAVE_IF_TUN_H') |
4163
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
7 |
conf.report_optional_feature("TapBridge", "Tap Bridge", |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
8 |
conf.env['ENABLE_TAP'], |
4186
f1d57182d491
tighten up configuration reqs for tap and emu
Craig Dowell <craigdo@ee.washington.edu>
parents:
4164
diff
changeset
|
9 |
"<linux/if_tun.h> include not detected") |
4163
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
10 |
else: |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
11 |
conf.report_optional_feature("TapBridge", "Tap Bridge", |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
12 |
False, |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
13 |
"needs threading support which is not available") |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
14 |
|
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
15 |
def build(bld): |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
16 |
module = bld.create_ns3_module('tap-bridge', ['node']) |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
17 |
module.source = [ |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
18 |
] |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
19 |
headers = bld.new_task_gen('ns3header') |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
20 |
headers.module = 'tap-bridge' |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
21 |
headers.source = [ |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
22 |
'tap.h', |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
23 |
] |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
24 |
|
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
25 |
env = bld.env_of_name('default') |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
26 |
if env['ENABLE_TAP']: |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
27 |
module.source.extend([ |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
28 |
'tap-bridge.cc', |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
29 |
'tap-encode-decode.cc', |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
30 |
]) |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
31 |
headers.source.extend([ |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
32 |
'tap-bridge.h', |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
33 |
]) |
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
34 |
|
4190
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
35 |
|
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
36 |
if not env['PLATFORM'].startswith('freebsd'): |
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
37 |
obj = bld.create_suid_program('tap-creator') |
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
38 |
obj.source = [ |
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
39 |
'tap-creator.cc', |
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
40 |
'tap-encode-decode.cc', |
b6734a5d920c
work around to allow FreeBSD to run tap-bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4186
diff
changeset
|
41 |
] |
4163
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
42 |
|
8c48682b3d42
checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
43 |