FreeRDP
proxy.c File Reference
#include <ctype.h>
#include <errno.h>
#include "proxy.h"
#include "freerdp/settings.h"
#include "tcp.h"
#include "winpr/environment.h"

Macros

#define CRLF   "\r\n"
 
#define TAG   FREERDP_TAG("core.proxy")
 

Enumerations

enum  { AUTH_M_NO_AUTH = 0, AUTH_M_GSSAPI = 1, AUTH_M_USR_PASS = 2 }
 
enum  { SOCKS_CMD_CONNECT = 1, SOCKS_CMD_BIND = 2, SOCKS_CMD_UDP_ASSOCIATE = 3 }
 
enum  { SOCKS_ADDR_IPV4 = 1, SOCKS_ADDR_FQDN = 3, SOCKS_ADDR_IPV6 = 4 }
 

Functions

static BOOL http_proxy_connect (BIO *bufferedBio, const char *hostname, UINT16 port)
 
static BOOL socks_proxy_connect (BIO *bufferedBio, const char *proxyUsername, const char *proxyPassword, const char *hostname, UINT16 port)
 
void proxy_read_environment (rdpSettings *settings, char *envname)
 
BOOL proxy_prepare (rdpSettings *settings, const char **lpPeerHostname, UINT16 *lpPeerPort, const char **lpProxyUsername, const char **lpProxyPassword)
 
static BOOL cidr4_match (const struct in_addr *addr, const struct in_addr *net, BYTE bits)
 
static BOOL cidr6_match (const struct in6_addr *address, const struct in6_addr *network, uint8_t bits)
 
static BOOL check_no_proxy (rdpSettings *settings, const char *no_proxy)
 
BOOL proxy_parse_uri (rdpSettings *settings, const char *uri)
 
BOOL proxy_connect (rdpSettings *settings, BIO *bufferedBio, const char *proxyUsername, const char *proxyPassword, const char *hostname, UINT16 port)
 
static int recv_socks_reply (BIO *bufferedBio, BYTE *buf, int len, char *reason, BYTE checkVer)
 

Variables

static const char * rplstat []
 

Macro Definition Documentation

#define CRLF   "\r\n"

FreeRDP: A Remote Desktop Protocol Implementation HTTP Proxy support

Copyright 2016 Christian Plattner ccpp@.nosp@m.gmx..nosp@m.at

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.

#define TAG   FREERDP_TAG("core.proxy")

Enumeration Type Documentation

anonymous enum
Enumerator
AUTH_M_NO_AUTH 
AUTH_M_GSSAPI 
AUTH_M_USR_PASS 
anonymous enum
Enumerator
SOCKS_CMD_CONNECT 
SOCKS_CMD_BIND 
SOCKS_CMD_UDP_ASSOCIATE 
anonymous enum
Enumerator
SOCKS_ADDR_IPV4 
SOCKS_ADDR_FQDN 
SOCKS_ADDR_IPV6 

Function Documentation

static BOOL check_no_proxy ( rdpSettings *  settings,
const char *  no_proxy 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL cidr4_match ( const struct in_addr *  addr,
const struct in_addr *  net,
BYTE  bits 
)
static

Here is the caller graph for this function:

static BOOL cidr6_match ( const struct in6_addr *  address,
const struct in6_addr *  network,
uint8_t  bits 
)
static

Here is the caller graph for this function:

static BOOL http_proxy_connect ( BIO *  bufferedBio,
const char *  hostname,
UINT16  port 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL proxy_connect ( rdpSettings *  settings,
BIO *  bufferedBio,
const char *  proxyUsername,
const char *  proxyPassword,
const char *  hostname,
UINT16  port 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL proxy_parse_uri ( rdpSettings *  settings,
const char *  uri 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL proxy_prepare ( rdpSettings *  settings,
const char **  lpPeerHostname,
UINT16 lpPeerPort,
const char **  lpProxyUsername,
const char **  lpProxyPassword 
)

FreeRDP: A Remote Desktop Protocol Implementation HTTP proxy support

Copyright 2014 Christian Plattner ccpp@.nosp@m.gmx..nosp@m.at

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.

Here is the call graph for this function:

Here is the caller graph for this function:

void proxy_read_environment ( rdpSettings *  settings,
char *  envname 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int recv_socks_reply ( BIO *  bufferedBio,
BYTE buf,
int  len,
char *  reason,
BYTE  checkVer 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL socks_proxy_connect ( BIO *  bufferedBio,
const char *  proxyUsername,
const char *  proxyPassword,
const char *  hostname,
UINT16  port 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* rplstat[]
static
Initial value:
=
{
"succeeded",
"general SOCKS server failure",
"connection not allowed by ruleset",
"Network unreachable",
"Host unreachable",
"Connection refused",
"TTL expired",
"Command not supported",
"Address type not supported"
}