VLC  3.0.15
vlc_http.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_http.h: Shared code for HTTP clients
3  *****************************************************************************
4  * Copyright (C) 2001-2008 VLC authors and VideoLAN
5  * $Id: a48ea794963ad476fc059eb3ffcf787186b78b47 $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  * Christophe Massiot <massiot@via.ecp.fr>
9  * RĂ©mi Denis-Courmont
10  * Antoine Cellerier <dionoea at videolan dot org>
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU Lesser General Public License as published by
14  * the Free Software Foundation; either version 2.1 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program; if not, write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26 
27 #ifndef VLC_HTTP_H
28 #define VLC_HTTP_H 1
29 
30 /**
31  * \file
32  * This file defines functions, structures, enums and macros shared between
33  * HTTP clients.
34  */
35 
36 #include <vlc_url.h>
37 #include <vlc_arrays.h>
38 
39 /* RFC 2617: Basic and Digest Access Authentication */
40 typedef struct vlc_http_auth_t
41 {
42  char *psz_realm;
43  char *psz_domain;
44  char *psz_nonce;
45  char *psz_opaque;
46  char *psz_stale;
48  char *psz_qop;
49  int i_nonce;
50  char *psz_cnonce;
51  char *psz_HA1; /* stored H(A1) value if algorithm = "MD5-sess" */
53 
54 
58  ( vlc_object_t *, vlc_http_auth_t * , const char * );
61  const char *, const char *,
62  const char *, const char *,
63  const char * );
66  const char *, const char *,
67  const char *, const char * ) VLC_USED;
68 
69 /* RFC 6265: cookies */
70 
72 
75 
76 /**
77  * Parse a value of an incoming Set-Cookie header and append the
78  * cookie to the cookie jar if appropriate.
79  *
80  * @param jar cookie jar object
81  * @param cookie header field value of Set-Cookie
82  * @return true, if the cookie was added, false otherwise
83  */
85  const char *cookie, const char *host, const char *path );
86 
87 /**
88  * Returns a cookie value that match the given URL.
89  *
90  * @param p_jar a cookie jar
91  * @param p_url the URL for which the cookies are returned
92  * @return A string consisting of semicolon-separated cookie NAME=VALUE pairs.
93  */
95  const char *host, const char *path );
96 
97 #endif /* VLC_HTTP_H */
vlc_http_auth_t::psz_algorithm
char * psz_algorithm
Definition: vlc_http.h:47
vlc_http_cookies_new
vlc_http_cookie_jar_t * vlc_http_cookies_new(void)
Definition: httpcookies.c:272
VLC_API
#define VLC_API
Definition: fourcc_gen.c:30
vlc_common.h
vlc_http_auth_t
Definition: vlc_http.h:40
vlc_http_auth_ParseWwwAuthenticateHeader
void vlc_http_auth_ParseWwwAuthenticateHeader(vlc_object_t *, vlc_http_auth_t *, const char *)
Definition: http_auth.c:228
vlc_http_auth_t
struct vlc_http_auth_t vlc_http_auth_t
vlc_http_auth_t::psz_nonce
char * psz_nonce
Definition: vlc_http.h:44
vlc_http_cookies_destroy
void vlc_http_cookies_destroy(vlc_http_cookie_jar_t *p_jar)
Definition: httpcookies.c:284
vlc_http_auth_t::psz_cnonce
char * psz_cnonce
Definition: vlc_http.h:50
vlc_http_cookies_store
bool vlc_http_cookies_store(vlc_http_cookie_jar_t *jar, const char *cookie, const char *host, const char *path)
Parse a value of an incoming Set-Cookie header and append the cookie to the cookie jar if appropriate...
Definition: httpcookies.c:298
vlc_http_auth_t::psz_stale
char * psz_stale
Definition: vlc_http.h:46
vlc_http_auth_ParseAuthenticationInfoHeader
int vlc_http_auth_ParseAuthenticationInfoHeader(vlc_object_t *, vlc_http_auth_t *, const char *, const char *, const char *, const char *, const char *)
Definition: http_auth.c:306
vlc_http_auth_Init
void vlc_http_auth_Init(vlc_http_auth_t *)
Definition: http_auth.c:486
vlc_http_auth_t::psz_realm
char * psz_realm
Definition: vlc_http.h:42
vlc_http_cookies_fetch
char * vlc_http_cookies_fetch(vlc_http_cookie_jar_t *jar, bool secure, const char *host, const char *path)
Returns a cookie value that match the given URL.
Definition: httpcookies.c:353
vlc_http_auth_t::psz_HA1
char * psz_HA1
Definition: vlc_http.h:51
vlc_url.h
vlc_http_auth_FormatAuthorizationHeader
char * vlc_http_auth_FormatAuthorizationHeader(vlc_object_t *, vlc_http_auth_t *, const char *, const char *, const char *, const char *)
Definition: http_auth.c:385
vlc_object_t
The main vlc_object_t structure.
Definition: vlc_objects.h:39
VLC_USED
#define VLC_USED
Definition: fourcc_gen.c:31
vlc_http_auth_t::psz_domain
char * psz_domain
Definition: vlc_http.h:43
vlc_http_auth_t::psz_qop
char * psz_qop
Definition: vlc_http.h:48
vlc_arrays.h
vlc_http_auth_Deinit
void vlc_http_auth_Deinit(vlc_http_auth_t *)
Definition: http_auth.c:491
vlc_http_auth_t::i_nonce
int i_nonce
Definition: vlc_http.h:49
vlc_http_auth_t::psz_opaque
char * psz_opaque
Definition: vlc_http.h:45