Exemplo n.º 1
0
static int get_wbits(gnutls_compression_method_t algorithm)
{
	int ret = -1;
	/* avoid prefix */
	GNUTLS_COMPRESSION_ALG_LOOP(ret = p->window_bits);
	return ret;
}
Exemplo n.º 2
0
static int get_comp_level(gnutls_compression_method_t algorithm)
{
	int ret = -1;
	/* avoid prefix */
	GNUTLS_COMPRESSION_ALG_LOOP(ret = p->comp_level);
	return ret;
}
Exemplo n.º 3
0
/* return the tls number of the specified algorithm */
int _gnutls_compression_get_num(gnutls_compression_method_t algorithm)
{
	int ret = -1;

	/* avoid prefix */
	GNUTLS_COMPRESSION_ALG_LOOP(ret = p->num);

	return ret;
}
Exemplo n.º 4
0
/**
 * gnutls_compression_get_name:
 * @algorithm: is a Compression algorithm
 *
 * Convert a #gnutls_compression_method_t value to a string.
 *
 * Returns: a pointer to a string that contains the name of the
 *   specified compression algorithm, or %NULL.
 **/
const char *
gnutls_compression_get_name (gnutls_compression_method_t algorithm)
{
  const char *ret = NULL;

  /* avoid prefix */
  GNUTLS_COMPRESSION_ALG_LOOP (ret = p->name + sizeof ("GNUTLS_COMP_") - 1);

  return ret;
}
Exemplo n.º 5
0
int _gnutls_compression_is_ok(gnutls_compression_method_t algorithm)
{
	ssize_t ret = -1;
	GNUTLS_COMPRESSION_ALG_LOOP(ret = p->id);
	if (ret >= 0)
		ret = 0;
	else
		ret = 1;
	return ret;
}