summaryrefslogtreecommitdiff
path: root/res/snmp
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-10-21 21:08:47 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-10-21 21:08:47 +0000
commitcdd1f9e29607351b683663832e25e76a051cdf7a (patch)
treefc090fae29428e50ebaebee71709d20ea2681aee /res/snmp
parent1ebf7767d0c7fe090b4dd41e110a18988b99985c (diff)
Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the case where multiple results need to be returned; OBJ_NODATA mode already was supported). In addition, it converts ast_channel_iterators (only the targeted versions, not the ones that iterate over all channels) to use this method. During this work, I removed the 'ao2_flags' arguments to the ast_channel_iterator constructor functions; there were no uses of that argument yet, there is only one possible flag to pass, and it made the iterators less 'opaque'. If at some point in the future someone really needs an ast_channel_iterator that does not lock the container, we can provide constructor(s) for that purpose. Review: https://reviewboard.asterisk.org/r/379/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/snmp')
-rw-r--r--res/snmp/agent.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/res/snmp/agent.c b/res/snmp/agent.c
index f4d4fc6fd..df4523339 100644
--- a/res/snmp/agent.c
+++ b/res/snmp/agent.c
@@ -243,7 +243,7 @@ static u_char *ast_var_channels_table(struct variable *vp, oid *name, size_t *le
i = name[*length - 1] - 1;
- if (!(iter = ast_channel_iterator_all_new(0))) {
+ if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
@@ -588,7 +588,7 @@ static u_char *ast_var_channel_types_table(struct variable *vp, oid *name, size_
long_ret = 0;
- if (!(iter = ast_channel_iterator_all_new(0))) {
+ if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
@@ -622,7 +622,7 @@ static u_char *ast_var_channel_bridge(struct variable *vp, oid *name, size_t *le
return NULL;
}
- if (!(iter = ast_channel_iterator_all_new(0))) {
+ if (!(iter = ast_channel_iterator_all_new())) {
return NULL;
}
@@ -635,6 +635,8 @@ static u_char *ast_var_channel_bridge(struct variable *vp, oid *name, size_t *le
chan = ast_channel_unref(chan);
}
+ ast_channel_iterator_destroy(iter);
+
*var_len = sizeof(long_ret);
return (vp->magic == ASTCHANBRIDGECOUNT) ? (u_char *) &long_ret : NULL;