GLOBUS_GASS_TRANSFER_PROTOCOL(3)
π globus_gass_transfer_protocol β Protocol Modules π
okay bestie, settle in, because this is the Library Functions Manual entry for section 3 and it's giving big energy. this is the Protocol Implementation API, and it's literally the blueprint for teaching GASS new tricks. no cap. π¦
β¨ NAME β¨
globus_gass_transfer_protocol β Protocol Modules
- Protocol Implementation API. π
πΈ SYNOPSIS πΈ
π§ Data Structures
struct globus_gass_transfer_request_proto_sβ Protocol module request handling structure. (the lil' request handler blueprint π )struct globus_gass_transfer_listener_proto_sβ Protocol module listener handling structure. (the listener handler blueprint π)struct globus_gass_transfer_proto_descriptor_tβ Protocol module descriptor structure. (the whole personality card of the module fr fr β)
π Typedefs
typedef struct globus_gass_transfer_request_proto_s globus_gass_transfer_request_proto_ttypedef struct globus_gass_transfer_listener_proto_s globus_gass_transfer_listener_proto_ttypedef void(* globus_gass_transfer_proto_send_t) (globus_gass_transfer_request_proto_t *proto, globus_gass_transfer_request_t request, globus_byte_t *bytes, globus_size_t bytes_length, globus_bool_t last_data)typedef void(* globus_gass_transfer_proto_receive_t) (globus_gass_transfer_request_proto_t *proto, globus_gass_transfer_request_t request, globus_byte_t *bytes, globus_size_t bytes_length, globus_size_t wait_for_length)typedef void(* globus_gass_transfer_proto_func_t) (globus_gass_transfer_request_proto_t *proto, globus_gass_transfer_request_t request)typedef void(* globus_gass_transfer_proto_new_request_t) (globus_gass_transfer_request_t request, globus_gass_transfer_requestattr_t *attr)typedef int(* globus_gass_transfer_proto_create_listener_t) (globus_gass_transfer_listener_t listener, globus_gass_transfer_listenerattr_t *attr, char *scheme, char **base_url, globus_gass_transfer_listener_proto_t **proto)typedef void(* globus_gass_transfer_proto_listener_t) (globus_gass_transfer_listener_proto_t *proto, globus_gass_transfer_listener_t listener)typedef globus_object_t *(* globus_gass_transfer_proto_new_attr_t) (char *url_scheme)typedef void(* globus_gass_transfer_proto_accept_t) (globus_gass_transfer_listener_proto_t *proto, globus_gass_transfer_listener_t listener, globus_gass_transfer_request_t request, globus_gass_transfer_requestattr_t *attr)
π₯ Functions
void globus_gass_transfer_proto_send_complete (globus_gass_transfer_request_t request, globus_byte_t *bytes, globus_size_t nbytes, globus_bool_t failed, globus_bool_t last_data)void globus_gass_transfer_proto_receive_complete (globus_gass_transfer_request_t request, globus_byte_t *bytes, globus_size_t nbytes, globus_bool_t failed, globus_bool_t last_data)void globus_gass_transfer_proto_listener_ready (globus_gass_transfer_listener_t listener)int globus_gass_transfer_proto_register_protocol (globus_gass_transfer_proto_descriptor_t *proto_desc)int globus_gass_transfer_proto_unregister_protocol (globus_gass_transfer_proto_descriptor_t *proto_desc)void globus_gass_transfer_proto_request_ready (globus_gass_transfer_request_t request, globus_gass_transfer_request_proto_t *proto)void globus_gass_transfer_proto_new_listener_request (globus_gass_transfer_listener_t listener, globus_gass_transfer_request_t request, globus_gass_transfer_request_proto_t *proto)void globus_gass_transfer_proto_request_denied (globus_gass_transfer_request_t request, int reason, char *message)void globus_gass_transfer_proto_request_referred (globus_gass_transfer_request_t request, char **url, globus_size_t num_urls)
π Detailed Description π
Protocol Implementation API.
Protocol Modules
okay so here's the tea β β the GASS Protocol Module API exists so you can extend the GASS client and server APIs to support extra protocols, and you never have to touch the core of the GASS implementation. not even once. that's the whole point, bestie. π«Ά
GASS protocol modules are intended to handle protocol-specific connection and data handling. and get this β the GASS Transfer library already ships with protocol modules that implement HTTP, HTTPS, FTP, and GSI-FTP protocols. iconic lineup tbh. π
Every protocol module implementation must include the following header file:
#include "globus_gass_transfer_proto.h"
no exceptions, no skipping, that's the vibe check. β
so to implement a protocol module, you have to create a globus_gass_transfer_proto_descriptor_t structure, and this structure is literally the module's whole rΓ©sumΓ© β it says what the protocol module is able to do. it contains:
- the URL scheme which the protocol module supports π
- function pointers which indicate what type of operations (client or server) that the module implements
now for the specifics, because details matter, periodt:
- to implement a client-side protocol module, the
new_requestattrandnew_requestfields must be set to the protocol module's implementations of those functions. - to implement a server-side</server-side> protocol module, the
new_listenerattrandnew_listenerfunctions must be set to the protocol module's implementations of those functions.
π heads up bestie: the ordering here is not a drill.new_requestattrandnew_requestfor client,new_listenerattrandnew_listenerfor server. set them or your module is doing nothing.
A protocol module implementor registers a protocol module with the GASS Transfer library by calling the function globus_gass_transfer_proto_register_protocol(), and unregisters the module by calling globus_gass_transfer_proto_unregister_protocol().
β οΈ IMPORTANT, FR FR: these functions must be called after the GLOBUS_GASS_TRANSFER_MODULE has already been activated. like, activated first. do not come for the register-before-activate pipeline, it will not end well. π
Once registered, applications may use URLs of the scheme type provided by the protocol module for the standard client or server operations. and that's the slay. β¨
β¨ Typedef Documentation β¨
okay bestie, this is the typedef section and it is long but we are not skipping a single crumb π . every type, every param, every "see also" β it's all here. periodt.
globus_gass_transfer_listener_proto_t
typedef struct globus_gass_transfer_listener_proto_s globus_gass_transfer_listener_proto_t
it's the Protocol module listener handling structure β¨. that's the whole vibe.
See also: globus_gass_transfer_listener_proto_s
globus_gass_transfer_proto_accept_t
typedef void(* globus_gass_transfer_proto_accept_t)
(globus_gass_transfer_listener_proto_t *proto,
globus_gass_transfer_listener_t listener, globus_gass_transfer_request_t
request, globus_gass_transfer_requestattr_t *attr)
Protocol module implementation function type for server request parsing π«Ά.
function pointers of this type are linked up with the globus_gass_transfer_listener_proto_t that's associated with a particular listener handle. they get called when a server implementation wants to accept a new connection from the listener. a new request is generated based on the protocol-specific request done on the new connection. no cap.
the new request will be created with the attributes specified in the attr parameter. once the protocol module has parsed the request, it must call globus_gass_transfer_proto_new_listener_request() to let the server implementation decide how to process this request. like, that's not optional bestie π.
the protocol module should update the request to indicate the type of operation being requested, the size of the file (if applicable), and the identity of the client (if applicable).
Parameters:
protoβ the protocol specific listener data structure associated with the listener handle.listenerβ the listener handle which the user requested the listen on.requestβ the new request handle.attrβ the request attribute set to be used when processing this request.
globus_gass_transfer_proto_create_listener_t
typedef int(* globus_gass_transfer_proto_create_listener_t)
(globus_gass_transfer_listener_t listener,
globus_gass_transfer_listenerattr_t *attr, char *scheme, char
**base_url, globus_gass_transfer_listener_proto_t **proto)
Protocol module implementation function type for new server listeners πΈ.
a function pointer of this type is associated with the globus_gass_transfer_proto_descriptor_t for a particular protocol module's implementation. it gets called when the server has called globus_gass_transfer_create_listener(). iconic.
Parameters:
listenerβ the listener handle to associate with the new proto created by the protocol module.attrβ a protocol-specific attribute set, created by calling the protocol module'snew_listenerattrfunction pointer.schemeβ the URL scheme that the server has requested for the new listener. this will be one the scheme associated with a particular protocol module.base_urlβ a pointer to be set the value of the base url of this listener. for most protocols, this will contain the scheme, hostname, and port number of the listener. this string must be allocated using one of the memory allocators defined in theglobus_commonlibrary. it will be freed by the GASS Transfer library when the listener is closed.protoβ a pointer to be set to a newglobus_gass_transfer_listener_proto_twhich will be associated with this listener. this must be allocated by the protocol module using one of the memory allocators defined in theglobus_commonlibrary. it will be freed by the GASS Transfer library when the listener is closed.
Returns:
a GASS error value, or GLOBUS_SUCCESS. π
globus_gass_transfer_proto_func_t
typedef void(* globus_gass_transfer_proto_func_t)
(globus_gass_transfer_request_proto_t *proto,
globus_gass_transfer_request_t request)
Protocol module implementation function type π¦.
function pointers of this type are associated with the globus_gass_transfer_request_proto_t associated with a particular request handle. they get called when certain functions which modify the status of a request have been called by a client or server.
a function of this type is used for the fail, deny, refer, authorize, and destroy fields of the globus_gass_transfer_request_proto_t. a protocol module can query the request handle to determine the status and, if applicable, denial reasons if necessary. iykyk.
Parameters:
protoβ the protocol module's request handler.requestβ the request handle.
globus_gass_transfer_proto_listener_t
typedef void(* globus_gass_transfer_proto_listener_t)
(globus_gass_transfer_listener_proto_t *proto,
globus_gass_transfer_listener_t listener)
Protocol module implementation function type for server operations π.
function pointers of this type are associated with the globus_gass_transfer_listener_proto_t associated with a particular listener handle. they get called when a server implementation wants to close the listener, listen for new connections, or destroy the listener. slay.
Parameters:
protoβ the protocol-specific implementation of theglobus_gass_transfer_listener_proto_tfor a particular listener.listenerβ the listener handle associated with theproto.
See also: globus_gass_transfer_proto_create_listener_t
globus_gass_transfer_proto_new_attr_t
typedef globus_object_t *(* globus_gass_transfer_proto_new_attr_t) (char
*url_scheme)
Protocol module implementation function type for attribute creation π.
a function pointer of this type is associated with the globus_gass_transfer_proto_descriptor_t defining a protocol module. it gets called when a client requests a new request attribute set be created for a URL scheme handled by a protocol module. the function implementation must create a new request attribute usable by the protocol.
the returned attribute must be a globus object which inherits from one of the base attributes defined in the GASS Transfer API. a client or server operation will use a request attribute generated by this function when creating a new globus_gass_transfer_request_proto_t to handle a request. fr fr.
Parameters:
url_schemeβ the URL scheme that the request attribute should be compatible with.
Returns:
a globus_object_t-based request attribute. π
See also: globus_gass_transfer_proto_new_request_t, globus_gass_transfer_proto_accept_t
globus_gass_transfer_proto_new_request_t
typedef void(* globus_gass_transfer_proto_new_request_t)
(globus_gass_transfer_request_t request,
globus_gass_transfer_requestattr_t *attr)
Protocol module implementation function type for new client requests β.
a function pointer of this type is associated with the globus_gass_transfer_proto_descriptor_t for a particular protocol module's implementation. it gets called when the client has begun a file transfer request by calling one of the functions in the @ref globus_gass_transfer_client section of this manual.
when this function is called for a protocol module, the module should query the request handle to determine the URL which is being requested by the client, and the operation being done on that URL. the protocol module should initiate the request, and once it has determined that it has been authorized, denied, or referred, one of globus_gass_transfer_proto_request_ready(), globus_gass_transfer_proto_request_denied(), or globus_gass_transfer_proto_request_referred() must be called. like, you have to, bestie π.
Parameters:
requestβ the request handle containing the information about the request.attrβ a protocol-specific attribute set, created by calling the protocol module'snew_requestattrfunction pointer.
globus_gass_transfer_proto_receive_t
typedef void(* globus_gass_transfer_proto_receive_t)
(globus_gass_transfer_request_proto_t *proto,
globus_gass_transfer_request_t request, globus_byte_t *bytes,
globus_size_t bytes_length, globus_size_t wait_for_length)
Protocol module function type to handle receiving data π.
a function pointer of this type is associated with the globus_gass_transfer_request_proto_t associated with a request handle. it gets called when client or server has registered a bytes array for receiving from the client or server which is handling the request. the GASS Transfer Library will only pass one bytes array to the protocol module for processing per request at any given time.
once the protocol module has processed the array, it must call globus_gass_transfer_proto_receive_complete() to let the GASS Transfer library continue to process the request. no skipping that step, periodt.
Parameters:
protoβ the protocol module's request handler.requestβ the request handle with which this block of bytes is associated.bytesβ the user-supplied byte array containing the data associated with the request.bytes_lengthβ the length of thebytesarray.wait_for_lengthβ the minimum amount of data to receive before callingglobus_gass_transfer_proto_receive_complete()for the request. the GASS Transfer protocol module may call that function with a smaller value for the amount received if EOF has been reached.
See also: globus_gass_transfer_receive_bytes()
globus_gass_transfer_proto_send_t
typedef void(* globus_gass_transfer_proto_send_t)
(globus_gass_transfer_request_proto_t *proto,
globus_gass_transfer_request_t request, globus_byte_t *bytes,
globus_size_t bytes_length, globus_bool_t last_data)
Protocol module function type to handle sending data π.
a function pointer of this type is associated with the globus_gass_transfer_request_proto_t associated with a request handle. it gets called when client or server has registered a bytes array for sending to the client or server which is handling the request. the GASS Transfer Library will only pass one bytes array to the protocol module for processing per request at any given time.
once the protocol module has processed the array, it must call globus_gass_transfer_proto_send_complete() to let the GASS Transfer library continue to process the request. yes bestie, mandatory π
.
Parameters:
protoβ the protocol module's request handler.requestβ the request handle with which this block of bytes is associated.bytesβ the user-supplied byte array containing the data associated with the request.bytes_lengthβ the length of thebytesarray.last_dataβ a flag to indicate whether this is the final block of data for the request. if this is true, then the callback function will be delayed until the server acknowledges that the file has been completely received.
See also: globus_gass_transfer_send_bytes()
globus_gass_transfer_request_proto_t
typedef struct globus_gass_transfer_request_proto_s globus_gass_transfer_request_proto_t
Protocol module request handling structure π. that's the whole mood.
See also: globus_gass_transfer_request_proto_s
π« Function Documentation π«
okay bestie, this is the big one β every single function a protocol module author gets to play with. these are the calls you (the protocol module) make to tell the GASS Transfer Library what's going on. no cap, this is the whole toolkit. π§°β¨
πΈ globus_gass_transfer_proto_listener_ready πΈ
void globus_gass_transfer_proto_listener_ready
(globus_gass_transfer_listener_t listener)
Server listener ready. π
this one's your little "we're SO open for business" announcement. it tells the GASS Transfer Library that your protocol module has decided a brand new request can be accepted on this particular listener.
β οΈ lowkey important: you may only call this after the GASS Transfer Library has called thelistenfunction inside aglobus_gass_transfer_listener_proto_tprotocol module-specific listener structure. don't jump the gun, bestie. π
Parameters
listenerβ the listener handle that is now ready to accept a new connection. it's giving "door's open, come thru". πͺ
π¦ globus_gass_transfer_proto_new_listener_request π¦
void globus_gass_transfer_proto_new_listener_request
(globus_gass_transfer_listener_t listener,
globus_gass_transfer_request_t request,
globus_gass_transfer_request_proto_t * proto)
New listener request. β
this is the "guess what, a new request just dropped" notification. it tells the GASS Transfer Library that a fresh request β born when a server called globus_gass_transfer_register_accept() β has started processing inside a protocol module, and that module is now ready to send or receive data to handle it. main character request energy, honestly. π
Parameters
listenerβ the listener handle that was used to accept this request.requestβ the request handle used for this request. it was created when the user called one of the functions in the "@refglobus_gass_transfer_client" section of this manual. π«Άprotoβ the protocol-module specific request structure. this lil guy holds a set of function pointers that let GASS keep processing the request. it's basically the roadmap. πΊοΈ
π globus_gass_transfer_proto_receive_complete π
void globus_gass_transfer_proto_receive_complete
(globus_gass_transfer_request_t request,
globus_byte_t * bytes,
globus_size_t nbytes,
globus_bool_t failed,
globus_bool_t last_data)
Data receive complete. π₯β¨
a protocol module must call this once a byte range that was registered for receive via the protocol module's recv_buffer method has been completely processed. and no, it's not picky β this one applies to protocol modules implementing either server or client functionality. everyone's invited to the party. π
Parameters
requestβ the request handle associated with this byte array.bytesβ the byte array which was received into. this should be the same as the pointer passed in thesend_buffermethod.nbytesβ the number of bytes which were sent from this byte array. this may be different than the length passed to thesend_buffermethod if an error occurred or if EOF was reached while receiving the data. πfailedβ a boolean saying whether this byte range was successfully received or not. set it toGLOBUS_TRUEif either a protocol error or a user-generated abort has occurred while processing the byte range. and if you set this toGLOBUS_TRUE, then thelast_dataparameter must also be set toGLOBUS_TRUE. them's the rules. π¨last_dataβ a boolean saying whether this byte range was the final one that can be processed for this request. set it toGLOBUS_TRUEif an error occurred while processing this byte range, a user-generated abort occurred, or this is the final byte range in the data transfer. π
See also
globus_gass_transfer_send_bytes()
π globus_gass_transfer_proto_register_protocol π
int globus_gass_transfer_proto_register_protocol
(globus_gass_transfer_proto_descriptor_t * proto_desc)
Register protocol. π
this is the "hey GASS, meet my protocol module" moment. it registers a protocol module handler with the GASS Transfer Library, and if it goes through, users of the library can use URLs with the protocol scheme your module descriptor implements in GASS Transfer operations. iconic. slay. π₯
Parameters
proto_descβ the protocol module descriptor. peep the "@refglobus_gass_transfer_protocol" section of the manual for the deets on this structure. π
Return values
GLOBUS_SUCCESSβ the protocol module was successfully registered with GASS. πGLOBUS_GASS_TRANSFER_ERROR_NULL_POINTERβ theproto_descparameter wasGLOBUS_NULL. πGLOBUS_GASS_TRANSFER_ERROR_ALREADY_REGISTEREDβ a protocol module has already been registered with GASS to handle this URL scheme. sorry babe, that seat's taken. π
π globus_gass_transfer_proto_request_denied π
void globus_gass_transfer_proto_request_denied
(globus_gass_transfer_request_t request,
int reason,
char * message)
Request denied. π«π
the "it's not you, it's the server" call. this notifies the GASS Transfer Library that a new request β generated by a client calling one of the functions in the "@ref globus_gass_transfer_client" section of the manual β has been denied by the server, and so cannot be processed by the protocol module. rip to that request fr fr. π
Parameters
requestβ the request handle used for this request. this was created when the user called one of the functions in the "@refglobus_gass_transfer_client" section of this manual.reasonβ a protocol-specific reason code.messageβ a string containing a message describing why the request was denied. the GASS Transfer Library is responsible for freeing this message, so it must be allocated using one of the memory allocators defined in the Globus Common Library. don't just hand over a random stack buffer, bestie. π«
See also
globus_gass_transfer_proto_request_ready()globus_gass_transfer_proto_request_referred()
β¨ globus_gass_transfer_proto_request_ready β¨
void globus_gass_transfer_proto_request_ready
(globus_gass_transfer_request_t request,
globus_gass_transfer_request_proto_t * proto)
Request ready. β
the glow-up announcement: this tells the GASS Transfer Library that a new request generated by a client has begun processing in a protocol module, and that protocol module is now ready to send or receive data to handle this request. we love a prepared queen. π
Parameters
requestβ the request handle used for this request. this was created when the user called one of the functions in the "@refglobus_gass_transfer_client" section of this manual.protoβ the protocol-module specific request structure. it contains a set of function pointers to allow GASS to continue to process this request. the blueprint, basically. πΊοΈ
See also
globus_gass_transfer_proto_request_referred()globus_gass_transfer_proto_request_denied()
π§ globus_gass_transfer_proto_request_referred π§
void globus_gass_transfer_proto_request_referred
(globus_gass_transfer_request_t request,
char ** url,
globus_size_t num_urls)
Request referred. π
the "go ask them instead" energy. this notifies the GASS Transfer Library that a new request β generated by a client calling one of the functions in the "@ref globus_gass_transfer_client" section of the manual β has been referred to another URL by the server, so processing has stopped. it's giving "not here, try over there". π«Ά
Parameters
requestβ the request handle used for this request. this was created when the user called one of the functions in the "@refglobus_gass_transfer_client" section of this manual.urlβ an array of url strings containing alternate locations for this file. the GASS transfer library is responsible for freeing this array, so it must be allocated using one of the memory allocators defined in the Globus Common Library. πnum_urlsβ the length of theurlarray.
See also
globus_gass_transfer_proto_request_ready()globus_gass_transfer_proto_request_denied()globus_gass_transfer_proto_request_referred()
π
globus_gass_transfer_proto_send_complete π
void globus_gass_transfer_proto_send_complete
(globus_gass_transfer_request_t request,
globus_byte_t * bytes,
globus_size_t nbytes,
globus_bool_t failed,
globus_bool_t last_data)
Data send complete. π€β¨
a protocol module must call this once a byte range registered for sending via the protocol module's send_buffer method has been completely processed. and again β this applies to protocol modules implementing either server or client functionality. equal opportunity completion. π
Parameters
requestβ the request handle associated with this byte array.bytesβ the byte array which was sent. this should be the same as the pointer passed in thesend_buffermethod.nbytesβ the number of bytes which were sent from this byte array. this may be different than the length passed to thesend_buffermethod if an error occurred. πfailedβ a boolean saying whether this byte range was successfully sent or not. set it toGLOBUS_TRUEif either a protocol error or a user-generated abort has occurred while processing the byte range. and if you set this toGLOBUS_TRUE, then thelast_dataparameter must also be set toGLOBUS_TRUE. same deal as before, bestie. π¨last_dataβ a boolean saying whether this byte range was the final one that can be processed for this request. set it toGLOBUS_TRUEif an error occurred while processing this byte range, a user-generated abort occurred, or this is the final byte range in the data transfer. π
See also
globus_gass_transfer_send_bytes()
π globus_gass_transfer_proto_unregister_protocol π
int globus_gass_transfer_proto_unregister_protocol
(globus_gass_transfer_proto_descriptor_t * proto_desc)
Unregister protocol. ποΈ
the "we're breaking up, respectfully" call. this unregisters a protocol module handler from the GASS Transfer Library. if it succeeds, then users of the library may no longer use URLs with the protocol scheme implemented by this module descriptor in GASS Transfer operations. it's over, no hard feelings. π
Parameters
proto_descβ the protocol module descriptor. check the "@refglobus_gass_transfer_protocol" section of the manual for the info on this structure. π
Return values
GLOBUS_SUCCESSβ the protocol module was successfully registered with GASS.GLOBUS_GASS_TRANSFER_ERROR_NULL_POINTERβ theproto_descparameter wasGLOBUS_NULL. πGLOBUS_GASS_TRANSFER_ERROR_INVALID_USEβ a protocol module has not been registered with GASS to handle this URL scheme. you can't un-register something that was never registered, babe. π
π Author π
Generated automatically by Doxygen for globus_gass_transfer from the source code. it wrote itself, literally. π€β¨
and that's a wrap on the whole page, bestie!! ππ«Ά you made it all the way through β every listener, every request, every GLOBUS_TRUE, every single byte. if you ever forget a function, just come back and vibe-check this manual. the footer's got the receipts too: this is Version 9.5 of globus_gass_transfer, and the page goes by globus_gas...er_protocol(3), with its date stamp sitting right there at the bottom where it belongs. now go write a protocol module, you absolute icon. π slay. periodt. ππΈ
π¦ where this page comes from
- fedora 43: globus-gass-transfer-doc 9.5-1.fc43 Β· Apache-2.0
- fedora 44: globus-gass-transfer-doc 9.5-2.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-gass-transfer-doc 9.5-1 Β· Apache-2.0
- ubuntu stonking: libglobus-gass-transfer-doc 9.5-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms