Handle SCTP messages fragmented by the kernel

It does this under memory pressure, with no obvious way to turn it off.
Just handle it rather than worry about changing the kernel.

Change-Id: If4f29351e7b2baac2e551d9e4fc5238350b744d5
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/network/sctp_lib.h b/aos/network/sctp_lib.h
index 427f828..6b40600 100644
--- a/aos/network/sctp_lib.h
+++ b/aos/network/sctp_lib.h
@@ -8,6 +8,7 @@
 #include <optional>
 #include <string>
 #include <string_view>
+#include <vector>
 
 #include "aos/unique_malloc_ptr.h"
 #include "gflags/gflags.h"
@@ -94,6 +95,9 @@
   int fd() const { return fd_; }
 
   void SetMaxSize(size_t max_size) {
+    CHECK(partial_messages_.empty())
+        << ": May not update size with queued fragments because we do not "
+           "track individual message sizes";
     max_size_ = max_size;
     if (fd_ != -1) {
       DoSetMaxSize();
@@ -104,12 +108,18 @@
   void CloseSocket();
   void DoSetMaxSize();
 
+  // Examines a notification message for ones we handle here.
+  // Returns true if the notification was handled by this class.
+  bool ProcessNotification(const Message *message);
+
   int fd_ = -1;
 
   // We use this as a unique identifier that just increments for each message.
   uint32_t send_ppid_ = 0;
 
   size_t max_size_ = 1000;
+
+  std::vector<aos::unique_c_ptr<Message>> partial_messages_;
 };
 
 // Returns the max network buffer available for reading for a socket.