-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobal.cpp
More file actions
55 lines (48 loc) · 1.74 KB
/
global.cpp
File metadata and controls
55 lines (48 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "server.h"
const status_t ACNET_SUCCESS(0, 0);
const status_t ACNET_PEND(1, 1);
const status_t ACNET_ENDMULT(1, 2);
const status_t ACNET_NLM(1, -2);
const status_t ACNET_NOREMMEM(1, -3);
const status_t ACNET_TMO(1, -6);
const status_t ACNET_FUL(1, -7);
const status_t ACNET_BUSY(1, -8);
const status_t ACNET_NCN(1, -21);
const status_t ACNET_IVM(1, -23);
const status_t ACNET_NSR(1, -24);
const status_t ACNET_REQREJ(1, -25);
const status_t ACNET_NAME_IN_USE(1, -27);
const status_t ACNET_NCR(1, -28);
const status_t ACNET_NO_NODE(1, -30);
const status_t ACNET_TRP(1, -32);
const status_t ACNET_NOTASK(1, -33);
const status_t ACNET_DISCONNECTED(1, -34);
const status_t ACNET_LEVEL2(1, -35);
const status_t ACNET_NODE_DOWN(1, -42);
const status_t ACNET_BUG(1, -45);
const status_t ACNET_INVARG(1, -50);
// ACNET header creation
AcnetHeader::AcnetHeader() :
flags_(0), status_(ACNET_SUCCESS.raw()), sTrunk_(0), sNode_(0), cTrunk_(0), cNode_(0),
svrTaskName_(0), clntTaskId_(0), msgId_(0), msgLen_(0)
{
}
AcnetHeader::AcnetHeader(uint16_t flags, status_t status, trunknode_t svrNode,
trunknode_t clntNode, taskhandle_t svrTaskName,
taskid_t clntTaskId, reqid_t msgId, uint16_t msgLen) :
flags_(htoas(flags)), status_(htoas(status.raw())), sTrunk_(svrNode.trunk().raw()),
sNode_(svrNode.node().raw()), cTrunk_(clntNode.trunk().raw()), cNode_(clntNode.node().raw()),
svrTaskName_(htoal(svrTaskName.raw())), clntTaskId_(htoas(clntTaskId.raw())),
msgId_(htoas(msgId.raw())), msgLen_(htoas(msgLen))
{
}
bool AcnetHeader::isEMR()
{
assert((flags() & ACNET_FLG_TYPE) == ACNET_FLG_RPY);
return !(flags() & ACNET_FLG_MLT) || status() == ACNET_ENDMULT ||
status().isFatal();
}
// Local Variables:
// mode:c++
// fill-column:125
// End: