Hi all,
I've modified libq931/callref.c to make it work on ppc. Is there anyone
able to test if this version of libq931/callref.c works on intel-machines ?
thx
Dirk
libq931/callref.c
* Authors: Daniele "Vihai" Orlandi <[EMAIL PROTECTED]>
*
* This program is free software and may be modified and distributed
* under the terms and conditions of the GNU General Public License.
*
*/
#include <assert.h>
#include <linux/types.h>
#define Q931_PRIVATE
#include <libq931/callref.h>
void q931_make_callref(
void *buf,
int len,
q931_callref callref,
enum q931_callref_flag direction)
{
assert(buf);
assert(direction == Q931_CALLREF_FLAG_FROM_ORIGINATING_SIDE ||
direction == Q931_CALLREF_FLAG_TO_ORIGINATING_SIDE);
assert(len <= sizeof(q931_callref));
union { q931_callref cr; __u8 raw[sizeof(q931_callref)*4]; } cu;
int i;
cu.cr = callref;
for (i=0; i<len*4; i++) {
#if __BYTE_ORDER == __BIG_ENDIAN
((__u8 *)buf)[(len*4-1)-i] = cu.raw[i];
#else
((__u8 *)buf)[i] = cu.raw[i];
#endif
}
if (direction == Q931_CALLREF_FLAG_TO_ORIGINATING_SIDE)
*((__u8 *)buf) |= 0x80;
}
_______________________________________________
Visdn-hackers mailing list
[email protected]
https://mailman.uli.it/mailman/listinfo/visdn-hackers