Socket Family structure.
More...
#include <netfs.h>
|
| const char * | name |
| |
| uint64_t(* | init )(socket_t *sock) |
| | Initialize a socket.
|
| |
| void(* | deinit )(socket_t *sock) |
| | Deinitialize a socket.
|
| |
| uint64_t(* | bind )(socket_t *sock) |
| | Bind a socket to its address.
|
| |
| uint64_t(* | listen )(socket_t *sock, uint32_t backlog) |
| | Listen for incoming connections on a socket.
|
| |
| uint64_t(* | connect )(socket_t *sock) |
| | Connect a socket to its address.
|
| |
| uint64_t(* | accept )(socket_t *sock, socket_t *newSock, mode_t mode) |
| | Accept an incoming connection on a listening socket.
|
| |
| size_t(* | send )(socket_t *sock, const void *buffer, size_t count, size_t *offset, mode_t mode) |
| | Send data on a socket.
|
| |
| size_t(* | recv )(socket_t *sock, void *buffer, size_t count, size_t *offset, mode_t mode) |
| | Receive data on a socket.
|
| |
| wait_queue_t *(* | poll )(socket_t *sock, poll_events_t *revents) |
| | Poll a socket for events.
|
| |
| list_entry_t | listEntry |
| |
| list_t | sockets |
| |
| rwmutex_t | mutex |
| |
Socket Family structure.
Definition at line 143 of file netfs.h.
◆ name
| const char* netfs_family_t::name |
◆ init
Initialize a socket.
- Parameters
-
| sock | Pointer to the socket to initialize. |
- Returns
- On success,
0. On failure, ERR and errno is set.
Definition at line 152 of file netfs.h.
◆ deinit
| void(* netfs_family_t::deinit) (socket_t *sock) |
Deinitialize a socket.
- Parameters
-
| sock | Pointer to the socket to deinitialize. |
Definition at line 158 of file netfs.h.
◆ bind
Bind a socket to its address.
The address is stored in socket_t::address.
- Parameters
-
| sock | Pointer to the socket to bind. |
- Returns
- On success,
0. On failure, ERR and errno is set.
Definition at line 167 of file netfs.h.
◆ listen
Listen for incoming connections on a socket.
- Parameters
-
| sock | Pointer to the socket to listen on. |
| backlog | Maximum number of pending connections. |
- Returns
- On success,
0. On failure, ERR and errno is set.
Definition at line 175 of file netfs.h.
◆ connect
Connect a socket to its address.
The address is stored in socket_t::address.
- Parameters
-
| sock | Pointer to the socket to connect. |
- Returns
- On success,
0. On failure, ERR and errno is set.
Definition at line 184 of file netfs.h.
◆ accept
Accept an incoming connection on a listening socket.
- Parameters
-
| sock | Pointer to the listening socket. |
| newSock | Pointer to the socket to initialize for the new connection. |
| mode | Mode flags for the new socket. |
- Returns
- On success,
0. On failure, ERR and errno is set.
Definition at line 193 of file netfs.h.
◆ send
Send data on a socket.
- Parameters
-
| sock | Pointer to the socket to send data on. |
| buffer | Pointer to the data to send. |
| count | Number of bytes to send. |
| offset | Pointer to the position in the file, families may ignore this. |
| mode | Mode flags for sending. |
- Returns
- On success, number of bytes sent. On failure,
ERR and errno is set.
Definition at line 204 of file netfs.h.
◆ recv
Receive data on a socket.
- Parameters
-
| sock | Pointer to the socket to receive data on. |
| buffer | Pointer to the buffer to store received data. |
| count | Maximum number of bytes to receive. |
| offset | Pointer to the position in the file, families may ignore this. |
| mode | Mode flags for receiving. |
- Returns
- On success, number of bytes received. On failure,
ERR and errno is set.
Definition at line 215 of file netfs.h.
◆ poll
Poll a socket for events.
- Parameters
-
| sock | Pointer to the socket to poll. |
| revents | Pointer to store the events that occurred. |
- Returns
- On success, a pointer to the wait queue to block on. On failure,
NULL and errno is set.
Definition at line 223 of file netfs.h.
◆ listEntry
◆ sockets
| list_t netfs_family_t::sockets |
◆ mutex
The documentation for this struct was generated from the following file: