17 #ifndef __RTEMS_SHELL_H__ 18 #define __RTEMS_SHELL_H__ 20 #include <sys/types.h> 37 #define RTEMS_SHELL_KEYS_EXTENDED (0x8000) 38 #define RTEMS_SHELL_KEYS_NORMAL_MASK (0x00ff) 39 #define RTEMS_SHELL_KEYS_INS (0) 40 #define RTEMS_SHELL_KEYS_DEL (1) 41 #define RTEMS_SHELL_KEYS_UARROW (2) 42 #define RTEMS_SHELL_KEYS_DARROW (3) 43 #define RTEMS_SHELL_KEYS_LARROW (4) 44 #define RTEMS_SHELL_KEYS_RARROW (5) 45 #define RTEMS_SHELL_KEYS_HOME (6) 46 #define RTEMS_SHELL_KEYS_END (7) 47 #define RTEMS_SHELL_KEYS_F1 (8) 48 #define RTEMS_SHELL_KEYS_F2 (9) 49 #define RTEMS_SHELL_KEYS_F3 (10) 50 #define RTEMS_SHELL_KEYS_F4 (11) 51 #define RTEMS_SHELL_KEYS_F5 (12) 52 #define RTEMS_SHELL_KEYS_F6 (13) 53 #define RTEMS_SHELL_KEYS_F7 (14) 54 #define RTEMS_SHELL_KEYS_F8 (15) 55 #define RTEMS_SHELL_KEYS_F9 (16) 56 #define RTEMS_SHELL_KEYS_F10 (17) 58 typedef bool (*rtems_shell_login_check_t)(
63 extern bool rtems_shell_login_prompt(
67 rtems_shell_login_check_t check
70 extern bool rtems_shell_login_check(
72 const char *passphrase
75 typedef int (*rtems_shell_command_t)(
int argc,
char **argv);
84 rtems_shell_command_t command;
101 extern unsigned int rtems_shell_getchar(FILE *in);
113 rtems_shell_command_t command
121 extern int rtems_shell_make_args(
128 extern int rtems_shell_cat_file(
133 extern void rtems_shell_write_file(
138 extern int rtems_shell_script_file(
156 const char *task_name,
157 size_t task_stacksize,
162 rtems_shell_login_check_t login_check
179 const char *task_name,
180 size_t task_stacksize,
196 const char *taskname;
206 rtems_shell_login_check_t login_check;
221 bool rtems_shell_main_loop(
242 typedef int (*rtems_shell_filesystems_mounter_t)(
254 rtems_shell_filesystems_mounter_t mounter;
305 typedef void (*rtems_shell_wait_for_input_notification)(
307 int seconds_remaining,
320 int timeout_in_seconds,
321 rtems_shell_wait_for_input_notification notification,
322 void *notification_arg
325 extern int rtems_shell_main_monitor(
int argc,
char **argv);
331 int rtems_shell_main_mv(
int argc,
char *argv[]);
332 int rtems_shell_main_cp(
int argc,
char *argv[]);
333 int rtems_shell_main_rm(
int argc,
char *argv[]);
uid_t uid
The real and effective UID of the shell task in case no login check is present.
Definition: shell.h:212
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:80
int rtems_shell_libc_mounter(const char *driver, const char *path, rtems_shell_filesystems_t *fs, rtems_filesystem_options_t options)
Helper for the mount command.
rtems_filesystem_options_t
File system options.
Definition: libio.h:1585
rtems_status_code rtems_shell_script(const char *task_name, size_t task_stacksize, rtems_task_priority task_priority, const char *input, const char *output, bool output_append, bool wait, bool echo)
Run a shell script creating a shell tasks to execute the command under.
Definition: shell.c:1070
rtems_status_code rtems_shell_init(const char *task_name, size_t task_stacksize, rtems_task_priority task_priority, const char *devname, bool forever, bool wait, rtems_shell_login_check_t login_check)
Initialise the shell creating tasks to login and run the shell sessions.
Definition: shell.c:1039
rtems_status_code rtems_shell_wait_for_input(int fd, int timeout_in_seconds, rtems_shell_wait_for_input_notification notification, void *notification_arg)
Waits for input.
Definition: shell-wait-for-input.c:57
Private environment associated with each shell instance.
Definition: shell.h:192
POSIX Termios Implementation for RTEMS Console Device Driver.
Priority_Control rtems_task_priority
Define the type for an RTEMS API task priority.
Definition: tasks.h:79
rtems_status_code
Classic API Status.
Definition: status.h:46
void rtems_shell_get_prompt(rtems_shell_env_t *shell_env, char *prompt, size_t size)
This method dynamically builds the command line prompt string and places it in prompt.
Definition: shell_getprompt.c:33
uint32_t rtems_name
Classic API object name type.
Definition: types.h:74
int link(const char *path1, const char *path2)
link() - POSIX 1003.1b - 5.3.4 - Create a new link
Definition: link.c:28
gid_t gid
The real and effective GID of the shell task in case no login check is present.
Definition: shell.h:218
File system operations table.
Definition: libio.h:471
void rtems_shell_mount_add_fsys(rtems_shell_filesystems_t *fs)
Add a new file system mount configuration to the mount command.
rtems_name magic
'S','E','N','V': Shell Environment
Definition: shell.h:194
void rtems_shell_mount_del_fsys(rtems_shell_filesystems_t *fs)
Delete file system mount configuration from the mount command.