Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
ce751324
Commit
ce751324
authored
Jul 17, 2009
by
Steven Murray
Browse files
Added placeholders for new message marshalling code
parent
2f4da9b2
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
castor/tape/aggregator/AggregatorDlfMessageConstants.hpp
View file @
ce751324
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Jul 16 1
3:36:42
CEST 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Jul 16 1
8:16:16
CEST 2009
*/
/******************************************************************************
...
...
@@ -95,39 +95,41 @@ AGGREGATOR_GIVE_RECALL_FILE_TO_RTCPD=58, /* "Giving recall file to RTCPD" */
AGGREGATOR_GAVE_RECALL_FILE_TO_RTCPD
=
59
,
/* "Gave recall file to RTCPD" */
AGGREGATOR_GIVE_MIGRATE_FILE_TO_RTCPD
=
60
,
/* "Giving migrate file to RTCPD" */
AGGREGATOR_GAVE_MIGRATE_FILE_TO_RTCPD
=
61
,
/* "Gave migrate file to RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD
=
62
,
/* "Receiving FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD
=
63
,
/* "Received FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD
=
64
,
/* "Receiving FileRqstErrBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD
=
65
,
/* "Received FileRqstErrBody from RTCPD" */
AGGREGATOR_PROCESSING_TAPE_DISK_RQST
=
66
,
/* "Processing a tape/disk IO request from RTCPD" */
AGGREGATOR_PING_RTCPD
=
67
,
/* "Pinging RTCPD" */
AGGREGATOR_PINGED_RTCPD
=
68
,
/* "Pinged RTCPD" */
AGGREGATOR_SEND_ACK_TO_RTCPD
=
69
,
/* "Sending acknowledge to RTCPD" */
AGGREGATOR_SENT_ACK_TO_RTCPD
=
70
,
/* "Sent acknowledge to RTCPD" */
AGGREGATOR_RECEIVE_TAPERQSTBODY
=
71
,
/* "Receiving tape request message body" */
AGGREGATOR_RECEIVED_TAPERQSTBODY
=
72
,
/* "Received tape request message body" */
AGGREGATOR_RECEIVE_GIVEOUTPBODY
=
73
,
/* "Receiving GIVE_OUTP message body" */
AGGREGATOR_RECEIVED_GIVEOUTPBODY
=
74
,
/* "Received GIVE_OUTP message body" */
AGGREGATOR_RECEIVE_TAPERQSTERRBODY
=
75
,
/* "Receiving tape request message body with error appendix" */
AGGREGATOR_RECEIVED_TAPERQSTERRBODY
=
76
,
/* "Received tape request message body with error appendix" */
AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD
=
77
,
/* "Sending delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD
=
78
,
/* "Sent delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT
=
79
,
/* "Created TCP/IP port for RTCPD callbacks" */
AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD
=
80
,
/* "Connection closed by RTCPD" */
AGGREGATOR_CLOSED_CONNECTION
=
81
,
/* "Connection closed by aggregator" */
AGGREGATOR_NOTIFY_GATEWAY_FILE_MIGRATED
=
82
,
/* "Notifying tape gateway file migrated" */
AGGREGATOR_NOTIFIED_GATEWAY_FILE_MIGRATED
=
83
,
/* "Notified tape gateway file migrated" */
AGGREGATOR_NOTIFY_GATEWAY_FILE_RECALLED
=
84
,
/* "Notifying tape gateway file recalled" */
AGGREGATOR_NOTIFIED_GATEWAY_FILE_RECALLED
=
85
,
/* "Notified tape gateway file recalled" */
AGGREGATOR_NOTIFY_GATEWAY_END_OF_SESSION
=
86
,
/* "Notifying tape gateway end of session" */
AGGREGATOR_NOTIFIED_GATEWAY_END_OF_SESSION
=
87
,
/* "Notified tape gateway end of session" */
AGGREGATOR_NOTIFY_GATEWAY_DUMP_MESSAGE
=
88
,
/* "Notifying tape gateway dump message" */
AGGREGATOR_NOTIFIED_GATEWAY_DUMP_MESSAGE
=
89
,
/* "Notified tape gateway dump message" */
AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_SESSION
=
90
,
/* "Failed to notify gateway end of session" */
AGGREGATOR_NOTIFY_GATEWAY_END_OF_FAILED_SESSION
=
91
,
/* "Notifying tape gateway end of failed session" */
AGGREGATOR_NOTIFIED_GATEWAY_END_OF_FAILED_SESSION
=
92
,
/* "Notified tape gateway end of failed session" */
AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_FAILED_SESSION
=
93
,
/* "Failed to notify gateway end of failed session" */
AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS
=
94
/* "Failed to process RTCPD sockets" */
AGGREGATOR_RECEIVE_MSGBODY_FROM_RTCPD
=
62
,
/* "Receiving message body from RTCPD" */
AGGREGATOR_RECEIVED_MSGBODY_FROM_RTCPD
=
63
,
/* "Received message body from RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD
=
64
,
/* "Receiving FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD
=
65
,
/* "Received FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD
=
66
,
/* "Receiving FileRqstErrBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD
=
67
,
/* "Received FileRqstErrBody from RTCPD" */
AGGREGATOR_PROCESSING_TAPE_DISK_RQST
=
68
,
/* "Processing a tape/disk IO request from RTCPD" */
AGGREGATOR_PING_RTCPD
=
69
,
/* "Pinging RTCPD" */
AGGREGATOR_PINGED_RTCPD
=
70
,
/* "Pinged RTCPD" */
AGGREGATOR_SEND_ACK_TO_RTCPD
=
71
,
/* "Sending acknowledge to RTCPD" */
AGGREGATOR_SENT_ACK_TO_RTCPD
=
72
,
/* "Sent acknowledge to RTCPD" */
AGGREGATOR_RECEIVE_TAPERQSTBODY
=
73
,
/* "Receiving tape request message body" */
AGGREGATOR_RECEIVED_TAPERQSTBODY
=
74
,
/* "Received tape request message body" */
AGGREGATOR_RECEIVE_GIVEOUTPBODY
=
75
,
/* "Receiving GIVE_OUTP message body" */
AGGREGATOR_RECEIVED_GIVEOUTPBODY
=
76
,
/* "Received GIVE_OUTP message body" */
AGGREGATOR_RECEIVE_TAPERQSTERRBODY
=
77
,
/* "Receiving tape request message body with error appendix" */
AGGREGATOR_RECEIVED_TAPERQSTERRBODY
=
78
,
/* "Received tape request message body with error appendix" */
AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD
=
79
,
/* "Sending delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD
=
80
,
/* "Sent delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT
=
81
,
/* "Created TCP/IP port for RTCPD callbacks" */
AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD
=
82
,
/* "Connection closed by RTCPD" */
AGGREGATOR_CLOSED_CONNECTION
=
83
,
/* "Connection closed by aggregator" */
AGGREGATOR_NOTIFY_GATEWAY_FILE_MIGRATED
=
84
,
/* "Notifying tape gateway file migrated" */
AGGREGATOR_NOTIFIED_GATEWAY_FILE_MIGRATED
=
85
,
/* "Notified tape gateway file migrated" */
AGGREGATOR_NOTIFY_GATEWAY_FILE_RECALLED
=
86
,
/* "Notifying tape gateway file recalled" */
AGGREGATOR_NOTIFIED_GATEWAY_FILE_RECALLED
=
87
,
/* "Notified tape gateway file recalled" */
AGGREGATOR_NOTIFY_GATEWAY_END_OF_SESSION
=
88
,
/* "Notifying tape gateway end of session" */
AGGREGATOR_NOTIFIED_GATEWAY_END_OF_SESSION
=
89
,
/* "Notified tape gateway end of session" */
AGGREGATOR_NOTIFY_GATEWAY_DUMP_MESSAGE
=
90
,
/* "Notifying tape gateway dump message" */
AGGREGATOR_NOTIFIED_GATEWAY_DUMP_MESSAGE
=
91
,
/* "Notified tape gateway dump message" */
AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_SESSION
=
92
,
/* "Failed to notify gateway end of session" */
AGGREGATOR_NOTIFY_GATEWAY_END_OF_FAILED_SESSION
=
93
,
/* "Notifying tape gateway end of failed session" */
AGGREGATOR_NOTIFIED_GATEWAY_END_OF_FAILED_SESSION
=
94
,
/* "Notified tape gateway end of failed session" */
AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_FAILED_SESSION
=
95
,
/* "Failed to notify gateway end of failed session" */
AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS
=
96
/* "Failed to process RTCPD sockets" */
};
// enum AggregatorDlfMessages
}
// namespace aggregator
}
// namespace tape
...
...
castor/tape/aggregator/AggregatorDlfMessageStrings.cpp
View file @
ce751324
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Jul 16 1
3:36:42
CEST 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Thu Jul 16 1
8:16:16
CEST 2009
*/
/******************************************************************************
...
...
@@ -91,6 +91,8 @@ castor::dlf::Message castor::tape::aggregator::AggregatorDaemon::s_dlfMessages[]
{
AGGREGATOR_GAVE_RECALL_FILE_TO_RTCPD
,
"Gave recall file to RTCPD"
},
{
AGGREGATOR_GIVE_MIGRATE_FILE_TO_RTCPD
,
"Giving migrate file to RTCPD"
},
{
AGGREGATOR_GAVE_MIGRATE_FILE_TO_RTCPD
,
"Gave migrate file to RTCPD"
},
{
AGGREGATOR_RECEIVE_MSGBODY_FROM_RTCPD
,
"Receiving message body from RTCPD"
},
{
AGGREGATOR_RECEIVED_MSGBODY_FROM_RTCPD
,
"Received message body from RTCPD"
},
{
AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD
,
"Receiving FileRqstBody from RTCPD"
},
{
AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD
,
"Received FileRqstBody from RTCPD"
},
{
AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD
,
"Receiving FileRqstErrBody from RTCPD"
},
...
...
castor/tape/aggregator/AggregatorDlfMessages.csv
View file @
ce751324
...
...
@@ -60,36 +60,38 @@
59,AGGREGATOR_GAVE_RECALL_FILE_TO_RTCPD,"Gave recall file to RTCPD"
60,AGGREGATOR_GIVE_MIGRATE_FILE_TO_RTCPD,"Giving migrate file to RTCPD"
61,AGGREGATOR_GAVE_MIGRATE_FILE_TO_RTCPD,"Gave migrate file to RTCPD"
62,AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD,"Receiving FileRqstBody from RTCPD"
63,AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD,"Received FileRqstBody from RTCPD"
64,AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD,"Receiving FileRqstErrBody from RTCPD"
65,AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD,"Received FileRqstErrBody from RTCPD"
66,AGGREGATOR_PROCESSING_TAPE_DISK_RQST,"Processing a tape/disk IO request from RTCPD"
67,AGGREGATOR_PING_RTCPD,"Pinging RTCPD"
68,AGGREGATOR_PINGED_RTCPD,"Pinged RTCPD"
69,AGGREGATOR_SEND_ACK_TO_RTCPD,"Sending acknowledge to RTCPD"
70,AGGREGATOR_SENT_ACK_TO_RTCPD,"Sent acknowledge to RTCPD"
71,AGGREGATOR_RECEIVE_TAPERQSTBODY,"Receiving tape request message body"
72,AGGREGATOR_RECEIVED_TAPERQSTBODY,"Received tape request message body"
73,AGGREGATOR_RECEIVE_GIVEOUTPBODY,"Receiving GIVE_OUTP message body"
74,AGGREGATOR_RECEIVED_GIVEOUTPBODY,"Received GIVE_OUTP message body"
75,AGGREGATOR_RECEIVE_TAPERQSTERRBODY,"Receiving tape request message body with error appendix"
76,AGGREGATOR_RECEIVED_TAPERQSTERRBODY,"Received tape request message body with error appendix"
77,AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sending delayed acknowledge of request for more work to RTCPD"
78,AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sent delayed acknowledge of request for more work to RTCPD"
79,AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT,"Created TCP/IP port for RTCPD callbacks"
80,AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD,"Connection closed by RTCPD"
81,AGGREGATOR_CLOSED_CONNECTION,"Connection closed by aggregator"
82,AGGREGATOR_NOTIFY_GATEWAY_FILE_MIGRATED,"Notifying tape gateway file migrated"
83,AGGREGATOR_NOTIFIED_GATEWAY_FILE_MIGRATED,"Notified tape gateway file migrated"
84,AGGREGATOR_NOTIFY_GATEWAY_FILE_RECALLED,"Notifying tape gateway file recalled"
85,AGGREGATOR_NOTIFIED_GATEWAY_FILE_RECALLED,"Notified tape gateway file recalled"
86,AGGREGATOR_NOTIFY_GATEWAY_END_OF_SESSION,"Notifying tape gateway end of session"
87,AGGREGATOR_NOTIFIED_GATEWAY_END_OF_SESSION,"Notified tape gateway end of session"
88,AGGREGATOR_NOTIFY_GATEWAY_DUMP_MESSAGE,"Notifying tape gateway dump message"
89,AGGREGATOR_NOTIFIED_GATEWAY_DUMP_MESSAGE,"Notified tape gateway dump message"
90,AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_SESSION,"Failed to notify gateway end of session"
91,AGGREGATOR_NOTIFY_GATEWAY_END_OF_FAILED_SESSION,"Notifying tape gateway end of failed session"
92,AGGREGATOR_NOTIFIED_GATEWAY_END_OF_FAILED_SESSION,"Notified tape gateway end of failed session"
93,AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_FAILED_SESSION,"Failed to notify gateway end of failed session"
94,AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS,"Failed to process RTCPD sockets"
62,AGGREGATOR_RECEIVE_MSGBODY_FROM_RTCPD,"Receiving message body from RTCPD"
63,AGGREGATOR_RECEIVED_MSGBODY_FROM_RTCPD,"Received message body from RTCPD"
64,AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD,"Receiving FileRqstBody from RTCPD"
65,AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD,"Received FileRqstBody from RTCPD"
66,AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD,"Receiving FileRqstErrBody from RTCPD"
67,AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD,"Received FileRqstErrBody from RTCPD"
68,AGGREGATOR_PROCESSING_TAPE_DISK_RQST,"Processing a tape/disk IO request from RTCPD"
69,AGGREGATOR_PING_RTCPD,"Pinging RTCPD"
70,AGGREGATOR_PINGED_RTCPD,"Pinged RTCPD"
71,AGGREGATOR_SEND_ACK_TO_RTCPD,"Sending acknowledge to RTCPD"
72,AGGREGATOR_SENT_ACK_TO_RTCPD,"Sent acknowledge to RTCPD"
73,AGGREGATOR_RECEIVE_TAPERQSTBODY,"Receiving tape request message body"
74,AGGREGATOR_RECEIVED_TAPERQSTBODY,"Received tape request message body"
75,AGGREGATOR_RECEIVE_GIVEOUTPBODY,"Receiving GIVE_OUTP message body"
76,AGGREGATOR_RECEIVED_GIVEOUTPBODY,"Received GIVE_OUTP message body"
77,AGGREGATOR_RECEIVE_TAPERQSTERRBODY,"Receiving tape request message body with error appendix"
78,AGGREGATOR_RECEIVED_TAPERQSTERRBODY,"Received tape request message body with error appendix"
79,AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sending delayed acknowledge of request for more work to RTCPD"
80,AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sent delayed acknowledge of request for more work to RTCPD"
81,AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT,"Created TCP/IP port for RTCPD callbacks"
82,AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD,"Connection closed by RTCPD"
83,AGGREGATOR_CLOSED_CONNECTION,"Connection closed by aggregator"
84,AGGREGATOR_NOTIFY_GATEWAY_FILE_MIGRATED,"Notifying tape gateway file migrated"
85,AGGREGATOR_NOTIFIED_GATEWAY_FILE_MIGRATED,"Notified tape gateway file migrated"
86,AGGREGATOR_NOTIFY_GATEWAY_FILE_RECALLED,"Notifying tape gateway file recalled"
87,AGGREGATOR_NOTIFIED_GATEWAY_FILE_RECALLED,"Notified tape gateway file recalled"
88,AGGREGATOR_NOTIFY_GATEWAY_END_OF_SESSION,"Notifying tape gateway end of session"
89,AGGREGATOR_NOTIFIED_GATEWAY_END_OF_SESSION,"Notified tape gateway end of session"
90,AGGREGATOR_NOTIFY_GATEWAY_DUMP_MESSAGE,"Notifying tape gateway dump message"
91,AGGREGATOR_NOTIFIED_GATEWAY_DUMP_MESSAGE,"Notified tape gateway dump message"
92,AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_SESSION,"Failed to notify gateway end of session"
93,AGGREGATOR_NOTIFY_GATEWAY_END_OF_FAILED_SESSION,"Notifying tape gateway end of failed session"
94,AGGREGATOR_NOTIFIED_GATEWAY_END_OF_FAILED_SESSION,"Notified tape gateway end of failed session"
95,AGGREGATOR_FAILED_TO_NOTIFY_GATEWAY_END_OF_FAILED_SESSION,"Failed to notify gateway end of failed session"
96,AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS,"Failed to process RTCPD sockets"
castor/tape/aggregator/BridgeProtocolEngine.cpp
View file @
ce751324
...
...
@@ -75,12 +75,23 @@ castor::tape::aggregator::BridgeProtocolEngine::BridgeProtocolEngine(
m_nbReceivedENDOF_REQs
(
0
)
{
// Build the map of message body handlers
m_handlers
[
RTCP_FILE_REQ
]
=
&
BridgeProtocolEngine
::
rtcpFileReqCallback
;
m_handlers
[
RTCP_FILEERR_REQ
]
=
&
BridgeProtocolEngine
::
rtcpFileErrReqCallback
;
m_handlers
[
RTCP_TAPE_REQ
]
=
&
BridgeProtocolEngine
::
rtcpTapeReqCallback
;
m_handlers
[
RTCP_TAPEERR_REQ
]
=
&
BridgeProtocolEngine
::
rtcpTapeErrReqCallback
;
m_handlers
[
RTCP_ENDOF_REQ
]
=
&
BridgeProtocolEngine
::
rtcpEndOfReqCallback
;
m_handlers
[
GIVE_OUTP
]
=
&
BridgeProtocolEngine
::
giveOutpCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC
,
RTCP_FILE_REQ
)]
=
&
BridgeProtocolEngine
::
rtcpFileReqCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC
,
RTCP_FILEERR_REQ
)]
=
&
BridgeProtocolEngine
::
rtcpFileErrReqCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC
,
RTCP_TAPE_REQ
)]
=
&
BridgeProtocolEngine
::
rtcpTapeReqCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC
,
RTCP_TAPEERR_REQ
)]
=
&
BridgeProtocolEngine
::
rtcpTapeErrReqCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC
,
RTCP_ENDOF_REQ
)]
=
&
BridgeProtocolEngine
::
rtcpEndOfReqCallback
;
m_handlers
[
createHandlerKey
(
RTCOPY_MAGIC_SHIFT
,
GIVE_OUTP
)]
=
&
BridgeProtocolEngine
::
giveOutpCallback
;
}
...
...
@@ -573,10 +584,13 @@ void castor::tape::aggregator::BridgeProtocolEngine::processRtcpdRequest(
}
// Find the message type's corresponding handler
MsgBodyCallbackMap
::
iterator
itor
=
m_handlers
.
find
(
header
.
reqType
);
MsgBodyCallbackMap
::
iterator
itor
=
m_handlers
.
find
(
createHandlerKey
(
header
.
magic
,
header
.
reqType
));
if
(
itor
==
m_handlers
.
end
())
{
TAPE_THROW_CODE
(
EBADMSG
,
": Unknown request type: 0x"
<<
header
.
reqType
);
": Unknown magic and request type combination"
": magic=0x"
<<
std
::
hex
<<
header
.
magic
<<
": reqType=0x"
<<
header
.
reqType
<<
std
::
dec
);
}
const
MsgBodyCallback
handler
=
itor
->
second
;
...
...
@@ -594,8 +608,13 @@ void castor::tape::aggregator::BridgeProtocolEngine::rtcpFileReqCallback(
RtcpFileRqstMsgBody
body
;
/*
RtcpTxRx::receiveRtcpFileRqstBody(m_cuuid, m_volReqId, socketFd,
RTCPDNETRWTIMEOUT, header, body);
*/
RtcpTxRx
::
receiveMsgBody
(
m_cuuid
,
m_volReqId
,
socketFd
,
RTCPDNETRWTIMEOUT
,
header
,
body
);
processRtcpFileReq
(
header
,
body
,
socketFd
,
receivedENDOF_REQ
);
}
...
...
@@ -610,8 +629,12 @@ void castor::tape::aggregator::BridgeProtocolEngine::rtcpFileErrReqCallback(
RtcpFileRqstErrMsgBody
body
;
/*
RtcpTxRx::receiveRtcpFileRqstErrBody(m_cuuid, m_volReqId, socketFd,
RTCPDNETRWTIMEOUT, header, body);
*/
RtcpTxRx
::
receiveMsgBody
(
m_cuuid
,
m_volReqId
,
socketFd
,
RTCPDNETRWTIMEOUT
,
header
,
body
);
// If RTCPD has reported an error
if
(
body
.
err
.
errorCode
!=
0
)
{
...
...
@@ -856,8 +879,13 @@ void castor::tape::aggregator::BridgeProtocolEngine::rtcpTapeReqCallback(
RtcpTapeRqstMsgBody
body
;
/*
RtcpTxRx::receiveRtcpTapeRqstBody(m_cuuid, m_volReqId, socketFd,
RTCPDNETRWTIMEOUT, header, body);
*/
RtcpTxRx
::
receiveMsgBody
(
m_cuuid
,
m_volReqId
,
socketFd
,
RTCPDNETRWTIMEOUT
,
header
,
body
);
return
(
processRtcpTape
(
header
,
body
,
socketFd
,
receivedENDOF_REQ
));
}
...
...
@@ -873,8 +901,13 @@ void
RtcpTapeRqstErrMsgBody
body
;
/*
RtcpTxRx::receiveRtcpTapeRqstErrBody(m_cuuid, m_volReqId, socketFd,
RTCPDNETRWTIMEOUT, header, body);
*/
RtcpTxRx
::
receiveMsgBody
(
m_cuuid
,
m_volReqId
,
socketFd
,
RTCPDNETRWTIMEOUT
,
header
,
body
);
if
(
body
.
err
.
errorCode
!=
0
)
{
char
codeStr
[
STRERRORBUFLEN
];
...
...
castor/tape/aggregator/BridgeProtocolEngine.hpp
View file @
ce751324
...
...
@@ -175,12 +175,12 @@ private:
const
MessageHeader
&
header
,
const
int
socketFd
,
bool
&
endOfSession
);
/**
* Datatype for the map of message body handler
s
.
* Datatype for the map of
magic+reqType to
message body handler.
*/
typedef
std
::
map
<
uint
32
_t
,
MsgBodyCallback
>
MsgBodyCallbackMap
;
typedef
std
::
map
<
uint
64
_t
,
MsgBodyCallback
>
MsgBodyCallbackMap
;
/**
* Map of message body handler
s
.
* Map of
magic+reqType to
message body handler.
*/
MsgBodyCallbackMap
m_handlers
;
...
...
@@ -190,6 +190,33 @@ private:
*/
utils
::
IndexedContainer
<
uint64_t
,
MAXPENDINGTRANSFERS
>
m_pendingTransferIds
;
/**
* In-line helper function that returns a 64-bit message body handler key to
* be used in the m_handler map.
*
* The 64-bit key is generated by combining the specified 32-bit magic
* number with the specified 32-bit request type.
*
* @param magic The magic number.
* @param reqType The request type.
* @return The 64-bit key.
*/
uint64_t
createHandlerKey
(
uint32_t
magic
,
uint32_t
reqType
)
throw
()
{
struct
TwoUint32
{
uint32_t
a
;
uint32_t
b
;
};
uint64_t
key
;
TwoUint32
*
twoUint32
=
(
TwoUint32
*
)
&
key
;
twoUint32
->
a
=
reqType
;
twoUint32
->
b
=
magic
;
return
key
;
}
/**
* Accepts an RTCPD connection using the specified listener socket.
*/
...
...
castor/tape/aggregator/Imakefile
View file @
ce751324
...
...
@@ -73,9 +73,11 @@ AGGREGATORBIN_SRCS = \
BridgeProtocolEngine.cpp \
DriveAllocationProtocolEngine.cpp \
GatewayTxRx.cpp \
LogHelper.cpp \
Marshaller.cpp \
Packer.cpp \
RcpJobSubmitter.cpp \
RtcpMarshaller.cpp \
RtcpTxRx.cpp \
SmartFd.cpp \
SmartFdList.cpp \
...
...
castor/tape/aggregator/LogHelper.cpp
0 → 100644
View file @
ce751324
/******************************************************************************
* castor/tape/aggregator/LogHelper.cpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
*
* @author Nicola.Bessone@cern.ch Steven.Murray@cern.ch
*****************************************************************************/
#include
"castor/dlf/Dlf.hpp"
#include
"castor/tape/aggregator/LogHelper.hpp"
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RcpJobRqstMsgBody
&
body
)
throw
()
{
castor
::
dlf
::
Param
params
[]
=
{
castor
::
dlf
::
Param
(
"volReqId"
,
volReqId
),
castor
::
dlf
::
Param
(
"socketFd"
,
socketFd
),
castor
::
dlf
::
Param
(
"tapeRequestId"
,
body
.
tapeRequestId
),
castor
::
dlf
::
Param
(
"clientPort"
,
body
.
clientPort
),
castor
::
dlf
::
Param
(
"clientEuid"
,
body
.
clientEuid
),
castor
::
dlf
::
Param
(
"clientEgid"
,
body
.
clientEgid
),
castor
::
dlf
::
Param
(
"clientHost"
,
body
.
clientHost
),
castor
::
dlf
::
Param
(
"deviceGroupName"
,
body
.
deviceGroupName
),
castor
::
dlf
::
Param
(
"driveName"
,
body
.
driveName
),
castor
::
dlf
::
Param
(
"clientUserName"
,
body
.
clientUserName
)};
castor
::
dlf
::
dlf_writep
(
cuuid
,
DLF_LVL_SYSTEM
,
message_no
,
params
);
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RcpJobReplyMsgBody
&
body
)
throw
()
{
castor
::
dlf
::
Param
params
[]
=
{
castor
::
dlf
::
Param
(
"volReqId"
,
volReqId
),
castor
::
dlf
::
Param
(
"socketFd"
,
socketFd
),
castor
::
dlf
::
Param
(
"status"
,
body
.
status
),
castor
::
dlf
::
Param
(
"errorMessage"
,
body
.
errorMessage
)};
castor
::
dlf
::
dlf_writep
(
cuuid
,
DLF_LVL_SYSTEM
,
message_no
,
params
);
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpTapeRqstErrMsgBody
&
body
)
throw
()
{
/*
castor::dlf::Param params[] = {
castor::dlf::Param("volReqId" , volReqId ),
castor::dlf::Param("socketFd" , socketFd ),
castor::dlf::Param("vid", vid);
char vsn[CA_MAXVSNLEN+1];
char label[CA_MAXLBLTYPLEN+1];
char devtype[CA_MAXDVTLEN+1];
char density[CA_MAXDENLEN+1];
char unit[CA_MAXUNMLEN+1];
uint32_t volReqId; // VDQM volume request ID
uint32_t jobId; // Local RTCOPY server job ID
uint32_t mode; // WRITE_DISABLE or WRITE_ENABLE
uint32_t start_file; // Start file if mapped VID
uint32_t end_file; // End file if mapped VID
uint32_t side; // Disk side number
uint32_t tprc; // Return code from last Ctape
uint32_t tStartRequest; // Start time of request (set by client)
uint32_t tEndRequest; // End time of request (set by client)
uint32_t tStartRtcpd; // Time when request is received by rtcpd server
uint32_t tStartMount; // Time when mount request is sent to Ctape
uint32_t tEndMount; // Time when mount request returns
uint32_t tStartUnmount; // Time when unmount request is sent to Ctape
uint32_t tEndUnmount; // Time when unmount request returns
Cuuid_t rtcpReqId; // Unique request id assigned by RTCOPY
castor::dlf::dlf_writep(cuuid, DLF_LVL_SYSTEM, message_no, params);
*/
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpTapeRqstMsgBody
&
body
)
throw
()
{
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpFileRqstErrMsgBody
&
body
)
throw
()
{
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpFileRqstMsgBody
&
body
)
throw
()
{
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
GiveOutpMsgBody
&
body
)
throw
()
{
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpNoMoreRequestsMsgBody
&
body
)
throw
()
{
}
//-----------------------------------------------------------------------------
// logMsgBody
//-----------------------------------------------------------------------------
void
castor
::
tape
::
aggregator
::
LogHelper
::
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpAbortMsgBody
&
body
)
throw
()
{
}
castor/tape/aggregator/LogHelper.hpp
0 → 100644
View file @
ce751324
/******************************************************************************
* castor/tape/aggregator/LogHelper.hpp
*
* This file is part of the Castor project.
* See http://castor.web.cern.ch/castor
*
* Copyright (C) 2003 CERN
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
* @author Nicola.Bessone@cern.ch Steven.Murray@cern.ch
*****************************************************************************/
#ifndef CASTOR_TAPE_AGGREGATOR_LOGHELPER
#define CASTOR_TAPE_AGGREGATOR_LOGHELPER
#include
"castor/tape/aggregator/GiveOutpMsgBody.hpp"
#include
"castor/tape/aggregator/RcpJobReplyMsgBody.hpp"
#include
"castor/tape/aggregator/RcpJobRqstMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpAbortMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpNoMoreRequestsMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpFileRqstMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpFileRqstErrMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpTapeRqstMsgBody.hpp"
#include
"castor/tape/aggregator/RtcpTapeRqstErrMsgBody.hpp"
#include
"h/Cuuid.h"
namespace
castor
{
namespace
tape
{
namespace
aggregator
{
/**
* Collection of static methods to facilitate logging.
*/
class
LogHelper
{
public:
/**
* Logs the specified RTCP message body.
*
* @param cuuid The uuid of the component issuing the message.
* @param message_no The message number in the facility.
* @param severity The severity of the message.
* @param volReqId The volume request ID.
* @param socketFd The file descriptor of the associated TCP/IP socket.
* @param body The message body.
*/
static
void
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RcpJobRqstMsgBody
&
body
)
throw
();
/**
* Logs the specified RTCP message body.
*
* @param cuuid The uuid of the component issuing the message.
* @param message_no The message number in the facility.
* @param severity The severity of the message.
* @param volReqId The volume request ID.
* @param socketFd The file descriptor of the associated TCP/IP socket.
* @param body The message body.
*/
static
void
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RcpJobReplyMsgBody
&
body
)
throw
();
/**
* Logs the specified RTCP message body.
*
* @param cuuid The uuid of the component issuing the message.
* @param message_no The message number in the facility.
* @param severity The severity of the message.
* @param volReqId The volume request ID.
* @param socketFd The file descriptor of the associated TCP/IP socket.
* @param body The message body.
*/
static
void
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,
const
uint32_t
volReqId
,
const
int
socketFd
,
const
RtcpTapeRqstErrMsgBody
&
body
)
throw
();
/**
* Logs the specified RTCP message body.
*
* @param cuuid The uuid of the component issuing the message.
* @param message_no The message number in the facility.
* @param severity The severity of the message.
* @param volReqId The volume request ID.
* @param socketFd The file descriptor of the associated TCP/IP socket.
* @param body The message body.
*/
static
void
logMsgBody
(
const
Cuuid_t
&
cuuid
,
const
int
severity
,
const
int
message_no
,