OpenOCD
|
Socket abstraction layer. More...
Go to the source code of this file.
Functions | |
JAYLINK_PRIV bool | socket_bind (int sock, const struct sockaddr *address, size_t length) |
Bind an address to a socket. More... | |
JAYLINK_PRIV bool | socket_close (int sock) |
Close a socket. More... | |
JAYLINK_PRIV bool | socket_recv (int sock, void *buffer, size_t *length, int flags) |
Receive a message from a socket. More... | |
JAYLINK_PRIV bool | socket_recvfrom (int sock, void *buffer, size_t *length, int flags, struct sockaddr *address, size_t *address_length) |
Receive a message from a socket. More... | |
JAYLINK_PRIV bool | socket_send (int sock, const void *buffer, size_t *length, int flags) |
Send a message on a socket. More... | |
JAYLINK_PRIV bool | socket_sendto (int sock, const void *buffer, size_t *length, int flags, const struct sockaddr *address, size_t address_length) |
Send a message on a socket. More... | |
JAYLINK_PRIV bool | socket_set_option (int sock, int level, int option, const void *value, size_t length) |
Set an option on a socket. More... | |
Socket abstraction layer.
Definition in file socket.c.
JAYLINK_PRIV bool socket_bind | ( | int | sock, |
const struct sockaddr * | address, | ||
size_t | length | ||
) |
Bind an address to a socket.
[in] | sock | Socket descriptor. |
[in] | address | Address to be bound to the socket. |
[in] | length | Length of the structure pointed to by address in bytes. |
Definition at line 69 of file socket.c.
Referenced by discovery_tcp_scan().
JAYLINK_PRIV bool socket_close | ( | int | sock | ) |
Close a socket.
[in] | sock | Socket descriptor. |
Definition at line 44 of file socket.c.
Referenced by discovery_tcp_scan(), and transport_tcp_open().
JAYLINK_PRIV bool socket_recv | ( | int | sock, |
void * | buffer, | ||
size_t * | length, | ||
int | flags | ||
) |
Receive a message from a socket.
[in] | sock | Socket descriptor. |
[out] | buffer | Buffer to store the received message on success. Its content is undefined on failure. |
[in,out] | length | Maximum length of the message in bytes. On success, the value gets updated with the actual number of received bytes. The value is undefined on failure. |
[in] | flags | Flags to modify the function behaviour. Use bitwise OR to specify multiple flags. |
Definition at line 132 of file socket.c.
Referenced by _recv().
JAYLINK_PRIV bool socket_recvfrom | ( | int | sock, |
void * | buffer, | ||
size_t * | length, | ||
int | flags, | ||
struct sockaddr * | address, | ||
size_t * | address_length | ||
) |
Receive a message from a socket.
[in] | sock | Socket descriptor. |
[out] | buffer | Buffer to store the received message on success. Its content is undefined on failure. |
[in,out] | length | Maximum length of the message in bytes. On success, the value gets updated with the actual number of received bytes. The value is undefined on failure. |
[in] | flags | Flags to modify the function behaviour. Use bitwise OR to specify multiple flags. |
[out] | address | Structure to store the source address of the message on success. Its content is undefined on failure. Can be NULL. |
[in,out] | address_length | Length of the structure pointed to by address in bytes. On success, the value gets updated with the actual length of the structure. The value is undefined on failure. Should be NULL if address is NULL. |
Definition at line 211 of file socket.c.
Referenced by discovery_tcp_scan().
JAYLINK_PRIV bool socket_send | ( | int | sock, |
const void * | buffer, | ||
size_t * | length, | ||
int | flags | ||
) |
Send a message on a socket.
[in] | sock | Socket descriptor. |
[in] | buffer | Buffer of the message to be sent. |
[in,out] | length | Length of the message in bytes. On success, the value gets updated with the actual number of bytes sent. The value is undefined on failure. |
[in] | flags | Flags to modify the function behaviour. Use bitwise OR to specify multiple flags. |
Definition at line 100 of file socket.c.
Referenced by _send().
JAYLINK_PRIV bool socket_sendto | ( | int | sock, |
const void * | buffer, | ||
size_t * | length, | ||
int | flags, | ||
const struct sockaddr * | address, | ||
size_t | address_length | ||
) |
Send a message on a socket.
[in] | sock | Socket descriptor. |
[in] | buffer | Buffer to send message from. |
[in,out] | length | Number of bytes to send. On success, the value gets updated with the actual number of bytes sent. The value is undefined on failure. |
[in] | flags | Flags to modify the function behaviour. Use bitwise OR to specify multiple flags. |
[in] | address | Destination address of the message. |
[in] | address_length | Length of the structure pointed to by address in bytes. |
Definition at line 168 of file socket.c.
Referenced by discovery_tcp_scan().
JAYLINK_PRIV bool socket_set_option | ( | int | sock, |
int | level, | ||
int | option, | ||
const void * | value, | ||
size_t | length | ||
) |
Set an option on a socket.
[in] | sock | Socket descriptor. |
[in] | level | Level at which the option is defined. |
[in] | option | Option to set the value for. |
[in] | value | Buffer of the value to be set. |
[in] | length | Length of the value buffer in bytes. |
Definition at line 250 of file socket.c.
Referenced by discovery_tcp_scan(), and set_socket_timeouts().