Statistics
| Branch: | Revision:

napa-baselibs / monl / ctrl_msg.h @ d1e0f2ca

History | View | Annotate | Download (2.18 KB)

1 956892f0 ArpadBakay
/***************************************************************************
2
 *   Copyright (C) 2009 by Robert Birke
3
 *   robert.birke@polito.it
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9

10
 * This library is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14

15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with this library; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
18
 ***********************************************************************/
19
#ifndef _CTRL_MSG_H_
20
#define _CTRL_MSG_H_
21
22
#include "mon.h"
23
24
//TODO: check sizeof with structure ... probably not working properly
25
#pragma pack(push)  /* push current alignment to stack */
26
#pragma pack(1)     /* set alignment to 1 byte boundary */
27
28
// Header
29
struct MonHeader {
30
        uint16_t length;
31
        uint16_t type;
32
};
33
#define MONHDR_SIZE (sizeof(struct MonHeader))
34
35
//MeasureResposne
36
struct MeasureResponse {
37
        MonHandler         mh_remote;
38
        MonHandler         mh_local;
39
        uint32_t                command;
40
        uint32_t                status;
41
};
42
#define MRESPONSE_SIZE (sizeof(struct MeasureResponse))
43
44
struct InitRemoteMeasure {
45
        MeasurementId                                         mid;
46
        MeasurementCapabilities                mc;
47
        MonHandler                                                mh_local;
48
        MsgType                                                        msg_type;
49
        uint16_t                                                        n_params;
50
};
51
#define INITREMOTEMEASURE_SIZE (sizeof(struct InitRemoteMeasure))
52
53
struct DeInitRemoteMeasure {
54
        MonHandler                                                mh_local;
55
        MonHandler                                                mh_remote;
56
};
57
#define DEINITREMOTEMEASURE_SIZE (sizeof(struct DeInitRemoteMeasure))
58
59
struct RemoteResults {
60
        uint32_t                                                        length;
61
        MsgType                                                        msg_type;
62
};
63
#define REMOTERESULTS_SIZE (sizeof(struct RemoteResults))
64
65
struct OobData {
66
        MonHandler                                                mh_local;
67
        MonHandler                                                mh_remote;
68
};
69
#define OOBDATA_SIZE (sizeof(struct OobData))
70
71
#pragma pack(pop)   /* restore original alignment from stack */
72
73
#endif