assh/helper_io.h header reference
Description [link]
This header provides helper functions designed to handle events generated by the transport layer.
It also provides terminal related helper functions.
Members [link]
Functions [link]
- ssize_t asshh_fd_event(struct assh_session_s *s, struct assh_event_s *e, int fd)
- assh_status_t asshh_fd_get_password(struct assh_context_s *c, const char **pass, size_t max_len, int fd, assh_bool_t echo)
- void asshh_print_kex_details(struct assh_session_s *s, FILE *out, const struct assh_event_s *event)
- void asshh_print_string(FILE *out, const struct assh_cbuffer_s *str)
Members detail [link]
ssize_t asshh_fd_event(struct assh_session_s *s, struct assh_event_s *e, int fd) [link]
This function is declared in assh/helper_io.h source file, line 54.
This function can be used to handle the ASSH_EVENT_READ and ASSH_EVENT_WRITE events by reading from and writing to a file descriptor. This function takes care of calling the assh_event_done function.
The amount of transferred data is returned. This can be 0 if the system call was interrupted or non-blocking. In case of IO error, the ASSH_ERR_IO error is reported to the assh_event_done function and -1 is returned.
assh_status_t asshh_fd_get_password(struct assh_context_s *c, const char **pass, size_t max_len, int fd, assh_bool_t echo) [link]
This function is declared in assh/helper_io.h source file, line 62.
This function read characters on the file descriptor until a new line is found. The terminal echo is disabled. Characters beyond the specified length are read but ignored. This function fails if the file descriptor is not a tty.
void asshh_print_kex_details(struct assh_session_s *s, FILE *out, const struct assh_event_s *event) [link]
This function is declared in assh/helper_io.h source file, line 74.
This function prints a list of algorithms selected by the kex exchange.
void asshh_print_string(FILE *out, const struct assh_cbuffer_s *str) [link]
This function is declared in assh/helper_io.h source file, line 69.
This function writes a string to the passed stream, filtering out terminal control characters.