]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
added gnutls_dtls_get_data_mtu().
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 20 Mar 2011 10:06:53 +0000 (11:06 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 20 Mar 2011 10:56:03 +0000 (11:56 +0100)
lib/gnutls_dtls.c
lib/includes/gnutls/dtls.h
lib/libgnutls.map

index 9a5771ee18292dbbac15ce7970fe9ea065cbbb22..335e237657b85c830cf038662726dfb415d965d5 100644 (file)
@@ -333,6 +333,9 @@ int i, offset = 0;
  * be retransmitted. The total timeout is the time after which the
  * handshake will be aborted with %GNUTLS_E_TIMEDOUT.
  *
+ * The DTLS protocol recommends the values of 1 sec and 60 seconds
+ * respectively.
+ *
  * If the retransmission timeout is zero then the handshake will operate
  * in a non-blocking way, i.e., return %GNUTLS_E_AGAIN.
  *
@@ -359,7 +362,7 @@ void gnutls_dtls_set_mtu (gnutls_session_t session, unsigned int mtu)
 }
 
 /**
- * gnutls_dtls_get_mtu:
+ * gnutls_dtls_get_data_mtu:
  * @session: is a #gnutls_session_t structure.
  *
  * This function will return the actual maximum transfer unit for
@@ -369,7 +372,7 @@ void gnutls_dtls_set_mtu (gnutls_session_t session, unsigned int mtu)
  * Returns: the maximum allowed transfer unit.
  *
  **/
-unsigned int gnutls_dtls_get_mtu (gnutls_session_t session)
+unsigned int gnutls_dtls_get_data_mtu (gnutls_session_t session)
 {
 int ret;
 
@@ -380,6 +383,23 @@ int ret;
     return session->internals.dtls.mtu - RECORD_HEADER_SIZE(session);
 }
 
+/**
+ * gnutls_dtls_get_mtu:
+ * @session: is a #gnutls_session_t structure.
+ *
+ * This function will return the MTU size as set with
+ * gnutls_dtls_set_mtu(). This is not the actual MTU
+ * of data you can transmit. Use gnutls_dtls_get_data_mtu()
+ * for that reason.
+ *
+ * Returns: the set maximum transfer unit.
+ *
+ **/
+unsigned int gnutls_dtls_get_mtu (gnutls_session_t session)
+{
+  return session->internals.dtls.mtu;
+}
+
 #define COOKIE_SIZE 16
 #define COOKIE_MAC_SIZE 16
 
index 89d038898d1ca08f0ec104a58b91e53a7001ee86..39cb52dcd2e9c82fac08c1416fd191b2c432222c 100644 (file)
@@ -42,6 +42,8 @@ void gnutls_dtls_set_timeouts (gnutls_session_t session, unsigned int retrans_ti
   unsigned int total_timeout);
 
 unsigned int gnutls_dtls_get_mtu (gnutls_session_t session);
+unsigned int gnutls_dtls_get_data_mtu (gnutls_session_t session);
+
 void gnutls_dtls_set_mtu (gnutls_session_t session, unsigned int mtu);
 
 typedef struct {
index 021f8db4f5a9d4e8214f82ee29617201e11f3627..f5d967e4fa9deb89f0c83dad99fc31c9f1b8c866 100644 (file)
@@ -700,6 +700,7 @@ GNUTLS_3_0_0 {
        gnutls_dtls_cookie_verify;
        gnutls_dtls_cookie_send;
        gnutls_dtls_prestate_set;
+       gnutls_dtls_get_data_mtu;
 } GNUTLS_2_12;
 
 GNUTLS_PRIVATE {