XRootD
ClientFattrRequest Struct Reference

#include <XProtocol.hh>

+ Collaboration diagram for ClientFattrRequest:

Static Public Member Functions

static char * NVecInsert (const char *name, char *buffer)
 
static char * NVecRead (char *buffer, char *&name)
 
static char * NVecRead (char *buffer, kXR_unt16 &rc)
 
static char * VVecInsert (const char *value, char *buffer)
 
static char * VVecRead (char *buffer, kXR_int32 &len)
 
static char * VVecRead (char *buffer, kXR_int32 len, char *&value)
 

Public Attributes

kXR_int32 dlen
 
kXR_char fhandle [4]
 
kXR_char numattr
 
kXR_char options
 
kXR_unt16 requestid
 
kXR_char reserved [9]
 
kXR_char streamid [2]
 
kXR_char subcode
 

Static Public Attributes

static const int aData = 0x10
 
static const int isNew = 0x01
 

Detailed Description

Definition at line 315 of file XProtocol.hh.

Member Function Documentation

◆ NVecInsert()

char * ClientFattrRequest::NVecInsert ( const char *  name,
char *  buffer 
)
static

Definition at line 176 of file XProtocol.cc.

177 {
178  // set rc to 0
179  memset( buffer, 0, sizeof( kXR_unt16 ) );
180  buffer += sizeof( kXR_unt16 );
181  // copy attribute name including trailing null
182  size_t len = strlen( name );
183  memcpy( buffer, name, len + 1 );
184  buffer += len + 1;
185 
186  // return memory that comes right after newly inserted nvec record
187  return buffer;
188 }
unsigned short kXR_unt16
Definition: XPtypes.hh:67

Referenced by XrdCl::MessageUtils::CreateXAttrVec().

+ Here is the caller graph for this function:

◆ NVecRead() [1/2]

char * ClientFattrRequest::NVecRead ( char *  buffer,
char *&  name 
)
static

Definition at line 219 of file XProtocol.cc.

220 {
221  name = strdup( buffer );
222  buffer += strlen( name ) + 1;
223  return buffer;
224 }

◆ NVecRead() [2/2]

char * ClientFattrRequest::NVecRead ( char *  buffer,
kXR_unt16 rc 
)
static

Definition at line 209 of file XProtocol.cc.

210  {
211  memcpy(&rc, buffer, sizeof(kXR_unt16));
212  rc = htons( rc );
213  buffer += sizeof( kXR_unt16 );
214  return buffer;
215  }

◆ VVecInsert()

char * ClientFattrRequest::VVecInsert ( const char *  value,
char *  buffer 
)
static

Definition at line 192 of file XProtocol.cc.

193 {
194  // copy value size
195  kXR_int32 len = strlen( value );
196  kXR_int32 lendat = htonl( len );
197  memcpy( buffer, &lendat, sizeof( kXR_int32 ) );
198  buffer += sizeof( kXR_int32 );
199  // copy value itself
200  memcpy( buffer, value, len );
201  buffer += len;
202 
203  // return memory that comes right after newly inserted vvec entry
204  return buffer;
205 }
int kXR_int32
Definition: XPtypes.hh:89

Referenced by XrdCl::MessageUtils::CreateXAttrVec().

+ Here is the caller graph for this function:

◆ VVecRead() [1/2]

char * ClientFattrRequest::VVecRead ( char *  buffer,
kXR_int32 len 
)
static

Definition at line 228 of file XProtocol.cc.

229 {
230  memcpy(&len, buffer, sizeof(kXR_int32));
231  len = htonl( len );
232  buffer += sizeof( kXR_int32 );
233  return buffer;
234 }

◆ VVecRead() [2/2]

char * ClientFattrRequest::VVecRead ( char *  buffer,
kXR_int32  len,
char *&  value 
)
static

Definition at line 238 of file XProtocol.cc.

239 {
240  value = reinterpret_cast<char*>( malloc( len + 1 ) );
241  strncpy( value, buffer, len );
242  value[len] = 0;
243  buffer += len;
244  return buffer;
245 }

Member Data Documentation

◆ aData

const int ClientFattrRequest::aData = 0x10
static

◆ dlen

kXR_int32 ClientFattrRequest::dlen

Definition at line 323 of file XProtocol.hh.

Referenced by XrdCl::LocalFileHandler::ExecRequest().

◆ fhandle

kXR_char ClientFattrRequest::fhandle[4]

Definition at line 318 of file XProtocol.hh.

Referenced by XrdCl::XRootDTransport::GenerateDescription().

◆ isNew

const int ClientFattrRequest::isNew = 0x01
static

Definition at line 327 of file XProtocol.hh.

◆ numattr

kXR_char ClientFattrRequest::numattr

◆ options

kXR_char ClientFattrRequest::options

Definition at line 321 of file XProtocol.hh.

Referenced by XrdCl::XRootDTransport::GenerateDescription().

◆ requestid

kXR_unt16 ClientFattrRequest::requestid

Definition at line 317 of file XProtocol.hh.

◆ reserved

kXR_char ClientFattrRequest::reserved[9]

Definition at line 322 of file XProtocol.hh.

◆ streamid

kXR_char ClientFattrRequest::streamid[2]

Definition at line 316 of file XProtocol.hh.

◆ subcode

kXR_char ClientFattrRequest::subcode

The documentation for this struct was generated from the following files: