acl.c File Reference

Include dependency graph for acl.c:


Data Structures

struct  vlc_acl_entry_t
struct  vlc_acl_t

Functions

static int ACL_Resolve (vlc_object_t *p_this, uint8_t *p_bytes, const char *psz_ip)
int ACL_Check (vlc_acl_t *p_acl, const char *psz_ip)
 Check if a given address passes an access control list.
int ACL_AddNet (vlc_acl_t *p_acl, const char *psz_ip, int i_len, bool b_allow)
 Adds an item to an ACL.
vlc_acl_t__ACL_Create (vlc_object_t *p_this, bool b_allow)
 Creates an empty ACL.
vlc_acl_t__ACL_Duplicate (vlc_object_t *p_this, const vlc_acl_t *p_acl)
 Perform a deep copy of an existing ACL.
void ACL_Destroy (vlc_acl_t *p_acl)
 Releases all resources associated with an ACL object.
int ACL_LoadFile (vlc_acl_t *p_acl, const char *psz_path)
 Reads ACL entries from a file.

Function Documentation

vlc_acl_t* __ACL_Create ( vlc_object_t p_this,
bool  b_allow 
)

Creates an empty ACL.

Parameters:
b_allow whether to grant (true) or deny (false) access by default (ie if none of the ACL entries matched).
Returns:
an ACL object. NULL in case of error.

vlc_acl_t* __ACL_Duplicate ( vlc_object_t p_this,
const vlc_acl_t p_acl 
)

Perform a deep copy of an existing ACL.

Parameters:
p_this object to attach the copy to.
p_acl ACL object to be copied.
Returns:
a new ACL object, or NULL on error.

int ACL_AddNet ( vlc_acl_t p_acl,
const char *  psz_ip,
int  i_len,
bool  b_allow 
)

Adds an item to an ACL.

Items are always matched in the same order as they are added.

int ACL_Check ( vlc_acl_t p_acl,
const char *  psz_ip 
)

Check if a given address passes an access control list.

Parameters:
p_acl pre-existing ACL to match the address against
psz_ip numeric IPv4/IPv6 address
Returns:
0 if the first matching ACL entry is an access grant, 1 if the first matching ACL entry is a denial of access, -1 on error.

void ACL_Destroy ( vlc_acl_t p_acl  ) 

Releases all resources associated with an ACL object.

int ACL_LoadFile ( vlc_acl_t p_acl,
const char *  psz_path 
)

Reads ACL entries from a file.

Parameters:
p_acl ACL object in which to insert parsed entries.
psz_patch filename from which to parse entries.
Returns:
0 on success, -1 on error.

static int ACL_Resolve ( vlc_object_t p_this,
uint8_t *  p_bytes,
const char *  psz_ip 
) [static]


Generated on Wed Aug 13 08:05:43 2008 for VLC by  doxygen 1.5.1