2 * transsip - the telephony network
3 * By Daniel Borkmann <daniel@transsip.org>
4 * Copyright 2011 Daniel Borkmann <dborkma@tik.ee.ethz.ch>,
5 * Swiss federal institute of technology (ETH Zurich)
6 * Subject to the GPL, version 2.
12 #include <readline/readline.h>
14 #define MAX_MENU_ELEMS 100
16 extern void call_out(char *host
, char *port
);
17 extern void call_in(int take
);
19 extern int cmd_help(char *args
);
20 extern int cmd_quit(char *args
);
21 extern int cmd_stat(char *args
);
22 extern int cmd_call_ip(char *args
);
23 extern int cmd_take(char *arg
);
27 rl_icpfunc_t
*callback
;
29 struct shell_cmd
*sub_cmd
;
32 static struct shell_cmd call_node
[] = {
33 { "ip", cmd_call_ip
, "Call an IP directly", NULL
, },
34 { "peer", cmd_help
, "Call a peer throught transsip DHT", NULL
, },
35 { NULL
, NULL
, NULL
, NULL
, },
38 static struct shell_cmd show_node
[] = {
39 { "settings", cmd_help
, "Show settings", NULL
, },
40 { "pubkey", cmd_help
, "Show my public key", NULL
, },
41 { "contacts", cmd_help
, "Show my contacts", NULL
, },
42 { NULL
, NULL
, NULL
, NULL
, },
45 static struct shell_cmd import_node
[] = {
46 { "contact", cmd_help
, "Import a contact user/pubkey", NULL
, },
47 { NULL
, NULL
, NULL
, NULL
, },
50 static struct shell_cmd cmd_tree
[] = {
51 { "help", cmd_help
, "Show help", NULL
, },
52 { "quit", cmd_quit
, "Exit transsip shell", NULL
, },
53 { "call", NULL
, "Perform a call", call_node
, },
54 { "take", cmd_take
, "Take a call", NULL
, },
55 { "show", NULL
, "Show information", show_node
, },
56 { "import", NULL
, "Import things", import_node
, },
57 { NULL
, NULL
, NULL
, NULL
, },
60 #endif /* CLICMDS_H */