]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/RTPSInfoSRC.c
fd43140e6a4c237c7f87e5152b43478224da7511
[orte.git] / orte / liborte / RTPSInfoSRC.c
1 /*
2  *  $Id: RTPSInfoSRC.c,v 0.0.0.1      2003/09/10
3  *
4  *  DEBUG:  section 44                  message INFO SRC
5  *
6  *  -------------------------------------------------------------------  
7  *                                ORTE                                 
8  *                      Open Real-Time Ethernet                       
9  *                                                                    
10  *                      Copyright (C) 2001-2006                       
11  *  Department of Control Engineering FEE CTU Prague, Czech Republic  
12  *                      http://dce.felk.cvut.cz                       
13  *                      http://www.ocera.org                          
14  *                                                                    
15  *  Author:              Petr Smolik    petr@smoliku.cz             
16  *  Advisor:             Pavel Pisa                                   
17  *  Project Responsible: Zdenek Hanzalek                              
18  *  --------------------------------------------------------------------
19  *
20  *  This program is free software; you can redistribute it and/or modify
21  *  it under the terms of the GNU General Public License as published by
22  *  the Free Software Foundation; either version 2 of the License, or
23  *  (at your option) any later version.
24  *  
25  *  This program is distributed in the hope that it will be useful,
26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  *  GNU General Public License for more details.
29  *  
30  */ 
31
32 #include "orte_all.h"
33
34 /**********************************************************************************/
35 void RTPSInfoSRC(CDR_Codec *cdrCodec,MessageInterpret *mi) {
36   IPAddress          ipa;
37   ProtocolVersion    protocol;
38   VendorId           vid;
39   HostId             hid;
40   AppId              aid;
41   char               sIPAddress[MAX_STRING_IPADDRESS_LENGTH];
42   CDR_Endianness     data_endian;
43
44   /* appIPAddress */
45   CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&ipa);
46   
47   /* ProtocolVersion */
48   CDR_get_octet(cdrCodec, (CORBA_octet *)&protocol.major);
49   CDR_get_octet(cdrCodec, (CORBA_octet *)&protocol.minor);
50
51   /* Vendor Id */
52   CDR_get_octet(cdrCodec, (CORBA_octet *)&vid.major);
53   CDR_get_octet(cdrCodec, (CORBA_octet *)&vid.minor);
54
55   /* next data are sent in big endianing */
56   data_endian=cdrCodec->data_endian;
57   cdrCodec->data_endian=FLAG_BIG_ENDIAN;
58
59   /* HostId */
60   CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&hid);
61
62   /* AppId */
63   CDR_get_ulong(cdrCodec, (CORBA_unsigned_long *)&aid);
64
65   cdrCodec->data_endian=data_endian;
66
67   debug(44,3) ("  RTPSInfoSRC: \n");
68   debug(44,4) ("    appIPAddress:%s\n",IPAddressToString(ipa,sIPAddress));
69   debug(44,4) ("    pv:%lu,%lu vid:%lu,%lu hid:0x%x aid:0x%x\n",
70                              protocol.major,protocol.minor,vid.major,vid.minor,hid,aid);
71
72   mi->sourceHostId=hid;
73   mi->sourceAppId=aid;
74   mi->sourceVersion=protocol;
75   mi->sourceVendorId=vid;
76   mi->unicastReplyIPAddress=ipa;
77   mi->unicastReplyPort=PORT_INVALID;
78   mi->multicastReplyIPAddress=IPADDRESS_INVALID;
79   mi->multicastReplyPort=PORT_INVALID;
80   mi->haveTimestamp=ORTE_FALSE;
81 }