---
name: "globus_gass_transfer_proto_request_denied"
section: "3"
platform: "linux"
package: "libglobus-gass-transfer-doc"
version: "9.4-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gass_transfer_protocol"
---

# globus\_gass\_transfer\_proto\_request\_denied(3)

Protocol Modules - Protocol Implementation API.

Part of [globus\_gass\_transfer\_protocol(3)](/globus_gass_transfer_protocol/3.md).

## 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.  struct **globus\_gass\_transfer\_listener\_proto\_s**\
 Protocol module listener handling structure.  struct **globus\_gass\_transfer\_proto\_descriptor\_t**\
 Protocol module descriptor structure.

### Typedefs

typedef struct **globus\_gass\_transfer\_request\_proto\_s** **globus\_gass\_transfer\_request\_proto\_t**\
 typedef struct **globus\_gass\_transfer\_listener\_proto\_s** **globus\_gass\_transfer\_listener\_proto\_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)\
 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

The GASS Protocol Module API is designed to make it possible to extend the GASS client and server APIs to support additional protocols without making any changes to the core of the GASS implementation. GASS protocol modules are intended to to handle protocol-specific connection and data handling. The GASS Transfer library includes protocol modules which implement the HTTP, HTTPS, FTP, and GSI-FTP protocols.

Every protocol module implementation must include the following header file:

```
#include "globus_gass_transfer_proto.h"
```

To implement a protocol module, one must create a **globus\_gass\_transfer\_proto\_descriptor\_t** structure which indicates what the protocol module is able to do. This structure contains the URL scheme which the protocol module supports, and function pointers which indicate what type of operations (client or server) that the module implements. To implement a client-side protocol module, the new\_requestattr and new\_request fields must be set to the protocol module's implementations of those functions. To implement a server-side protocol module, the new\_listenerattr and new\_listener functions must be set to the protocol module's implementations of those functions.

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()**. This functions must be called after the **GLOBUS\_GASS\_TRANSFER\_MODULE** has already been activated. Once registered, applications may use URLs of the scheme type provided by the protocol module for the standard **client** or **server** operations.

## Typedef Documentation

### typedef struct globus\_gass\_transfer\_listener\_proto\_s globus\_gass\_transfer\_listener\_proto\_t

Protocol module listener handling structure.

**See also**

**globus\_gass\_transfer\_listener\_proto\_s**

### 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 associated with the **globus\_gass\_transfer\_listener\_proto\_t** associated with a particular listener handle. They are 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.

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.

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.

### 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 is called when the server has called **globus\_gass\_transfer\_create\_listener()**.

**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's **new\_listenerattr function 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 the globus\_common library. It will be freed by the GASS Transfer library when the listener is closed. \
 *proto* A pointer to be set to a new globus\_gass\_transfer\_listener\_proto\_t which will be associated with this listener. This must be allocated by the protocol module using one of the memory allocators defined in the globus\_common library. It will be freed by the GASS Transfer library when the listener is closed.

**Returns**

A GASS error value, or GLOBUS\_SUCCESS.

### 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 are 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.

**Parameters**

*proto* The protocol module's request handler. \
 *request* The request handle.

### 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 are called when a server implementation wants to close the listener, listen for new connections, or destroy the listener.

**Parameters**

*proto* The protocol-specific implementation of the **globus\_gass\_transfer\_listener\_proto\_t** for a particular listener. \
 *listener* The listener handle associated with the *proto*.

**See also**

**globus\_gass\_transfer\_proto\_create\_listener\_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 is 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.

**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**

### 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 is 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.

**Parameters**

*request* The request handle containing the information about the request. \
 *attr* A protocol-specific attribute set, created by calling the protocol module's **new\_requestattr function pointer**.

### 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 is 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.

**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 the *bytes* array. \
 *wait\_for\_length* The minimum amount of data to receive before calling **globus\_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()**

### 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 is 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.

**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 the *bytes* array. \
 *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()**

### typedef struct globus\_gass\_transfer\_request\_proto\_s globus\_gass\_transfer\_request\_proto\_t

Protocol module request handling structure.

**See also**

**globus\_gass\_transfer\_request\_proto\_s**

## Function Documentation

### void globus\_gass\_transfer\_proto\_listener\_ready (globus\_gass\_transfer\_listener\_t listener)

Server listener ready.

This function notifies the GASS Transfer Library that the protocol module has decided that a new request can be accepted on this particular listener. It must only be called after the GASS Transfer Library has called the **listen function** in a **globus\_gass\_transfer\_listener\_proto\_t** protocol module-specific listener structure.

**Parameters**

*listener* The listener handle which is now ready for accepting a new connection.

### 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 function notifies the GASS Transfer Library that new request generated by a server calling the **globus\_gass\_transfer\_register\_accept()** function has begun processing in a protocol module, and that protocol module is now ready to send or receive data to handle this request.

**Parameters**

*listener* The listener handle used to accept this request. \
 *request* The request handle used for this request. This was created by the user calling one of the functions in the '@ref\
        globus\_gass\_transfer\_client' section of this manual. \
 *proto* The protocol-module specific request structure. This structure contains a set of function pointers to allow GASS to continue to process this request.

### 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 function once a byte range registered for receive via the protocol module's recv\_buffer method has been completely processed. This function is called for protocol modules implementing either server or client functionality.

**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 the send\_buffer method. \
 *nbytes* The number of bytes which were sent from this byte array. This may be different than length passed to the send\_buffer method if an error occurred or EOF was reached while receiving the data. \
 *failed* A boolean indicating whether this byte range was successfully received or not. This should be set to *GLOBUS\_TRUE* if either a protocol error or a user-generated abort has occurred while processing the byte range. If this is set to *GLOBUS\_TRUE*, then the *last\_data* parameter must also be set to *GLOBUS\_TRUE*. \
 *last\_data* A boolean indicating whether this byte range was the final one which can be processed for this request. This should be set to *GLOBUS\_TRUE* if an error occurred while processing this byte range, and user-generated abort occurred, or this is the final byte range in the data transfer.

**See also**

**globus\_gass\_transfer\_send\_bytes()**

### int globus\_gass\_transfer\_proto\_register\_protocol (globus\_gass\_transfer\_proto\_descriptor\_t \* proto\_desc)

Register protocol.

This function registers a protocol module handler with the GASS Transfer library. If this succeeds, then users of the library may use the URLs with the protocol scheme implemented by this module descriptor in GASS Transfer operations.

**Parameters**

*proto\_desc* The protocol module descriptor. See the '@ref\
        globus\_gass\_transfer\_protocol' section of the manual for information on this structure.

**Return values**

*GLOBUS\_SUCCESS* The protocol module was successfully registered with GASS. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NULL\_POINTER* The *proto\_desc* parameter was *GLOBUS\_NULL*. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_ALREADY\_REGISTERED* A protocol module has already been registered with GASS to handle this URL scheme.

### void globus\_gass\_transfer\_proto\_request\_denied (globus\_gass\_transfer\_request\_t request, int reason, char \* message)

Request denied.

This function notifies the GASS Transfer Library that 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.

**Parameters**

*request* The request handle used for this request. This was created by the user calling one of the functions in the '@ref\
        globus\_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. It must be allocated using one of the memory allocators defined in the Globus Common Library.

**See also**

**globus\_gass\_transfer\_proto\_request\_ready()**, **globus\_gass\_transfer\_proto\_request\_referred()**

### void globus\_gass\_transfer\_proto\_request\_ready (globus\_gass\_transfer\_request\_t request, globus\_gass\_transfer\_request\_proto\_t \* proto)

Request ready.

This function notifies the GASS Transfer Library that 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.

**Parameters**

*request* The request handle used for this request. This was created by the user calling one of the functions in the '@ref\
        globus\_gass\_transfer\_client' section of this manual. \
 *proto* The protocol-module specific request structure. This structure contains a set of function pointers to allow GASS to continue to process this request.

**See also**

**globus\_gass\_transfer\_proto\_request\_referred()**, **globus\_gass\_transfer\_proto\_request\_denied()**

### void globus\_gass\_transfer\_proto\_request\_referred (globus\_gass\_transfer\_request\_t request, char \*\* url, globus\_size\_t num\_urls)

Request referred.

This function notifies the GASS Transfer Library that 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, and so processing has stopped.

**Parameters**

*request* The request handle used for this request. This was created by the user calling one of the functions in the '@ref\
        globus\_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. It must be allocated using one of the memory allocators defined in the Globus Common Library. \
 *num\_urls* The length of the *url* array.

**See also**

**globus\_gass\_transfer\_proto\_request\_ready()**, **globus\_gass\_transfer\_proto\_request\_denied()**, **globus\_gass\_transfer\_proto\_request\_referred()**

### 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 function once a byte range registered for sending via the protocol module's send\_buffer method has been completely processed. This function is called for protocol modules implementing either server or client functionality.

**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 the send\_buffer method. \
 *nbytes* The number of bytes which were sent from this byte array. This may be different than length passed to the send\_buffer method if an error occurred. \
 *failed* A boolean indicating whether this byte range was successfully sent or not. This should be set to *GLOBUS\_TRUE* if either a protocol error or a user-generated abort has occurred while processing the byte range. If this is set to *GLOBUS\_TRUE*, then the *last\_data* parameter must also be set to *GLOBUS\_TRUE*. \
 *last\_data* A boolean indicating whether this byte range was the final one which can be processed for this request. This should be set to *GLOBUS\_TRUE* if an error occurred while processing this byte range, and user-generated abort occurred, or this is the final byte range in the data transfer.

**See also**

**globus\_gass\_transfer\_send\_bytes()**

### int globus\_gass\_transfer\_proto\_unregister\_protocol (globus\_gass\_transfer\_proto\_descriptor\_t \* proto\_desc)

Unregister protocol.

This function unregisters a protocol module handler from the GASS Transfer library. If this succeeds, then users of the library may no longer user URLs with the protocol scheme implemented by this module descriptor in GASS Transfer operations.

**Parameters**

*proto\_desc* The protocol module descriptor. See the '@ref\
        globus\_gass\_transfer\_protocol' section of the manual for information on this structure.

**Return values**

*GLOBUS\_SUCCESS* The protocol module was successfully registered with GASS. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_NULL\_POINTER* The *proto\_desc* parameter was *GLOBUS\_NULL*. \
 *GLOBUS\_GASS\_TRANSFER\_ERROR\_INVALID\_USE* A protocol module has not been registered with GASS to handle this URL scheme.

## Author

Generated automatically by Doxygen for globus\_gass\_transfer from the source code.
