]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/RTPSUtils.c
bug in CDRStream format -> now u_int8_t used
[orte.git] / orte / liborte / RTPSUtils.c
1 /*
2  *  $Id: RTPSUtils.c,v 0.0.0.1          2003/09/13 
3  *
4  *  DEBUG:  section 50          Utils
5  *  AUTHOR: Petr Smolik                 petr.smolik@wo.cz
6  *
7  *  ORTE - OCERA Real-Time Ethernet     http://www.ocera.org/
8  *  --------------------------------------------------------------------
9  *
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.
14  *  
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.
19  *  
20  */ 
21
22 #include "orte.h"
23
24 /**********************************************************************************/
25 int gavl_cmp_ntp_time(const NtpTime *a,const NtpTime *b) {
26   return NtpTimeCmp(*a,*b);
27 }
28
29 /**********************************************************************************/
30 int gavl_cmp_sn(const SequenceNumber *a, const SequenceNumber *b) {
31   return SeqNumberCmp(*a,*b);
32 }
33
34 /**********************************************************************************/
35 int 
36 gavl_cmp_guid(const GUID_RTPS *a, const GUID_RTPS *b) {
37   //HID
38   if (a->hid>b->hid) return 1;
39   if (a->hid<b->hid) return -1;
40   //AID
41   if (a->aid>b->aid) return 1;
42   if (a->aid<b->aid) return -1;
43   //OID
44   if (a->oid>b->oid) return 1;
45   if (a->oid<b->oid) return -1;
46   return 0;
47 }
48
49 /**********************************************************************************/
50 int 
51 gavl_cmp_str(const char *const *a,const char *const *b) {
52   return strcmp(*a,*b);
53 }
54 /**********************************************************************************/
55 int 
56 getMaxMessageLength(ORTEDomain *d) {
57   return d->domainProp.wireProp.metaBytesPerPacket-d->mbSend.cdrStream.length-
58          RTPS_HEADER_LENGTH-20;
59 }
60