4 #ifndef CVMFS_CACHE_TRANSPORT_H_
5 #define CVMFS_CACHE_TRANSPORT_H_
21 case cvmfs::STATUS_UNKNOWN:
22 return "unknown cache protocol error";
23 case cvmfs::STATUS_OK:
25 case cvmfs::STATUS_NOSUPPORT:
26 return "operation not implemented by cache plugin";
27 case cvmfs::STATUS_FORBIDDEN:
28 return "cache plugin denied the operation";
29 case cvmfs::STATUS_NOSPACE:
30 return "no space in cache";
31 case cvmfs::STATUS_NOENTRY:
32 return "object not found in cache";
33 case cvmfs::STATUS_MALFORMED:
34 return "malformed cache protocol message";
35 case cvmfs::STATUS_IOERR:
37 case cvmfs::STATUS_CORRUPTED:
38 return "corrupted data detected";
39 case cvmfs::STATUS_TIMEOUT:
40 return "multipart request timed out";
41 case cvmfs::STATUS_BADCOUNT:
42 return "invalid attempt to set negative reference count";
43 case cvmfs::STATUS_OUTOFBOUNDS:
44 return "out of bounds";
45 case cvmfs::STATUS_PARTIAL:
46 return "cache could not be cleaned up to the given limit";
48 return "unexpected cache protocol error";
108 explicit Frame(google::protobuf::MessageLite *m);
111 void Reset(uint32_t original_att_size);
155 void FillObjectType(
int object_flags, cvmfs::EnumObjectType *wire_type);
156 bool ParseObjectType(cvmfs::EnumObjectType wire_type,
int *object_flags);
165 void *attachment = NULL,
166 uint32_t att_size = 0);
174 #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)