MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / netconn_bind_if

Function netconn_bind_if

components/net/lwip/lwip-2.1.2/src/api/api_lib.c:350–365  ·  view source on GitHub ↗

* @ingroup netconn_common * Bind a netconn to a specific interface and port. * Binding one netconn twice might not always be checked correctly! * * @param conn the netconn to bind * @param if_idx the local interface index to bind the netconn to * @return ERR_OK if bound, any other err_t on failure */

Source from the content-addressed store, hash-verified

348 * @return ERR_OK if bound, any other err_t on failure
349 */
350err_t
351netconn_bind_if(struct netconn *conn, u8_t if_idx)
352{
353 API_MSG_VAR_DECLARE(msg);
354 err_t err;
355
356 LWIP_ERROR("netconn_bind_if: invalid conn", (conn != NULL), return ERR_ARG;);
357
358 API_MSG_VAR_ALLOC(msg);
359 API_MSG_VAR_REF(msg).conn = conn;
360 API_MSG_VAR_REF(msg).msg.bc.if_idx = if_idx;
361 err = netconn_apimsg(lwip_netconn_do_bind_if, &API_MSG_VAR_REF(msg));
362 API_MSG_VAR_FREE(msg);
363
364 return err;
365}
366
367/**
368 * @ingroup netconn_common

Callers

nothing calls this directly

Calls 1

netconn_apimsgFunction · 0.70

Tested by

no test coverage detected