---
name: "rpma_peer_cfg_from_descriptor"
section: "3"
platform: "linux"
package: "librpma-dev"
version: "1.3.0-2+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rpma_peer_cfg_from_descriptor"
---

# rpma\_peer\_cfg\_from\_descriptor(3)

create a peer cfg from the descriptor

## NAME

**rpma\_peer\_cfg\_from\_descriptor** - create a peer cfg from the descriptor

## SYNOPSIS

```
      #include <librpma.h>
      struct rpma_peer_cfg;
      int rpma_peer_cfg_from_descriptor(const void *desc, size_t desc_size,
                      struct rpma_peer_cfg **pcfg_ptr);
```

## DESCRIPTION

**rpma\_peer\_cfg\_from\_descriptor**() creates a peer configuration object from the descriptor.

## SECURITY WARNING

An attacker might modify the serialized remote node configuration while it is transferred via an unsecured connection (e.g. rdma\_cm private data), which might cause different remote persistency method selections. The most dangerous situation is switching from the GPSPM mode to the APM one. Users should avoid using [**rpma\_conn\_get\_private\_data**(3)](/rpma_conn_get_private_data/3.md) and [**rpma\_conn\_req\_get\_private\_data**(3)](/rpma_conn_req_get_private_data/3.md) API calls and they should utilize TLS/SSL connections to transfer all configuration data between peers instead.

## RETURN VALUE

The **rpma\_peer\_cfg\_from\_descriptor**() function returns 0 on success or a negative error code on failure. **rpma\_peer\_cfg\_from\_descriptor**() does not set \*pcfg\_ptr value on failure.

## ERRORS

**rpma\_peer\_cfg\_from\_descriptor**() can fail with the following errors:

- •

  RPMA\_E\_INVAL - desc or pcfg\_ptr are NULL

- •

  RPMA\_E\_NOMEM - out of memory

## SEE ALSO

[**rpma\_conn\_apply\_remote\_peer\_cfg**(3)](/rpma_conn_apply_remote_peer_cfg/3.md), [**rpma\_peer\_cfg\_get\_descriptor**(3)](/rpma_peer_cfg_get_descriptor/3.md), [**rpma\_peer\_cfg\_new**(3)](/rpma_peer_cfg_new/3.md), [**librpma**(7)](/librpma/7.md) and https://pmem.io/rpma/
