/* *=========================================================================== * ipcom_enter_vxworks_shell *=========================================================================== * Description: IP shell command to enter the VxWorks shell. The command blocks * until the VxWorks shell exits * Parameters: Command and arguments (not used) * Returns: 0 * */ IP_GLOBAL int ipcom_cmd_vxshell(int argc, char **argv) { int fd; Ipcom_proc *proc; Ipcom_vxshell_session_t session; (void)argc; (void)argv; proc = ipcom_proc_find(ipcom_getpid(), IP_FALSE); #ifdef IPCOM_USE_NATIVE_SOCK_API fd = proc->shell_fd; #else fd = ipcom_windnet_socket_use_existing(proc->shell_fd); #endif ipcom_sem_create(&session.shell_exit_sem, 0); if (shellParserControl(REMOTE_START, (Ip_u32)&session, fd, ipcom_vxworks_shell_logout_cb) == 0) { ipcom_sem_wait(session.shell_exit_sem); shellParserControl(REMOTE_STOP, (Ip_u32)&session, 0, IP_NULL); } ipcom_sem_delete(&session.shell_exit_sem); #ifndef IPCOM_USE_NATIVE_SOCK_API close(fd); #endif return 0; }
/* *=========================================================================== * ipppp_work_init *=========================================================================== * Description: * Parameters: * Returns: * */ IP_STATIC Ip_err ipppp_work_init(void *unused) { IPCOM_UNUSED_ARG(unused); ipcom_list_init(&ipppp_work_queue); ipcom_mutex_create(&ipppp_work_lock); ipcom_sem_create(&ipppp_work_sem, 0); return ipcom_proc_create("ipppp_work", (Ipcom_proc_func)ipppp_work, IPCOM_PROC_STACK_DEFAULT, IP_NULL); }
/* *=========================================================================== * ipcom_cmd_smptest_server *=========================================================================== * Description: This is the server part of the smptest command * Parameters: The address we should listen to, and info about how many sockets * we should use. * Returns: 0 on success. -1 on failure. */ IP_STATIC int ipcom_cmd_smptest_server() { Ipcom_proc_attr attr; unsigned int i; Ipcom_proc *proc; int retval; spawn_number_server = 0; if ( 0 != ipcom_sem_create( &sem_wait_server, 0 ) ) { ipcom_printf("ipcom_sem_create failed: %s"IP_LF, ipcom_strerror(ipcom_errno)); return -1; } ipcom_atomic_set( &num_wait_server, smp_opt_server.num_sock ); ipcom_atomic_set( &listen_wait, smp_opt_server.num_sock ); ipcom_proc_attr_init(&attr); attr.priority = IPCOM_PRIORITY_DEFAULT; /* Hacky hacky way to write from a task.. copied from ipcom_mshell.c */ proc = ipcom_proc_self(); ip_assert( proc != 0 ); server_out = proc->shell_fd; for ( i = 0;i < smp_opt_server.num_sock;++i ) { retval = ipcom_proc_acreate("ipcom_cmd_smptest_server_spawn", (Ipcom_proc_func)ipcom_cmd_smptest_server_spawn, &attr, 0 ); if (retval != 0) { ipcom_printf( "Error spawning smptest server"IP_LF ); return retval; } } ipcom_sem_wait( sem_wait_server ); ipcom_sem_delete( &sem_wait_server ); return 0; }
/* *=========================================================================== * ipcom_cmd_smptest_client *=========================================================================== * Description: This is the client part of the smptest command * Parameters: The address we should connect to, and info about how many sockets * we should use. * Returns: 0 on success. -1 on failure. */ IP_STATIC int ipcom_cmd_smptest_client() { Ipcom_proc_attr attr; unsigned int i; int retval; spawn_number_client = 0; if ( 0 != ipcom_sem_create( &sem_wait_client, 0 ) ) { ipcom_printf("ipcom_sem_create failed: %s"IP_LF, ipcom_strerror(ipcom_errno)); return -1; } ipcom_atomic_set( &num_wait_client, smp_opt_client.num_sock ); ipcom_proc_attr_init(&attr); attr.priority = IPCOM_PRIORITY_DEFAULT; for ( i = 0;i < smp_opt_client.num_sock;++i ) { retval = ipcom_proc_acreate("ipcom_cmd_smptest_client_spawn", (Ipcom_proc_func)ipcom_cmd_smptest_client_spawn, &attr, 0 ); if (retval != 0) { ipcom_printf( "Error spawning smptest client"IP_LF ); return retval; } } ipcom_sem_wait( sem_wait_client ); /* wait for tasks to complete */ ipcom_sem_delete( &sem_wait_client ); return 0; }