transports: Resize socket send buffer if needed

This was originally added in openbmc/pldm to make the socket send buffer
big enough to send a message if the message is longer than the current
send buffer size.

When you call set_sock_opt with buffer size X, given that X is within a
certain range, the send buffer is actually set to 2*X. get_sock_opt
returns the 2*X value, not X. So add in some helper functions.

Change-Id: I8ded9357db4268cd264cf0ecfb80479223106c09
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
diff --git a/src/transport/socket.h b/src/transport/socket.h
new file mode 100644
index 0000000..17751ca
--- /dev/null
+++ b/src/transport/socket.h
@@ -0,0 +1,14 @@
+#ifndef LIBPLDM_SRC_TRANSPORT_SOCKET_H
+#define LIBPLDM_SRC_TRANSPORT_SOCKET_H
+
+struct pldm_socket_sndbuf {
+	int size;
+	int socket;
+	int max_size;
+};
+
+int pldm_socket_sndbuf_init(struct pldm_socket_sndbuf *ctx, int socket);
+int pldm_socket_sndbuf_accomodate(struct pldm_socket_sndbuf *ctx, int msg_len);
+int pldm_socket_sndbuf_get(struct pldm_socket_sndbuf *ctx);
+
+#endif // LIBPLDM_SRC_TRANSPORT_SOCKET_H