lwIP 2.1.1 Lightweight IP stack

Data Structures | Enumerations | Functions
sockets.c File Reference
`#include "lwip/opt.h"`
`#include "lwip/sockets.h"`
`#include "lwip/priv/sockets_priv.h"`
`#include "lwip/api.h"`
`#include "lwip/igmp.h"`
`#include "lwip/inet.h"`
`#include "lwip/tcp.h"`
`#include "lwip/raw.h"`
`#include "lwip/udp.h"`
`#include "lwip/memp.h"`
`#include "lwip/pbuf.h"`
`#include "lwip/netif.h"`
`#include "lwip/priv/tcpip_priv.h"`
`#include "lwip/mld6.h"`
`#include <string.h>`
`#include "path/to/my/lwip_hooks.h"`

## Data Structures
union | sockaddr_aligned

## Enumerations
enum | lwip_pollscan_opts { LWIP_POLLSCAN_CLEAR = 1, LWIP_POLLSCAN_INC_WAIT = 2, LWIP_POLLSCAN_DEC_WAIT = 4 }

## Functions
void | lwip_socket_thread_init (void)
void | lwip_socket_thread_cleanup (void)
int | lwip_listen (int s, int backlog)
int | lwip_shutdown (int s, int how)
int | lwip_fcntl (int s, int cmd, int val)

## Detailed Description

Sockets BSD-Like API module

## Enumeration Type Documentation

## ◆ lwip_pollscan_opts

enum lwip_pollscan_opts

Options for the lwip_pollscan function.

Enumerator
LWIP_POLLSCAN_CLEAR | Clear revents in each struct pollfd.
LWIP_POLLSCAN_INC_WAIT | Increment select_waiting in each struct lwip_sock.
LWIP_POLLSCAN_DEC_WAIT | Decrement select_waiting in each struct lwip_sock.

## Function Documentation

## ◆ lwip_fcntl()

int lwip_fcntl | ( | int | s,
|  | int | cmd,
|  | int | val
| ) |  |

A minimal implementation of fcntl. Currently only the commands F_GETFL and F_SETFL are implemented. The flag O_NONBLOCK and access modes are supported for F_GETFL, only the flag O_NONBLOCK is implemented for F_SETFL.

## ◆ lwip_listen()

int lwip_listen | ( | int | s,
|  | int | backlog
| ) |  |

Set a socket into listen mode. The socket may not have been used for another connection previously.

Parameters

  s | the socket to set to listening mode
  backlog | (ATTENTION: needs TCP_LISTEN_BACKLOG=1)

Returns
  0 on success, non-zero on failure

## ◆ lwip_shutdown()

int lwip_shutdown | ( | int | s,
|  | int | how
| ) |  |

Close one end of a full-duplex connection.

## ◆ lwip_socket_thread_cleanup()

void lwip_socket_thread_cleanup | ( | void |  | ) |

LWIP_NETCONN_SEM_PER_THREAD==1: destroy thread-local semaphore

## ◆ lwip_socket_thread_init()

void lwip_socket_thread_init | ( | void |  | ) |

LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore