2 * $Id: RTPSUtils.c,v 0.0.0.1 2003/09/13
4 * DEBUG: section 50 Utils
5 * AUTHOR: Petr Smolik petr.smolik@wo.cz
7 * ORTE - OCERA Real-Time Ethernet http://www.ocera.org/
8 * --------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 /**********************************************************************************/
25 int gavl_cmp_ntp_time(const NtpTime *a,const NtpTime *b) {
26 return NtpTimeCmp(*a,*b);
29 /**********************************************************************************/
30 int gavl_cmp_sn(const SequenceNumber *a, const SequenceNumber *b) {
31 return SeqNumberCmp(*a,*b);
34 /**********************************************************************************/
36 gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b) {
38 if (a->hid>b->hid) return 1;
39 if (a->hid<b->hid) return -1;
41 if (a->aid>b->aid) return 1;
42 if (a->aid<b->aid) return -1;
44 if (a->oid>b->oid) return 1;
45 if (a->oid<b->oid) return -1;
49 /**********************************************************************************/
51 gavl_cmp_str(const char *const *a,const char *const *b) {
54 /**********************************************************************************/
56 getMaxMessageLength(ORTEDomain *d) {
57 return d->domainProp.wireProp.metaBytesPerPacket-d->mbSend.cdrStream.length-
58 RTPS_HEADER_LENGTH-20;