/*
- * Copyright (C) 2001-2012 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2015-2016 Red Hat, Inc.
*
* Author: Nikos Mavrogiannopoulos, Simon Josefsson
*
}
-const char *_gnutls_extension_get_name(uint16_t type)
+/**
+ * gnutls_ext_get_name:
+ * @ext: is a TLS extension numeric ID
+ *
+ * Convert a TLS extension numeric ID to a printable string.
+ *
+ * Returns: a pointer to a string that contains the name of the
+ * specified cipher, or %NULL.
+ **/
+const char *gnutls_ext_get_name(unsigned int ext)
{
size_t i;
for (i = 0; extfunc[i] != NULL; i++)
- if (extfunc[i]->type == type)
+ if (extfunc[i]->type == ext)
return extfunc[i]->name;
return NULL;
_gnutls_handshake_log
("EXT[%d]: expecting extension '%s'\n",
session,
- _gnutls_extension_get_name(session->internals.
+ gnutls_ext_get_name(session->internals.
extensions_sent
[i]));
}
if (ext_recv == NULL) {
_gnutls_handshake_log
("EXT[%p]: Found extension '%s/%d'\n", session,
- _gnutls_extension_get_name(type), type);
+ gnutls_ext_get_name(type), type);
continue;
}
_gnutls_handshake_log
("EXT[%p]: Parsing extension '%s/%d' (%d bytes)\n",
- session, _gnutls_extension_get_name(type), type,
+ session, gnutls_ext_get_name(type), type,
size);
if ((ret = ext_recv(session, sdata, size)) < 0) {
gnutls_ext_deinit_data_func deinit_func, gnutls_ext_pack_func pack_func,
gnutls_ext_unpack_func unpack_func);
+const char *gnutls_ext_get_name(unsigned int ext);
+
/* Public supplemental data related functions */
typedef int (*gnutls_supp_recv_func) (gnutls_session_t session,