conn/ip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
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 
21 #ifndef NET_CONN_IP_H
22 #define NET_CONN_IP_H
23 
24 #include <stdint.h>
25 #include <stdlib.h>
26 
27 #ifdef MODULE_GNRC_CONN_IP
28 #include "net/gnrc/conn.h"
29 #endif
30 
31 #ifdef MODULE_LWIP_CONN_IP
32 #include "lwip/conn.h"
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
42 struct conn_ip;
43 
47 typedef struct conn_ip conn_ip_t;
48 
63 int conn_ip_create(conn_ip_t *conn, const void *addr, size_t addr_len, int family, int proto);
64 
70 void conn_ip_close(conn_ip_t *conn);
71 
84 int conn_ip_getlocaladdr(conn_ip_t *conn, void *addr);
85 
104 int conn_ip_recvfrom(conn_ip_t *conn, void *data, size_t max_len, void *addr, size_t *addr_len);
105 
125 int conn_ip_sendto(const void *data, size_t len, const void *src, size_t src_len,
126  void *dst, size_t dst_len, int family, int proto);
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* NET_CONN_IP_H */
133 
void conn_ip_close(conn_ip_t *conn)
Closes a raw IPv4/IPv6 connection.
int conn_ip_sendto(const void *data, size_t len, const void *src, size_t src_len, void *dst, size_t dst_len, int family, int proto)
Sends a message over IPv4/IPv6.
int conn_ip_getlocaladdr(conn_ip_t *conn, void *addr)
Gets the local address of a raw IPv4/IPv6 connection.
int conn_ip_create(conn_ip_t *conn, const void *addr, size_t addr_len, int family, int proto)
Creates a new raw IPv4/IPv6 connection object.
Raw connection type.
Definition: gnrc/conn.h:50
int conn_ip_recvfrom(conn_ip_t *conn, void *data, size_t max_len, void *addr, size_t *addr_len)
Receives a message over IPv4/IPv6.
GNRC-specific types and function definitions.
stdlib.h wrapper for MSP430