mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-22 05:57:28 +08:00
netshell01: New test and stop using old network configuration code
The old network configuration using a data structure does not support IPV6 and does not support all of the network settings that the FreeBSD command line utilities do. Transition to using the network utilities like ifconfig, route, etc. to initialize the NIC configuration.
This commit is contained in:
parent
c1e56a553c
commit
42cd4b0bde
@ -11,9 +11,6 @@
|
||||
void print_test_name(void);
|
||||
void test_main(void);
|
||||
|
||||
/* XXX temporary until in .h file */
|
||||
void rtems_initialize_interfaces(void);
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
@ -28,9 +25,6 @@ rtems_task Init(
|
||||
|
||||
rtems_bsd_initialize_with_interrupt_server();
|
||||
|
||||
puts( "Initializing interfaces" );
|
||||
rtems_initialize_interfaces();
|
||||
|
||||
test_main();
|
||||
/* should not return */
|
||||
|
||||
|
30
testsuite/netshell01/Makefile
Normal file
30
testsuite/netshell01/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
include ../../config.inc
|
||||
|
||||
PGM=${ARCH}/netshell01.exe
|
||||
|
||||
# optional managers required
|
||||
MANAGERS=all
|
||||
|
||||
# C source names
|
||||
C_FILES = init.c test_main.c shellconfig.c
|
||||
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
|
||||
|
||||
AM_CPPFLAGS += -I $(INSTALL_BASE)/include
|
||||
AM_CPPFLAGS += -I ../init01
|
||||
LINK_LIBS += $(INSTALL_BASE)/libbsdc.a
|
||||
LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
|
||||
|
||||
include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
|
||||
include $(RTEMS_CUSTOM)
|
||||
include $(PROJECT_ROOT)/make/leaf.cfg
|
||||
|
||||
OBJS= $(C_O_FILES)
|
||||
CLEAN_ADDITIONS += init.c
|
||||
|
||||
all: init.c ${ARCH} $(PGM)
|
||||
|
||||
init.c: ../init01/init.c
|
||||
cp ../init01/init.c .
|
||||
|
||||
$(PGM): $(OBJS)
|
||||
-$(make-exe)
|
15
testsuite/netshell01/shellconfig.c
Normal file
15
testsuite/netshell01/shellconfig.c
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Shell Configuration
|
||||
*/
|
||||
|
||||
#include <rtems/shell.h>
|
||||
|
||||
#define CONFIGURE_SHELL_COMMANDS_INIT
|
||||
#define CONFIGURE_SHELL_COMMANDS_ALL
|
||||
#define CONFIGURE_SHELL_MOUNT_MSDOS
|
||||
#define CONFIGURE_SHELL_MOUNT_RFS
|
||||
#define CONFIGURE_SHELL_DEBUGRFS
|
||||
|
||||
#include <rtems/shellconfig.h>
|
||||
|
||||
|
30
testsuite/netshell01/test_main.c
Normal file
30
testsuite/netshell01/test_main.c
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* This is the body of the test. It does not do much except ensure
|
||||
* that the target is alive after initializing the TCP/IP stack.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <rtems/shell.h>
|
||||
|
||||
void print_test_name(void)
|
||||
{
|
||||
printf( "\n\n*** LIBFREEBSD NETWORK SHELL TEST ***\n" );
|
||||
}
|
||||
|
||||
/*
|
||||
* RTEMS Startup Task
|
||||
*/
|
||||
void test_main(void)
|
||||
{
|
||||
rtems_shell_env_t env = rtems_global_shell_env;
|
||||
|
||||
rtems_shell_main_loop( &env );
|
||||
|
||||
puts( "*** END OF NETWORK SHELL TEST ***" );
|
||||
exit( 0 );
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user