---
name: "globus_gram_protocol.h"
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.h"
---

# globus\_gram\_protocol.h(3)

GRAM Protocol API.

## NAME

globus\_gram\_protocol.h - GRAM Protocol API.

## SYNOPSIS

`#include 'globus_io.h'`\
 `#include 'globus_gram_protocol_constants.h'`\

### Functions

int **globus\_gram\_protocol\_setup\_attr** (globus\_io\_attr\_t \*attr)\
 Create default I/O attribute for GRAM.  globus\_bool\_t **globus\_gram\_protocol\_authorize\_self** (gss\_ctx\_id\_t context)\
 Determine if a GSSAPI context has the same source and target identities.  int **globus\_gram\_protocol\_allow\_attach** (char \*\*url, globus\_gram\_protocol\_callback\_t callback, void \*callback\_arg)\
 Create a GRAM protocol service listener.  int **globus\_gram\_protocol\_callback\_disallow** (char \*url)\
 Stop a GASS protocol listener from handling new requests.  int **globus\_gram\_protocol\_post** (const char \*url, globus\_gram\_protocol\_handle\_t \*handle, globus\_io\_attr\_t \*attr, globus\_byte\_t \*message, globus\_size\_t message\_size, globus\_gram\_protocol\_callback\_t callback, void \*callback\_arg)\
 Post a GRAM protocol request to a GRAM server.  int **globus\_gram\_protocol\_post\_delegation** (const char \*url, globus\_gram\_protocol\_handle\_t \*handle, globus\_io\_attr\_t \*attr, globus\_byte\_t \*message, globus\_size\_t message\_size, gss\_cred\_id\_t cred\_handle, gss\_OID\_set restriction\_oids, gss\_buffer\_set\_t restriction\_buffers, OM\_uint32 req\_flags, OM\_uint32 time\_req, globus\_gram\_protocol\_callback\_t callback, void \*callback\_arg)\
 Post a GRAM protocol delegation request to a GRAM server.  int **globus\_gram\_protocol\_reply** (globus\_gram\_protocol\_handle\_t handle, int code, globus\_byte\_t \*message, globus\_size\_t message\_size)\
 Reply to a GRAM protocol message.  int **globus\_gram\_protocol\_accept\_delegation** (globus\_gram\_protocol\_handle\_t handle, gss\_OID\_set restriction\_oids, gss\_buffer\_set\_t restriction\_bufers, OM\_uint32 req\_flags, OM\_uint32 time\_req, globus\_gram\_protocol\_delegation\_callback\_t callback, void \*arg)\
 Perform the server-side of the GSSAPI delegation handshake to receive a new delegated credential.  int **globus\_gram\_protocol\_frame\_request** (const char \*url, const globus\_byte\_t \*msg, globus\_size\_t msgsize, globus\_byte\_t \*\*framedmsg, globus\_size\_t \*framedsize)\
 Create a HTTP-framed copy of a GRAM request.  int **globus\_gram\_protocol\_frame\_reply** (int code, const globus\_byte\_t \*msg, globus\_size\_t msgsize, globus\_byte\_t \*\*framedmsg, globus\_size\_t \*framedsize)\
 Create a HTTP-framed copy of a GRAM reply.  int **globus\_gram\_protocol\_pack\_job\_request** (int job\_state\_mask, const char \*callback\_url, const char \*rsl, globus\_byte\_t \*\*query, globus\_size\_t \*querysize)\
 Pack a GRAM Job Request.  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\_pack\_job\_request\_reply** (int status, const char \*job\_contact, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM reply message.  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\_pack\_job\_request\_reply\_with\_extensions** (int status, const char \*job\_contact, globus\_hashtable\_t \*extensions, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM reply message with extension attributes.  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\_pack\_status\_request** (const char \*status\_request, globus\_byte\_t \*\*query, globus\_size\_t \*querysize)\
 Pack a GRAM query message.  int **globus\_gram\_protocol\_unpack\_status\_request** (const globus\_byte\_t \*query, globus\_size\_t querysize, char \*\*status\_requst)\
 Unpack a GRAM query message.  int **globus\_gram\_protocol\_pack\_status\_reply** (int job\_status, int failure\_code, int job\_failure\_code, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM query reply message.  int **globus\_gram\_protocol\_pack\_status\_reply\_with\_extensions** (int job\_status, int failure\_code, int job\_failure\_code, globus\_hashtable\_t \*extensions, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM query reply message with extensions.  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\_pack\_status\_update\_message** (char \*job\_contact, int status, int failure\_code, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM status update message.  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\_pack\_status\_update\_message\_with\_extensions** (char \*job\_contact, int status, int failure\_code, globus\_hashtable\_t \*extensions, globus\_byte\_t \*\*reply, globus\_size\_t \*replysize)\
 Pack a GRAM status update message with extensions.  int **globus\_gram\_protocol\_unpack\_status\_update\_message\_with\_extensions** (const globus\_byte\_t \*reply, globus\_size\_t replysize, globus\_hashtable\_t \*message\_hash)\
 Unpack a GRAM status update message with extensions.  int **globus\_gram\_protocol\_pack\_version\_request** (char \*\*request, size\_t \*requestsize)\
 Pack a GRAM version request message.  void **globus\_gram\_protocol\_hash\_destroy** (globus\_hashtable\_t \*message\_hash)\
 globus\_gram\_protocol\_extension\_t \* **globus\_gram\_protocol\_create\_extension** (const char \*attribute, const char \*format,...)\
 int **globus\_gram\_protocol\_get\_sec\_context** (globus\_gram\_protocol\_handle\_t handle, gss\_ctx\_id\_t \*context)\
 Get a reference to the GSSAPI security context associated with a GRAM protocol handle.  const char \* **globus\_gram\_protocol\_error\_string** (int error\_code)\
 Get a description of a a GRAM error code.  void **globus\_gram\_protocol\_error\_7\_hack\_replace\_message** (const char \*message)\
 Replace the error message associated with error 7 with a custom message.  void **globus\_gram\_protocol\_error\_10\_hack\_replace\_message** (const char \*message)\
 Replace the error message associated with error 10 with a custom message.

## Detailed Description

GRAM Protocol API.

## Function Documentation

### globus\_gram\_protocol\_extension\_t \* globus\_gram\_protocol\_create\_extension (const char \* attribute, const char \* format, ...)

Create a GRAM5 protocol extension entry

Allocates a new GRAM5 protocol extension entry containing an attribute-value pair. The *attribute* parameter is copied into the extension, and the *format* parameter is a printf-style format string used to construct the value of the extension.

The caller is responsible for freeing the extension when done with it. The quoting rules described in **GRAM Protocol** must be implemented by the caller in the format string.

**Parameters**

*attribute* Name of the extension attribute \
 *format* Printf-style format string used along with the varargs to construct the extension's value string.

**Return values**

*A* new GRAM5 extension structure, or NULL if a malloc error occurred.

## Author

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