Loading...
Searching...
No Matches
sock_internal.h
1/*
2 * Copyright (C) 2016 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
22#ifndef LWIP_SOCK_INTERNAL_H
23#define LWIP_SOCK_INTERNAL_H
24
25#include <stdbool.h>
26#include <stdint.h>
27
28#include "net/af.h"
29#include "net/sock.h"
30
31#include "lwip/ip_addr.h"
32#include "lwip/api.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
42#ifndef LWIP_SOCK_TCP_ACCEPT_TIMEOUT
43#define LWIP_SOCK_TCP_ACCEPT_TIMEOUT (0)
44#endif
45
51int lwip_sock_create(struct netconn **conn, const struct _sock_tl_ep *local,
52 const struct _sock_tl_ep *remote, int proto,
53 uint16_t flags, int type);
54uint16_t lwip_sock_bind_addr_to_netif(const ip_addr_t *bind_addr);
55int lwip_sock_get_addr(struct netconn *conn, struct _sock_tl_ep *ep, u8_t local);
56#if defined(MODULE_LWIP_SOCK_UDP) || defined(MODULE_LWIP_SOCK_IP)
57int lwip_sock_recv(struct netconn *conn, uint32_t timeout, struct netbuf **buf);
58#endif
59ssize_t lwip_sock_sendv(struct netconn *conn, const iolist_t *snips,
60 int proto, const struct _sock_tl_ep *remote, int type);
61static inline ssize_t lwip_sock_send(struct netconn *conn,
62 const void *data, size_t len,
63 int proto, const struct _sock_tl_ep *remote, int type)
64{
65 iolist_t snip = {
66 .iol_base = (void *)data,
67 .iol_len = len,
68 };
69
70 return lwip_sock_sendv(conn, &snip, proto, remote, type);
71}
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* LWIP_SOCK_INTERNAL_H */
Global UNIX address family definitions.
Common sock API definitions.
Common IP-based transport layer end point.
Definition sock.h:215
iolist structure definition
Definition iolist.h:39
void * iol_base
ptr to this list entries data
Definition iolist.h:41