|
| 1 | +# This file is part of ssh-python. |
| 2 | +# Copyright (C) 2018 Panos Kittenis |
| 3 | +# |
| 4 | +# This library is free software; you can redistribute it and/or |
| 5 | +# modify it under the terms of the GNU Lesser General Public |
| 6 | +# License as published by the Free Software Foundation, version 2.1. |
| 7 | +# |
| 8 | +# This library is distributed in the hope that it will be useful, |
| 9 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | +# Lesser General Public License for more details. |
| 12 | +# |
| 13 | +# You should have received a copy of the GNU Lesser General Public |
| 14 | +# License along with this library; if not, write to the Free Software |
| 15 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 |
| 16 | + |
| 17 | +from c_ssh cimport ssh_session, ssh_string, ssh_message, ssh_channel, uint32_t, uint16_t, \ |
| 18 | + uint8_t, ssh_key_struct, ssh_buffer |
| 19 | + |
| 20 | +cdef extern from "libssh/include/messages.h" nogil: |
| 21 | + struct ssh_auth_request: |
| 22 | + char *username |
| 23 | + int method |
| 24 | + char *password |
| 25 | + ssh_key_struct *pubkey |
| 26 | + char signature_state |
| 27 | + char kbdint_response |
| 28 | + |
| 29 | + struct ssh_channel_request_open: |
| 30 | + int type |
| 31 | + uint32_t sender |
| 32 | + uint32_t window |
| 33 | + uint32_t packet_size |
| 34 | + char *originator |
| 35 | + uint16_t originator_port |
| 36 | + char *destination |
| 37 | + uint16_t destination_port |
| 38 | + |
| 39 | + struct ssh_service_request: |
| 40 | + char *service |
| 41 | + |
| 42 | + struct ssh_global_request: |
| 43 | + int type |
| 44 | + uint8_t want_reply |
| 45 | + char *bind_address |
| 46 | + uint16_t bind_port |
| 47 | + |
| 48 | + struct ssh_channel_request: |
| 49 | + int type |
| 50 | + ssh_channel channel |
| 51 | + uint8_t want_reply |
| 52 | + char *TERM |
| 53 | + uint32_t width |
| 54 | + uint32_t height |
| 55 | + uint32_t pxwidth |
| 56 | + uint32_t pxheight |
| 57 | + ssh_string modes |
| 58 | + char *var_name |
| 59 | + char *var_value |
| 60 | + char *command |
| 61 | + char *subsystem |
| 62 | + uint8_t x11_single_connection |
| 63 | + char *x11_auth_protocol |
| 64 | + char *x11_auth_cookie |
| 65 | + uint32_t x11_screen_number |
| 66 | + |
| 67 | + struct ssh_message_struct: |
| 68 | + ssh_session session |
| 69 | + int type |
| 70 | + ssh_auth_request auth_request |
| 71 | + ssh_channel_request_open channel_request_open |
| 72 | + ssh_channel_request channel_request |
| 73 | + ssh_service_request service_request |
| 74 | + ssh_global_request global_request |
| 75 | + |
| 76 | + int ssh_message_handle_channel_request(ssh_session session, ssh_channel channel, ssh_buffer packet, |
| 77 | + const char *request, uint8_t want_reply) |
| 78 | + void ssh_message_queue(ssh_session session, ssh_message message) |
| 79 | + ssh_message ssh_message_pop_head(ssh_session session) |
| 80 | + int ssh_message_channel_request_open_reply_accept_channel(ssh_message msg, ssh_channel chan) |
0 commit comments