FreeRDP
sshagent_main.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <pwd.h>
#include <unistd.h>
#include <errno.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
#include "sshagent_main.h"
#include <freerdp/freerdp.h>
#include <freerdp/client/channels.h>
#include <freerdp/channels/log.h>

Macros

#define TAG   CHANNELS_TAG("sshagent.client")
 

Functions

static int connect_to_sshagent (const char *udspath)
 
static DWORD WINAPI sshagent_read_thread (LPVOID data)
 
static UINT sshagent_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
 
static UINT sshagent_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT sshagent_on_new_channel_connection (IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT sshagent_plugin_initialize (IWTSPlugin *pPlugin, IWTSVirtualChannelManager *pChannelMgr)
 
static UINT sshagent_plugin_terminated (IWTSPlugin *pPlugin)
 
 if (!sshagent)
 

Variables

SSHAGENT_PLUGIN * sshagent
 
return status
 

Macro Definition Documentation

◆ TAG

#define TAG   CHANNELS_TAG("sshagent.client")

FreeRDP: A Remote Desktop Protocol Implementation SSH Agent Virtual Channel Extension

Copyright 2013 Christian Hofstaedtler Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2017 Ben Cohen

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ connect_to_sshagent()

static int connect_to_sshagent ( const char *  udspath)
static

Function to open the connection to the sshagent

Returns
The fd on success, otherwise -1
Here is the caller graph for this function:

◆ if()

if ( sshagent)
Here is the call graph for this function:

◆ sshagent_on_close()

static UINT sshagent_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Callback for when the virtual channel is closed

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sshagent_on_data_received()

static UINT sshagent_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream data 
)
static

Callback for data received from the RDP server; forward this to ssh-agent

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sshagent_on_new_channel_connection()

static UINT sshagent_on_new_channel_connection ( IWTSListenerCallback *  pListenerCallback,
IWTSVirtualChannel *  pChannel,
BYTE Data,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
static

Callback for when a new virtual channel is opened

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sshagent_plugin_initialize()

static UINT sshagent_plugin_initialize ( IWTSPlugin *  pPlugin,
IWTSVirtualChannelManager *  pChannelMgr 
)
static

Callback for when the plugin is initialised

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sshagent_plugin_terminated()

static UINT sshagent_plugin_terminated ( IWTSPlugin *  pPlugin)
static

Callback for when the plugin is terminated

Returns
0 on success, otherwise a Win32 error code
Here is the caller graph for this function:

◆ sshagent_read_thread()

static DWORD WINAPI sshagent_read_thread ( LPVOID  data)
static

Entry point for thread to read from the ssh-agent socket and forward the data to RDP

Returns
NULL
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ sshagent

sshagent
Initial value:
{
return status
Definition: sshagent_main.c:372
WINPR_PRAGMA_DIAG_PUSH WINPR_PRAGMA_DIAG_IGNORED_STRICT_PROTOTYPES typedef UINT(VCAPITYPE *static_entry_fn_t)()
#define CHANNEL_RC_OK
Definition: wtsapi.h:156

Main entry point for sshagent DVC plugin

Returns
0 on success, otherwise a Win32 error code

◆ status

return status