Document the info callback.

This callback is some combination of arguably useful stuff (bracket
handshakes, alerts) and completely insane things (find out when the
state machine advances). Deprecate the latter.

Change-Id: Ibea5b32cb360b767b0f45b302fd5f1fe17850593
Reviewed-on: https://boringssl-review.googlesource.com/6305
Reviewed-by: Adam Langley <alangley@gmail.com>
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c
index 73a3f8a..3dd5f8c 100644
--- a/ssl/d1_clnt.c
+++ b/ssl/d1_clnt.c
@@ -135,7 +135,7 @@
 
 int dtls1_connect(SSL *s) {
   BUF_MEM *buf = NULL;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
   int ret = -1;
   int new_state, state, skip = 0;
 
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index e2d505c..a31dcc3 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -228,7 +228,7 @@
   int al, i, ret;
   unsigned int n;
   SSL3_RECORD *rr;
-  void (*cb)(const SSL *ssl, int type2, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
 
   if ((type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) ||
       (peek && type != SSL3_RT_APPLICATION_DATA)) {
@@ -557,7 +557,7 @@
 
 int dtls1_dispatch_alert(SSL *s) {
   int i, j;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
   uint8_t buf[DTLS1_AL_HEADER_LENGTH];
   uint8_t *ptr = &buf[0];
 
diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c
index 89c26aa..267bdf1 100644
--- a/ssl/d1_srvr.c
+++ b/ssl/d1_srvr.c
@@ -132,7 +132,7 @@
 
 int dtls1_accept(SSL *s) {
   BUF_MEM *buf = NULL;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
   uint32_t alg_a;
   int ret = -1;
   int new_state, state, skip = 0;
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index e34af59..242ac26 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -174,7 +174,7 @@
 
 int ssl3_connect(SSL *s) {
   BUF_MEM *buf = NULL;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
   int ret = -1;
   int new_state, state, skip = 0;
 
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index f2a26a9..1cb2ac6 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -382,7 +382,7 @@
   int al, i, ret;
   unsigned int n;
   SSL3_RECORD *rr;
-  void (*cb)(const SSL *ssl, int type2, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
 
   if ((type && type != SSL3_RT_APPLICATION_DATA && type != SSL3_RT_HANDSHAKE) ||
       (peek && type != SSL3_RT_APPLICATION_DATA)) {
@@ -786,7 +786,7 @@
 
 int ssl3_dispatch_alert(SSL *s) {
   int i, j;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
 
   s->s3->alert_dispatch = 0;
   i = do_ssl3_write(s, SSL3_RT_ALERT, &s->s3->send_alert[0], 2);
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index 4f48462..637e6ed 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -177,7 +177,7 @@
 int ssl3_accept(SSL *s) {
   BUF_MEM *buf = NULL;
   uint32_t alg_a;
-  void (*cb)(const SSL *ssl, int type, int val) = NULL;
+  void (*cb)(const SSL *ssl, int type, int value) = NULL;
   int ret = -1;
   int new_state, state, skip = 0;
 
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index b6374c6..24b9914 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2073,12 +2073,12 @@
 }
 
 void SSL_set_info_callback(SSL *ssl,
-                           void (*cb)(const SSL *ssl, int type, int val)) {
+                           void (*cb)(const SSL *ssl, int type, int value)) {
   ssl->info_callback = cb;
 }
 
-void (*SSL_get_info_callback(const SSL *ssl))(const SSL * /*ssl*/, int /*type*/,
-                                              int /*val*/) {
+void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type,
+                                              int value) {
   return ssl->info_callback;
 }
 
diff --git a/ssl/ssl_session.c b/ssl/ssl_session.c
index 83a38d4..4c2e464 100644
--- a/ssl/ssl_session.c
+++ b/ssl/ssl_session.c
@@ -826,13 +826,13 @@
   return ctx->get_session_cb;
 }
 
-void SSL_CTX_set_info_callback(SSL_CTX *ctx,
-                               void (*cb)(const SSL *ssl, int type, int val)) {
+void SSL_CTX_set_info_callback(
+    SSL_CTX *ctx, void (*cb)(const SSL *ssl, int type, int value)) {
   ctx->info_callback = cb;
 }
 
 void (*SSL_CTX_get_info_callback(SSL_CTX *ctx))(const SSL *ssl, int type,
-                                                int val) {
+                                                int value) {
   return ctx->info_callback;
 }