c-icap-doc  0.1
Data Structures | Typedefs | Functions
Access lists API


Access control lists related API. More...

Data Structures

struct  ci_acl_type
 
This is the struct used to implement an acl type object. More...
 

Typedefs

typedef struct ci_acl_type ci_acl_type_t
 
This is the struct used to implement an acl type object.
 
typedef struct ci_acl_spec ci_acl_spec_t
 This struct holds an access control list (acl). More...
 
typedef struct ci_access_entry ci_access_entry_t
 
An access entry object holds an access control list, and can be connected to linked lists of access entries. More...
 

Functions

ci_access_entry_tci_access_entry_new (ci_access_entry_t **list, int type)
 
Append a new access entry object to an access entries list More...
 
void ci_access_entry_release (ci_access_entry_t *list)
 
Destroy an access entries list More...
 
int ci_access_entry_add_acl_by_name (ci_access_entry_t *access_entry, const char *aclname)
 
Add an acl to an access entry object More...
 
int ci_access_entry_match_request (ci_access_entry_t *access_entry, ci_request_t *req)
 
Check if an access entries list matches a request object More...
 
void ci_acl_init ()
 
Initializes the c-icap acl subsystem. More...
 
void ci_acl_reset ()
 
Resets the c-icap acl subsystem. More...
 
const ci_acl_type_tci_acl_type_search (const char *name)
 
Search for an acl type More...
 
int ci_acl_type_add (const ci_acl_type_t *type)
 
Add a custom acl type to the c-icap acl subsystem More...
 

Detailed Description


Access control lists related API.

Structures, functions and macros used to define custom acl types, and use access control lists in services and modules.

Typedef Documentation

◆ ci_access_entry_t

typedef struct ci_access_entry ci_access_entry_t


An access entry object holds an access control list, and can be connected to linked lists of access entries.

This struct used to implement lists of access control lists. Each access entry can hold an "allow" or "deny" access control list. An access entries list represents the following c-icap config lines:

icap_access allow LOCALNET LOCALHOST
icap_access deny ALL

each of the above lines represented by an ci_access_entry object. The ci_access_entry objects can be connected to a simple linked list.

◆ ci_acl_spec_t

typedef struct ci_acl_spec ci_acl_spec_t

This struct holds an access control list (acl).

Imagine the following access control list defined in the c-icap config file:

acl LOCALNET 127.0.0.1/255.255.255.255 192.168.1.0/255.255.255.0

This struct represents access control lists like the above

Function Documentation

◆ ci_access_entry_add_acl_by_name()

int ci_access_entry_add_acl_by_name ( ci_access_entry_t access_entry,
const char *  aclname 
)


Add an acl to an access entry object

Parameters
access_entryPointer to the access entry object
aclnameThe name of the acl to be added.
Returns
non zero on success, zero otherwise

◆ ci_access_entry_match_request()

int ci_access_entry_match_request ( ci_access_entry_t access_entry,
ci_request_t req 
)


Check if an access entries list matches a request object

Parameters
access_entryPointer to the access entries list (a linked list of ci_access_entry_t objects)
reqpointer to the request object (ci_request_t object)
Returns
CI_ACCESS_ALLOW if request matches the access list, CI_ACCESS_DENY otherwise

◆ ci_access_entry_new()

ci_access_entry_t* ci_access_entry_new ( ci_access_entry_t **  list,
int  type 
)


Append a new access entry object to an access entries list

Parameters
listPointer to the access entry list
typeCI_ACCESS_ALLOW if CI_ACCESS_DENY to specify if this access entry holds an "allow" or "deny" access control list
Returns
A pointer to the newly created access entry object

◆ ci_access_entry_release()

void ci_access_entry_release ( ci_access_entry_t list)


Destroy an access entries list

Parameters
listPointer to the access entries list

◆ ci_acl_init()

void ci_acl_init ( )


Initializes the c-icap acl subsystem.

It is not thread safe

◆ ci_acl_reset()

void ci_acl_reset ( )


Resets the c-icap acl subsystem.

It is not thread safe

◆ ci_acl_type_add()

int ci_acl_type_add ( const ci_acl_type_t type)


Add a custom acl type to the c-icap acl subsystem

Parameters
typePointer to the c-acl_type_t struct which implements the acl type
Returns
non zero on success, zero otherwise

◆ ci_acl_type_search()

const ci_acl_type_t* ci_acl_type_search ( const char *  name)


Search for an acl type

Parameters
nameThe name of the acl type
Returns
Pointer to the ci_acl_type_t structure which implements the acl type, or NULL