acl.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _ASTERISK_ACL_H
00024 #define _ASTERISK_ACL_H
00025
00026
00027 #if defined(__cplusplus) || defined(c_plusplus)
00028 extern "C" {
00029 #endif
00030
00031 #include "asterisk/network.h"
00032 #include "asterisk/io.h"
00033
00034 #define AST_SENSE_DENY 0
00035 #define AST_SENSE_ALLOW 1
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 struct ast_ha {
00048
00049 struct in_addr netaddr;
00050 struct in_addr netmask;
00051 int sense;
00052 struct ast_ha *next;
00053 };
00054
00055
00056 void ast_free_ha(struct ast_ha *ha);
00057
00058
00059 void ast_copy_ha(const struct ast_ha *from, struct ast_ha *to);
00060
00061
00062 struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha *path, int *error);
00063
00064
00065 int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin);
00066
00067
00068 struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original);
00069
00070 int ast_get_ip(struct sockaddr_in *sin, const char *value);
00071
00072 int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service);
00073
00074 int ast_ouraddrfor(struct in_addr *them, struct in_addr *us);
00075
00076 int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr);
00077
00078 int ast_str2cos(const char *value, unsigned int *cos);
00079
00080 int ast_str2tos(const char *value, unsigned int *tos);
00081 const char *ast_tos2str(unsigned int tos);
00082
00083 #if defined(__cplusplus) || defined(c_plusplus)
00084 }
00085 #endif
00086
00087 #endif