1 /* 2 * IMPORTANT NOTICE: THIS FILE CONTAINS STUBS ONLY RIGHT NOW, TO ENABLE A 3 * SEAMLESS TRANSITION TO THE NEW API FOR PROGRAMS STATICALLY LINKED TO LIBC! 4 * 5 * This file implements the upper socket layer of VFS: the BSD socket system 6 * calls, and any associated file descriptor, file pointer, vnode, and file 7 * system processing. In most cases, this layer will call into the lower 8 * socket layer in order to send the request to a socket driver. Generic file 9 * calls (e.g., read, write, ioctl, and select) are not implemented here, and 10 * will directly call into the lower socket layer as well. 11 * 12 * The following table shows the system call numbers implemented in this file, 13 * along with their request and reply message types. Each request layout 14 * message type is prefixed with "m_lc_vfs_". Each reply layout message type 15 * is prefixed with "m_vfs_lc_". For requests without a specific reply layout, 16 * only the "m_type" message field is used in the reply message. 17 * 18 * Type Request layout Reply layout 19 * ---- -------------- ------------ 20 * VFS_SOCKET socket 21 * VFS_SOCKETPAIR socket fdpair 22 * VFS_BIND sockaddr 23 * VFS_CONNECT sockaddr 24 * VFS_LISTEN listen 25 * VFS_ACCEPT sockaddr socklen 26 * VFS_SENDTO sendrecv 27 * VFS_RECVFROM sendrecv socklen 28 * VFS_SENDMSG sockmsg 29 * VFS_RECVMSG sockmsg 30 * VFS_SETSOCKOPT sockopt 31 * VFS_GETSOCKOPT sockopt socklen 32 * VFS_GETSOCKNAME sockaddr socklen 33 * VFS_GETPEERNAME sockaddr socklen 34 * VFS_SHUTDOWN shutdown 35 */ 36 37 #include "fs.h" 38 39 #include <sys/socket.h> 40 41 /* 42 * Create a socket. 43 */ 44 int 45 do_socket(void) 46 { 47 48 return EAFNOSUPPORT; 49 } 50 51 /* 52 * Create a pair of connected sockets. 53 */ 54 int 55 do_socketpair(void) 56 { 57 58 return EAFNOSUPPORT; 59 } 60 61 /* 62 * Bind a socket to a local address. 63 */ 64 int 65 do_bind(void) 66 { 67 68 return ENOTSOCK; 69 } 70 71 /* 72 * Connect a socket to a remote address. 73 */ 74 int 75 do_connect(void) 76 { 77 78 return ENOTSOCK; 79 } 80 81 /* 82 * Put a socket in listening mode. 83 */ 84 int 85 do_listen(void) 86 { 87 88 return ENOTSOCK; 89 } 90 91 /* 92 * Accept a connection on a listening socket, creating a new socket. 93 */ 94 int 95 do_accept(void) 96 { 97 98 return ENOTSOCK; 99 } 100 101 /* 102 * Send a message on a socket. 103 */ 104 int 105 do_sendto(void) 106 { 107 108 return ENOTSOCK; 109 } 110 111 /* 112 * Receive a message from a socket. 113 */ 114 int 115 do_recvfrom(void) 116 { 117 118 return ENOTSOCK; 119 } 120 121 /* 122 * Send or receive a message on a socket using a message structure. 123 */ 124 int 125 do_sockmsg(void) 126 { 127 128 return ENOTSOCK; 129 } 130 131 /* 132 * Set socket options. 133 */ 134 int 135 do_setsockopt(void) 136 { 137 138 return ENOTSOCK; 139 } 140 141 /* 142 * Get socket options. 143 */ 144 int 145 do_getsockopt(void) 146 { 147 148 return ENOTSOCK; 149 } 150 151 /* 152 * Get the local address of a socket. 153 */ 154 int 155 do_getsockname(void) 156 { 157 158 return ENOTSOCK; 159 } 160 161 /* 162 * Get the remote address of a socket. 163 */ 164 int 165 do_getpeername(void) 166 { 167 168 return ENOTSOCK; 169 } 170 171 /* 172 * Shut down socket send and receive operations. 173 */ 174 int 175 do_shutdown(void) 176 { 177 178 return ENOTSOCK; 179 } 180