]> git.proxmox.com Git - mirror_kronosnet.git/commitdiff
[docs] add knet packet layout
authorFabio M. Di Nitto <fdinitto@redhat.com>
Fri, 2 Aug 2019 08:43:09 +0000 (10:43 +0200)
committerFabio M. Di Nitto <fdinitto@redhat.com>
Fri, 2 Aug 2019 08:43:09 +0000 (10:43 +0200)
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
libknet/threads_pmtud.c

index 463fe1b36226cf86efe95bba403b7b47e9942880..46e24674be8ce93df128502ad13e4355a4f61026 100644 (file)
@@ -91,6 +91,28 @@ restart:
                failsafe++;
        }
 
+       /*
+        * unencrypted packet looks like:
+        *
+        * | ip | protocol | knet_header | unencrypted data                                  |
+        * | onwire_len                                                                      |
+        * | overhead_len  |
+        *                 | data_len                                                        |
+        *                               | app MTU                                           |
+        *
+        * encrypted packet looks like (not to scale):
+        *
+        * | ip | protocol | salt | crypto(knet_header | data)      | crypto_data_pad | hash |
+        * | onwire_len                                                                      |
+        * | overhead_len  |
+        *                 | data_len                                                        |
+        *                                             | app MTU    |
+        *
+        * knet_h->sec_block_size is >= 0 if encryption will pad the data
+        * knet_h->sec_salt_size is >= 0 if encryption is enabled
+        * knet_h->sec_hash_size is >= 0 if signing is enabled
+        */
+
        data_len = onwire_len - overhead_len;
 
        if (knet_h->crypto_instance) {