[asterisk-commits] rizzo: trunk r76034 - in /trunk: include/asterisk/acl.h main/acl.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 20 09:38:37 CDT 2007
Author: rizzo
Date: Fri Jul 20 09:38:36 2007
New Revision: 76034
URL: http://svn.digium.com/view/asterisk?view=rev&rev=76034
Log:
expose struct ast_ha so external code can do things such as printing it
(e.g. chan_sip.c in a subsequent commit).
Obviously exposing the internals of a data structure is far from ideal
(especially in a case like this where the implementation is very
inefficient and will need to be changed at some point).
On the other hand, it was also unclear what additional APIs should
we provide instead, and because exposing the stucture has no impact
on source and binary compatibility, this seemed to me the best option at
this time.
Modified:
trunk/include/asterisk/acl.h
trunk/main/acl.c
Modified: trunk/include/asterisk/acl.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/acl.h?view=diff&rev=76034&r1=76033&r2=76034
==============================================================================
--- trunk/include/asterisk/acl.h (original)
+++ trunk/include/asterisk/acl.h Fri Jul 20 09:38:36 2007
@@ -36,7 +36,21 @@
/* Host based access control */
-struct ast_ha;
+/*! \brief internal representation of acl entries
+ * In principle user applications would have no need for this,
+ * but there is sometimes a need to extract individual items,
+ * e.g. to print them, and rather than defining iterators to
+ * navigate the list, and an externally visible 'struct ast_ha_entry',
+ * at least in the short term it is more convenient to make the whole
+ * thing public and let users play with them.
+ */
+struct ast_ha {
+ /* Host access rule */
+ struct in_addr netaddr;
+ struct in_addr netmask;
+ int sense;
+ struct ast_ha *next;
+};
/*! \brief Free host access list */
void ast_free_ha(struct ast_ha *ha);
Modified: trunk/main/acl.c
URL: http://svn.digium.com/view/asterisk/trunk/main/acl.c?view=diff&rev=76034&r1=76033&r2=76034
==============================================================================
--- trunk/main/acl.c (original)
+++ trunk/main/acl.c Fri Jul 20 09:38:36 2007
@@ -69,14 +69,6 @@
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/srv.h"
-
-struct ast_ha {
- /* Host access rule */
- struct in_addr netaddr;
- struct in_addr netmask;
- int sense;
- struct ast_ha *next;
-};
struct my_ifreq {
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0", "ppp0", etc. */
More information about the asterisk-commits
mailing list