4 #ifndef CVMFS_CACHE_TRANSPORT_H_
5 #define CVMFS_CACHE_TRANSPORT_H_
21 case cvmfs::STATUS_UNKNOWN:
return "unknown cache protocol error";
22 case cvmfs::STATUS_OK:
return "OK";
23 case cvmfs::STATUS_NOSUPPORT:
24 return "operation not implemented by cache plugin";
25 case cvmfs::STATUS_FORBIDDEN:
return "cache plugin denied the operation";
26 case cvmfs::STATUS_NOSPACE:
return "no space in cache";
27 case cvmfs::STATUS_NOENTRY:
return "object not found in cache";
28 case cvmfs::STATUS_MALFORMED:
return "malformed cache protocol message";
29 case cvmfs::STATUS_IOERR:
return "I/O error";
30 case cvmfs::STATUS_CORRUPTED:
return "corrupted data detected";
31 case cvmfs::STATUS_TIMEOUT:
return "multipart request timed out";
32 case cvmfs::STATUS_BADCOUNT:
33 return "invalid attempt to set negative reference count";
34 case cvmfs::STATUS_OUTOFBOUNDS:
return "out of bounds";
35 case cvmfs::STATUS_PARTIAL:
36 return "cache could not be cleaned up to the given limit";
37 default:
return "unexpected cache protocol error";
97 explicit Frame(google::protobuf::MessageLite *m);
100 void Reset(uint32_t original_att_size);
144 void FillObjectType(
int object_flags, cvmfs::EnumObjectType *wire_type);
145 bool ParseObjectType(cvmfs::EnumObjectType wire_type,
int *object_flags);
154 void *attachment = NULL,
155 uint32_t att_size = 0);
163 #endif // CVMFS_CACHE_TRANSPORT_H_
static const unsigned kMaxStackAlloc
static const unsigned char kWireProtocolVersion
void SendNonBlocking(struct iovec *iov, unsigned iovcnt)
void SendFrame(Frame *frame)
void FillObjectType(int object_flags, cvmfs::EnumObjectType *wire_type)
static const char kReadyNotification
static const uint32_t kFlagSendIgnoreFailure
void FillMsgHash(const shash::Any &hash, cvmfs::MsgHash *msg_hash)
void MergeFrom(const Frame &other)
static const uint32_t kMaxMsgSize
void * attachment() const
bool ParseMsgHash(const cvmfs::MsgHash &msg_hash, shash::Any *hash)
cvmfs::MsgRpc * GetMsgRpc()
uint32_t att_size() const
void set_att_size(uint32_t size)
google::protobuf::MessageLite * msg_typed_
static const unsigned char kFlagHasAttachment
google::protobuf::MessageLite * GetMsgTyped()
void SendData(void *message, uint32_t msg_size, void *attachment=NULL, uint32_t att_size=0)
static const char kFailureNotification
bool ParseMsgRpc(void *buffer, uint32_t size)
bool RecvFrame(Frame *frame)
void set_attachment(void *attachment, uint32_t att_size)
static const unsigned kInnerHeaderSize
void Reset(uint32_t original_att_size)
const char * CacheTransportCode2Ascii(const cvmfs::EnumStatus code)
static const unsigned kHeaderSize
int fd_connection() const
static const char * kEnvReadyNotifyFd
static const uint32_t kFlagSendNonBlocking
bool ParseObjectType(cvmfs::EnumObjectType wire_type, int *object_flags)
CacheTransport(int fd_connection)
bool RecvHeader(uint32_t *size, bool *has_attachment)