Changeset 917a78b in rtems-libbsd
- Timestamp:
- 12/12/13 08:11:00 (10 years ago)
- Branches:
- 4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
- Children:
- e6d558f
- Parents:
- ec37843
- git-author:
- Sebastian Huber <sebastian.huber@…> (12/12/13 08:11:00)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (01/30/14 15:23:03)
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rec37843 r917a78b 1106 1106 $(CC) $(CPPFLAGS) $(CFLAGS) -DINET6 -c $< -o $@ 1107 1107 1108 TEST_DHCPCD01 = testsuite/dhcpcd01/dhcpcd01.exe 1109 TEST_DHCPCD01_O_FILES = 1110 TEST_DHCPCD01_D_FILES = 1111 TEST_DHCPCD01_O_FILES += testsuite/dhcpcd01/test_main.o 1112 TEST_DHCPCD01_D_FILES += testsuite/dhcpcd01/test_main.d 1113 $(TEST_DHCPCD01): $(TEST_DHCPCD01_O_FILES) $(LIB) 1114 $(LINK.c) -Wl,-Map,testsuite/dhcpcd01/dhcpcd01.map $^ -lm -lz -o $@ 1115 NET_TESTS += $(TEST_DHCPCD01) 1116 O_FILES += $(TEST_DHCPCD01_O_FILES) 1117 D_FILES += $(TEST_DHCPCD01_D_FILES) 1118 1119 TEST_DHCPCD02 = testsuite/dhcpcd02/dhcpcd02.exe 1120 TEST_DHCPCD02_O_FILES = 1121 TEST_DHCPCD02_D_FILES = 1122 TEST_DHCPCD02_O_FILES += testsuite/dhcpcd02/test_main.o 1123 TEST_DHCPCD02_D_FILES += testsuite/dhcpcd02/test_main.d 1124 $(TEST_DHCPCD02): $(TEST_DHCPCD02_O_FILES) $(LIB) 1125 $(LINK.c) -Wl,-Map,testsuite/dhcpcd02/dhcpcd02.map $^ -lm -lz -o $@ 1126 NET_TESTS += $(TEST_DHCPCD02) 1127 O_FILES += $(TEST_DHCPCD02_O_FILES) 1128 D_FILES += $(TEST_DHCPCD02_D_FILES) 1129 1108 1130 TEST_ARPHOLE = testsuite/arphole/arphole.exe 1109 1131 TEST_ARPHOLE_O_FILES = … … 1302 1324 D_FILES += $(TEST_THREAD01_D_FILES) 1303 1325 RUN_TESTS += $(TEST_THREAD01) 1326 LIB_C_FILES += dhcpcd/arp.c 1327 dhcpcd/arp.o: dhcpcd/arp.c 1328 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1329 LIB_C_FILES += dhcpcd/auth.c 1330 dhcpcd/auth.o: dhcpcd/auth.c 1331 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1332 LIB_C_FILES += dhcpcd/bpf.c 1333 dhcpcd/bpf.o: dhcpcd/bpf.c 1334 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1335 LIB_C_FILES += dhcpcd/common.c 1336 dhcpcd/common.o: dhcpcd/common.c 1337 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1338 LIB_C_FILES += dhcpcd/dhcp6.c 1339 dhcpcd/dhcp6.o: dhcpcd/dhcp6.c 1340 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1341 LIB_C_FILES += dhcpcd/dhcp.c 1342 dhcpcd/dhcp.o: dhcpcd/dhcp.c 1343 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1344 LIB_C_FILES += dhcpcd/dhcpcd.c 1345 dhcpcd/dhcpcd.o: dhcpcd/dhcpcd.c 1346 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1347 LIB_C_FILES += dhcpcd/dhcpcd-embedded.c 1348 dhcpcd/dhcpcd-embedded.o: dhcpcd/dhcpcd-embedded.c 1349 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1350 LIB_C_FILES += dhcpcd/dhcp-common.c 1351 dhcpcd/dhcp-common.o: dhcpcd/dhcp-common.c 1352 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1353 LIB_C_FILES += dhcpcd/duid.c 1354 dhcpcd/duid.o: dhcpcd/duid.c 1355 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1356 LIB_C_FILES += dhcpcd/eloop.c 1357 dhcpcd/eloop.o: dhcpcd/eloop.c 1358 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1359 LIB_C_FILES += dhcpcd/if-bsd.c 1360 dhcpcd/if-bsd.o: dhcpcd/if-bsd.c 1361 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1362 LIB_C_FILES += dhcpcd/if-options.c 1363 dhcpcd/if-options.o: dhcpcd/if-options.c 1364 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1365 LIB_C_FILES += dhcpcd/if-pref.c 1366 dhcpcd/if-pref.o: dhcpcd/if-pref.c 1367 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1368 LIB_C_FILES += dhcpcd/ipv4.c 1369 dhcpcd/ipv4.o: dhcpcd/ipv4.c 1370 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1371 LIB_C_FILES += dhcpcd/ipv4ll.c 1372 dhcpcd/ipv4ll.o: dhcpcd/ipv4ll.c 1373 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1374 LIB_C_FILES += dhcpcd/ipv6.c 1375 dhcpcd/ipv6.o: dhcpcd/ipv6.c 1376 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1377 LIB_C_FILES += dhcpcd/ipv6nd.c 1378 dhcpcd/ipv6nd.o: dhcpcd/ipv6nd.c 1379 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1380 LIB_C_FILES += dhcpcd/net.c 1381 dhcpcd/net.o: dhcpcd/net.c 1382 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1383 LIB_C_FILES += dhcpcd/platform-bsd.c 1384 dhcpcd/platform-bsd.o: dhcpcd/platform-bsd.c 1385 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1386 LIB_C_FILES += dhcpcd/compat/pselect.c 1387 dhcpcd/compat/pselect.o: dhcpcd/compat/pselect.c 1388 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1389 LIB_C_FILES += dhcpcd/crypt/hmac_md5.c 1390 dhcpcd/crypt/hmac_md5.o: dhcpcd/crypt/hmac_md5.c 1391 $(CC) $(CPPFLAGS) $(CFLAGS) -D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6 -c $< -o $@ 1392 LIB_C_FILES += rtemsbsd/rtems/rtems-bsd-shell-dhcpcd.c 1304 1393 1305 1394 ifeq ($(NEED_DUMMY_PIC_IRQ),yes) -
freebsd-to-rtems.py
rec37843 r917a78b 2430 2430 2431 2431 tests = Module('tests') 2432 tests.addTest('dhcpcd01', ['test_main'], runTest = False, netTest = True) 2433 tests.addTest('dhcpcd02', ['test_main'], runTest = False, netTest = True) 2432 2434 tests.addTest('arphole', ['test_main'], runTest = False, netTest = True) 2433 2435 tests.addTest('unix01', ['test_main']) … … 2447 2449 tests.addTest('thread01', ['test_main']) 2448 2450 2451 dhcpcd = Module('dhcpcd') 2452 dhcpcd.addSourceFiles( 2453 [ 2454 'dhcpcd/arp.c', 2455 'dhcpcd/auth.c', 2456 'dhcpcd/bpf.c', 2457 'dhcpcd/common.c', 2458 'dhcpcd/dhcp6.c', 2459 'dhcpcd/dhcp.c', 2460 'dhcpcd/dhcpcd.c', 2461 'dhcpcd/dhcpcd-embedded.c', 2462 'dhcpcd/dhcp-common.c', 2463 'dhcpcd/duid.c', 2464 'dhcpcd/eloop.c', 2465 'dhcpcd/if-bsd.c', 2466 'dhcpcd/if-options.c', 2467 'dhcpcd/if-pref.c', 2468 'dhcpcd/ipv4.c', 2469 'dhcpcd/ipv4ll.c', 2470 'dhcpcd/ipv6.c', 2471 'dhcpcd/ipv6nd.c', 2472 'dhcpcd/net.c', 2473 'dhcpcd/platform-bsd.c', 2474 'dhcpcd/compat/pselect.c', 2475 'dhcpcd/crypt/hmac_md5.c', 2476 ], 2477 '-D__FreeBSD__ -DTHERE_IS_NO_FORK -DMASTER_ONLY -DINET -DINET6' 2478 ) 2479 dhcpcd.addRTEMSSourceFiles( 2480 [ 2481 'rtems/rtems-bsd-shell-dhcpcd.c', 2482 ] 2483 ) 2484 2449 2485 # Register all the Module instances with the Module Manager 2450 2486 mm.addModule(rtems) … … 2489 2525 2490 2526 mm.addModule(tests) 2527 mm.addModule(dhcpcd) 2491 2528 2492 2529 # XXX TODO Check that no file is also listed in empty -
rtemsbsd/include/machine/rtems-bsd-commands.h
rec37843 r917a78b 57 57 int rtems_bsd_command_route(int argc, char **argv); 58 58 59 int rtems_bsd_command_dhcpcd(int argc, char **argv); 60 59 61 __END_DECLS 60 62 -
rtemsbsd/include/rtems/netcmds-config.h
rec37843 r917a78b 29 29 extern rtems_shell_cmd_t rtems_shell_ROUTE_Command; 30 30 extern rtems_shell_cmd_t rtems_shell_NETSTAT_Command; 31 extern rtems_shell_cmd_t rtems_shell_DHCPCD_Command; 31 32 // #endif 32 33 -
testsuite/include/rtems/bsd/test/default-network-init.h
rec37843 r917a78b 30 30 */ 31 31 32 #include <sys/stat.h> 33 32 34 #include <net/if.h> 33 35 34 36 #include <assert.h> 37 #include <fcntl.h> 35 38 #include <ifaddrs.h> 36 39 #include <stdio.h> … … 43 46 #include <rtems/stackchk.h> 44 47 #include <rtems/bsd/bsd.h> 48 49 #if defined(DEFAULT_NETWORK_DHCPCD_ENABLE) && \ 50 !defined(DEFAULT_NETWORK_NO_STATIC_IFCONFIG) 51 #define DEFAULT_NETWORK_NO_STATIC_IFCONFIG 52 #endif 45 53 46 54 #ifndef DEFAULT_NETWORK_NO_STATIC_IFCONFIG … … 144 152 } 145 153 154 #ifdef DEFAULT_NETWORK_DHCPCD_ENABLE 155 static void 156 default_network_dhcpcd_task(rtems_task_argument arg) 157 { 158 int exit_code; 159 char *dhcpcd[] = { 160 "dhcpcd", 161 NULL 162 }; 163 164 #ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY 165 static const char cfg[] = "nodhcp\nnodhcp6\n"; 166 int fd; 167 int rv; 168 ssize_t n; 169 170 fd = open("/etc/dhcpcd.conf", O_CREAT | O_WRONLY, 171 S_IRWXU | S_IRWXG | S_IRWXO); 172 assert(fd >= 0); 173 174 n = write(fd, cfg, sizeof(cfg)); 175 assert(n == (ssize_t) sizeof(cfg)); 176 177 rv = close(fd); 178 assert(rv == 0); 179 #endif 180 181 exit_code = rtems_bsd_command_dhcpcd(RTEMS_BSD_ARGC(dhcpcd), dhcpcd); 182 assert(exit_code == EXIT_SUCCESS); 183 } 184 #endif 185 186 static void 187 default_network_dhcpcd(void) 188 { 189 #ifdef DEFAULT_NETWORK_DHCPCD_ENABLE 190 rtems_status_code sc; 191 rtems_id id; 192 193 sc = rtems_task_create( 194 rtems_build_name('D', 'H', 'C', 'P'), 195 RTEMS_MAXIMUM_PRIORITY - 1, 196 RTEMS_MINIMUM_STACK_SIZE, 197 RTEMS_DEFAULT_MODES, 198 RTEMS_FLOATING_POINT, 199 &id 200 ); 201 assert(sc == RTEMS_SUCCESSFUL); 202 203 sc = rtems_task_start(id, default_network_dhcpcd_task, 0); 204 assert(sc == RTEMS_SUCCESSFUL); 205 #endif 206 } 207 146 208 static void 147 209 default_network_on_exit(int exit_code, void *arg) … … 200 262 default_network_ifconfig_hwif0(ifname); 201 263 default_network_route_hwif0(ifname); 264 default_network_dhcpcd(); 202 265 203 266 test_main();
Note: See TracChangeset
for help on using the changeset viewer.