Dillo v3.1.1-98-g318d1f14
|
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include "dlib/dlib.h"
#include "dpip/dpip.h"
Go to the source code of this file.
Macros | |
#define | _MSG(...) |
#define | MSG_INNARDS(prefix, ...) |
#define | MSG(...) MSG_INNARDS("", __VA_ARGS__) |
#define | MSG_WARN(...) MSG_INNARDS("** WARNING **: ", __VA_ARGS__) |
#define | MSG_ERR(...) MSG_INNARDS("** ERROR **: ", __VA_ARGS__) |
Functions | |
static char * | Dpi_blocking_read (int fd) |
static void | Dpi_close_fd (int fd) |
static int | Dpi_make_socket_fd () |
static int | Dpi_read_comm_keys (int *port) |
static int | Dpi_check_dpid_ids () |
static int | Dpi_blocking_write (int fd, const char *msg, int msg_len) |
static int | Dpi_start_dpid (void) |
static int | Dpi_check_dpid (int num_tries) |
static int | Dpi_blocking_start_dpid (void) |
static int | Dpi_get_server_port (const char *server_name) |
static int | Dpi_connect_socket (const char *server_name) |
char * | a_Dpi_send_blocking_cmd (const char *server_name, const char *cmd) |
Send a command to a dpi server, and block until the answer is got. | |
void | a_Cookies_set (const char *cookie, const char *host, const char *path, const char *date) |
char * | a_Cookies_get_query (const char *scheme, const char *host, const char *path) |
static void | expect (int lineno, const char *exp_reply, const char *scheme, const char *host, const char *path) |
static void | toomany () |
static void | maxage () |
static void | expires_server_ahead () |
static void | expires_server_behind () |
static void | expires_extremes () |
static void | expires_date_formats () |
static void | path () |
int | Cookies_rc_check () |
int | main () |
Variables | |
static uint_t | failed = 0 |
static uint_t | passed = 0 |
static char | SharedKey [32] |
#define MSG | ( | ... | ) | MSG_INNARDS("", __VA_ARGS__) |
#define MSG_ERR | ( | ... | ) | MSG_INNARDS("** ERROR **: ", __VA_ARGS__) |
#define MSG_INNARDS | ( | prefix, | |
... | |||
) |
#define MSG_WARN | ( | ... | ) | MSG_INNARDS("** WARNING **: ", __VA_ARGS__) |
char * a_Cookies_get_query | ( | const char * | scheme, |
const char * | host, | ||
const char * | path | ||
) |
Definition at line 457 of file cookies.c.
References _MSG, a_Dpi_send_blocking_cmd(), a_Dpip_build_cmd(), a_Dpip_get_attr(), dFree(), dStrdup(), and path().
void a_Cookies_set | ( | const char * | cookie, |
const char * | host, | ||
const char * | path, | ||
const char * | date | ||
) |
Definition at line 436 of file cookies.c.
References _MSG, a_Dpi_send_blocking_cmd(), a_Dpip_build_cmd(), dFree(), and path().
char * a_Dpi_send_blocking_cmd | ( | const char * | server_name, |
const char * | cmd | ||
) |
Send a command to a dpi server, and block until the answer is got.
Return value: the dpip tag answer as an string, NULL on error.
Definition at line 412 of file cookies.c.
References Dpi_blocking_read(), Dpi_blocking_start_dpid(), Dpi_blocking_write(), Dpi_close_fd(), Dpi_connect_socket(), and MSG_ERR.
int Cookies_rc_check | ( | ) |
Definition at line 898 of file cookies.c.
References default_deny, dFree(), dGethomedir(), dIsspace, dStrAsciiCasecmp(), dStrconcat(), dStrerror, dStrstrip(), FALSE, MSG_ERR, MSG_WARN, and TRUE.
Referenced by main().
|
static |
Definition at line 66 of file cookies.c.
References dStr_append_l(), dStr_free(), dStr_sized_new(), dStrerror, FALSE, Dstr::len, MSG_ERR, Dstr::str, and TRUE.
Referenced by a_Dpi_send_blocking_cmd(), Dpi_get_server_port(), and Dpi_start_dpid().
|
static |
Definition at line 277 of file cookies.c.
References Dpi_check_dpid(), dUsleep(), and MSG.
Referenced by a_Dpi_send_blocking_cmd().
|
static |
Definition at line 167 of file cookies.c.
References dStrerror, and MSG_ERR.
Referenced by a_Dpi_send_blocking_cmd(), Dpi_connect_socket(), Dpi_get_server_port(), and Dpi_start_dpid().
|
static |
Definition at line 243 of file cookies.c.
References _MSG, Dpi_check_dpid_ids(), and Dpi_start_dpid().
Referenced by Dpi_blocking_start_dpid().
|
static |
Definition at line 142 of file cookies.c.
References Dpi_close_fd(), Dpi_make_socket_fd(), Dpi_read_comm_keys(), dStrerror, and MSG.
Referenced by Dpi_check_dpid().
|
static |
Definition at line 92 of file cookies.c.
References dReturn_if.
Referenced by a_Dpi_send_blocking_cmd(), Dpi_check_dpid_ids(), Dpi_connect_socket(), Dpi_get_server_port(), and Dpi_start_dpid().
|
static |
Definition at line 372 of file cookies.c.
References _MSG, a_Dpip_build_cmd(), dFree(), Dpi_blocking_write(), Dpi_close_fd(), Dpi_get_server_port(), Dpi_make_socket_fd(), dStrerror, MSG, MSG_ERR, and SharedKey.
Referenced by a_Dpi_send_blocking_cmd().
|
static |
Definition at line 299 of file cookies.c.
References _MSG, a_Dpip_build_cmd(), a_Dpip_get_attr(), dFree(), Dpi_blocking_read(), Dpi_blocking_write(), Dpi_close_fd(), Dpi_make_socket_fd(), Dpi_read_comm_keys(), dReturn_val_if_fail, dStrerror, and MSG.
Referenced by Dpi_connect_socket().
|
static |
Definition at line 102 of file cookies.c.
Referenced by Dpi_check_dpid_ids(), Dpi_connect_socket(), and Dpi_get_server_port().
|
static |
Definition at line 116 of file cookies.c.
References dFree(), dGethomedir(), dGetline(), dStrconcat(), dStrerror, MSG_ERR, and SharedKey.
Referenced by Dpi_check_dpid_ids(), and Dpi_get_server_port().
|
static |
Definition at line 191 of file cookies.c.
References dFree(), dGethomedir(), Dpi_blocking_read(), Dpi_blocking_write(), Dpi_close_fd(), dStrconcat(), dStrerror, and MSG.
Referenced by Dpi_check_dpid().
|
static |
Definition at line 482 of file cookies.c.
References a_Cookies_get_query(), failed, MSG, passed, and path().
Referenced by expires_date_formats(), expires_extremes(), expires_server_ahead(), expires_server_behind(), main(), maxage(), path(), and toomany().
|
static |
Definition at line 771 of file cookies.c.
References a_Cookies_set(), and expect().
Referenced by main().
|
static |
|
static |
Definition at line 592 of file cookies.c.
References a_Cookies_set(), dFree(), dStrconcat(), dStrdup(), and expect().
Referenced by main().
|
static |
Definition at line 644 of file cookies.c.
References a_Cookies_set(), dFree(), dStrconcat(), dStrdup(), and expect().
Referenced by main().
int main | ( | void | ) |
Definition at line 972 of file cookies.c.
References a_Cookies_get_query(), a_Cookies_set(), Cookies_rc_check(), expect(), expires_date_formats(), expires_extremes(), expires_server_ahead(), expires_server_behind(), failed, maxage(), MSG, passed, path(), and toomany().
|
static |
|
static |
Definition at line 859 of file cookies.c.
References a_Cookies_set(), and expect().
Referenced by a_Cookies_get_query(), a_Cookies_get_query(), a_Cookies_set(), a_Cookies_set(), Auth_realm_add_path(), Auth_realm_by_path(), Auth_realm_includes_path(), expect(), File_serve_client(), fill_services_list(), get_hyphenator(), Paths::getPrefsFP(), help_cb(), Paths::init(), main(), srv_parse_tok(), stop_active_dpis(), and UIcmd_make_save_filename().
|
static |
Definition at line 495 of file cookies.c.
References a_Cookies_set(), and expect().
Referenced by main().
|
static |
Definition at line 54 of file cookies.c.
Referenced by expect(), main(), Tls_connect(), and Tls_handshake().
|
static |
|
static |
Definition at line 57 of file cookies.c.
Referenced by Dpi_connect_socket(), and Dpi_read_comm_keys().