Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
domain.c File Reference
#include <stdlib.h>
#include "../dlib/dlib.h"
#include "msg.h"
#include "list.h"
#include "domain.h"
Include dependency graph for domain.c:

Go to the source code of this file.

Functions

void a_Domain_parse (FILE *fp)
 Parse domainrc.
 
void a_Domain_freeall (void)
 
static bool_t Domain_match (const char *host, const char *pattern)
 Wildcard ('*') pattern always matches.
 
bool_t a_Domain_permit (const DilloUrl *source, const DilloUrl *dest)
 Is the resource at 'source' permitted to request the resource at 'dest'?
 

Variables

static Rule * exceptions = NULL
 
static int num_exceptions = 0
 
static int num_exceptions_max = 1
 
static bool_t default_deny = FALSE
 

Function Documentation

◆ a_Domain_freeall()

void a_Domain_freeall ( void  )

Definition at line 79 of file domain.c.

References dFree(), exceptions, and num_exceptions.

Referenced by main().

◆ a_Domain_parse()

void a_Domain_parse ( FILE *  fp)

Parse domainrc.

Definition at line 31 of file domain.c.

References _MSG, a_List_add, default_deny, dFree(), dGetline(), dStrAsciiCasecmp(), dStrdup(), dStrstrip(), exceptions, FALSE, MSG, num_exceptions, num_exceptions_max, and TRUE.

Referenced by main().

◆ a_Domain_permit()

bool_t a_Domain_permit ( const DilloUrl source,
const DilloUrl dest 
)

Is the resource at 'source' permitted to request the resource at 'dest'?

Definition at line 116 of file domain.c.

References _MSG, a_Url_same_organization(), default_deny, Domain_match(), dStrAsciiCasecmp(), exceptions, FALSE, MSG, num_exceptions, TRUE, URL_HOST, URL_SCHEME, and URL_STR.

Referenced by Cache_parse_header(), and Capi_request_permitted().

◆ Domain_match()

static bool_t Domain_match ( const char *  host,
const char *  pattern 
)
static

Wildcard ('*') pattern always matches.

"example.org" pattern matches "example.org". ".example.org" pattern matches "example.org" and "sub.example.org".

Definition at line 95 of file domain.c.

References dStrAsciiCasecmp(), FALSE, and TRUE.

Referenced by a_Domain_permit().

Variable Documentation

◆ default_deny

bool_t default_deny = FALSE
static

Definition at line 26 of file domain.c.

Referenced by a_Domain_parse(), a_Domain_permit(), and Cookies_rc_check().

◆ exceptions

Rule* exceptions = NULL
static

Definition at line 22 of file domain.c.

Referenced by a_Domain_freeall(), a_Domain_parse(), and a_Domain_permit().

◆ num_exceptions

int num_exceptions = 0
static

Definition at line 23 of file domain.c.

Referenced by a_Domain_freeall(), a_Domain_parse(), and a_Domain_permit().

◆ num_exceptions_max

int num_exceptions_max = 1
static

Definition at line 24 of file domain.c.

Referenced by a_Domain_parse().