|
libcoap 4.3.5-develop-13abce9
|
Internal API for handling CoAP Datagrams (UDP) (RFC7252) More...
Collaboration diagram for Datagram (UDP) Support:Functions | |
| int | coap_socket_connect_udp (coap_socket_t *sock, const coap_address_t *local_if, const coap_address_t *server, int default_port, coap_address_t *local_addr, coap_address_t *remote_addr) |
| Create a new UDP socket and 'connect' it to the address tuple. | |
| int | coap_socket_bind_udp (coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr) |
| Create a new UDP socket and then listen for new incoming UDP sessions to the specified IP address and port. | |
| ssize_t | coap_socket_send (coap_socket_t *sock, coap_session_t *session, const uint8_t *data, size_t datalen) |
| Function interface for data transmission. | |
| ssize_t | coap_socket_recv (coap_socket_t *sock, coap_packet_t *packet) |
| Function interface for reading data. | |
| void | coap_socket_dgrm_close (coap_socket_t *sock) |
| Function interface to close off a datagram socket. | |
Internal API for handling CoAP Datagrams (UDP) (RFC7252)
| int coap_socket_bind_udp | ( | coap_socket_t * | sock, |
| const coap_address_t * | listen_addr, | ||
| coap_address_t * | bound_addr | ||
| ) |
Create a new UDP socket and then listen for new incoming UDP sessions to the specified IP address and port.
Internal function.
| sock | Where socket information is to be filled in. |
| listen_addr | The address to be listening for new incoming sessions. |
| bound_addr | Filled in with the address that the UDP layer. is listening on for new incoming UDP sessions. |
1 if succesful, 0 if failure of some sort | int coap_socket_connect_udp | ( | coap_socket_t * | sock, |
| const coap_address_t * | local_if, | ||
| const coap_address_t * | server, | ||
| int | default_port, | ||
| coap_address_t * | local_addr, | ||
| coap_address_t * | remote_addr | ||
| ) |
Create a new UDP socket and 'connect' it to the address tuple.
Internal function.
| sock | Where socket information is to be filled in. |
| local_if | The local address to use or NULL. |
| server | The address to connect to. |
| default_port | The port to use if not set in server. |
| local_addr | Filled in after connection initiation with the local address. |
| remote_addr | Filled in after connection initiation with the remote address. |
1 if succesful, 0 if failure of some sort. | void coap_socket_dgrm_close | ( | coap_socket_t * | sock | ) |
Function interface to close off a datagram socket.
Internal function.
| sock | Socket to close. |
Definition at line 891 of file coap_dgrm_posix.c.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t coap_socket_recv | ( | coap_socket_t * | sock, |
| coap_packet_t * | packet | ||
| ) |
Function interface for reading data.
This function returns the number of bytes that have been read, or a value less than zero on error. In case of an error, *packet is set to NULL.
Internal function.
| sock | Socket to read data from. |
| packet | Received packet metadata and payload. src and dst should be preset. |
Definition at line 671 of file coap_dgrm_posix.c.
Here is the call graph for this function:
Here is the caller graph for this function:| ssize_t coap_socket_send | ( | coap_socket_t * | sock, |
| coap_session_t * | session, | ||
| const uint8_t * | data, | ||
| size_t | datalen | ||
| ) |
Function interface for data transmission.
This function returns the number of bytes that have been transmitted, or a value less than zero on error.
Internal function.
| sock | Socket to send data over. |
| session | Addressing information for unconnected sockets, or NULL |
| data | The data to send. |
| datalen | The actual length of data. |
Definition at line 478 of file coap_dgrm_posix.c.
Here is the call graph for this function:
Here is the caller graph for this function: