00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _VLC_HTTPD_H
00025 #define _VLC_HTTPD_H 1
00026
00027
00028
00029 struct httpd_t
00030 {
00031 VLC_COMMON_MEMBERS
00032
00033 int i_host;
00034 httpd_host_t **host;
00035 };
00036
00037 enum
00038 {
00039 HTTPD_MSG_NONE,
00040
00041
00042 HTTPD_MSG_ANSWER,
00043
00044
00045 HTTPD_MSG_CHANNEL,
00046
00047
00048 HTTPD_MSG_GET,
00049 HTTPD_MSG_HEAD,
00050 HTTPD_MSG_POST,
00051
00052
00053 HTTPD_MSG_OPTIONS,
00054 HTTPD_MSG_DESCRIBE,
00055 HTTPD_MSG_SETUP,
00056 HTTPD_MSG_PLAY,
00057 HTTPD_MSG_PAUSE,
00058 HTTPD_MSG_TEARDOWN,
00059
00060
00061 HTTPD_MSG_MAX
00062 };
00063
00064 enum
00065 {
00066 HTTPD_PROTO_NONE,
00067 HTTPD_PROTO_HTTP,
00068 HTTPD_PROTO_RTSP,
00069 };
00070
00071 struct httpd_message_t
00072 {
00073 httpd_client_t *cl;
00074
00075 int i_type;
00076 int i_proto;
00077 int i_version;
00078
00079
00080 int i_status;
00081 char *psz_status;
00082
00083
00084 char *psz_url;
00085
00086
00087 uint8_t *psz_args;
00088
00089
00090 int i_channel;
00091
00092
00093 int i_name;
00094 char **name;
00095 int i_value;
00096 char **value;
00097
00098
00099 int64_t i_body_offset;
00100 int i_body;
00101 uint8_t *p_body;
00102
00103 };
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 VLC_EXPORT( httpd_host_t *, httpd_HostNew, ( vlc_object_t *, const char *psz_host, int i_port ) );
00118 VLC_EXPORT( httpd_host_t *, httpd_TLSHostNew, ( vlc_object_t *, const char *, int, const char *, const char *, const char *, const char * ) );
00119
00120
00121 VLC_EXPORT( void, httpd_HostDelete, ( httpd_host_t * ) );
00122
00123
00124 VLC_EXPORT( httpd_url_t *, httpd_UrlNew, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) );
00125 VLC_EXPORT( httpd_url_t *, httpd_UrlNewUnique, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) );
00126
00127 VLC_EXPORT( int, httpd_UrlCatch, ( httpd_url_t *, int i_msg, httpd_callback_t, httpd_callback_sys_t * ) );
00128
00129 VLC_EXPORT( void, httpd_UrlDelete, ( httpd_url_t * ) );
00130
00131
00132 VLC_EXPORT( void, httpd_ClientModeStream, ( httpd_client_t *cl ) );
00133 VLC_EXPORT( void, httpd_ClientModeBidir, ( httpd_client_t *cl ) );
00134 VLC_EXPORT( char*, httpd_ClientIP, ( httpd_client_t *cl, char *psz_ip ) );
00135 VLC_EXPORT( char*, httpd_ServerIP, ( httpd_client_t *cl, char *psz_ip ) );
00136
00137
00138
00139 VLC_EXPORT( httpd_file_t *, httpd_FileNew, ( httpd_host_t *, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_file_callback_t pf_fill, httpd_file_sys_t * ) );
00140 VLC_EXPORT( void, httpd_FileDelete, ( httpd_file_t * ) );
00141
00142
00143 VLC_EXPORT( httpd_handler_t *, httpd_HandlerNew, ( httpd_host_t *, const char *psz_url, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl, httpd_handler_callback_t pf_fill, httpd_handler_sys_t * ) );
00144 VLC_EXPORT( void, httpd_HandlerDelete, ( httpd_handler_t * ) );
00145
00146
00147 VLC_EXPORT( httpd_redirect_t *, httpd_RedirectNew, ( httpd_host_t *, const char *psz_url_dst, const char *psz_url_src ) );
00148 VLC_EXPORT( void, httpd_RedirectDelete, ( httpd_redirect_t * ) );
00149
00150
00151 VLC_EXPORT( httpd_stream_t *, httpd_StreamNew, ( httpd_host_t *, const char *psz_url, const char *psz_mime, const char *psz_user, const char *psz_password, const vlc_acl_t *p_acl ) );
00152 VLC_EXPORT( void, httpd_StreamDelete, ( httpd_stream_t * ) );
00153 VLC_EXPORT( int, httpd_StreamHeader, ( httpd_stream_t *, uint8_t *p_data, int i_data ) );
00154 VLC_EXPORT( int, httpd_StreamSend, ( httpd_stream_t *, uint8_t *p_data, int i_data ) );
00155
00156
00157
00158 VLC_EXPORT( void, httpd_MsgInit, ( httpd_message_t * ) );
00159 VLC_EXPORT( void, httpd_MsgAdd, ( httpd_message_t *, char *psz_name, char *psz_value, ... ) );
00160
00161 VLC_EXPORT( char *, httpd_MsgGet, ( httpd_message_t *, char *psz_name ) );
00162 VLC_EXPORT( void, httpd_MsgClean, ( httpd_message_t * ) );
00163
00164 #endif