OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <fcntl.h> | 5 #include <fcntl.h> |
6 #include <linux/if_tun.h> | 6 #include <linux/if_tun.h> |
7 #include <linux/types.h> | 7 #include <linux/types.h> |
8 #include <math.h> | 8 #include <math.h> |
9 #include <net/if.h> | 9 #include <net/if.h> |
10 #include <netinet/in.h> | 10 #include <netinet/in.h> |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 /* this is the special file descriptor that the caller will use to talk | 261 /* this is the special file descriptor that the caller will use to talk |
262 * with the virtual interface */ | 262 * with the virtual interface */ |
263 return fd; | 263 return fd; |
264 } | 264 } |
265 | 265 |
266 | 266 |
267 int main(int argc, char **argv) { | 267 int main(int argc, char **argv) { |
268 base::AtExitManager exit_manager; | 268 base::AtExitManager exit_manager; |
269 CommandLine::Init(argc, argv); | 269 base::CommandLine::Init(argc, argv); |
270 InitLogging(logging::LoggingSettings()); | 270 InitLogging(logging::LoggingSettings()); |
271 | 271 |
272 if (argc < 4) { | 272 if (argc < 4) { |
273 fprintf(stderr, "Usage: tap_proxy tap1 tap2 type\n"); | 273 fprintf(stderr, "Usage: tap_proxy tap1 tap2 type\n"); |
274 fprintf(stderr, | 274 fprintf(stderr, |
275 "Where 'type' is one of perfect, good, wifi, bad or evil\n"); | 275 "Where 'type' is one of perfect, good, wifi, bad or evil\n"); |
276 exit(1); | 276 exit(1); |
277 } | 277 } |
278 | 278 |
279 scoped_ptr<media::cast::test::PacketPipe> in_pipe, out_pipe; | 279 scoped_ptr<media::cast::test::PacketPipe> in_pipe, out_pipe; |
(...skipping 25 matching lines...) Expand all Loading... |
305 int fd2 = tun_alloc(argv[2], IFF_TAP); | 305 int fd2 = tun_alloc(argv[2], IFF_TAP); |
306 | 306 |
307 base::MessageLoopForIO message_loop; | 307 base::MessageLoopForIO message_loop; |
308 last_printout = base::TimeTicks::Now(); | 308 last_printout = base::TimeTicks::Now(); |
309 media::cast::test::QueueManager qm1(fd1, fd2, in_pipe.Pass()); | 309 media::cast::test::QueueManager qm1(fd1, fd2, in_pipe.Pass()); |
310 media::cast::test::QueueManager qm2(fd2, fd1, out_pipe.Pass()); | 310 media::cast::test::QueueManager qm2(fd2, fd1, out_pipe.Pass()); |
311 CheckByteCounters(); | 311 CheckByteCounters(); |
312 printf("Press Ctrl-C when done.\n"); | 312 printf("Press Ctrl-C when done.\n"); |
313 message_loop.Run(); | 313 message_loop.Run(); |
314 } | 314 } |
OLD | NEW |