|
ApertureOS
|
Data Structures | |
| struct | SocketDesc |
| The description of the socket. More... | |
| struct | SocketConnectionDesc |
| The description of the socket connection. More... | |
Typedefs | |
| typedef uint32_t(* | Sock_ReadAsync) (uint8_t *buffer, uint32_t size) |
| A pointer to a function that asynchronously performs a Socket read. More... | |
| typedef uint32_t(* | Sock_SeekAsync) (uint64_t offset, int whence) |
| A pointer to a function that asynchronously performs a Socket seek. More... | |
| typedef uint32_t(* | Sock_WriteAsync) (uint8_t *src_buf, uint32_t size) |
| A pointer to a function that asynchronously performs a Socket write. More... | |
Enumerations | |
| enum | SOCK_ERROR { SOCK_ERROR_NONE = 0, SOCK_ERROR_UNKNOWN = 1 << 0, SOCK_ERROR_NO_FREE_CONNECTIONS = 1 << 1, SOCK_ERROR_NO_PERMS = 1 << 2, SOCK_ERROR_FAILED_BUSY = 1 << 3, SOCK_ERROR_EXISTS = 1 << 4, SOCK_ERROR_NOT_EXIST = 1 << 5 } |
| Socket errors. More... | |
| enum | SOCK_FEATURES { SOCK_FEAT_NONE = 0, SOCK_FEAT_WRITABLE = 1, SOCK_FEAT_READABLE = 2, SOCK_FEAT_SEEKABLE = 4, SOCK_FEAT_NOTIFICATION = 8, SOCK_FEAT_SUPERVISOR = 32 } |
| Socket features. More... | |
| enum | SOCK_NOTIFICATIONS { SOCK_NOTIFICATIONS_NONE = 0, SOCK_NOTIFICATION_WRITE = 1<<0, SOCK_NOTIFICATION_READ = 1<<1, SOCK_NOTIFICATION_SEEK = 1<<2, SOCK_NOTIFICATION_CONNECT = 1<<3, SOCK_NOTIFICATION_DISCONNECT = 1<<4, SOCK_NOTIFICATION_COMPLETE = 1 << 31 } |
| Socket notifications. More... | |
Functions | |
| SOCK_ERROR | Socket_Create (const char *name, SocketDesc *desc) |
| Create a new Socket and register it to the kernel. More... | |
| SOCK_ERROR | Socket_Connect (const char *name, SocketConnectionDesc *desc, UID *id) |
| Attempt to connect to a socket. More... | |
| SOCK_ERROR | Socket_Disconnect (UID id) |
| Attempt to disconnect from the socket. More... | |
| SOCK_ERROR | Socket_ReadAsync (UID id, uint8_t *buffer, uint32_t size) |
| Request an asynchronous read from the socket. More... | |
| SOCK_ERROR | Socket_WriteAsync (UID id, uint8_t *buffer, uint32_t size) |
| Request an asynchronous write to the socket. More... | |
| SOCK_ERROR | Socket_SeekAsync (UID id, uint64_t offset, int whence) |
| Request an asynchronous seek of the socket. More... | |
| typedef uint32_t(* Sock_ReadAsync) (uint8_t *buffer, uint32_t size) |
A pointer to a function that asynchronously performs a Socket read.
| typedef uint32_t(* Sock_SeekAsync) (uint64_t offset, int whence) |
A pointer to a function that asynchronously performs a Socket seek.
| typedef uint32_t(* Sock_WriteAsync) (uint8_t *src_buf, uint32_t size) |
A pointer to a function that asynchronously performs a Socket write.
| enum SOCK_ERROR |
Socket errors.
| enum SOCK_FEATURES |
Socket features.
| enum SOCK_NOTIFICATIONS |
Socket notifications.
| SOCK_ERROR Socket_Connect | ( | const char * | name, |
| SocketConnectionDesc * | desc, | ||
| UID * | id | ||
| ) |
Attempt to connect to a socket.
| name | The name of the socket to connect to |
| desc | The description of the requested connection |
| id | The UID identifying the connection |
| SOCK_ERROR Socket_Create | ( | const char * | name, |
| SocketDesc * | desc | ||
| ) |
Create a new Socket and register it to the kernel.
| name | The name of the socket |
| desc | The description of the socket |
| SOCK_ERROR Socket_Disconnect | ( | UID | id | ) |
Attempt to disconnect from the socket.
Note: Disconnection may fail if the socket is busy
| id | The UID identifying the connection |
| SOCK_ERROR Socket_ReadAsync | ( | UID | id, |
| uint8_t * | buffer, | ||
| uint32_t | size | ||
| ) |
Request an asynchronous read from the socket.
The socket is required to notify through the message pump with the SOCK_NOTIFICATION_COMPLETE flag set on completion of this request. This operation requires the socket to support reading and the connection to have requested permission to do so
| id | The UID identifying the connection |
| buffer | The buffer to write the read data to |
| size | The size in bytes of data to read |
| SOCK_ERROR Socket_SeekAsync | ( | UID | id, |
| uint64_t | offset, | ||
| int | whence | ||
| ) |
Request an asynchronous seek of the socket.
The socket is required to notify through the message pump with the SOCK_NOTIFICATION_COMPLETE flag set on completion of this request. This operation requires the socket to support seeking and the connection to have requested permission to do so
| id | The UID identifying the connection |
| offset | The offset relative to whence to seek to |
| whence | The location relative to which to seek |
| SOCK_ERROR Socket_WriteAsync | ( | UID | id, |
| uint8_t * | buffer, | ||
| uint32_t | size | ||
| ) |
Request an asynchronous write to the socket.
The socket is required to notify through the message pump with the SOCK_NOTIFICATION_COMPLETE flag set on completion of this request. This operation requires the socket to support writing and the connection to have requested permission to do so
| id | The UID identifying the connection |
| buffer | The buffer to read the data to write from |
| size | The size in bytes of data to write |
1.8.9.1