Mercurial > dropbear
comparison cli-chansession.c @ 1460:58a74cb829b8
Pointer parameter could be declared as pointing to const (callback)
author | Francois Perrad <francois.perrad@gadz.org> |
---|---|
date | Sat, 19 Aug 2017 22:39:53 +0200 |
parents | 06d52bcb8094 |
children | 79eef94ccea9 |
comparison
equal
deleted
inserted
replaced
1459:06d52bcb8094 | 1460:58a74cb829b8 |
---|---|
33 #include "runopts.h" | 33 #include "runopts.h" |
34 #include "termcodes.h" | 34 #include "termcodes.h" |
35 #include "chansession.h" | 35 #include "chansession.h" |
36 #include "agentfwd.h" | 36 #include "agentfwd.h" |
37 | 37 |
38 static void cli_closechansess(struct Channel *channel); | 38 static void cli_closechansess(const struct Channel *channel); |
39 static int cli_initchansess(struct Channel *channel); | 39 static int cli_initchansess(struct Channel *channel); |
40 static void cli_chansessreq(struct Channel *channel); | 40 static void cli_chansessreq(struct Channel *channel); |
41 static void send_chansess_pty_req(const struct Channel *channel); | 41 static void send_chansess_pty_req(const struct Channel *channel); |
42 static void send_chansess_shell_req(const struct Channel *channel); | 42 static void send_chansess_shell_req(const struct Channel *channel); |
43 static void cli_escape_handler(struct Channel *channel, unsigned char* buf, int *len); | 43 static void cli_escape_handler(const struct Channel *channel, const unsigned char* buf, int *len); |
44 static int cli_init_netcat(struct Channel *channel); | 44 static int cli_init_netcat(struct Channel *channel); |
45 | 45 |
46 static void cli_tty_setup(void); | 46 static void cli_tty_setup(void); |
47 | 47 |
48 const struct ChanType clichansess = { | 48 const struct ChanType clichansess = { |
81 m_free(type); | 81 m_free(type); |
82 } | 82 } |
83 | 83 |
84 | 84 |
85 /* If the main session goes, we close it up */ | 85 /* If the main session goes, we close it up */ |
86 static void cli_closechansess(struct Channel *UNUSED(channel)) { | 86 static void cli_closechansess(const struct Channel *UNUSED(channel)) { |
87 cli_tty_cleanup(); /* Restore tty modes etc */ | 87 cli_tty_cleanup(); /* Restore tty modes etc */ |
88 | 88 |
89 /* This channel hasn't gone yet, so we have > 1 */ | 89 /* This channel hasn't gone yet, so we have > 1 */ |
90 if (ses.chancount > 1) { | 90 if (ses.chancount > 1) { |
91 dropbear_log(LOG_INFO, "Waiting for other channels to close..."); | 91 dropbear_log(LOG_INFO, "Waiting for other channels to close..."); |
450 return 0; | 450 return 0; |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 static | 454 static |
455 void cli_escape_handler(struct Channel* UNUSED(channel), unsigned char* buf, int *len) { | 455 void cli_escape_handler(const struct Channel* UNUSED(channel), const unsigned char* buf, int *len) { |
456 char c; | 456 char c; |
457 int skip_char = 0; | 457 int skip_char = 0; |
458 | 458 |
459 /* only handle escape characters if they are read one at a time. simplifies | 459 /* only handle escape characters if they are read one at a time. simplifies |
460 the code and avoids nasty people putting ~. at the start of a line to paste */ | 460 the code and avoids nasty people putting ~. at the start of a line to paste */ |