author | viric@mandarina |
Mon, 28 Apr 2008 21:42:48 +0200 | |
changeset 92 | faf9db07c037 |
parent 88 | a7f546938313 |
child 94 | 330324fc7c20 |
permissions | -rw-r--r-- |
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
1 |
enum Transport |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
2 |
{ |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
3 |
UNIX, |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
4 |
TCP, |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
5 |
ETHERNET |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
6 |
}; |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
7 |
|
21 | 8 |
struct Command_line { |
9 |
int is_server; |
|
10 |
char *unix_path; /* path or 0 if not to be used */ |
|
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
11 |
int tcp_port; |
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
12 |
char *eth_device; |
88 | 13 |
int eth_port; |
21 | 14 |
struct { |
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
15 |
int serve_tcp; /* yes/no */ |
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
16 |
int serve_unix; /* yes/no */ |
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
17 |
int serve_eth; /* yes/no */ |
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
18 |
int max_served; /* how many */ |
21 | 19 |
char run_in_subterminal; /* use opentty */ |
36
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
20 |
char echo_in_local_terminal; |
21 | 21 |
char use_blocking_sockets; |
22 |
char send_xterm_resize; |
|
23 | 23 |
char client_may_close_app_stdin; |
32
df110f784648
Added read-only clients, added stdin-close option to clients.
lbatlle@npdl268.bpo.hp.com
parents:
29
diff
changeset
|
24 |
char client_can_write; |
41 | 25 |
char nohup; /* detach from terminal as nohup */ |
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
26 |
char **command; /* ordono por exec */ |
21 | 27 |
} s_param; |
28 |
struct { |
|
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
29 |
enum Transport transport; |
21 | 30 |
unsigned int wait_until_char; /* -1, don't wait. */ |
31 |
char raw_mode; /* bool. else cooked */ |
|
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
32 |
char * server_address; |
21 | 33 |
} c_param; |
34 |
int buffer_size; |
|
35 |
}; |
|
36 |
||
0 | 37 |
|
38 |
/* error.c */ |
|
21 | 39 |
void not_implemented(const char *msg, ...); |
14 | 40 |
void error(const char *msg, ...); |
82
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
75
diff
changeset
|
41 |
void warning(const char *msg, ...); |
5cbe47923060
Added a terminal-creation capability.
lbatlle@npdl268.bpo.hp.com
parents:
75
diff
changeset
|
42 |
void debugmsg(const char *msg, ...); |
26
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
24
diff
changeset
|
43 |
void finish(int ret); |
0 | 44 |
|
21 | 45 |
/* signals.c */ |
46 |
void install_signal_forwarders(); |
|
60 | 47 |
void program_timeout(int secs); |
48 |
void unprogram_timeout(); |
|
66
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
60
diff
changeset
|
49 |
int did_timeout_happen(); |
71
c209487034d7
True nohup-like behaviour. Programs ignore to SIGHUP.
viric@llimona
parents:
66
diff
changeset
|
50 |
void ignore_sighup(); |
21 | 51 |
|
52 |
/* main.c */ |
|
53 |
extern int app_stdin; |
|
54 |
extern int app_stdout; |
|
55 |
extern int app_stderr; |
|
56 |
extern struct Command_line command_line; |
|
57 |
int max(int a, int b); |
|
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
58 |
int min(int a, int b); |
21 | 59 |
|
60 |
/* gen_sockets.c */ |
|
61 |
extern char *stream_buffer; |
|
62 |
extern int stream_buffer_size; |
|
34 | 63 |
extern char *ostream_buffer; |
64 |
extern int ostream_buffer_size; |
|
75 | 65 |
extern char *ostream_buffer2; |
66 |
extern int ostream_buffer2_size; |
|
34 | 67 |
void init_stream_buffers(); |
36
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
68 |
void welcome_new_client_socket(int s); |
21 | 69 |
|
23 | 70 |
/* server.c */ |
29
91286c3ecebc
Added getopt, and some things got based on parameters.
viric@llimona
parents:
26
diff
changeset
|
71 |
int server(); |
23 | 72 |
|
73 |
/* client.c */ |
|
74 |
int client(); |
|
24 | 75 |
|
76 |
/* app_term.c */ |
|
77 |
int fork_app(char * const command[]); |
|
74 | 78 |
void pass_winsize_to_slave(); |
26
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
24
diff
changeset
|
79 |
|
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
24
diff
changeset
|
80 |
/* server_term.c */ |
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
24
diff
changeset
|
81 |
void prepare_user_terminal(); |
96920c3707b3
Unix sockets version works! Well, signals don't. :)
viric@llimona
parents:
24
diff
changeset
|
82 |
void restore_user_terminal(); |
34 | 83 |
|
36
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
84 |
/* xterm.c */ |
34 | 85 |
char * get_xterm_resize_string(); |
36
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
86 |
|
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
87 |
/* dump.c */ |
75 | 88 |
extern int should_dump; |
36
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
89 |
void hex_dump(const char *head, const unsigned char *data, int len); |
da427c23d755
Added dumps, telnet_filter, applied filters in tm, improved telnet experience.
viric@llimona
parents:
34
diff
changeset
|
90 |
void dump_line(const char *msg, ...); |
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
91 |
|
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
92 |
/* eth_proto.c */ |
87
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
93 |
enum Eth_type |
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
94 |
{ |
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
95 |
ETH_SERVER, |
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
96 |
ETH_CLIENT |
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
97 |
}; |
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
98 |
void eth_proto_init(); |
87
be4ee314545c
Making client and server use different ethernet protocols
viric@llimona
parents:
82
diff
changeset
|
99 |
int eth_proto_open(enum Eth_type type); |
43
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
100 |
int eth_proto_recv(char *data, int size); |
625794738afc
Added first attempt for an ethernet protocol. Even not tried.
viric@llimona
parents:
41
diff
changeset
|
101 |
int eth_proto_send(const char *data, int size); |
66
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
60
diff
changeset
|
102 |
int eth_proto_allow_sending(); |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
60
diff
changeset
|
103 |
int eth_proto_max_send(); |
b2469563a1dc
Reliable ethernet protocol. I still need pselect instead of select.
viric@mandarina
parents:
60
diff
changeset
|
104 |
int eth_proto_process_timeouts(); |