Adding KyoungSoo's changes for setting buffer sizes
authorSapan Bhatia <sapanb@cs.princeton.edu>
Thu, 2 Apr 2009 19:48:10 +0000 (19:48 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Thu, 2 Apr 2009 19:48:10 +0000 (19:48 +0000)
bmsocket/bmsocket.c
bmsocket/bmsocket.h [new file with mode: 0644]

index 873f4fc..c6809f8 100644 (file)
@@ -7,7 +7,7 @@
 
 #define VSYS_BMSOCKET "/vsys/fd_bmsocket.control"
 
-int socket(int domain, int type, int protocol)
+int CreateLargeBufSocket(int recvbuf, int sndbuf)
 {
     int sfd;
     struct sockaddr_un addr;
@@ -31,6 +31,16 @@ int socket(int domain, int type, int protocol)
         exit(-1);
     }
 
+    /* passing the parameters */
+    if (send(sfd, &recvbuf, sizeof(recvbuf), 0) != sizeof(recvbuf)) {
+        perror("Could not connect to Vsys control socket");
+        exit(-1);
+
+    }
+    if (send(sfd, &sndbuf, sizeof(sndbuf), 0) != sizeof(sndbuf)) {
+        perror("Could not connect to Vsys control socket");
+        exit(-1);
+    }
 
     remotefd = receive_fd(sfd);
     return remotefd;
diff --git a/bmsocket/bmsocket.h b/bmsocket/bmsocket.h
new file mode 100644 (file)
index 0000000..930f6f2
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _BM_SOCKET_H_
+#define _BM_SOCKET_H_
+
+extern int CreateLargeBufSocket(int recvbuf, int sndbuf);
+
+#endif