summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-16 09:53:03 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-16 09:56:10 +0100
commit1216eabdcb81b9d13fb3c422b411a8c1cd700ee7 (patch)
tree8aa3e61e9e8d7a2cfb9b18f4767ba8591fd73d27 /doc
parentb24ab4e5c7219c4d5b4ae3255fad31a8731c9e69 (diff)
downloadgnutls-1216eabdcb81b9d13fb3c422b411a8c1cd700ee7.tar.gz
Added convenience functions to avoid ugly casting in simple programs.
Diffstat (limited to 'doc')
-rw-r--r--doc/cha-gtls-app.texi18
-rw-r--r--doc/examples/ex-cert-select-pkcs11.c2
-rw-r--r--doc/examples/ex-cert-select.c2
-rw-r--r--doc/examples/ex-client-anon.c2
-rw-r--r--doc/examples/ex-client-dtls.c2
-rw-r--r--doc/examples/ex-client-psk.c2
-rw-r--r--doc/examples/ex-client-resume.c2
-rw-r--r--doc/examples/ex-client-srp.c2
-rw-r--r--doc/examples/ex-client-x509.c2
-rw-r--r--doc/examples/ex-serv-anon.c2
-rw-r--r--doc/examples/ex-serv-pgp.c2
-rw-r--r--doc/examples/ex-serv-psk.c2
-rw-r--r--doc/examples/ex-serv-srp.c2
-rw-r--r--doc/examples/ex-serv-x509.c2
14 files changed, 25 insertions, 19 deletions
diff --git a/doc/cha-gtls-app.texi b/doc/cha-gtls-app.texi
index 9a7ea4fafb..0f264def59 100644
--- a/doc/cha-gtls-app.texi
+++ b/doc/cha-gtls-app.texi
@@ -608,19 +608,25 @@ The initialization functions for the credentials are shown below.
The next step is to setup the underlying transport layer details. The
Berkeley sockets are implicitly used by GnuTLS, thus a
-call to @funcref{gnutls_transport_set_ptr2} would be sufficient to
-specify the socket descriptor.
+call to @funcref{gnutls_transport_set_int} would be sufficient to
+specify the socket descriptor.
-@showfuncdesc{gnutls_transport_set_ptr2}
-
-@showfuncA{gnutls_transport_set_ptr}
+@showfuncB{gnutls_transport_set_int,gnutls_transport_set_int2}
If however another transport layer than TCP is selected, then
-the following functions have to be specified.
+a pointer should be used instead to express the parameter to be
+passed to custom functions. In that case the following functions should
+be used instead.
+
+@showfuncB{gnutls_transport_set_ptr,gnutls_transport_set_ptr2}
+
+Moreover all of the following push and pull callbacks should be set.
@showfuncdesc{gnutls_transport_set_push_function}
@showfuncdesc{gnutls_transport_set_vec_push_function}
@showfuncdesc{gnutls_transport_set_pull_function}
+@showfuncdesc{gnutls_transport_set_pull_timeout_function}
+
The functions above accept a callback function which
should return the number of bytes written, or -1 on
diff --git a/doc/examples/ex-cert-select-pkcs11.c b/doc/examples/ex-cert-select-pkcs11.c
index e867926b87..a437a51507 100644
--- a/doc/examples/ex-cert-select-pkcs11.c
+++ b/doc/examples/ex-cert-select-pkcs11.c
@@ -114,7 +114,7 @@ main (void)
*/
sd = tcp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
/* Perform the TLS handshake
*/
diff --git a/doc/examples/ex-cert-select.c b/doc/examples/ex-cert-select.c
index 7b5173425a..b4ec2b1605 100644
--- a/doc/examples/ex-cert-select.c
+++ b/doc/examples/ex-cert-select.c
@@ -129,7 +129,7 @@ main (void)
*/
sd = tcp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
/* Perform the TLS handshake
*/
diff --git a/doc/examples/ex-client-anon.c b/doc/examples/ex-client-anon.c
index a85071bbce..3d4d3afa08 100644
--- a/doc/examples/ex-client-anon.c
+++ b/doc/examples/ex-client-anon.c
@@ -51,7 +51,7 @@ main (void)
*/
sd = tcp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
/* Perform the TLS handshake
diff --git a/doc/examples/ex-client-dtls.c b/doc/examples/ex-client-dtls.c
index a7c363882f..026cb7d082 100644
--- a/doc/examples/ex-client-dtls.c
+++ b/doc/examples/ex-client-dtls.c
@@ -65,7 +65,7 @@ main (void)
/* connect to the peer */
sd = udp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
/* set the connection MTU */
gnutls_dtls_set_mtu (session, 1000);
diff --git a/doc/examples/ex-client-psk.c b/doc/examples/ex-client-psk.c
index a68944a49b..4ebff50dcd 100644
--- a/doc/examples/ex-client-psk.c
+++ b/doc/examples/ex-client-psk.c
@@ -61,7 +61,7 @@ main (void)
*/
sd = tcp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
/* Perform the TLS handshake
diff --git a/doc/examples/ex-client-resume.c b/doc/examples/ex-client-resume.c
index de3b403857..1842c5e7a1 100644
--- a/doc/examples/ex-client-resume.c
+++ b/doc/examples/ex-client-resume.c
@@ -59,7 +59,7 @@ main (void)
free (session_data);
}
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
/* Perform the TLS handshake
diff --git a/doc/examples/ex-client-srp.c b/doc/examples/ex-client-srp.c
index 112e9f0476..7b4989608c 100644
--- a/doc/examples/ex-client-srp.c
+++ b/doc/examples/ex-client-srp.c
@@ -58,7 +58,7 @@ main (void)
gnutls_credentials_set (session, GNUTLS_CRD_SRP, srp_cred);
gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, cert_cred);
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
/* Perform the TLS handshake
diff --git a/doc/examples/ex-client-x509.c b/doc/examples/ex-client-x509.c
index 9295f981d5..acd6593d47 100644
--- a/doc/examples/ex-client-x509.c
+++ b/doc/examples/ex-client-x509.c
@@ -77,7 +77,7 @@ int main (void)
*/
sd = tcp_connect ();
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
gnutls_handshake_set_timeout (session, GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
/* Perform the TLS handshake
diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c
index a46fe9c80b..727ed16bd6 100644
--- a/doc/examples/ex-serv-anon.c
+++ b/doc/examples/ex-serv-anon.c
@@ -99,7 +99,7 @@ main (void)
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
sizeof (topbuf)), ntohs (sa_cli.sin_port));
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
do
{
diff --git a/doc/examples/ex-serv-pgp.c b/doc/examples/ex-serv-pgp.c
index aa4f8457c2..78e4c59e1f 100644
--- a/doc/examples/ex-serv-pgp.c
+++ b/doc/examples/ex-serv-pgp.c
@@ -116,7 +116,7 @@ main (void)
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
sizeof (topbuf)), ntohs (sa_cli.sin_port));
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
ret = gnutls_handshake (session);
if (ret < 0)
{
diff --git a/doc/examples/ex-serv-psk.c b/doc/examples/ex-serv-psk.c
index 498beeef02..2e025ca9ca 100644
--- a/doc/examples/ex-serv-psk.c
+++ b/doc/examples/ex-serv-psk.c
@@ -140,7 +140,7 @@ main (void)
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
sizeof (topbuf)), ntohs (sa_cli.sin_port));
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
ret = gnutls_handshake (session);
if (ret < 0)
{
diff --git a/doc/examples/ex-serv-srp.c b/doc/examples/ex-serv-srp.c
index c3dcae8455..3a95edd172 100644
--- a/doc/examples/ex-serv-srp.c
+++ b/doc/examples/ex-serv-srp.c
@@ -102,7 +102,7 @@ main (void)
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
sizeof (topbuf)), ntohs (sa_cli.sin_port));
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
do
{
diff --git a/doc/examples/ex-serv-x509.c b/doc/examples/ex-serv-x509.c
index 3f6c305b6e..8929242070 100644
--- a/doc/examples/ex-serv-x509.c
+++ b/doc/examples/ex-serv-x509.c
@@ -122,7 +122,7 @@ main (void)
inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
sizeof (topbuf)), ntohs (sa_cli.sin_port));
- gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
+ gnutls_transport_set_int (session, sd);
do
{