# shell.c File Reference

`#include <lib/kmalloc.h>`
`#include <ubixos/fork.h>`
`#include <string.h>`
`#include "net/mem.h"`
`#include "net/debug.h"`
`#include "net/def.h"`
`#include "net/api.h"`
`#include "net/stats.h"`
`#include "lib/kprintf.h"`

Go to the source code of this file.

## Defines

#define | ECLOSED -4
#define | ESUCCESS 0
#define | ESYNTAX -1
#define | ETOOFEW -2
#define | ETOOMANY -3
#define | NCONNS 10

## Functions

static void | prompt (struct netconn *conn)
static void | sendstr (const char *str, struct netconn *conn)
void | shell_init (void)
static void | shell_main (struct netconn *conn)
static void | shell_thread (void *arg)

## Variables

char * | buffer = 0x0

## Define Documentation

#define ECLOSED -4

Definition at line 53 of file shell.c.

#define ESUCCESS 0

Definition at line 49 of file shell.c.

#define ESYNTAX -1

Definition at line 50 of file shell.c.

#define ETOOFEW -2

Definition at line 51 of file shell.c.

#define ETOOMANY -3

Definition at line 52 of file shell.c.

#define NCONNS 10

Definition at line 55 of file shell.c.

## Function Documentation

static void prompt | ( | struct netconn * | conn | ) | `[static]`

Definition at line 62 of file shell.c.

References sendstr().

Referenced by shell_main().

static void sendstr | ( | const char * | str,
|  | struct netconn * | conn |
| ) |  |  | `[static]`

Definition at line 58 of file shell.c.

References NETCONN_NOCOPY, netconn_write(), and strlen.

Referenced by prompt(), and shell_main().

void shell_init | ( | void |  | ) |

Definition at line 114 of file shell.c.

References NULL, shell_thread(), and sys_thread_new().

Referenced by netMainThread().

static void shell_main | ( | struct netconn * | conn | ) | `[static]`

Definition at line 66 of file shell.c.

References buffer, kprintf(), netbuf_copy(), netbuf_delete(), netbuf_len(), netconn_close(), netconn_recv(), prompt(), sendstr(), and strcmp().

Referenced by shell_thread().

static void shell_thread | ( | void * | arg | ) | `[static]`

Definition at line 94 of file shell.c.

References buffer, kmalloc(), kprintf(), netconn_accept(), netconn_bind(), netconn_listen(), netconn_new(), NETCONN_TCP, NULL, and shell_main().

Referenced by shell_init().

## Variable Documentation

char* buffer = 0x0

Definition at line 47 of file shell.c.

Referenced by readUbixFS(), shell_main(), shell_thread(), sys_write(), and udpecho_thread().