---
name: "globus_gram_protocol_unpack_job_request_reply_with_extensions"
section: "3"
platform: "linux"
package: "libglobus-gram-protocol-doc"
version: "13.6-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gram_protocol_unpack"
---

# globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions(3)

Message Unpacking - Message Unpacking.

Part of [globus\_gram\_protocol\_unpack(3)](/globus_gram_protocol_unpack/3.md).

## NAME

globus\_gram\_protocol\_unpack - Message Unpacking

 \- Message Unpacking.

## SYNOPSIS

### Functions

int **globus\_gram\_protocol\_unpack\_job\_request** (const globus\_byte\_t \*query, globus\_size\_t querysize, int \*job\_state\_mask, char \*\*callback\_url, char \*\*description)\
 Unpack a GRAM Job Request.  int **globus\_gram\_protocol\_unpack\_job\_request\_reply** (const globus\_byte\_t \*reply, globus\_size\_t replysize, int \*status, char \*\*job\_contact)\
 Unpack a GRAM reply message.  int **globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions** (const globus\_byte\_t \*reply, globus\_size\_t replysize, int \*status, char \*\*job\_contact, globus\_hashtable\_t \*extensions)\
 Unpack a GRAM reply message, parsing all extensions.  int **globus\_gram\_protocol\_unpack\_status\_request** (const globus\_byte\_t \*query, globus\_size\_t querysize, char \*\*status\_request)\
 Unpack a GRAM query message.  int **globus\_gram\_protocol\_unpack\_status\_reply** (const globus\_byte\_t \*reply, globus\_size\_t replysize, int \*job\_status, int \*failure\_code, int \*job\_failure\_code)\
 Unpack a GRAM query reply.  int **globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions** (const globus\_byte\_t \*reply, globus\_size\_t replysize, globus\_hashtable\_t \*extensions)\
 Unpack a GRAM query reply with extensions.  int **globus\_gram\_protocol\_unpack\_status\_update\_message** (const globus\_byte\_t \*reply, globus\_size\_t replysize, char \*\*job\_contact, int \*status, int \*failure\_code)\
 Unpack a GRAM status update message.  int **globus\_gram\_protocol\_unpack\_status\_update\_message\_with\_extensions** (const globus\_byte\_t \*reply, globus\_size\_t replysize, globus\_hashtable\_t \*extensions)\
 Unpack a GRAM status update message with extensions.  void **globus\_gram\_protocol\_hash\_destroy** (globus\_hashtable\_t \*message\_hash)\

## Detailed Description

Message Unpacking.

## Function Documentation

### void globus\_gram\_protocol\_hash\_destroy (globus\_hashtable\_t \* message\_hash)

Destroy message attribute hash

**Parameters**

*message\_hash* Hashtable of globus\_gram\_protocol\_extension\_t \* values to destroy

### int globus\_gram\_protocol\_unpack\_job\_request (const globus\_byte\_t \* query, globus\_size\_t querysize, int \* job\_state\_mask, char \*\* callback\_url, char \*\* description)

Unpack a GRAM Job Request. The **globus\_gram\_protocol\_unpack\_job\_request()** function parses the job request message packed in the *query* message and returns copies of the standard message attributes in the *job\_state\_mask*, *callback\_url*, and *description* parameters.

**Parameters**

*query* The unframed job request message to parse. \
 *querysize* The length of the job request message string. \
 *job\_state\_mask* A pointer to an integer to be set to the job state mask from the job request. \
 *callback\_url* A pointer to be set with a copy of the URL of the callback contact to be registered for this job request. The caller must free this memory by calling free(). \
 *description* A pointer to be set to a copy of the job description RSL string for this job request. The caller must free this memory by calling free().

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_job\_request()** will return *GLOBUS\_SUCCESS* and modify the *job\_state\_mask*, *callback\_url*, and *description* parameters to values extracted from the message in *query*. If an error occurs, an integer error code will be returned and the values of *job\_state\_mask*, *callback\_url*, and *description* will be undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_job\_request\_reply (const globus\_byte\_t \* reply, globus\_size\_t replysize, int \* status, char \*\* job\_contact)

Unpack a GRAM reply message. The **globus\_gram\_protocol\_unpack\_job\_request\_reply()** function parses the reply message packed in the *reply* message and returns copies of the standard message attributes in the *status* and *job\_contact* parameters.

**Parameters**

*reply* The unframed job reply message to parse. \
 *replysize* The length of the reply string. \
 *status* A pointer to an integer to be set to the failure code associated with the job request. This may be GLOBUS\_SUCCESS, if the job request was successful. \
 *job\_contact* A pointer to a string to be set to the job contact string. This may set to NULL if the job request failed. If **globus\_gram\_protocol\_unpack\_job\_request\_reply()** returns GLOBUS\_SUCCESS, then the caller must free this string using free().

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_job\_request\_reply()** returns *GLOBUS\_SUCCESS* and modifies the *status* and *job\_contact* parameters to point to the values described above. If an error occurs, an integer error code is returned and the values pointed to by *status* and *job\_contact* are undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAN\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_MALLOC\_FAILED* Out of memory \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions (const globus\_byte\_t \* reply, globus\_size\_t replysize, int \* status, char \*\* job\_contact, globus\_hashtable\_t \* extensions)

Unpack a GRAM reply message, parsing all extensions. The **globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions()** function parses the reply message packed in the *reply* message parameter and returns copies of the standard message attributes in the *status* and *job\_contact* parameters, and all other extension attributes in the hashtable pointed to by *extensions*. Each entry in the hashtable will be keyed by the attribute name and the value will be a pointer to a *globus\_gram\_protocol\_extension\_t* structure.

**Parameters**

*status* A pointer to an integer to be set to the failure code associated with the job request. This may be GLOBUS\_SUCCESS, if the job request was successful. \
 *job\_contact* A pointer to a string to be set to the job contact string. This may set to NULL if the job request failed. If **globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions()** returns GLOBUS\_SUCCESS, then the caller must free this string using free(). \
 *extensions* A pointer to be set to a hash table containing the names and values of all protocol extensions present in the response message. If **globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions()** returns GLOBUS\_SUCCESS, the caller must free this hash table and its values by calling **globus\_gram\_protocol\_hash\_destroy()**. \
 *reply* The unframed job reply message to parse. \
 *replysize* The length of the reply string.

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_job\_request\_reply\_with\_extensions()** returns *GLOBUS\_SUCCESS* and modifies the *status*, *job\_contact*, and *extensions* to point to the values described above. If an error occurs, an integer error code is returned and the values pointed to by *status*, *job\_contact*, and *extensions* are undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAN\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_MALLOC\_FAILED* Out of memory \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_status\_reply (const globus\_byte\_t \* reply, globus\_size\_t replysize, int \* job\_status, int \* failure\_code, int \* job\_failure\_code)

Unpack a GRAM query reply. The **globus\_gram\_protocol\_unpack\_status\_reply()** function parses the message packed in the *reply* parameter and sets the current job state, protocol failure code, and job failure code values in its output parameters.

**Parameters**

*reply* The unframed reply message to parse. \
 *replysize* The length of the reply message. \
 *job\_status* A pointer to an integer to be set to the job's current **job state**. \
 *failure\_code* A pointer to an integer to be set to the failure code associated with the query request. This may be GLOBUS\_SUCCESS, if the request was successful. \
 *job\_failure\_code* A pointer to an integer to be set to the failure code for the job, if the *job\_status* is GLOBUS\_GRAM\_PROTOCOL\_JOB\_STATE\_FAILED.

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_status\_reply()** returns *GLOBUS\_SUCCESS* and modifies the *job\_status*, *failure\_code*, and *job\_failure\_code* parameters to point to the value described above. If an error occurs, an integer error code is returned and the values pointed to by *job\_status*, *failure\_code*, and *job\_failure\_code* are undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter

### int globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions (const globus\_byte\_t \* reply, globus\_size\_t replysize, globus\_hashtable\_t \* extensions)

Unpack a GRAM query reply with extensions. The **globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions()** function parses the message packed in the *reply* parameter, storing all attributes and values in a hash table. The *extensions* parameter is modified to point to that hash table. The caller of **globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions()** must free that hash table by calling **globus\_gram\_protocol\_hash\_destroy()**.

**Parameters**

*reply* The unframed reply message to parse. \
 *replysize* The length of the reply message. \
 *extensions* A pointer to be set to a hash table containing the names and values of all protocol attributes present in the reply message. If **globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions()** returns GLOBUS\_SUCCESS, the caller must free this hash table and its values by calling **globus\_gram\_protocol\_hash\_destroy()**.

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_status\_reply\_with\_extensions()** returns *GLOBUS\_SUCCESS* and modifies the *extensions* parameter to point to the value described above. If an error occurs, an integer error code is returned and the value pointed to by *extensions* is undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_status\_request (const globus\_byte\_t \* query, globus\_size\_t querysize, char \*\* status\_request)

Unpack a GRAM query message. The **globus\_gram\_protocol\_unpack\_status\_request()** function parses the message packed in the *query* parameter and returns a copy of the message in the *status\_request* parameter.

**Parameters**

*query* The unframed query message to parse. \
 *querysize* The length of the query string. \
 *status\_request* A pointer to a string to be set to the query value. The caller must free this string using free().

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_status\_request()** returns *GLOBUS\_SUCCESS* and modifies the *status\_request* parameter to point to the value described above. If an error occurs, an integer error code is returned and the value pointed to by *status\_request* is undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_MALLOC\_FAILED* Out of memory \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_status\_update\_message (const globus\_byte\_t \* reply, globus\_size\_t replysize, char \*\* job\_contact, int \* status, int \* failure\_code)

Unpack a GRAM status update message. The **globus\_gram\_protocol\_unpack\_status\_update\_message()** function parses the message packed in the *reply* parameter, storing the standard message attribute values in its return parameters *job\_contact*, *status*, and *failure\_code*. The caller is responsible for freeing the *job\_contact* value.

**Parameters**

*reply* The unframed reply message to parse. \
 *replysize* The length of the reply message. \
 *job\_contact* An output parameter to be set to the job contact string. If **globus\_gram\_protocol\_unpack\_status\_update\_message()** returns GLOBUS\_SUCCESS, then the caller must free this string using free(). \
 *status* An output parameter to be set to the integer value of the job's current **job state**. \
 *failure\_code* An output parameter to be set to the integer failure code for the job if the *job\_status* is GLOBUS\_GRAM\_PROTOCOL\_JOB\_STATE\_FAILED.

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_status\_update\_message()** returns *GLOBUS\_SUCCESS* and modifies the *job\_contact*, *status*, and *failure\_code* parameters as described above. If an error occurs, an integer error code is returned and the values pointed to by the *job\_contact*, *status*, and *failure\_code* parameters are undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_NULL\_PARAMETER* Null parameter \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_MALLOC\_FAILED* Out of memory \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

### int globus\_gram\_protocol\_unpack\_status\_update\_message\_with\_extensions (const globus\_byte\_t \* reply, globus\_size\_t replysize, globus\_hashtable\_t \* extensions)

Unpack a GRAM status update message with extensions. The **globus\_gram\_protocol\_unpack\_status\_update\_message\_with\_extensions()** function parses the message packed in the *reply* parameter, storing the message attribute values in its return parameter *extensions*. The caller is responsible for freeing the *extensions* hash table by calling **globus\_gram\_protocol\_hash\_destroy()**.

**Parameters**

*reply* The unframed reply message to parse. \
 *replysize* The length of the reply message. \
 *extensions* An output parameter which will be initialized to a hashtable containing the message attributes. The caller must destroy this hashtable calling **globus\_gram\_protocol\_hash\_destroy()**.

**Returns**

Upon success, **globus\_gram\_protocol\_unpack\_status\_update\_message\_with\_extensions()** returns *GLOBUS\_SUCCESS* and modifies the *extensions* parameter as described above. If an error occurs, an integer error code is returned and the value pointed to by the *extensions* parameters is undefined.

**Return values**

*GLOBUS\_SUCCESS* Success \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_HTTP\_UNPACK\_FAILED* Unpack failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_MALLOC\_FAILED* Malloc failed \
 *GLOBUS\_GRAM\_PROTOCOL\_ERROR\_VERSION\_MISMATCH* Version mismatch

## Author

Generated automatically by Doxygen for globus\_gram\_protocol from the source code.
