asterisk/res
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

Review: https://reviewboard.asterisk.org/r/1655/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
..
ael Merged revisions 299449 via svnmerge from 2010-12-22 20:10:34 +00:00
ais Merged revisions 335510 via svnmerge from 2011-09-13 07:35:59 +00:00
snmp Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
Makefile Merged revisions 318351 via svnmerge from 2011-05-09 23:16:12 +00:00
res_adsi.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_adsi.exports.in Remove the old stub files, preferring the optional_api method. 2010-07-14 20:48:59 +00:00
res_ael_share.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_ael_share.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_agi.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_agi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_ais.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_calendar.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_calendar.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_calendar_caldav.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_calendar_ews.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_calendar_exchange.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_calendar_icalendar.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_clialiases.c Allow each logging destination and console to have its own notion of the verbosity level. 2011-11-29 18:43:16 +00:00
res_clioriginate.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_config_curl.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_config_ldap.c Fix infinite loop releasing the same memory in ldap_loadentry(). 2011-08-19 17:24:56 +00:00
res_config_odbc.c Merged revisions 334230 via svnmerge from 2011-09-01 17:31:34 +00:00
res_config_pgsql.c Merged revisions 332830 via svnmerge from 2011-08-22 18:33:27 +00:00
res_config_sqlite.c Fix sqlite config driver segfault and broken queries 2011-11-03 20:37:50 +00:00
res_config_sqlite3.c Add SQLite 3 realtime support 2011-09-11 17:09:36 +00:00
res_convert.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_crypto.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_crypto.exports.in Remove built-in AES code and use optional_api instead 2010-07-21 19:11:32 +00:00
res_curl.c Add load priority order, such that preload becomes unnecessary in most cases 2010-07-20 19:35:02 +00:00
res_fax.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_fax.exports.in Log spandsp's fax debug output to the FAX logger level. 2010-05-21 15:15:58 +00:00
res_fax_spandsp.c Improve T.38 gateway V.21 preamble detection. 2011-12-28 18:59:16 +00:00
res_format_attr_celt.c Added support level for new modules 2011-11-23 16:10:45 +00:00
res_format_attr_silk.c Added support level for new modules 2011-11-23 16:10:45 +00:00
res_http_post.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_jabber.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_jabber.exports.in Fix chan_jingle/gtalk load regression introduced in r346087 2011-12-05 14:47:11 +00:00
res_limit.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_monitor.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_monitor.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_musiconhold.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_mutestream.c Replace direct access to channel name with accessor functions 2012-01-09 22:15:50 +00:00
res_odbc.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_odbc.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_phoneprov.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_pktccops.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_pktccops.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_realtime.c Cleanup references to sipusers and sipfriends dynamic realtime families 2011-11-01 19:53:26 +00:00
res_rtp_asterisk.c Fix regression that 'rtp/rtcp set debup ip' only works when also a port was specified. 2011-11-28 14:34:14 +00:00
res_rtp_multicast.c Fix sequence number overflow over 16 bits causing codec change in RTP packets. 2011-10-27 19:48:23 +00:00
res_security_log.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_smdi.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_smdi.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_snmp.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_speech.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_speech.exports.in Allow symbol export filtering to work properly on platforms that have symbol prefixes. 2010-04-02 18:57:58 +00:00
res_srtp.c Add a separate buffer for SRTCP packets 2011-12-19 01:36:21 +00:00
res_srtp.exports.in Add SRTP support for Asterisk 2010-06-08 05:29:08 +00:00
res_stun_monitor.c Re-resolve the STUN address if a STUN poll fails for res_stun_monitor. 2011-12-01 21:19:41 +00:00
res_timing_dahdi.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00
res_timing_kqueue.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
res_timing_pthread.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00
res_timing_timerfd.c Fix timing source dependency issues with MOH 2011-12-27 20:55:15 +00:00