! Initialize a single dpi socket * \Return * \li 1 on success * \li -1 on failure */
| 660 | * \li -1 on failure |
| 661 | */ |
| 662 | int init_dpi_socket(struct dp *dpi_attr) |
| 663 | { |
| 664 | int s_fd, port, ret = -1; |
| 665 | |
| 666 | if ((s_fd = bind_socket_fd(DPID_BASE_PORT, &port)) != -1) { |
| 667 | dpi_attr->sock_fd = s_fd; |
| 668 | dpi_attr->port = port; |
| 669 | FD_SET(s_fd, &sock_set); |
| 670 | ret = 1; |
| 671 | } |
| 672 | |
| 673 | return ret; |
| 674 | } |
| 675 | |
| 676 | /*! Setup sockets for the plugins and add them to |
| 677 | * the set of sockets (sock_set) watched by select. |
no test coverage detected