23 #ifndef _ASTERISK_ACL_H 24 #define _ASTERISK_ACL_H 27 #if defined(__cplusplus) || defined(c_plusplus) 59 #define ACL_NAME_LENGTH 80 465 #if defined(__cplusplus) || defined(c_plusplus)
struct ast_ha * ast_duplicate_ha_list(struct ast_ha *original)
Duplicate the contents of a list of host access rules.
#define AST_LIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
int ast_find_ourip(struct ast_sockaddr *ourip, const struct ast_sockaddr *bindaddr, int family)
Find our IP address.
void ast_acl_output(int fd, struct ast_acl_list *acl, const char *prefix)
output an ACL to the provided fd
enum ast_cc_service_type service
enum ast_acl_sense ast_apply_ha(const struct ast_ha *ha, const struct ast_sockaddr *addr)
Apply a set of rules to a given IP address.
struct stasis_message_type * ast_named_acl_change_type(void)
a stasis_message_type for changes against a named ACL or the set of all named ACLs ...
void ast_ha_join_cidr(const struct ast_ha *ha, struct ast_str **buf)
Convert HAs to a comma separated string value using CIDR notation.
Wrapper for an ast_acl linked list.
int ast_str2tos(const char *value, unsigned int *tos)
Convert a string to the appropriate TOS value.
I/O Management (derived from Cheops-NG)
enum ast_acl_sense ast_apply_acl_nolog(struct ast_acl_list *acl_list, const struct ast_sockaddr *addr)
Apply a set of rules to a given IP address, don't log failure.
Socket address structure.
void ast_ha_join(const struct ast_ha *ha, struct ast_str **buf)
Convert HAs to a comma separated string value.
internal representation of ACL entries In principle user applications would have no need for this...
int ast_ouraddrfor(const struct ast_sockaddr *them, struct ast_sockaddr *us)
Get our local IP address when contacting a remote host.
struct ast_acl_list * ast_duplicate_acl_list(struct ast_acl_list *original)
Duplicates the contests of a list of lists of host access rules.
struct ast_sockaddr netmask
A set of macros to manage forward-linked lists.
an ast_acl is a linked list node of ast_ha structs which may have names.
enum ast_acl_sense ast_apply_acl(struct ast_acl_list *acl_list, const struct ast_sockaddr *addr, const char *purpose)
Apply a set of rules to a given IP address.
int ast_acl_list_is_empty(struct ast_acl_list *acl_list)
Determines if an ACL is empty or if it contains entries.
Wrapper for network related headers, masking differences between various operating systems...
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
struct ast_acl_list * ast_free_acl_list(struct ast_acl_list *acl)
Free a list of ACLs.
int ast_get_ip(struct ast_sockaddr *addr, const char *hostname)
Get the IP address given a hostname.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
int ast_str2cos(const char *value, unsigned int *cos)
Convert a string to the appropriate COS value.
int ast_lookup_iface(char *iface, struct ast_sockaddr *address)
Find an IP address associated with a specific interface.
int ast_get_ip_or_srv(struct ast_sockaddr *addr, const char *hostname, const char *service)
Get the IP address given a hostname and optional service.
void ast_free_ha(struct ast_ha *ha)
Free a list of HAs.
struct ast_ha * ast_named_acl_find(const char *name, int *is_realtime, int *is_undefined)
Retrieve a named ACL.
struct ast_ha * ast_append_ha_with_port(const char *sense, const char *stuff, struct ast_ha *path, int *error)
Add a new rule with optional port to a list of HAs.
void ast_append_acl(const char *sense, const char *stuff, struct ast_acl_list **path, int *error, int *named_acl_flag)
Add a rule to an ACL struct.
void ast_ha_output(int fd, const struct ast_ha *ha, const char *prefix)
output an HA to the provided fd
static struct ast_str * hostname
struct ast_ha * ast_append_ha(const char *sense, const char *stuff, struct ast_ha *path, int *error)
Add a new rule to a list of HAs.
int error(const char *format,...)
const char * ast_tos2str(unsigned int tos)
Convert a TOS value into its string representation.
struct ast_sockaddr bindaddr
void ast_copy_ha(const struct ast_ha *from, struct ast_ha *to)
Copy the contents of one HA to another.
static char prefix[MAX_PREFIX]