1 / 17

IBP Client APIs

IBP Client APIs. Storage Management IBP_allocate , IBP_manage Data Transfer IBP_store, IBP_load, IBP_copy, IBP_mcopy Depot Management IBP_status NFU IBP_nfu_op. IBP Capability. Format ibp://hostname:port/<resourceid>#key/WRMkey/WRM Example

lindsey
Download Presentation

IBP Client APIs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IBP Client APIs • Storage Management • IBP_allocate , IBP_manage • Data Transfer • IBP_store, IBP_load, IBP_copy, IBP_mcopy • Depot Management • IBP_status • NFU • IBP_nfu_op

  2. IBP Capability • Format ibp://hostname:port/<resourceid>#key/WRMkey/WRM • Example Read Cap: ibp://rod.cs.utk.edu:6714/0#abcd….6789/0123456789/READ Write Cap: ibp://rod.cs.utk.edu:6714/0#abcd….6789/9876543210/WRITE Manage Cap: ibp://rod.cs.utk.edu:6714/0#abcd….6789/2345678901/MANAGE

  3. Data Structure • IBP_depot typedef struct { char host[MAX_LENGTH]; // hostname int port; // port number int rid; // resource id } *IBP_depot;

  4. Data Structure • IBP_attributes typedef struct { time_t duration; // expiration time ( -1 for permanent ) int reliability; // IBP_HARD or IBP_SOFT int type; // access mode } *IBP_attributes ; Four Access Modes: IBP_BYTEARRAY, IBP_BUFFER, IBP_FIFO, IBP_CIRQ

  5. Data Structure • IBP_timer typedef struct ibp_timer { int ClientTimeout; int ServerSync; } *IBP_timer;

  6. Data Structure • IBP_CapStatus typedef struct { int readRefCount; int writeRefCount; unsigned long int currentSize; unsigned long int maxSize; struct ibp_attributes attrib ; } *IBP_CapStatus;

  7. IBP_allocate • IBP_set_of_caps IBP_allocate( IBP_depot depot, IBP_timer timer, unsigned long int size, IBP_attributes attribute ) • Allocate a sizebytes remote storage area on the depotwith specific attribute. • On success, IBP_allocate returns a set of capabilities. Otherwise a NULL is returned with IBP_errno indicating error number.

  8. IBP_Store • unsigned long int IBP_store ( IBP_cap cap , IBP_timer timeout, char *data, unsigned long int size); • Upload size bytes of data to the depot. • On success, IBP_store returns number of bytes written. Otherwise 0 is returned with IBP_errno indicating error number.

  9. IBP_load • unsigned long int IBP_load ( IBP_cap cap , IBP_timer timeout, char *data, unsigned long int size, unsigned long int offset ); • Download size bytes of data,starting at offset, from the depot. • On success, IBP_load returns number of bytes read. Otherwise 0 is returned with IBP_errno indicating error number.

  10. IBP_copy • unsigned long int IBP_copy ( IBP_cap srcCap , IBP_cap dstCap, IBP_timer srcTimeout, IBP_timer dstTimeout, unsigned long int size, unsigned long int offset ); • Move size bytes of data , starting at offset, from srcCap to dstCap . • On success, IBP_copy returns number of bytes written. Otherwise 0 is returned with IBP_errno indicating error number.

  11. IBP_mcopy • unsigned long int IBP_mcopy ( IBP_cap srcCap , IBP_cap dstCaps[], unsigned int nDstCaps; IBP_timer srcTimeout, IBP_timer dstTimeout, unsigned long int size, unsigned long int offset int type[], int port[], int service);

  12. IBP_mcopy • Move size bytes of data , starting at offset, from srcCap to an array of dstCaps . • On success, IBP_mcopy returns number of bytes written. Otherwise 0 is returned with IBP_errno indicating error number.

  13. IBP_manage • unsigned long int IBP_manage ( IBP_cap cap , IBP_timer timeout, int cmd, int capType, IBP_CapStatus status ); • 4 Commands: IBP_INCR IBP_DECR IBP_CHNG IBP_PROBE • On success, IBP_manage returns 0, otherwise -1 is returned with IBP_errno indicating error number.

  14. IBP_status • IBP_dptInfo IBP_status ( IBP_depot depot, int cmd, IBP_timer timeout, char *passwd, unsigned long int hardSize, unsigned long int softSize, long duration ); • 2 Commands: IBP_ST_INQ IBP_ST_CHANGE • On success, IBP_manage returns a pointer to IBP_dptInfo structure, otherwise NULL is returned with IBP_errno indicating error number.

  15. IBP_nfu_op • int IBP_nfu_op ( IBP_depot depot , int opcode, int nParameters, PARAMETER *paras, IBP_timer timeout); • Invoke a NFU(opcode) on the depot. • On success, IBP_nfu_ops returns IBP_OK. Otherwise error number is returned and also IBP_errno is set.

  16. PARAMETER structure • typedef struct { IOTYPE ioType; void *data; int offset; int length; }PARAMETER; • typedef enum { IBP_REF_RD, IBP_REF_WR, IBP_REF_RDWR, IBP_VAL_IN, IBP_VAL_OUT,IBP_VAL_INOUT } IOTYPE;

  17. Parameter Type • Call-by-reference • Use IBP capabilities as parameters. At IBP depot side, NFU reads/writes data from/to allocations. • Call-by-value • User data are sent to IBP depot for input parameters and results are sent back from depot for output parameters.

More Related