1 #include <sys/socket.h>
8 #define VSYS_BMSOCKET "/vsys/fd_bmsocket.control"
10 int CreateLargeBufSocket(int recvbuf, int sndbuf)
13 struct sockaddr_un addr;
16 sfd = socket(AF_UNIX, SOCK_STREAM, 0);
18 perror("Could not create UNIX socket\n");
22 memset(&addr, 0, sizeof(struct sockaddr_un));
24 addr.sun_family = AF_UNIX;
25 strncpy(addr.sun_path, VSYS_BMSOCKET,
26 sizeof(addr.sun_path) - 1);
28 if (connect(sfd, (struct sockaddr *) &addr,
29 sizeof(struct sockaddr_un)) == -1) {
30 perror("Could not connect to Vsys control socket");
34 /* passing the parameters */
35 if (send(sfd, &recvbuf, sizeof(recvbuf), 0) != sizeof(recvbuf)) {
36 perror("Could not connect to Vsys control socket");
40 if (send(sfd, &sndbuf, sizeof(sndbuf), 0) != sizeof(sndbuf)) {
41 perror("Could not connect to Vsys control socket");
45 remotefd = receive_fd(sfd);