Loading...
Searching...
No Matches
Netif Support
Libcoap Internal API

Internal API for Netif Support. More...

Collaboration diagram for Netif Support:

## Functions

int | coap_netif_available (coap_session_t *session)
| Function interface to check whether netif for session is still available.
int | coap_netif_available_ep (coap_endpoint_t *endpoint)
| Function interface to check whether netif for endpoint is still available.
int | coap_netif_dgrm_listen (coap_endpoint_t *endpoint, const coap_address_t *listen_addr)
| Layer function interface for Netif datagram listem (udp).
int | coap_netif_dgrm_connect (coap_session_t *session, const coap_address_t *local_if, const coap_address_t *server, int default_port)
| Layer function interface for Netif datagram connect (udp).
ssize_t | coap_netif_dgrm_read (coap_session_t *session, coap_packet_t *packet)
| Function interface for layer data datagram receiving for sessions.
ssize_t | coap_netif_dgrm_read_ep (coap_endpoint_t *endpoint, coap_packet_t *packet)
| Function interface for layer data datagram receiving for endpoints.
ssize_t | coap_netif_dgrm_write (coap_session_t *session, const uint8_t *data, size_t datalen)
| Function interface for netif datagram data transmission.
int | coap_netif_strm_listen (coap_endpoint_t *endpoint, const coap_address_t *listen_addr)
| Layer function interface for Netif stream listem (tcp).
int | coap_netif_strm_accept (coap_endpoint_t *endpoint, coap_session_t *session, void *extra)
| Layer function interface for Netif stream accept.
int | coap_netif_strm_connect1 (coap_session_t *session, const coap_address_t *local_if, const coap_address_t *server, int default_port)
| Layer function interface for Netif stream connect (tcp).
int | coap_netif_strm_connect2 (coap_session_t *session)
| Layer function interface for Netif stream connect (tcp).
ssize_t | coap_netif_strm_read (coap_session_t *session, uint8_t *data, size_t datalen)
| Function interface for layer data stream receiving.
ssize_t | coap_netif_strm_write (coap_session_t *session, const uint8_t *data, size_t datalen)
| Function interface for netif stream data transmission.
void | coap_netif_close (coap_session_t *session)
| Layer function interface for Netif close for a session.
void | coap_netif_close_ep (coap_endpoint_t *endpoint)
| Layer function interface for Netif close for a endpoint.

## Detailed Description

Internal API for Netif Support.

This provides a layer that sits between CoAP/DTLS and Sockets.

## Function Documentation

## coap_netif_available()

int coap_netif_available | ( | coap_session_t * | session | ) |

Function interface to check whether netif for session is still available.

Parameters

  session | Session to check against.

Returns
  1 If netif is available, else 0.

Definition at line 25 of file coap_netif.c.

Here is the caller graph for this function:

## coap_netif_available_ep()

int coap_netif_available_ep | ( | coap_endpoint_t * | endpoint | ) |

Function interface to check whether netif for endpoint is still available.

Parameters

  endpoint | Endpoint to check against.

Returns
  1 If netif is available, else 0.

## coap_netif_close()

void coap_netif_close | ( | coap_session_t * | session | ) |

Layer function interface for Netif close for a session.

Parameters

  session | Session to do the netif close on.

Definition at line 260 of file coap_netif.c.

Here is the call graph for this function:

## coap_netif_close_ep()

void coap_netif_close_ep | ( | coap_endpoint_t * | endpoint | ) |

Layer function interface for Netif close for a endpoint.

Parameters

  endpoint | Endpoint to do the netif close on.

## coap_netif_dgrm_connect()

int coap_netif_dgrm_connect | ( | coap_session_t * | session,
|  | const coap_address_t * | local_if,
|  | const coap_address_t * | server,
|  | int | default_port )

Layer function interface for Netif datagram connect (udp).

Parameters

  session | Session to do the connect on.
  local_if | The local interface to bind to or NULL.
  server | The server to connect to.
  default_port | The Port to connect to if not defined.

Returns
  `1` OK, 0 on failure.

## coap_netif_dgrm_listen()

int coap_netif_dgrm_listen | ( | coap_endpoint_t * | endpoint,
|  | const coap_address_t * | listen_addr )

Layer function interface for Netif datagram listem (udp).

Parameters

  endpoint | Endpoint to do the listen on.
  listen_addr | The local address to bind.

Returns
  `1` OK, 0 on failure.

## coap_netif_dgrm_read()

ssize_t coap_netif_dgrm_read | ( | coap_session_t * | session,
|  | coap_packet_t * | packet )

Function interface for layer data datagram receiving for sessions.

This function returns the number of bytes that have been read, or -1 on error.

Parameters

  session | Session to receive data on.
  packet | Where to put the received information

Returns
  >=0 Number of bytes read. -1 Error of some sort (see errno). -2 ICMP error response

Definition at line 72 of file coap_netif.c.

Here is the call graph for this function:
Here is the caller graph for this function:

## coap_netif_dgrm_read_ep()

ssize_t coap_netif_dgrm_read_ep | ( | coap_endpoint_t * | endpoint,
|  | coap_packet_t * | packet )

Function interface for layer data datagram receiving for endpoints.

This function returns the number of bytes that have been read, or -1 on error.

Parameters

  endpoint | Endpoint to receive data on.
  packet | Where to put the received information

Returns
  >=0 Number of bytes read. -1 Error of some sort (see errno). -2 ICMP error response

## coap_netif_dgrm_write()

ssize_t coap_netif_dgrm_write | ( | coap_session_t * | session,
|  | const uint8_t * | data,
|  | size_t | datalen )

Function interface for netif datagram data transmission.

This function returns the number of bytes that have been transmitted, or a value less than zero on error.

Parameters

  session | Session to send data on.
  data | The data to send.
  datalen | The actual length of `data`.

Returns
  The number of bytes written on success, or a value less than zero on error.

Definition at line 125 of file coap_netif.c.

Here is the call graph for this function:

## coap_netif_strm_accept()

int coap_netif_strm_accept | ( | coap_endpoint_t * | endpoint,
|  | coap_session_t * | session,
|  | void * | extra )

Layer function interface for Netif stream accept.

Parameters

  endpoint | Endpoint to to do the accept on.
  session | Session to to do the accept update on.
  extra | Available for use by any underlying network stack.

Returns
  `1` OK, 0 on failure.

## coap_netif_strm_connect1()

int coap_netif_strm_connect1 | ( | coap_session_t * | session,
|  | const coap_address_t * | local_if,
|  | const coap_address_t * | server,
|  | int | default_port )

Layer function interface for Netif stream connect (tcp).

Step 1 - initiate the connection.

Parameters

  session | Session to do the connect on.
  local_if | The local interface to bind to or NULL.
  server | The server to connect to.
  default_port | The Port to connect to if not defined.

Returns
  `1` OK, 0 on failure.

## coap_netif_strm_connect2()

int coap_netif_strm_connect2 | ( | coap_session_t * | session | ) |

Layer function interface for Netif stream connect (tcp).

Step 2 - complete the connection.

Parameters

  session | Session to do the connect complete on.

Returns
  `1` OK, 0 on failure.

## coap_netif_strm_listen()

int coap_netif_strm_listen | ( | coap_endpoint_t * | endpoint,
|  | const coap_address_t * | listen_addr )

Layer function interface for Netif stream listem (tcp).

Parameters

  endpoint | Endpoint to do the listen on.
  listen_addr | The local address to bind.

Returns
  `1` OK, 0 on failure.

## coap_netif_strm_read()

ssize_t coap_netif_strm_read | ( | coap_session_t * | session,
|  | uint8_t * | data,
|  | size_t | datalen )

Function interface for layer data stream receiving.

This function returns the number of bytes that have been read, or -1 on error.

Parameters

  session | Session to receive data on.
  data | The data to receive.
  datalen | The maximum length of `data`.

Returns
  >=0 Number of bytes read. -1 Error of some sort (see errno).

Definition at line 215 of file coap_netif.c.

Here is the call graph for this function:

## coap_netif_strm_write()

ssize_t coap_netif_strm_write | ( | coap_session_t * | session,
|  | const uint8_t * | data,
|  | size_t | datalen )

Function interface for netif stream data transmission.

This function returns the number of bytes that have been transmitted, or a value less than zero on error. The number of bytes written may be less than datalen because of congestion control.

Parameters

  session | Session to send data on.
  data | The data to send.
  datalen | The actual length of `data`.

Returns
  The number of bytes written on success, or a value less than zero on error.

Definition at line 236 of file coap_netif.c.

Here is the call graph for this function: