[asterisk-commits] murf: branch murf/bug8684-trunk r81359 - in /team/murf/bug8684-trunk: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 29 15:14:32 CDT 2007


Author: murf
Date: Wed Aug 29 15:14:31 2007
New Revision: 81359

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81359
Log:
Merged revisions 81353-81356 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r81353 | russell | 2007-08-29 12:27:48 -0600 (Wed, 29 Aug 2007) | 1 line

there is not actually code that sends these over the network in trunk yet
........
r81354 | russell | 2007-08-29 12:33:31 -0600 (Wed, 29 Aug 2007) | 1 line

Change pointer aritmetic on void * to char *
........
r81355 | russell | 2007-08-29 13:33:57 -0600 (Wed, 29 Aug 2007) | 2 lines

Fix parenthesis from my last commit

........
r81356 | russell | 2007-08-29 13:41:16 -0600 (Wed, 29 Aug 2007) | 1 line

Try to clarify the rules on changing ast_event and ast_event_ie
........

Modified:
    team/murf/bug8684-trunk/   (props changed)
    team/murf/bug8684-trunk/main/event.c

Propchange: team/murf/bug8684-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug 29 15:14:31 2007
@@ -1,1 +1,1 @@
-/trunk:1-81351
+/trunk:1-81357

Modified: team/murf/bug8684-trunk/main/event.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/main/event.c?view=diff&rev=81359&r1=81358&r2=81359
==============================================================================
--- team/murf/bug8684-trunk/main/event.c (original)
+++ team/murf/bug8684-trunk/main/event.c Wed Aug 29 15:14:31 2007
@@ -38,6 +38,14 @@
 /* Only use one thread for now to ensure ordered delivery */
 #define NUM_EVENT_THREADS 1
 
+/*!
+ * \brief An event information element
+ *
+ * \note The format of this structure is important.  Since these events may
+ *       be sent directly over a network, changing this structure will break
+ *       compatibility with older versions.  However, at this point, this code
+ *       has not made it into a release, so it is still fair game for change.
+ */
 struct ast_event_ie {
 	enum ast_event_ie_type ie_type:16;
 	/*! Total length of the IE payload */
@@ -48,9 +56,13 @@
 /*!
  * \brief An event
  *
- * \note The format of this structure is important, and can not change, since
- *       they are sent directly over the network (via IAX2).
+ * An ast_event consists of an event header (this structure), and zero or
+ * more information elements defined by ast_event_ie.
  *
+ * \note The format of this structure is important.  Since these events may
+ *       be sent directly over a network, changing this structure will break
+ *       compatibility with older versions.  However, at this point, this code
+ *       has not made it into a release, so it is still fair game for change.
  */
 struct ast_event {
 	/*! Event type */
@@ -365,14 +377,14 @@
 {
 	iterator->event_len = ntohs(event->event_len);
 	iterator->event = event;
-	iterator->ie = ((void *) event) + sizeof(*event);
+	iterator->ie = (struct ast_event_ie *) ( ((char *) event) + sizeof(*event) );
 	return;
 }
 
 int ast_event_iterator_next(struct ast_event_iterator *iterator)
 {
-	iterator->ie = ((void *) iterator->ie) + sizeof(*iterator->ie) + ntohs(iterator->ie->ie_payload_len);
-	return ((iterator->event_len < (((void *) iterator->ie) - ((void *) iterator->event))) ? -1 : 0);
+	iterator->ie = (struct ast_event_ie *) ( ((char *) iterator->ie) + sizeof(*iterator->ie) + ntohs(iterator->ie->ie_payload_len));
+	return ((iterator->event_len < (((char *) iterator->ie) - ((char *) iterator->event))) ? -1 : 0);
 }
 
 enum ast_event_ie_type ast_event_iterator_get_ie_type(struct ast_event_iterator *iterator)
@@ -455,7 +467,7 @@
 	if (!(*event = ast_realloc(*event, event_len + extra_len)))
 		return -1;
 
-	ie = ((void *) *event) + event_len;
+	ie = (struct ast_event_ie *) ( ((char *) *event) + event_len );
 	ie->ie_type = htons(ie_type);
 	ie->ie_payload_len = htons(data_len);
 	memcpy(ie->ie_payload, data, data_len);




More information about the asterisk-commits mailing list