---
name: "gnutls_anti_replay_set_add_function"
section: "3"
platform: "linux"
package: "gnutls"
version: "3.8.13-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gnutls_anti_replay_set_add_function"
---

# gnutls\_anti\_replay\_set\_add\_function(3)

API function

## NAME

gnutls\_anti\_replay\_set\_add\_function - API function

## SYNOPSIS

**#include \<gnutls/gnutls.h\>**

**void gnutls\_anti\_replay\_set\_add\_function(gnutls\_anti\_replay\_t** *anti\_replay***, gnutls\_db\_add\_func** *add\_func***);**

## ARGUMENTS

- gnutls\_anti\_replay\_t anti\_replay

  is a **gnutls\_anti\_replay\_t** type.

- gnutls\_db\_add\_func add\_func

  is the function.

## DESCRIPTION

Sets the function that will be used to store an entry if it is not already present in the resumed sessions database.  This function returns 0 if the entry is successfully stored, and a negative error code otherwise.  In particular, if the entry is found in the database, it returns **GNUTLS\_E\_DB\_ENTRY\_EXISTS**.

The arguments to the  *add\_func* are: - **ptr**: the pointer set with **gnutls\_anti\_replay\_set\_ptr()** - **exp\_time**: the expiration time of the entry - **key**: a pointer to the key - **data**: a pointer to data to store

The data set by this function can be examined using **gnutls\_db\_check\_entry\_expire\_time()** and **gnutls\_db\_check\_entry\_time()**.

## SINCE

3\.6.5

## REPORTING BUGS

Report bugs to \<bugs@gnutls.org\>.\
 Home page: https://www.gnutls.org

## COPYRIGHT

Copyright © 2001-2023 Free Software Foundation, Inc., and others.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gnutls** is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form visit

- https://www.gnutls.org/manual/
