xine-lib 1.2.11
Data Structures | Macros | Functions | Variables
input_ssh.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <libssh2.h>
#include <libssh2_sftp.h>
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#include "http_helper.h"
#include "input_helper.h"

Data Structures

struct  ssh_input_plugin_t
 
struct  sftp_input_class_t
 

Macros

#define LOG_MODULE   "input_ssh"
 
#define LOG_VERBOSE
 
#define DEFAULT_SSH_PORT   22
 

Functions

static int _wait_socket (ssh_input_plugin_t *this)
 
static void _emit_authentication_request (ssh_input_plugin_t *this)
 
static int _ssh_connect (ssh_input_plugin_t *this, const xine_url_t *url)
 
static int _sftp_session_init (ssh_input_plugin_t *this)
 
static int _scp_channel_init (ssh_input_plugin_t *this, const char *uri)
 
static int _sftp_open (ssh_input_plugin_t *this, const char *uri)
 
static off_t _scp_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
 
static off_t _sftp_read (input_plugin_t *this_gen, void *buf_gen, off_t len)
 
static off_t _scp_get_length (input_plugin_t *this_gen)
 
static off_t _sftp_get_length (input_plugin_t *this_gen)
 
static off_t _get_current_pos (input_plugin_t *this_gen)
 
static off_t _scp_seek (input_plugin_t *this_gen, off_t offset, int origin)
 
static off_t _sftp_seek (input_plugin_t *this_gen, off_t offset, int origin)
 
static const char * _get_mrl (input_plugin_t *this_gen)
 
static int _get_optional_data (input_plugin_t *this_gen, void *data, int data_type)
 
static void _dispose (input_plugin_t *this_gen)
 
static int _scp_fill_preview (ssh_input_plugin_t *this)
 
static int _open_plugin (input_plugin_t *this_gen)
 
static input_plugin_t_get_instance (input_class_t *cls_gen, xine_stream_t *stream, const char *mrl)
 
static void * scp_init_class (xine_t *xine, const void *data)
 
static ssh_input_plugin_t_open_input (sftp_input_class_t *this, xine_url_t *url, const char *mrl)
 
static int _read_dir (sftp_input_class_t *this, ssh_input_plugin_t *input, const char *mrl, const char *uri, int *nFiles)
 
static xine_mrl_t ** _get_dir (input_class_t *this_gen, const char *filename, int *nFiles)
 
static void _dispose_class_sftp (input_class_t *this_gen)
 
static void * sftp_init_class (xine_t *xine, const void *data)
 

Variables

const input_info_t input_info_sftp
 
const input_info_t input_info_scp
 
const plugin_info_t xine_plugin_info[] EXPORTED
 

Macro Definition Documentation

◆ DEFAULT_SSH_PORT

#define DEFAULT_SSH_PORT   22

◆ LOG_MODULE

#define LOG_MODULE   "input_ssh"

◆ LOG_VERBOSE

#define LOG_VERBOSE

Function Documentation

◆ _dispose()

static void _dispose ( input_plugin_t this_gen)
static

◆ _dispose_class_sftp()

static void _dispose_class_sftp ( input_class_t this_gen)
static

References _x_input_free_mrls().

Referenced by sftp_init_class().

◆ _emit_authentication_request()

static void _emit_authentication_request ( ssh_input_plugin_t this)
static

◆ _get_current_pos()

static off_t _get_current_pos ( input_plugin_t this_gen)
static

Referenced by _get_instance().

◆ _get_dir()

static xine_mrl_t ** _get_dir ( input_class_t this_gen,
const char *  filename,
int *  nFiles 
)
static

◆ _get_instance()

static input_plugin_t * _get_instance ( input_class_t cls_gen,
xine_stream_t stream,
const char *  mrl 
)
static

◆ _get_mrl()

static const char * _get_mrl ( input_plugin_t this_gen)
static

Referenced by _get_instance().

◆ _get_optional_data()

static int _get_optional_data ( input_plugin_t this_gen,
void *  data,
int  data_type 
)
static

◆ _open_input()

static ssh_input_plugin_t * _open_input ( sftp_input_class_t this,
xine_url_t url,
const char *  mrl 
)
static

References _sftp_session_init(), _ssh_connect(), input(), and NULL.

Referenced by _get_dir().

◆ _open_plugin()

static int _open_plugin ( input_plugin_t this_gen)
static

◆ _read_dir()

static int _read_dir ( sftp_input_class_t this,
ssh_input_plugin_t input,
const char *  mrl,
const char *  uri,
int *  nFiles 
)
static

◆ _scp_channel_init()

static int _scp_channel_init ( ssh_input_plugin_t this,
const char *  uri 
)
static

◆ _scp_fill_preview()

static int _scp_fill_preview ( ssh_input_plugin_t this)
static

References _scp_read(), LOG_MODULE, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _open_plugin().

◆ _scp_get_length()

static off_t _scp_get_length ( input_plugin_t this_gen)
static

Referenced by _get_instance().

◆ _scp_read()

static off_t _scp_read ( input_plugin_t this_gen,
void *  buf_gen,
off_t  len 
)
static

◆ _scp_seek()

static off_t _scp_seek ( input_plugin_t this_gen,
off_t  offset,
int  origin 
)
static

References _x_input_seek_preview().

Referenced by _get_instance().

◆ _sftp_get_length()

static off_t _sftp_get_length ( input_plugin_t this_gen)
static

◆ _sftp_open()

static int _sftp_open ( ssh_input_plugin_t this,
const char *  uri 
)
static

◆ _sftp_read()

static off_t _sftp_read ( input_plugin_t this_gen,
void *  buf_gen,
off_t  len 
)
static

◆ _sftp_seek()

static off_t _sftp_seek ( input_plugin_t this_gen,
off_t  offset,
int  origin 
)
static

References LOG_MODULE, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _get_instance().

◆ _sftp_session_init()

static int _sftp_session_init ( ssh_input_plugin_t this)
static

◆ _ssh_connect()

static int _ssh_connect ( ssh_input_plugin_t this,
const xine_url_t url 
)
static

◆ _wait_socket()

static int _wait_socket ( ssh_input_plugin_t this)
static

◆ scp_init_class()

static void * scp_init_class ( xine_t xine,
const void *  data 
)
static

◆ sftp_init_class()

static void * sftp_init_class ( xine_t xine,
const void *  data 
)
static

Variable Documentation

◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED
Initial value:
= {
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
const input_info_t input_info_sftp
Definition: input_ssh.c:922
const input_info_t input_info_scp
Definition: input_ssh.c:926
static void * sftp_init_class(xine_t *xine, const void *data)
Definition: input_ssh.c:894
static void * scp_init_class(xine_t *xine, const void *data)
Definition: input_ssh.c:689
#define XINE_VERSION_CODE
Definition: xine_internal.h:57
NULL
Definition: xine_plugin.c:78
#define PLUGIN_NONE
Definition: xine_plugin.h:29
#define PLUGIN_INPUT
Definition: xine_plugin.h:30

◆ input_info_scp

const input_info_t input_info_scp
Initial value:
= {
.priority = 100,
}

◆ input_info_sftp

const input_info_t input_info_sftp
Initial value:
= {
.priority = 100,
}