Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_header.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: OpenIGTLink Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_header.h $
5  Language: C
6  Date: $Date: 2011-03-24 00:32:25 -0400 (Thu, 24 Mar 2011) $
7  Version: $Revision: 7357 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __IGTL_HEADER_H
18 #define __IGTL_HEADER_H
19 
20 #define IGTL_HEADER_VERSION 1
21 #define IGTL_HEADER_SIZE 58
22 
23 #define IGTL_HEADER_TYPE_SIZE 12
24 #define IGTL_HEADER_NAME_SIZE 20
25 
26 /* Following macros will be obsolete. Included for old programs*/
27 #define IGTL_HEADER_TYPESIZE IGTL_HEADER_TYPE_SIZE
28 #define IGTL_HEADER_NAMESIZE IGTL_HEADER_NAME_SIZE
29 #define IGTL_HEADER_DEVSIZE IGTL_HEADER_NAME_SIZE
30 
31 // Device name prefix macro
32 #define IGTL_TYPE_PREFIX_NONE 0
33 #define IGTL_TYPE_PREFIX_GET 1
34 #define IGTL_TYPE_PREFIX_STT 2
35 #define IGTL_TYPE_PREFIX_STP 3
36 #define IGTL_TYPE_PREFIX_RTS 4
37 #define IGTL_NUM_TYPE_PREFIX 5
38 
39 
40 #include "igtl_types.h"
41 #include "igtl_win32header.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 #pragma pack(1) /* For 1-byte boundary in memroy */
48 
49 /*
50  * Message header of OpenIGTLink message.
51  *
52  * igtl_header is an overall data header for OpenIGTLink protocol.
53  * It is transfered at beginning of every OpenIGTLink message to give
54  * type and size of following data body to a receiver.
55  * These parameters allow the receiver to parse or skip the data body.
56  */
57 
58 typedef struct {
59  igtl_uint16 version; /* protocol version number */
60  char name[IGTL_HEADER_TYPE_SIZE]; /* data type name */
61  char device_name[IGTL_HEADER_NAME_SIZE]; /* device name */
62  igtl_uint64 timestamp; /* time stamp message */
63  igtl_uint64 body_size; /* size of the body */
64  igtl_uint64 crc; /* CRC */
65 } igtl_header;
66 
67 #pragma pack()
68 
69 /*
70  * Byte order converter for the header structre
71  *
72  * igtl_header_convert_byte_order convers endianness of each
73  * member variable in igtl_header structre from host byte order
74  * to network byte order, or vice versa.
75  *
76  */
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* __IGTL_HEADER_H */
84 
85 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000