author | Hajime Tazaki <tazaki@nict.go.jp> |
Sat, 02 Jun 2012 00:29:00 +0900 | |
changeset 22 | ed0d8cc18421 |
parent 20 | 5ca51e147e7f |
child 24 | 02787e1dfd96 |
permissions | -rw-r--r-- |
0 | 1 |
support umip(mip6d) with ns-3-linux for NEMO/MIP6 |
2 |
||
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
3 |
diff -r 056220694d84 model/dce-fd.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
4 |
--- a/model/dce-fd.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
5 |
+++ b/model/dce-fd.cc Sat Jun 02 00:27:53 2012 +0900 |
15 | 6 |
@@ -367,11 +367,30 @@ |
0 | 7 |
} |
8 |
||
9 |
UnixFd *socket = factory->CreateSocket (domain, type, protocol); |
|
10 |
+ if (!socket) |
|
11 |
+ return -1; |
|
12 |
socket->IncFdCount (); |
|
13 |
current->process->openFiles[fd] = new FileUsage (fd, socket); |
|
14 |
||
15 | 15 |
return fd; |
16 |
} |
|
17 |
+int dce_socketpair (int domain, int type, int protocol, int sv[2]) |
|
18 |
+{ |
|
19 |
+ sv[0] = dce_socket (domain, type, protocol); |
|
20 |
+ if (sv[0] < 0) |
|
21 |
+ { |
|
22 |
+ return -1; |
|
23 |
+ } |
|
24 |
+ |
|
25 |
+ sv[1] = dce_socket (domain, type, protocol); |
|
26 |
+ if (sv[1] < 0) |
|
27 |
+ { |
|
28 |
+ return -1; |
|
29 |
+ } |
|
30 |
+ |
|
31 |
+ return 0; |
|
32 |
+} |
|
33 |
+ |
|
34 |
int dce_bind (int fd, const struct sockaddr *my_addr, socklen_t addrlen) |
|
35 |
{ |
|
36 |
Thread *current = Current (); |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
37 |
diff -r 056220694d84 model/dce-manager.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
38 |
--- a/model/dce-manager.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
39 |
+++ b/model/dce-manager.cc Sat Jun 02 00:27:53 2012 +0900 |
15 | 40 |
@@ -1096,6 +1096,22 @@ |
0 | 41 |
libpthread_setup = (void (*)(const struct Libc *))(symbol); |
42 |
libpthread_setup (libc); |
|
43 |
||
44 |
+ h = ld->Load ("librt-ns3.so", RTLD_GLOBAL); |
|
45 |
+ if (h == 0) |
|
46 |
+ { |
|
47 |
+ err = ENOMEM; |
|
48 |
+ return 0; |
|
49 |
+ } |
|
50 |
+ symbol = ld->Lookup (h, "librt_setup"); |
|
51 |
+ if (symbol == 0) |
|
52 |
+ { |
|
53 |
+ NS_FATAL_ERROR ("This is not our fake librt !"); |
|
54 |
+ } |
|
55 |
+ // construct librt now |
|
56 |
+ void (*librt_setup)(const struct Libc *fn); |
|
57 |
+ librt_setup = (void (*)(const struct Libc *))(symbol); |
|
58 |
+ librt_setup (libc); |
|
59 |
+ |
|
60 |
// finally, call into 'main'. |
|
61 |
h = ld->Load (filename, RTLD_GLOBAL); |
|
62 |
||
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
63 |
diff -r 056220694d84 model/dce-poll.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
64 |
--- a/model/dce-poll.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
65 |
+++ b/model/dce-poll.cc Sat Jun 02 00:27:53 2012 +0900 |
15 | 66 |
@@ -180,7 +180,12 @@ |
67 |
} |
|
68 |
} |
|
69 |
nfds = eventByFd.size (); |
|
70 |
- if (nfds == 0) |
|
71 |
+ |
|
72 |
+ // select(2): |
|
73 |
+ // Some code calls select() with all three sets empty, nfds zero, and a |
|
74 |
+ // non-NULL timeout as a fairly portable way to sleep with subsecond |
|
75 |
+ // precision. |
|
76 |
+ if (nfds == 0 && !timeout) |
|
77 |
{ |
|
78 |
current->err = EINVAL; |
|
79 |
return -1; |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
80 |
diff -r 056220694d84 model/dce-signal.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
81 |
--- a/model/dce-signal.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
82 |
+++ b/model/dce-signal.cc Sat Jun 02 00:27:53 2012 +0900 |
0 | 83 |
@@ -3,6 +3,7 @@ |
84 |
#include "process.h" |
|
85 |
#include "ns3/log.h" |
|
86 |
#include "ns3/assert.h" |
|
87 |
+#include "waiter.h" |
|
88 |
#include <vector> |
|
1 | 89 |
#include <errno.h> |
0 | 90 |
|
19 | 91 |
@@ -98,6 +99,17 @@ |
0 | 92 |
|
93 |
return 0; |
|
94 |
} |
|
95 |
+ |
|
96 |
+int dce_sigwait (const sigset_t *set, int *sig) |
|
97 |
+{ |
|
98 |
+ int ret = 0; |
|
99 |
+ |
|
100 |
+ Waiter waiter; |
|
101 |
+ waiter.SetTimeout (Seconds (0.0)); |
|
102 |
+ waiter.WaitDoSignal (); |
|
103 |
+ |
|
104 |
+ return ret; |
|
105 |
+} |
|
1 | 106 |
int dce_sigprocmask(int how, const sigset_t *set, sigset_t *oldset) |
107 |
{ |
|
108 |
Thread *current = Current (); |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
109 |
diff -r 056220694d84 model/dce-signal.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
110 |
--- a/model/dce-signal.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
111 |
+++ b/model/dce-signal.h Sat Jun 02 00:27:53 2012 +0900 |
1 | 112 |
@@ -17,6 +17,7 @@ |
0 | 113 |
int dce_pthread_kill (pthread_t thread, int sig); |
114 |
void dce_abort (); |
|
1 | 115 |
int dce_sigprocmask(int how, const sigset_t *set, sigset_t *oldset); |
0 | 116 |
+int dce_sigwait (const sigset_t *set, int *sig); |
117 |
||
118 |
#ifdef __cplusplus |
|
119 |
} |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
120 |
diff -r 056220694d84 model/dce-string.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
121 |
--- a/model/dce-string.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
122 |
+++ b/model/dce-string.cc Sat Jun 02 00:27:53 2012 +0900 |
20
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
123 |
@@ -26,3 +26,9 @@ |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
124 |
/// \todo Do actual checking |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
125 |
strcpy (__dest, __src); |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
126 |
} |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
127 |
+ |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
128 |
+char *dce_strrchr(char *s, int c) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
129 |
+{ |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
130 |
+ return strrchr (s, c); |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
131 |
+} |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
132 |
+ |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
133 |
diff -r 056220694d84 model/dce-string.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
134 |
--- a/model/dce-string.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
135 |
+++ b/model/dce-string.h Sat Jun 02 00:27:53 2012 +0900 |
20
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
136 |
@@ -12,6 +12,7 @@ |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
137 |
char *dce___strcpy_chk (char *__restrict __dest, |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
138 |
const char *__restrict __src, |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
139 |
size_t __destlen); |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
140 |
+char *dce_strrchr(char *s, int c); |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
141 |
|
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
142 |
#ifdef __cplusplus |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
143 |
} |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
144 |
diff -r 056220694d84 model/dce-time.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
145 |
--- a/model/dce-time.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
146 |
+++ b/model/dce-time.cc Sat Jun 02 00:27:53 2012 +0900 |
0 | 147 |
@@ -54,3 +54,12 @@ |
148 |
||
149 |
return asctime_r (tm, Current ()->process->asctime_result); |
|
150 |
} |
|
151 |
+ |
|
152 |
+int dce_clock_gettime(clockid_t which_clock, struct timespec *tp) |
|
153 |
+{ |
|
154 |
+ NS_LOG_FUNCTION (Current () << UtilsGetNodeId ()); |
|
155 |
+ NS_ASSERT (Current () != 0); |
|
156 |
+ NS_ASSERT (tp != 0); |
|
157 |
+ *tp = UtilsTimeToTimespec (UtilsSimulationTimeToTime (Now ())); |
|
158 |
+ return 0; |
|
159 |
+} |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
160 |
diff -r 056220694d84 model/dce-time.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
161 |
--- a/model/dce-time.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
162 |
+++ b/model/dce-time.h Sat Jun 02 00:27:53 2012 +0900 |
15 | 163 |
@@ -3,6 +3,7 @@ |
164 |
||
165 |
#include "sys/dce-time.h" |
|
166 |
#include <time.h> |
|
167 |
+#include <sys/sysinfo.h> |
|
168 |
||
169 |
#ifdef __cplusplus |
|
170 |
extern "C" { |
|
171 |
@@ -13,6 +14,8 @@ |
|
0 | 172 |
struct tm *dce_localtime(const time_t *timep); |
173 |
char *dce_ctime(const time_t *timep); |
|
174 |
char *dce_asctime(const struct tm *tm); |
|
175 |
+int dce_clock_gettime(clockid_t which_clock, struct timespec *tp); |
|
15 | 176 |
+int dce_sysinfo (struct sysinfo *info); |
0 | 177 |
|
178 |
#ifdef __cplusplus |
|
179 |
} |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
180 |
diff -r 056220694d84 model/dce.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
181 |
--- a/model/dce.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
182 |
+++ b/model/dce.cc Sat Jun 02 00:27:53 2012 +0900 |
15 | 183 |
@@ -22,6 +22,8 @@ |
0 | 184 |
#include <getopt.h> |
185 |
#include <limits.h> |
|
186 |
#include <fcntl.h> |
|
187 |
+#include <net/if.h> |
|
188 |
+#include <sys/ioctl.h> |
|
189 |
#include "dce-random.h" |
|
190 |
#include "net/dce-if.h" |
|
191 |
#include "ns3/node.h" |
|
17 | 192 |
@@ -30,6 +32,7 @@ |
193 |
#include "ns3/names.h" |
|
194 |
#include "ns3/random-variable.h" |
|
195 |
#include "ns3/ipv4-l3-protocol.h" |
|
196 |
+#include "socket-fd-factory.h" |
|
197 |
||
198 |
NS_LOG_COMPONENT_DEFINE ("Dce"); |
|
199 |
||
200 |
@@ -639,20 +642,60 @@ |
|
15 | 201 |
} |
0 | 202 |
unsigned dce_if_nametoindex (const char *ifname) |
203 |
{ |
|
17 | 204 |
- int index = 0; |
205 |
- Ptr<Node> node = Current ()->process->manager->GetObject<Node> (); |
|
206 |
- Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> (); |
|
207 |
+ Thread *current = Current (); |
|
208 |
+ Ptr<SocketFdFactory> factory = 0; |
|
209 |
+ factory = current->process->manager->GetObject<SocketFdFactory> (); |
|
210 |
||
211 |
- for (uint32_t i = 0; i < node->GetNDevices (); ++i) |
|
212 |
+ if (factory->GetInstanceTypeId () == TypeId::LookupByName ("ns3::LinuxSocketFdFactory")) |
|
213 |
{ |
|
214 |
- Ptr<NetDevice> dev = node->GetDevice (i); |
|
215 |
- if (ifname == Names::FindName (dev)) |
|
216 |
+ struct ifreq ifr; |
|
217 |
+ int fd = dce_socket (AF_INET, SOCK_DGRAM, 0); |
|
218 |
+ if (fd < 0) |
|
219 |
{ |
|
220 |
- index = ipv4->GetInterfaceForDevice (dev); |
|
221 |
- return index; |
|
222 |
+ return 0; |
|
223 |
} |
|
224 |
+ |
|
225 |
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); |
|
226 |
+ if (dce_ioctl (fd, SIOCGIFINDEX, (char *)&ifr) < 0) |
|
227 |
+ { |
|
228 |
+ current->err = errno; |
|
229 |
+ return -1; |
|
230 |
+ } |
|
231 |
+ return ifr.ifr_ifindex; |
|
232 |
} |
|
233 |
- return 0; |
|
234 |
+ else |
|
0 | 235 |
+ { |
17 | 236 |
+ int index = 0; |
237 |
+ Ptr<Node> node = Current ()->process->manager->GetObject<Node> (); |
|
238 |
+ Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> (); |
|
239 |
+ |
|
240 |
+ for (uint32_t i = 0; i < node->GetNDevices (); ++i) |
|
241 |
+ { |
|
242 |
+ Ptr<NetDevice> dev = node->GetDevice (i); |
|
243 |
+ if (ifname == Names::FindName (dev)) |
|
244 |
+ { |
|
245 |
+ index = ipv4->GetInterfaceForDevice (dev); |
|
246 |
+ return index; |
|
247 |
+ } |
|
248 |
+ } |
|
0 | 249 |
+ return 0; |
250 |
+ } |
|
251 |
+} |
|
252 |
+char *dce_if_indextoname (unsigned ifindex, char *ifname) |
|
253 |
+{ |
|
254 |
+ struct ifreq ifr; |
|
255 |
+ int fd = dce_socket (AF_INET, SOCK_DGRAM, 0); |
|
256 |
+ if (fd < 0) |
|
257 |
+ { |
|
258 |
+ return 0; |
|
259 |
+ } |
|
260 |
+ |
|
261 |
+ ifr.ifr_ifindex = ifindex; |
|
262 |
+ if (dce_ioctl (fd, SIOCGIFNAME, (char *)&ifr) < 0) |
|
263 |
+ { |
|
264 |
+ return 0; |
|
265 |
+ } |
|
266 |
+ return strncpy (ifname, ifr.ifr_name, IFNAMSIZ); |
|
267 |
} |
|
268 |
pid_t dce_fork (void) |
|
269 |
{ |
|
17 | 270 |
@@ -849,6 +892,21 @@ |
15 | 271 |
static char loc[] = ""; |
272 |
return loc; |
|
273 |
} |
|
274 |
+int dce_sysinfo (struct sysinfo *info) |
|
275 |
+{ |
|
276 |
+ Thread *current = Current (); |
|
277 |
+ NS_LOG_FUNCTION (current << UtilsGetNodeId ()); |
|
278 |
+ NS_ASSERT (current != 0); |
|
279 |
+ if (!info) |
|
280 |
+ { |
|
281 |
+ current->err = ENAMETOOLONG; |
|
282 |
+ return -1; |
|
283 |
+ } |
|
284 |
+ |
|
285 |
+ info->uptime = (long)UtilsSimulationTimeToTime (Now ()).GetSeconds (); |
|
286 |
+ // XXX |
|
287 |
+ return 0; |
|
288 |
+} |
|
289 |
#ifdef HAVE_GETCPUFEATURES |
|
290 |
extern "C" |
|
291 |
{ |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
292 |
diff -r 056220694d84 model/elf-cache.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
293 |
--- a/model/elf-cache.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
294 |
+++ b/model/elf-cache.cc Sat Jun 02 00:27:53 2012 +0900 |
0 | 295 |
@@ -26,6 +26,9 @@ |
296 |
overriden.from = "libpthread.so.0"; |
|
297 |
overriden.to = "libpthread-ns3.so"; |
|
298 |
m_overriden.push_back (overriden); |
|
299 |
+ overriden.from = "librt.so.1"; |
|
300 |
+ overriden.to = "librt-ns3.so"; |
|
301 |
+ m_overriden.push_back (overriden); |
|
302 |
} |
|
303 |
||
304 |
std::string |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
305 |
diff -r 056220694d84 model/libc-ns3.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
306 |
--- a/model/libc-ns3.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
307 |
+++ b/model/libc-ns3.h Sat Jun 02 00:27:53 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
308 |
@@ -124,7 +124,8 @@ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
309 |
NATIVE (strcspn) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
310 |
NATIVE (strspn) |
20
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
311 |
NATIVE_EXPLICIT (strchr, char* (*) (char *, int)) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
312 |
-NATIVE_EXPLICIT (strrchr, char * (*) (char *, int)) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
313 |
+NATIVE_EXPLICIT (strrchr, const char * (*) (const char *, int)) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
314 |
+//DCE (strrchr) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
315 |
NATIVE (strcasecmp) |
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
316 |
NATIVE (strncasecmp) |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
317 |
DCE_WITH_ALIAS (strdup) // because C++ defines both const and non-const functions |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
318 |
@@ -149,6 +150,7 @@ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
319 |
NATIVE (htons) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
320 |
NATIVE (ntohl) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
321 |
NATIVE (ntohs) |
15 | 322 |
+NATIVE (lockf) |
323 |
NATIVE (inet_aton) |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
324 |
NATIVE (inet_addr) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
325 |
NATIVE (inet_network) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
326 |
@@ -158,9 +160,11 @@ |
0 | 327 |
NATIVE (inet_netof) |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
328 |
DCE (inet_ntop) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
329 |
NATIVE (inet_pton) |
0 | 330 |
+NATIVE (inet6_opt_find) |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
331 |
|
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
332 |
// SYS/SOCKET.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
333 |
DCE (socket) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
334 |
+DCE (socketpair) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
335 |
DCE (getsockname) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
336 |
DCE (getpeername) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
337 |
DCE (bind) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
338 |
@@ -312,7 +316,7 @@ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
339 |
NATIVE_WITH_ALIAS2 (gmtime_r, localtime_r) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
340 |
NATIVE (mktime) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
341 |
NATIVE (strftime) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
342 |
-NATIVE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime) // this is wrong. clock should be changed to DCE implementation |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
343 |
+DCE_WITH_ALIAS2 (clock_gettime, __vdso_clock_gettime) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
344 |
|
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
345 |
// SYS/TIME.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
346 |
DCE (gettimeofday) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
347 |
@@ -320,6 +324,8 @@ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
348 |
DCE (setitimer) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
349 |
DCE (getitimer) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
350 |
|
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
351 |
+DCE (sysinfo) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
352 |
+ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
353 |
// SYS/MAP.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
354 |
DCE (mmap) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
355 |
DCE (mmap64) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
356 |
@@ -347,6 +353,7 @@ |
0 | 357 |
NATIVE (sigdelset) |
358 |
NATIVE (sigismember) |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
359 |
DCE (sigprocmask) |
0 | 360 |
+DCE (sigwait) |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
361 |
|
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
362 |
// PTHREAD.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
363 |
DCE (pthread_create) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
364 |
@@ -377,6 +384,13 @@ |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
365 |
DCE (pthread_cond_wait) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
366 |
DCE (pthread_condattr_destroy) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
367 |
DCE (pthread_condattr_init) |
0 | 368 |
+NATIVE (pthread_rwlock_init) |
369 |
+NATIVE (pthread_rwlock_unlock) |
|
370 |
+NATIVE (pthread_rwlock_wrlock) |
|
371 |
+NATIVE (pthread_rwlock_rdlock) |
|
372 |
+NATIVE (pthread_rwlock_destroy) |
|
373 |
+NATIVE (pthread_setcancelstate) |
|
374 |
+NATIVE (pthread_sigmask) |
|
375 |
||
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
376 |
// SEMAPHORE.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
377 |
DCE (sem_init) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
378 |
@@ -420,6 +434,7 @@ |
0 | 379 |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
380 |
// NET/IF.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
381 |
DCE (if_nametoindex) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
382 |
+DCE (if_indextoname) |
0 | 383 |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
384 |
// DIRENT.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
385 |
DCE (opendir) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
386 |
@@ -479,6 +494,7 @@ |
0 | 387 |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
388 |
// NETINET/ETHER.H |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
389 |
NATIVE (ether_aton_r) |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
390 |
+NATIVE (ether_aton) |
0 | 391 |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
392 |
///////////////////// END OF INVENTAIRE ////////////////////////////////////////////////// |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
393 |
|
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
394 |
diff -r 056220694d84 model/librt-ns3.version |
0 | 395 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
396 |
+++ b/model/librt-ns3.version Sat Jun 02 00:27:53 2012 +0900 |
0 | 397 |
@@ -0,0 +1,4 @@ |
398 |
+NS3 { |
|
399 |
+global: |
|
400 |
+ librt_setup; |
|
401 |
+}; |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
402 |
diff -r 056220694d84 model/linux-socket-fd-factory.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
403 |
--- a/model/linux-socket-fd-factory.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
404 |
+++ b/model/linux-socket-fd-factory.cc Sat Jun 02 00:27:53 2012 +0900 |
18 | 405 |
@@ -464,6 +464,7 @@ |
406 |
void |
|
407 |
LinuxSocketFdFactory::SetTask (std::string path, std::string value) |
|
408 |
{ |
|
409 |
+ NS_LOG_FUNCTION (path << value); |
|
410 |
std::vector<std::pair<std::string,struct SimSysFile *> > files = GetSysFileList (); |
|
411 |
for (uint32_t i = 0; i < files.size (); i++) |
|
412 |
{ |
|
413 |
@@ -537,6 +538,7 @@ |
|
0 | 414 |
this)); |
415 |
Set (".net.ipv4.conf.all.forwarding", "1"); |
|
416 |
Set (".net.ipv4.conf.all.log_martians", "1"); |
|
18 | 417 |
+ Set (".net.ipv6.conf.all.forwarding", "0"); |
0 | 418 |
|
419 |
while (!m_earlySysfs.empty ()) |
|
420 |
{ |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
421 |
diff -r 056220694d84 model/net/dce-if.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
422 |
--- a/model/net/dce-if.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
423 |
+++ b/model/net/dce-if.h Sat Jun 02 00:27:53 2012 +0900 |
0 | 424 |
@@ -7,6 +7,7 @@ |
425 |
#endif |
|
426 |
||
427 |
unsigned dce_if_nametoindex (const char *ifname); |
|
428 |
+char *dce_if_indextoname (unsigned ifindex, char *ifname); |
|
429 |
||
430 |
||
431 |
#ifdef __cplusplus |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
432 |
diff -r 056220694d84 model/ns3-socket-fd-factory.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
433 |
--- a/model/ns3-socket-fd-factory.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
434 |
+++ b/model/ns3-socket-fd-factory.cc Sat Jun 02 00:27:53 2012 +0900 |
20
5ca51e147e7f
unbound, bind9, fedora8 added
Hajime Tazaki <tazaki@nict.go.jp>
parents:
19
diff
changeset
|
435 |
@@ -166,6 +166,7 @@ |
0 | 436 |
else |
437 |
{ |
|
19 | 438 |
NS_FATAL_ERROR ("unsupported domain"); |
0 | 439 |
+ return 0; |
440 |
} |
|
441 |
||
442 |
return socket; |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
443 |
diff -r 056220694d84 model/sys/dce-socket.h |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
444 |
--- a/model/sys/dce-socket.h Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
445 |
+++ b/model/sys/dce-socket.h Sat Jun 02 00:27:53 2012 +0900 |
15 | 446 |
@@ -28,6 +28,7 @@ |
447 |
ssize_t dce_sendmsg(int s, const struct msghdr *msg, int flags); |
|
448 |
int dce_getsockname(int s, struct sockaddr *name, socklen_t *namelen); |
|
449 |
int dce_getpeername(int s, struct sockaddr *name, socklen_t *namelen); |
|
450 |
+int dce_socketpair (int domain, int type, int protocol, int sv[2]); |
|
451 |
||
452 |
#ifdef __cplusplus |
|
453 |
} |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
454 |
diff -r 056220694d84 test/test-select.cc |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
455 |
--- a/test/test-select.cc Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
456 |
+++ b/test/test-select.cc Sat Jun 02 00:27:53 2012 +0900 |
19 | 457 |
@@ -43,9 +43,20 @@ |
458 |
struct timeval timeout = |
|
459 |
{ 0, 0 }; |
|
460 |
int nfds = select (timerfd + 1, &fds, NULL, NULL, &timeout); |
|
461 |
- close (timerfd); |
|
462 |
// no fds must be ready and select() should complete without errors |
|
463 |
TEST_ASSERT_EQUAL (nfds, 0); |
|
464 |
+ |
|
465 |
+ timeout.tv_sec = 1; |
|
466 |
+ timeout.tv_usec = 0; |
|
467 |
+ // select(2): |
|
468 |
+ // Some code calls select() with all three sets empty, nfds zero, and a |
|
469 |
+ // non-NULL timeout as a fairly portable way to sleep with subsecond |
|
470 |
+ // precision. |
|
471 |
+ nfds = select (0, &fds, NULL, NULL, &timeout); |
|
472 |
+ // no fds must be ready and select() should complete without errors |
|
473 |
+ TEST_ASSERT_EQUAL (nfds, 0); |
|
474 |
+ |
|
475 |
+ close (timerfd); |
|
476 |
} |
|
477 |
||
478 |
static bool |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
479 |
diff -r 056220694d84 wscript |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
480 |
--- a/wscript Sat Jun 02 00:22:49 2012 +0900 |
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
481 |
+++ b/wscript Sat Jun 02 00:27:53 2012 +0900 |
15 | 482 |
@@ -71,6 +71,17 @@ |
0 | 483 |
conf.end_msg(libpthread, True) |
484 |
conf.env['LIBPTHREAD_FILE'] = libpthread |
|
485 |
||
486 |
+ conf.start_msg('Searching rt library') |
|
487 |
+ librt = search_file ([ |
|
488 |
+ '/lib64/librt.so.1', |
|
489 |
+ '/lib/librt.so.1', |
|
490 |
+ ]) |
|
491 |
+ if librt is None: |
|
492 |
+ conf.fatal('not found') |
|
493 |
+ else: |
|
494 |
+ conf.end_msg(librt, True) |
|
495 |
+ conf.env['LIBRT_FILE'] = librt |
|
496 |
+ |
|
497 |
conf.find_program('readversiondef', var='READVERSIONDEF', mandatory=True) |
|
498 |
||
499 |
if Options.options.kernel_stack is not None and os.path.isdir(Options.options.kernel_stack): |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
500 |
@@ -429,6 +440,11 @@ |
0 | 501 |
rule='%s %s | cat ${SRC[0].abspath()} - > ${TGT}' % |
502 |
(bld.env['READVERSIONDEF'], bld.env['LIBPTHREAD_FILE'])) |
|
503 |
||
504 |
+ bld(source=['model/librt-ns3.version'], |
|
505 |
+ target='model/librt.version', |
|
506 |
+ rule='%s %s | cat ${SRC[0].abspath()} - > ${TGT}' % |
|
507 |
+ (bld.env['READVERSIONDEF'], bld.env['LIBRT_FILE'])) |
|
508 |
+ |
|
509 |
bld.add_group('dce_use_version_files') |
|
510 |
||
511 |
# The very small libc used to replace the glibc |
|
22
ed0d8cc18421
merge with HEAD of ns-3-dce
Hajime Tazaki <tazaki@nict.go.jp>
parents:
20
diff
changeset
|
512 |
@@ -448,3 +464,13 @@ |
0 | 513 |
linkflags=['-nostdlib', '-lc', |
514 |
'-Wl,--version-script=' + os.path.join('model', 'libpthread.version'), |
|
515 |
'-Wl,-soname=libpthread.so.0']) |
|
516 |
+ |
|
517 |
+ # The very small librt used to replace the glibc |
|
518 |
+ # and forward to the dce_* code |
|
519 |
+ bld.shlib(source = ['model/libc.cc', 'model/libc-setup.cc'], |
|
520 |
+ target='lib/rt-ns3', cflags=['-g'], |
|
521 |
+ defines=['LIBSETUP=librt_setup'], |
|
522 |
+ linkflags=['-nostdlib', '-lc', |
|
523 |
+ '-Wl,--version-script=' + os.path.join('model', 'librt.version'), |
|
524 |
+ '-Wl,-soname=librt.so.1']) |
|
525 |
+ |