* @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 */
| 348 | * @return ERR_OK if bound, any other err_t on failure |
| 349 | */ |
| 350 | err_t |
| 351 | netconn_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 |
nothing calls this directly
no test coverage detected