More header documentation.
[planlOS.git] / system / include / net / socket.h
blob3d3be5b1e80623414aa0d05b260fc360bd0666d5
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 /**
22 * \file socket.h
23 * Socket file system functions.
26 #ifndef NET_SOCKET_H_INCLUDED
27 #define NET_SOCKET_H_INCLUDED
29 #include "fs/fs.h"
31 #define NET_SOCKET_STREAM 1
32 #define NET_SOCKET_DGRAM 2
34 #define NET_SOCKET_IOCTL_SETSOCKOPT 1
35 #define NET_SOCKET_IOCTL_BIND 2
36 #define NET_SOCKET_IOCTL_LISTEN 3
37 #define NET_SOCKET_IOCTL_ACCEPT 4
39 /**
40 * Initializes the socket file system.
42 void netInitSocket(void);
44 /**
45 * Opens a new socket and writes the file handle data to socket.
47 int netOpenSocket(FsFileHandle *socket, int type);
49 #endif