Commit 4e93bd32 authored by Steven Murray's avatar Steven Murray
Browse files

umask is now passed from readtp through to rtcpd

parent d288688a
......@@ -28,14 +28,36 @@
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
namespace castor {
namespace tape {
/**
* The timeout in seconds used when sending and receiving RTCPD network
* messages.
*/
const size_t RTCPDNETRWTIMEOUT = 5;
const size_t STRERRORBUFLEN = 256;
const size_t VMGRERRORBUFLEN = 512;
/**
* The size in bytes of the error string buffer to be used with the strerror
* family of commands.
*/
const size_t STRERRORBUFLEN = 256;
/**
* The size in bytes of the VMGR error buffer.
*/
const size_t VMGRERRORBUFLEN = 512;
/**
* The conservative umask to be used in the RTCOPY protocol when it makes no
* sense to send one. The RTCOPY protocol sends umask information when
* migrating files from disk to tape and when indicating that more files can
* be requested by RTCPD.
*/
const mode_t RTCOPYCONSERVATIVEUMASK = 077;
} // namespace tape
} // namespace castor
......
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Mon Aug 10 18:07:35 CEST 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Tue Aug 11 19:03:32 CEST 2009
*/
/******************************************************************************
......@@ -74,73 +74,71 @@ AGGREGATOR_GOT_REQUEST_INFO_FROM_RTCPD=37, /* "Got request information from RTCP
AGGREGATOR_TOLD_CLIENT_TO_START_TRANSFER=38, /* "Told client to start the transfer protocol" */
AGGREGATOR_GET_VOLUME_FROM_CLIENT=39, /* "Getting volume from client" */
AGGREGATOR_GOT_VOLUME_FROM_CLIENT=40, /* "Got volume from client" */
AGGREGATOR_GOT_NO_VOLUME_FROM_CLIENT=41, /* "Got no volume from client" */
AGGREGATOR_GOT_NO_MORE_FILES_FROM_CLIENT=41, /* "Got no more files from client" */
AGGREGATOR_GET_FILE_TO_MIGRATE_FROM_CLIENT=42, /* "Getting file to migrate from client" */
AGGREGATOR_GOT_FILE_TO_MIGRATE_FROM_CLIENT=43, /* "Got file to migrate from client" */
AGGREGATOR_NO_MORE_FILES_TO_MIGRATE=44, /* "No more files to migrate" */
AGGREGATOR_GET_FILE_TO_RECALL_FROM_CLIENT=45, /* "Getting file to recall from client" */
AGGREGATOR_GOT_FILE_TO_RECALL_FROM_CLIENT=46, /* "Got file to recall from client" */
AGGREGATOR_NO_MORE_FILES_TO_RECALL=47, /* "No more files to recall" */
AGGREGATOR_GIVE_VOLUME_TO_RTCPD=48, /* "Giving volume to RTCPD" */
AGGREGATOR_GAVE_VOLUME_TO_RTCPD=49, /* "Gave volume to RTCPD" */
AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_RECALL_WORK=50, /* "Asking RTCPD to request more recall work" */
AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_RECALL_WORK=51, /* "Asked RTCPD to request more recall work" */
AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_MIGRATE_WORK=52, /* "Asking RTCPD to request more migrate work" */
AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_MIGRATE_WORK=53, /* "Asked RTCPD to request more migrate work" */
AGGREGATOR_TELL_RTCPD_DUMP_TAPE=54, /* "Telling RTCPD to dump tape" */
AGGREGATOR_TOLD_RTCPD_DUMP_TAPE=55, /* "Told RTCPD to dump tape" */
AGGREGATOR_TELL_RTCPD_END_OF_FILE_LIST=56, /* "Telling RTCPD end of file list" */
AGGREGATOR_TOLD_RTCPD_END_OF_FILE_LIST=57, /* "Told RTCPD end of file list" */
AGGREGATOR_TELL_RTCPD_TO_ABORT=58, /* "Telling RTCPD to abort" */
AGGREGATOR_TOLD_RTCPD_TO_ABORT=59, /* "Told RTCPD to abort" */
AGGREGATOR_GIVE_RECALL_FILE_TO_RTCPD=60, /* "Giving recall file to RTCPD" */
AGGREGATOR_GAVE_RECALL_FILE_TO_RTCPD=61, /* "Gave recall file to RTCPD" */
AGGREGATOR_GIVE_MIGRATE_FILE_TO_RTCPD=62, /* "Giving migrate file to RTCPD" */
AGGREGATOR_GAVE_MIGRATE_FILE_TO_RTCPD=63, /* "Gave migrate file to RTCPD" */
AGGREGATOR_RECEIVE_MSGBODY_FROM_RTCPD=64, /* "Receiving message body from RTCPD" */
AGGREGATOR_RECEIVED_MSGBODY_FROM_RTCPD=65, /* "Received message body from RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD=66, /* "Receiving FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD=67, /* "Received FileRqstBody from RTCPD" */
AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD=68, /* "Receiving FileRqstErrBody from RTCPD" */
AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD=69, /* "Received FileRqstErrBody from RTCPD" */
AGGREGATOR_PROCESSING_TAPE_DISK_RQST=70, /* "Processing a tape/disk IO request from RTCPD" */
AGGREGATOR_PING_RTCPD=71, /* "Pinging RTCPD" */
AGGREGATOR_PINGED_RTCPD=72, /* "Pinged RTCPD" */
AGGREGATOR_SEND_ACK_TO_RTCPD=73, /* "Sending acknowledge to RTCPD" */
AGGREGATOR_SENT_ACK_TO_RTCPD=74, /* "Sent acknowledge to RTCPD" */
AGGREGATOR_SEND_HEADER_TO_RTCPD=75, /* "Sending message header to RTCPD" */
AGGREGATOR_SENT_HEADER_TO_RTCPD=76, /* "Sent message header to RTCPD" */
AGGREGATOR_RECEIVE_TAPERQSTBODY=77, /* "Receiving tape request message body" */
AGGREGATOR_RECEIVED_TAPERQSTBODY=78, /* "Received tape request message body" */
AGGREGATOR_RECEIVE_GIVEOUTPBODY=79, /* "Receiving GIVE_OUTP message body" */
AGGREGATOR_RECEIVED_GIVEOUTPBODY=80, /* "Received GIVE_OUTP message body" */
AGGREGATOR_RECEIVE_TAPERQSTERRBODY=81, /* "Receiving tape request message body with error appendix" */
AGGREGATOR_RECEIVED_TAPERQSTERRBODY=82, /* "Received tape request message body with error appendix" */
AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD=83, /* "Sending delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD=84, /* "Sent delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT=85, /* "Created TCP/IP port for RTCPD callbacks" */
AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD=86, /* "Connection closed by RTCPD" */
AGGREGATOR_CLOSED_CONNECTION=87, /* "Connection closed by aggregator" */
AGGREGATOR_NOTIFY_CLIENT_FILE_MIGRATED=88, /* "Notifying client file migrated" */
AGGREGATOR_NOTIFIED_CLIENT_FILE_MIGRATED=89, /* "Notified client file migrated" */
AGGREGATOR_NOTIFY_CLIENT_FILE_RECALLED=90, /* "Notifying client file recalled" */
AGGREGATOR_NOTIFIED_CLIENT_FILE_RECALLED=91, /* "Notified client file recalled" */
AGGREGATOR_NOTIFY_CLIENT_END_OF_SESSION=92, /* "Notifying client end of session" */
AGGREGATOR_NOTIFIED_CLIENT_END_OF_SESSION=93, /* "Notified client end of session" */
AGGREGATOR_GET_DUMP_PARAMETERS_FROM_CLIENT=94, /* "Getting dump parameters from client" */
AGGREGATOR_GOT_DUMP_PARAMETERS_FROM_CLIENT=95, /* "Got dump parameters from client" */
AGGREGATOR_NOTIFY_CLIENT_DUMP_MESSAGE=96, /* "Notifying client dump message" */
AGGREGATOR_NOTIFIED_CLIENT_DUMP_MESSAGE=97, /* "Notified client dump message" */
AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_SESSION=98, /* "Failed to notify gateway end of session" */
AGGREGATOR_NOTIFY_CLIENT_END_OF_FAILED_SESSION=99, /* "Notifying client end of failed session" */
AGGREGATOR_NOTIFIED_CLIENT_END_OF_FAILED_SESSION=100, /* "Notified client end of failed session" */
AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_FAILED_SESSION=101, /* "Failed to notify gateway end of failed session" */
AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS=102, /* "Failed to process RTCPD sockets" */
AGGREGATOR_SELECT_INTR=103, /* "Select interrupted" */
AGGREGATOR_ENTERING_BRIDGE_MODE=104, /* "Entering bridge mode" */
AGGREGATOR_PING_CLIENT=105, /* "Pinging client" */
AGGREGATOR_PINGED_CLIENT=106, /* "Pinged client" */
AGGREGATOR_CLOSED_INITIAL_CALLBACK_CONNECTION=107 /* "Closed initial callback connection" */
AGGREGATOR_GET_FILE_TO_RECALL_FROM_CLIENT=44, /* "Getting file to recall from client" */
AGGREGATOR_GOT_FILE_TO_RECALL_FROM_CLIENT=45, /* "Got file to recall from client" */
AGGREGATOR_GIVE_VOLUME_TO_RTCPD=46, /* "Giving volume to RTCPD" */
AGGREGATOR_GAVE_VOLUME_TO_RTCPD=47, /* "Gave volume to RTCPD" */
AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_RECALL_WORK=48, /* "Asking RTCPD to request more recall work" */
AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_RECALL_WORK=49, /* "Asked RTCPD to request more recall work" */
AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_MIGRATE_WORK=50, /* "Asking RTCPD to request more migrate work" */
AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_MIGRATE_WORK=51, /* "Asked RTCPD to request more migrate work" */
AGGREGATOR_TELL_RTCPD_DUMP_TAPE=52, /* "Telling RTCPD to dump tape" */
AGGREGATOR_TOLD_RTCPD_DUMP_TAPE=53, /* "Told RTCPD to dump tape" */
AGGREGATOR_TELL_RTCPD_END_OF_FILE_LIST=54, /* "Telling RTCPD end of file list" */
AGGREGATOR_TOLD_RTCPD_END_OF_FILE_LIST=55, /* "Told RTCPD end of file list" */
AGGREGATOR_TELL_RTCPD_TO_ABORT=56, /* "Telling RTCPD to abort" */
AGGREGATOR_TOLD_RTCPD_TO_ABORT=57, /* "Told RTCPD to abort" */
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_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_SEND_HEADER_TO_RTCPD=73, /* "Sending message header to RTCPD" */
AGGREGATOR_SENT_HEADER_TO_RTCPD=74, /* "Sent message header to RTCPD" */
AGGREGATOR_RECEIVE_TAPERQSTBODY=75, /* "Receiving tape request message body" */
AGGREGATOR_RECEIVED_TAPERQSTBODY=76, /* "Received tape request message body" */
AGGREGATOR_RECEIVE_GIVEOUTPBODY=77, /* "Receiving GIVE_OUTP message body" */
AGGREGATOR_RECEIVED_GIVEOUTPBODY=78, /* "Received GIVE_OUTP message body" */
AGGREGATOR_RECEIVE_TAPERQSTERRBODY=79, /* "Receiving tape request message body with error appendix" */
AGGREGATOR_RECEIVED_TAPERQSTERRBODY=80, /* "Received tape request message body with error appendix" */
AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD=81, /* "Sending delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD=82, /* "Sent delayed acknowledge of request for more work to RTCPD" */
AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT=83, /* "Created TCP/IP port for RTCPD callbacks" */
AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD=84, /* "Connection closed by RTCPD" */
AGGREGATOR_CLOSED_CONNECTION=85, /* "Connection closed by aggregator" */
AGGREGATOR_NOTIFY_CLIENT_FILE_MIGRATED=86, /* "Notifying client file migrated" */
AGGREGATOR_NOTIFIED_CLIENT_FILE_MIGRATED=87, /* "Notified client file migrated" */
AGGREGATOR_NOTIFY_CLIENT_FILE_RECALLED=88, /* "Notifying client file recalled" */
AGGREGATOR_NOTIFIED_CLIENT_FILE_RECALLED=89, /* "Notified client file recalled" */
AGGREGATOR_NOTIFY_CLIENT_END_OF_SESSION=90, /* "Notifying client end of session" */
AGGREGATOR_NOTIFIED_CLIENT_END_OF_SESSION=91, /* "Notified client end of session" */
AGGREGATOR_GET_DUMP_PARAMETERS_FROM_CLIENT=92, /* "Getting dump parameters from client" */
AGGREGATOR_GOT_DUMP_PARAMETERS_FROM_CLIENT=93, /* "Got dump parameters from client" */
AGGREGATOR_NOTIFY_CLIENT_DUMP_MESSAGE=94, /* "Notifying client dump message" */
AGGREGATOR_NOTIFIED_CLIENT_DUMP_MESSAGE=95, /* "Notified client dump message" */
AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_SESSION=96, /* "Failed to notify gateway end of session" */
AGGREGATOR_NOTIFY_CLIENT_END_OF_FAILED_SESSION=97, /* "Notifying client end of failed session" */
AGGREGATOR_NOTIFIED_CLIENT_END_OF_FAILED_SESSION=98, /* "Notified client end of failed session" */
AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_FAILED_SESSION=99, /* "Failed to notify gateway end of failed session" */
AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS=100, /* "Failed to process RTCPD sockets" */
AGGREGATOR_SELECT_INTR=101, /* "Select interrupted" */
AGGREGATOR_ENTERING_BRIDGE_MODE=102, /* "Entering bridge mode" */
AGGREGATOR_PING_CLIENT=103, /* "Pinging client" */
AGGREGATOR_PINGED_CLIENT=104, /* "Pinged client" */
AGGREGATOR_CLOSED_INITIAL_CALLBACK_CONNECTION=105 /* "Closed initial callback connection" */
}; // enum AggregatorDlfMessages
} // namespace aggregator
} // namespace tape
......
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Mon Aug 10 18:07:35 CEST 2009
/* This file was generated by ./AggregatorDlfMessagesCodeGenerator on Tue Aug 11 19:03:32 CEST 2009
*/
/******************************************************************************
......@@ -70,13 +70,11 @@ castor::dlf::Message castor::tape::aggregator::AggregatorDaemon::s_dlfMessages[]
{AGGREGATOR_TOLD_CLIENT_TO_START_TRANSFER, "Told client to start the transfer protocol"},
{AGGREGATOR_GET_VOLUME_FROM_CLIENT, "Getting volume from client"},
{AGGREGATOR_GOT_VOLUME_FROM_CLIENT, "Got volume from client"},
{AGGREGATOR_GOT_NO_VOLUME_FROM_CLIENT, "Got no volume from client"},
{AGGREGATOR_GOT_NO_MORE_FILES_FROM_CLIENT, "Got no more files from client"},
{AGGREGATOR_GET_FILE_TO_MIGRATE_FROM_CLIENT, "Getting file to migrate from client"},
{AGGREGATOR_GOT_FILE_TO_MIGRATE_FROM_CLIENT, "Got file to migrate from client"},
{AGGREGATOR_NO_MORE_FILES_TO_MIGRATE, "No more files to migrate"},
{AGGREGATOR_GET_FILE_TO_RECALL_FROM_CLIENT, "Getting file to recall from client"},
{AGGREGATOR_GOT_FILE_TO_RECALL_FROM_CLIENT, "Got file to recall from client"},
{AGGREGATOR_NO_MORE_FILES_TO_RECALL, "No more files to recall"},
{AGGREGATOR_GIVE_VOLUME_TO_RTCPD, "Giving volume to RTCPD"},
{AGGREGATOR_GAVE_VOLUME_TO_RTCPD, "Gave volume to RTCPD"},
{AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_RECALL_WORK, "Asking RTCPD to request more recall work"},
......
......@@ -39,70 +39,68 @@
38,AGGREGATOR_TOLD_CLIENT_TO_START_TRANSFER,"Told client to start the transfer protocol"
39,AGGREGATOR_GET_VOLUME_FROM_CLIENT,"Getting volume from client"
40,AGGREGATOR_GOT_VOLUME_FROM_CLIENT,"Got volume from client"
41,AGGREGATOR_GOT_NO_VOLUME_FROM_CLIENT,"Got no volume from client"
41,AGGREGATOR_GOT_NO_MORE_FILES_FROM_CLIENT,"Got no more files from client"
42,AGGREGATOR_GET_FILE_TO_MIGRATE_FROM_CLIENT,"Getting file to migrate from client"
43,AGGREGATOR_GOT_FILE_TO_MIGRATE_FROM_CLIENT,"Got file to migrate from client"
44,AGGREGATOR_NO_MORE_FILES_TO_MIGRATE,"No more files to migrate"
45,AGGREGATOR_GET_FILE_TO_RECALL_FROM_CLIENT,"Getting file to recall from client"
46,AGGREGATOR_GOT_FILE_TO_RECALL_FROM_CLIENT,"Got file to recall from client"
47,AGGREGATOR_NO_MORE_FILES_TO_RECALL,"No more files to recall"
48,AGGREGATOR_GIVE_VOLUME_TO_RTCPD,"Giving volume to RTCPD"
49,AGGREGATOR_GAVE_VOLUME_TO_RTCPD,"Gave volume to RTCPD"
50,AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_RECALL_WORK,"Asking RTCPD to request more recall work"
51,AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_RECALL_WORK,"Asked RTCPD to request more recall work"
52,AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_MIGRATE_WORK,"Asking RTCPD to request more migrate work"
53,AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_MIGRATE_WORK,"Asked RTCPD to request more migrate work"
54,AGGREGATOR_TELL_RTCPD_DUMP_TAPE,"Telling RTCPD to dump tape"
55,AGGREGATOR_TOLD_RTCPD_DUMP_TAPE,"Told RTCPD to dump tape"
56,AGGREGATOR_TELL_RTCPD_END_OF_FILE_LIST,"Telling RTCPD end of file list"
57,AGGREGATOR_TOLD_RTCPD_END_OF_FILE_LIST,"Told RTCPD end of file list"
58,AGGREGATOR_TELL_RTCPD_TO_ABORT,"Telling RTCPD to abort"
59,AGGREGATOR_TOLD_RTCPD_TO_ABORT,"Told RTCPD to abort"
60,AGGREGATOR_GIVE_RECALL_FILE_TO_RTCPD,"Giving recall file to RTCPD"
61,AGGREGATOR_GAVE_RECALL_FILE_TO_RTCPD,"Gave recall file to RTCPD"
62,AGGREGATOR_GIVE_MIGRATE_FILE_TO_RTCPD,"Giving migrate file to RTCPD"
63,AGGREGATOR_GAVE_MIGRATE_FILE_TO_RTCPD,"Gave migrate file to RTCPD"
64,AGGREGATOR_RECEIVE_MSGBODY_FROM_RTCPD,"Receiving message body from RTCPD"
65,AGGREGATOR_RECEIVED_MSGBODY_FROM_RTCPD,"Received message body from RTCPD"
66,AGGREGATOR_RECEIVE_FILERQSTBODY_FROM_RTCPD,"Receiving FileRqstBody from RTCPD"
67,AGGREGATOR_RECEIVED_FILERQSTBODY_FROM_RTCPD,"Received FileRqstBody from RTCPD"
68,AGGREGATOR_RECEIVE_FILERQSTERRBODY_FROM_RTCPD,"Receiving FileRqstErrBody from RTCPD"
69,AGGREGATOR_RECEIVED_FILERQSTERRBODY_FROM_RTCPD,"Received FileRqstErrBody from RTCPD"
70,AGGREGATOR_PROCESSING_TAPE_DISK_RQST,"Processing a tape/disk IO request from RTCPD"
71,AGGREGATOR_PING_RTCPD,"Pinging RTCPD"
72,AGGREGATOR_PINGED_RTCPD,"Pinged RTCPD"
73,AGGREGATOR_SEND_ACK_TO_RTCPD,"Sending acknowledge to RTCPD"
74,AGGREGATOR_SENT_ACK_TO_RTCPD,"Sent acknowledge to RTCPD"
75,AGGREGATOR_SEND_HEADER_TO_RTCPD,"Sending message header to RTCPD"
76,AGGREGATOR_SENT_HEADER_TO_RTCPD,"Sent message header to RTCPD"
77,AGGREGATOR_RECEIVE_TAPERQSTBODY,"Receiving tape request message body"
78,AGGREGATOR_RECEIVED_TAPERQSTBODY,"Received tape request message body"
79,AGGREGATOR_RECEIVE_GIVEOUTPBODY,"Receiving GIVE_OUTP message body"
80,AGGREGATOR_RECEIVED_GIVEOUTPBODY,"Received GIVE_OUTP message body"
81,AGGREGATOR_RECEIVE_TAPERQSTERRBODY,"Receiving tape request message body with error appendix"
82,AGGREGATOR_RECEIVED_TAPERQSTERRBODY,"Received tape request message body with error appendix"
83,AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sending delayed acknowledge of request for more work to RTCPD"
84,AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sent delayed acknowledge of request for more work to RTCPD"
85,AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT,"Created TCP/IP port for RTCPD callbacks"
86,AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD,"Connection closed by RTCPD"
87,AGGREGATOR_CLOSED_CONNECTION,"Connection closed by aggregator"
88,AGGREGATOR_NOTIFY_CLIENT_FILE_MIGRATED,"Notifying client file migrated"
89,AGGREGATOR_NOTIFIED_CLIENT_FILE_MIGRATED,"Notified client file migrated"
90,AGGREGATOR_NOTIFY_CLIENT_FILE_RECALLED,"Notifying client file recalled"
91,AGGREGATOR_NOTIFIED_CLIENT_FILE_RECALLED,"Notified client file recalled"
92,AGGREGATOR_NOTIFY_CLIENT_END_OF_SESSION,"Notifying client end of session"
93,AGGREGATOR_NOTIFIED_CLIENT_END_OF_SESSION,"Notified client end of session"
94,AGGREGATOR_GET_DUMP_PARAMETERS_FROM_CLIENT,"Getting dump parameters from client"
95,AGGREGATOR_GOT_DUMP_PARAMETERS_FROM_CLIENT,"Got dump parameters from client"
96,AGGREGATOR_NOTIFY_CLIENT_DUMP_MESSAGE,"Notifying client dump message"
97,AGGREGATOR_NOTIFIED_CLIENT_DUMP_MESSAGE,"Notified client dump message"
98,AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_SESSION,"Failed to notify gateway end of session"
99,AGGREGATOR_NOTIFY_CLIENT_END_OF_FAILED_SESSION,"Notifying client end of failed session"
100,AGGREGATOR_NOTIFIED_CLIENT_END_OF_FAILED_SESSION,"Notified client end of failed session"
101,AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_FAILED_SESSION,"Failed to notify gateway end of failed session"
102,AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS,"Failed to process RTCPD sockets"
103,AGGREGATOR_SELECT_INTR,"Select interrupted"
104,AGGREGATOR_ENTERING_BRIDGE_MODE,"Entering bridge mode"
105,AGGREGATOR_PING_CLIENT,"Pinging client"
106,AGGREGATOR_PINGED_CLIENT,"Pinged client"
107,AGGREGATOR_CLOSED_INITIAL_CALLBACK_CONNECTION,"Closed initial callback connection"
44,AGGREGATOR_GET_FILE_TO_RECALL_FROM_CLIENT,"Getting file to recall from client"
45,AGGREGATOR_GOT_FILE_TO_RECALL_FROM_CLIENT,"Got file to recall from client"
46,AGGREGATOR_GIVE_VOLUME_TO_RTCPD,"Giving volume to RTCPD"
47,AGGREGATOR_GAVE_VOLUME_TO_RTCPD,"Gave volume to RTCPD"
48,AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_RECALL_WORK,"Asking RTCPD to request more recall work"
49,AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_RECALL_WORK,"Asked RTCPD to request more recall work"
50,AGGREGATOR_ASK_RTCPD_TO_RQST_MORE_MIGRATE_WORK,"Asking RTCPD to request more migrate work"
51,AGGREGATOR_ASKED_RTCPD_TO_RQST_MORE_MIGRATE_WORK,"Asked RTCPD to request more migrate work"
52,AGGREGATOR_TELL_RTCPD_DUMP_TAPE,"Telling RTCPD to dump tape"
53,AGGREGATOR_TOLD_RTCPD_DUMP_TAPE,"Told RTCPD to dump tape"
54,AGGREGATOR_TELL_RTCPD_END_OF_FILE_LIST,"Telling RTCPD end of file list"
55,AGGREGATOR_TOLD_RTCPD_END_OF_FILE_LIST,"Told RTCPD end of file list"
56,AGGREGATOR_TELL_RTCPD_TO_ABORT,"Telling RTCPD to abort"
57,AGGREGATOR_TOLD_RTCPD_TO_ABORT,"Told RTCPD to abort"
58,AGGREGATOR_GIVE_RECALL_FILE_TO_RTCPD,"Giving recall file to RTCPD"
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_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_SEND_HEADER_TO_RTCPD,"Sending message header to RTCPD"
74,AGGREGATOR_SENT_HEADER_TO_RTCPD,"Sent message header to RTCPD"
75,AGGREGATOR_RECEIVE_TAPERQSTBODY,"Receiving tape request message body"
76,AGGREGATOR_RECEIVED_TAPERQSTBODY,"Received tape request message body"
77,AGGREGATOR_RECEIVE_GIVEOUTPBODY,"Receiving GIVE_OUTP message body"
78,AGGREGATOR_RECEIVED_GIVEOUTPBODY,"Received GIVE_OUTP message body"
79,AGGREGATOR_RECEIVE_TAPERQSTERRBODY,"Receiving tape request message body with error appendix"
80,AGGREGATOR_RECEIVED_TAPERQSTERRBODY,"Received tape request message body with error appendix"
81,AGGREGATOR_SEND_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sending delayed acknowledge of request for more work to RTCPD"
82,AGGREGATOR_SENT_DELAYED_REQUEST_MORE_WORK_ACK_TO_RTCPD,"Sent delayed acknowledge of request for more work to RTCPD"
83,AGGREGATOR_CREATED_RTCPD_CALLBACK_PORT,"Created TCP/IP port for RTCPD callbacks"
84,AGGREGATOR_CONNECTION_CLOSED_BY_RTCPD,"Connection closed by RTCPD"
85,AGGREGATOR_CLOSED_CONNECTION,"Connection closed by aggregator"
86,AGGREGATOR_NOTIFY_CLIENT_FILE_MIGRATED,"Notifying client file migrated"
87,AGGREGATOR_NOTIFIED_CLIENT_FILE_MIGRATED,"Notified client file migrated"
88,AGGREGATOR_NOTIFY_CLIENT_FILE_RECALLED,"Notifying client file recalled"
89,AGGREGATOR_NOTIFIED_CLIENT_FILE_RECALLED,"Notified client file recalled"
90,AGGREGATOR_NOTIFY_CLIENT_END_OF_SESSION,"Notifying client end of session"
91,AGGREGATOR_NOTIFIED_CLIENT_END_OF_SESSION,"Notified client end of session"
92,AGGREGATOR_GET_DUMP_PARAMETERS_FROM_CLIENT,"Getting dump parameters from client"
93,AGGREGATOR_GOT_DUMP_PARAMETERS_FROM_CLIENT,"Got dump parameters from client"
94,AGGREGATOR_NOTIFY_CLIENT_DUMP_MESSAGE,"Notifying client dump message"
95,AGGREGATOR_NOTIFIED_CLIENT_DUMP_MESSAGE,"Notified client dump message"
96,AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_SESSION,"Failed to notify gateway end of session"
97,AGGREGATOR_NOTIFY_CLIENT_END_OF_FAILED_SESSION,"Notifying client end of failed session"
98,AGGREGATOR_NOTIFIED_CLIENT_END_OF_FAILED_SESSION,"Notified client end of failed session"
99,AGGREGATOR_FAILED_TO_NOTIFY_CLIENT_END_OF_FAILED_SESSION,"Failed to notify gateway end of failed session"
100,AGGREGATOR_FAILED_TO_PROCESS_RTCPD_SOCKETS,"Failed to process RTCPD sockets"
101,AGGREGATOR_SELECT_INTR,"Select interrupted"
102,AGGREGATOR_ENTERING_BRIDGE_MODE,"Entering bridge mode"
103,AGGREGATOR_PING_CLIENT,"Pinging client"
104,AGGREGATOR_PINGED_CLIENT,"Pinged client"
105,AGGREGATOR_CLOSED_INITIAL_CALLBACK_CONNECTION,"Closed initial callback connection"
......@@ -38,6 +38,8 @@
#include "castor/tape/aggregator/SmartFd.hpp"
#include "castor/tape/aggregator/SmartFdList.hpp"
#include "castor/tape/net/net.hpp"
#include "castor/tape/tapegateway/FileToMigrate.hpp"
#include "castor/tape/tapegateway/FileToRecall.hpp"
#include "castor/tape/utils/utils.hpp"
#include "h/Ctape_constants.h"
#include "h/rtcp_constants.h"
......@@ -499,35 +501,14 @@ void castor::tape::aggregator::BridgeProtocolEngine::runMigrationSession()
throw(castor::exception::Exception) {
try {
char filePath[CA_MAXPATHLEN+1];
char fileNsHost[CA_MAXHOSTNAMELEN+1];
char fileLastKnownFilename[CA_MAXPATHLEN+1];
char tapePath[CA_MAXPATHLEN+1];
unsigned char (blockId)[4];
utils::setBytes(filePath , '\0');
utils::setBytes(fileNsHost , '\0');
utils::setBytes(fileLastKnownFilename, '\0');
utils::setBytes(tapePath , '\0');
utils::setBytes(blockId , '\0');
uint64_t fileTransactionId = 0;
uint64_t fileId = 0;
int32_t fileTapeFileSeq = 0;
uint64_t fileSize = 0;
uint64_t fileLastModificationTime = 0;
int32_t positionCommandCode = 0;
// Get first file to migrate from tape gateway
const bool thereIsAFileToMigrate =
// Get first file to migrate from client
std::auto_ptr<tapegateway::FileToMigrate> fileFromClient(
ClientTxRx::getFileToMigrate(m_cuuid, m_jobRequest.volReqId,
m_jobRequest.clientHost, m_jobRequest.clientPort, fileTransactionId,
filePath, fileNsHost, fileId, fileTapeFileSeq, fileSize,
fileLastKnownFilename, fileLastModificationTime, positionCommandCode);
m_jobRequest.clientHost, m_jobRequest.clientPort));
// If there is no file to migrate, then notify tape gatway of end of session
// and return
if(!thereIsAFileToMigrate) {
// If there is no file to migrate, then notify tape gateway of end of
// session and return
if(fileFromClient.get() == NULL) {
try {
ClientTxRx::notifyEndOfSession(m_cuuid, m_jobRequest.volReqId,
m_jobRequest.clientHost, m_jobRequest.clientPort);
......@@ -546,7 +527,8 @@ void castor::tape::aggregator::BridgeProtocolEngine::runMigrationSession()
// Remember the file transaction ID and get its unique index to be passed
// to RTCPD through the "rtcpFileRequest.disk_fseq" message field
const uint32_t diskFseq = m_pendingTransferIds.insert(fileTransactionId);
const uint32_t diskFseq =
m_pendingTransferIds.insert(fileFromClient->fileTransactionId());
// Give volume to RTCPD
RtcpTapeRqstErrMsgBody rtcpVolume;
......@@ -566,13 +548,36 @@ void castor::tape::aggregator::BridgeProtocolEngine::runMigrationSession()
m_rtcpdInitialSockFd, RTCPDNETRWTIMEOUT, rtcpVolume);
// Give file to migrate to RTCPD
char migrationTapeFileId[CA_MAXPATHLEN+1];
utils::toHex(fileId, migrationTapeFileId);
RtcpTxRx::giveFileToRtcpd(m_cuuid, m_jobRequest.volReqId,
m_rtcpdInitialSockFd, RTCPDNETRWTIMEOUT, rtcpVolume.mode, filePath,
fileSize, "", RECORDFORMAT, migrationTapeFileId, MIGRATEUMASK,
positionCommandCode, fileTapeFileSeq, diskFseq, fileNsHost, fileId,
blockId);
{
char migrationTapeFileId[CA_MAXPATHLEN+1];
utils::toHex((uint64_t)fileFromClient->fileid(), migrationTapeFileId);
unsigned char blockId[4];
utils::setBytes(blockId, '\0');
char nshost[CA_MAXHOSTNAMELEN+1];
utils::copyString(nshost, fileFromClient->nshost().c_str());
RtcpTxRx::giveFileToRtcpd(
m_cuuid,
m_jobRequest.volReqId,
m_rtcpdInitialSockFd,
RTCPDNETRWTIMEOUT,
rtcpVolume.mode,
fileFromClient->path().c_str(),
fileFromClient->fileSize(),
"",
RECORDFORMAT,
migrationTapeFileId,
RTCOPYCONSERVATIVEUMASK,
(int32_t)fileFromClient->positionCommandCode(),
(int32_t)fileFromClient->fseq(),
diskFseq,
nshost,
(uint64_t)fileFromClient->fileid(),
blockId);
}
char tapePath[CA_MAXPATHLEN+1];
utils::setBytes(tapePath, '\0');
// Ask RTCPD to request more work
RtcpTxRx::askRtcpdToRequestMoreWork(m_cuuid, m_jobRequest.volReqId,
......@@ -893,47 +898,57 @@ void castor::tape::aggregator::BridgeProtocolEngine::processRtcpFileReq(
// If migrating
if(m_volume.mode() == tapegateway::WRITE) {
char filePath[CA_MAXPATHLEN+1];
char nsHost[CA_MAXHOSTNAMELEN+1];
char tapePath[CA_MAXPATHLEN+1];
char lastKnownFilename[CA_MAXPATHLEN+1];
unsigned char blockId[4];
utils::setBytes(filePath , '\0');
utils::setBytes(nsHost , '\0');
utils::setBytes(tapePath , '\0');
utils::setBytes(lastKnownFilename, '\0');
utils::setBytes(blockId , '\0');
uint64_t fileTransactionId = 0;
uint64_t fileId = 0;
int32_t tapeFseq = 0;
uint64_t fileSize = 0;
uint64_t lastModificationTime = 0;
int32_t positionMethod = 0;
// Get file to migrate from client
std::auto_ptr<tapegateway::FileToMigrate> fileFromClient(
ClientTxRx::getFileToMigrate(m_cuuid, m_jobRequest.volReqId,
m_jobRequest.clientHost, m_jobRequest.clientPort));
// If there is a file to migrate
if(ClientTxRx::getFileToMigrate(m_cuuid,
m_jobRequest.volReqId, m_jobRequest.clientHost,
m_jobRequest.clientPort, fileTransactionId, filePath, nsHost,
fileId, tapeFseq, fileSize, lastKnownFilename, lastModificationTime,
positionMethod)) {
if(fileFromClient.get() != NULL) {
// Remember the file transaction ID and get its unique index to be
// passed to RTCPD through the "rtcpFileRequest.disk_fseq" message
// field
const int diskFseq = m_pendingTransferIds.insert(fileTransactionId);
const int diskFseq =
m_pendingTransferIds.insert(fileFromClient->fileTransactionId());
// Give file to migrate to RTCPD
{
char migrationTapeFileId[CA_MAXPATHLEN+1];
utils::toHex((uint64_t)fileFromClient->fileid(), migrationTapeFileId);
unsigned char blockId[4];
utils::setBytes(blockId, '\0');
char nshost[CA_MAXHOSTNAMELEN+1];
utils::copyString(nshost, fileFromClient->nshost().c_str());
RtcpTxRx::giveFileToRtcpd(
m_cuuid,
m_jobRequest.volReqId,
m_rtcpdInitialSockFd,
RTCPDNETRWTIMEOUT,
WRITE_ENABLE,
fileFromClient->path().c_str(),
fileFromClient->fileSize(),
"",
RECORDFORMAT,
migrationTapeFileId,
RTCOPYCONSERVATIVEUMASK,
(int32_t)fileFromClient->positionCommandCode(),
(int32_t)fileFromClient->fseq(),
diskFseq,
nshost,
(uint64_t)fileFromClient->fileid(),
blockId);
}
char tapeFileId[CA_MAXPATHLEN+1];
utils::toHex(fileId, tapeFileId);
RtcpTxRx::giveFileToRtcpd(m_cuuid, m_jobRequest.volReqId, socketFd,
RTCPDNETRWTIMEOUT, WRITE_ENABLE, filePath, fileSize, "", RECORDFORMAT,
tapeFileId, MIGRATEUMASK, positionMethod, tapeFseq, diskFseq, nsHost,
fileId, blockId);
char tapePath[CA_MAXPATHLEN+1];
utils::setBytes(tapePath, '\0');
// Ask RTCPD to request more work
RtcpTxRx::askRtcpdToRequestMoreWork(m_cuuid, m_jobRequest.volReqId,
tapePath, socketFd, RTCPDNETRWTIMEOUT, WRITE_ENABLE);
// Tell RTCPD end of file list
RtcpTxRx::tellRtcpdEndOfFileList(m_cuuid, m_jobRequest.volReqId,
socketFd, RTCPDNETRWTIMEOUT);
......@@ -948,56 +963,66 @@ void castor::tape::aggregator::BridgeProtocolEngine::processRtcpFileReq(
// Else recalling (READ or DUMP)
} else {
char filePath[CA_MAXPATHLEN+1];
char nsHost[CA_MAXHOSTNAMELEN+1];
unsigned char blockId[4];
utils::setBytes(filePath, '\0');
utils::setBytes(nsHost , '\0');
utils::setBytes(blockId , '\0');
uint64_t fileTransactionId = 0;
uint64_t fileId = 0;
int32_t tapeFseq = 0;
int32_t positionCommandCode = 0;
// Get file to recall from client
std::auto_ptr<tapegateway::FileToRecall> fileFromClient(
ClientTxRx::getFileToRecall(m_cuuid, m_jobRequest.volReqId,
m_jobRequest.clientHost, m_jobRequest.clientPort));
// If there is a file to recall
if(ClientTxRx::getFileToRecall(m_cuuid,
m_jobRequest.volReqId, m_jobRequest.clientHost,
m_jobRequest.clientPort, fileTransactionId, filePath, nsHost,
fileId, tapeFseq, blockId, positionCommandCode)) {
if(fileFromClient.get() != NULL) {
// Remember the file transaction ID and get its unique index to be
// passed to RTCPD through the "rtcpFileRequest.disk_fseq" message
// field
const int diskFseq = m_pendingTransferIds.insert(fileTransactionId);
// The file size is not specified when recalling
const uint64_t fileSize = 0;
char tapeFileId[CA_MAXPATHLEN+1];
utils::setBytes(tapeFileId, '\0');
RtcpTxRx::giveFileToRtcpd(m_cuuid, m_jobRequest.volReqId, socketFd,
RTCPDNETRWTIMEOUT, WRITE_DISABLE, filePath, fileSize, body.tapePath,
RECORDFORMAT, tapeFileId, RECALLUMASK, positionCommandCode, tapeFseq,
diskFseq, nsHost, fileId, blockId);
const int diskFseq =
m_pendingTransferIds.insert(fileFromClient->fileTransactionId());
// Give file to recall to RTCPD
{
char tapeFileId[CA_MAXPATHLEN+1];
utils::setBytes(tapeFileId, '\0');
unsigned char blockId[4] = {
fileFromClient->blockId0(),
fileFromClient->blockId1(),
fileFromClient->blockId2(),
fileFromClient->blockId3()};
char nshost[CA_MAXHOSTNAMELEN+1];
utils::copyString(nshost, fileFromClient->nshost().c_str());
// The file size is not specified when recalling
const uint64_t fileSize = 0;
RtcpTxRx::giveFileToRtcpd(
m_cuuid,
m_jobRequest.volReqId,
socketFd,