Blame libfreerdp/core/gateway/http.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * Hypertext Transfer Protocol (HTTP)
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifndef FREERDP_LIB_CORE_GATEWAY_HTTP_H
Packit 1fb8d4
#define FREERDP_LIB_CORE_GATEWAY_HTTP_H
Packit 1fb8d4
Packit 1fb8d4
#include <winpr/stream.h>
Packit 1fb8d4
#include <winpr/winhttp.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/api.h>
Packit 1fb8d4
#include <freerdp/crypto/tls.h>
Packit 1fb8d4
Packit 1fb8d4
/* HTTP context */
Packit 1fb8d4
typedef struct _http_context HttpContext;
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL HttpContext* http_context_new(void);
Packit 1fb8d4
FREERDP_LOCAL void http_context_free(HttpContext* context);
Packit 1fb8d4
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_method(HttpContext* context, const char* Method);
Packit 1fb8d4
FREERDP_LOCAL const char* http_context_get_uri(HttpContext* context);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_context_set_uri(HttpContext* context, const char* URI);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_user_agent(HttpContext* context, const char* UserAgent);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_host(HttpContext* context, const char* Host);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_accept(HttpContext* context, const char* Accept);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_cache_control(HttpContext* context, const char* CacheControl);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_connection(HttpContext* context, const char* Connection);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_context_set_pragma(HttpContext* context, const char* Pragma);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_context_set_rdg_connection_id(HttpContext* context,
Packit Service 5a9772
                                                      const char* RdgConnectionId);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_context_set_rdg_auth_scheme(HttpContext* context,
Packit Service 5a9772
                                                    const char* RdgAuthScheme);
Packit 1fb8d4
Packit 1fb8d4
/* HTTP request */
Packit 1fb8d4
typedef struct _http_request HttpRequest;
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL HttpRequest* http_request_new(void);
Packit 1fb8d4
FREERDP_LOCAL void http_request_free(HttpRequest* request);
Packit 1fb8d4
Packit Service 5a9772
FREERDP_LOCAL BOOL http_request_set_method(HttpRequest* request, const char* Method);
Packit 1fb8d4
FREERDP_LOCAL SSIZE_T http_request_get_content_length(HttpRequest* request);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_request_set_content_length(HttpRequest* request, size_t length);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL const char* http_request_get_uri(HttpRequest* request);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_request_set_uri(HttpRequest* request, const char* URI);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_request_set_auth_scheme(HttpRequest* request, const char* AuthScheme);
Packit Service 5a9772
FREERDP_LOCAL BOOL http_request_set_auth_param(HttpRequest* request, const char* AuthParam);
Packit 1fb8d4
FREERDP_LOCAL BOOL http_request_set_transfer_encoding(HttpRequest* request,
Packit Service 5a9772
                                                      const char* TransferEncoding);
Packit 1fb8d4
Packit Service 5a9772
FREERDP_LOCAL wStream* http_request_write(HttpContext* context, HttpRequest* request);
Packit 1fb8d4
Packit 1fb8d4
/* HTTP response */
Packit 1fb8d4
typedef struct _http_response HttpResponse;
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL HttpResponse* http_response_new(void);
Packit 1fb8d4
FREERDP_LOCAL void http_response_free(HttpResponse* response);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL BOOL http_response_print(HttpResponse* response);
Packit 1fb8d4
FREERDP_LOCAL HttpResponse* http_response_recv(rdpTls* tls, BOOL readContentLength);
Packit 1fb8d4
Packit 1fb8d4
FREERDP_LOCAL long http_response_get_status_code(HttpResponse* response);
Packit 1fb8d4
FREERDP_LOCAL SSIZE_T http_response_get_body_length(HttpResponse* response);
Packit 1fb8d4
FREERDP_LOCAL const char* http_response_get_auth_token(HttpResponse* respone, const char* method);
Packit 1fb8d4
Packit 1fb8d4
#endif /* FREERDP_LIB_CORE_GATEWAY_HTTP_H */