| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 Travis Geiselbrecht | 2 * Copyright (c) 2014 Travis Geiselbrecht |
| 3 * | 3 * |
| 4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
| 5 * a copy of this software and associated documentation files | 5 * a copy of this software and associated documentation files |
| 6 * (the "Software"), to deal in the Software without restriction, | 6 * (the "Software"), to deal in the Software without restriction, |
| 7 * including without limitation the rights to use, copy, modify, merge, | 7 * including without limitation the rights to use, copy, modify, merge, |
| 8 * publish, distribute, sublicense, and/or sell copies of the Software, | 8 * publish, distribute, sublicense, and/or sell copies of the Software, |
| 9 * and to permit persons to whom the Software is furnished to do so, | 9 * and to permit persons to whom the Software is furnished to do so, |
| 10 * subject to the following conditions: | 10 * subject to the following conditions: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 */ | 22 */ |
| 23 #include <app.h> | 23 #include <app.h> |
| 24 #include <err.h> | 24 #include <err.h> |
| 25 #include <debug.h> | 25 #include <debug.h> |
| 26 #include <trace.h> | 26 #include <trace.h> |
| 27 #include <stdio.h> | 27 #include <stdio.h> |
| 28 #include <stdlib.h> | 28 #include <stdlib.h> |
| 29 #include <compiler.h> | 29 #include <compiler.h> |
| 30 #include <kernel/thread.h> | 30 #include <kernel/thread.h> |
| 31 #include <lib/minip.h> | 31 #include <lib/minip.h> |
| 32 #include <lib/tftp.h> |
| 32 #include <lib/cksum.h> | 33 #include <lib/cksum.h> |
| 33 #include <platform.h> | 34 #include <platform.h> |
| 34 | 35 |
| 35 #include "inetsrv.h" | 36 #include "inetsrv.h" |
| 36 | 37 |
| 37 static int chargen_worker(void *socket) | 38 static int chargen_worker(void *socket) |
| 38 { | 39 { |
| 39 uint64_t count = 0; | 40 uint64_t count = 0; |
| 40 tcp_socket_t *s = socket; | 41 tcp_socket_t *s = socket; |
| 41 | 42 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 221 |
| 221 static void inetsrv_entry(const struct app_descriptor *app, void *args) | 222 static void inetsrv_entry(const struct app_descriptor *app, void *args) |
| 222 { | 223 { |
| 223 /* XXX wait for the stack to initialize */ | 224 /* XXX wait for the stack to initialize */ |
| 224 | 225 |
| 225 printf("starting internet servers\n"); | 226 printf("starting internet servers\n"); |
| 226 | 227 |
| 227 thread_detach_and_resume(thread_create("chargen", &chargen_server, NULL, DEF
AULT_PRIORITY, DEFAULT_STACK_SIZE)); | 228 thread_detach_and_resume(thread_create("chargen", &chargen_server, NULL, DEF
AULT_PRIORITY, DEFAULT_STACK_SIZE)); |
| 228 thread_detach_and_resume(thread_create("discard", &discard_server, NULL, DEF
AULT_PRIORITY, DEFAULT_STACK_SIZE)); | 229 thread_detach_and_resume(thread_create("discard", &discard_server, NULL, DEF
AULT_PRIORITY, DEFAULT_STACK_SIZE)); |
| 229 thread_detach_and_resume(thread_create("echo", &echo_server, NULL, DEFAULT_P
RIORITY, DEFAULT_STACK_SIZE)); | 230 thread_detach_and_resume(thread_create("echo", &echo_server, NULL, DEFAULT_P
RIORITY, DEFAULT_STACK_SIZE)); |
| 231 tftp_server_init(NULL); |
| 230 } | 232 } |
| 231 | 233 |
| 232 APP_START(inetsrv) | 234 APP_START(inetsrv) |
| 233 .init = inetsrv_init, | 235 .init = inetsrv_init, |
| 234 .entry = inetsrv_entry, | 236 .entry = inetsrv_entry, |
| 235 .flags = 0, | 237 .flags = 0, |
| 236 APP_END | 238 APP_END |
| OLD | NEW |