sock/ip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Alexander Aring <aar@pengutronix.de>
3  * Freie Universit├Ąt Berlin
4  * HAW Hamburg
5  * Kaspar Schleiser <kaspar@schleiser.de>
6  *
7  * This file is subject to the terms and conditions of the GNU Lesser
8  * General Public License v2.1. See the file LICENSE in the top level
9  * directory for more details.
10  */
11 
268 #ifndef NET_SOCK_IP_H
269 #define NET_SOCK_IP_H
270 
271 #include <assert.h>
272 #include <stdint.h>
273 #include <stdlib.h>
274 #include <sys/types.h>
275 
276 #include "net/sock.h"
277 
278 #ifdef __cplusplus
279 extern "C" {
280 #endif
281 
288 typedef struct sock_ip sock_ip_t;
289 
332 int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
333  const sock_ip_ep_t *remote, uint8_t proto, uint16_t flags);
334 
342 void sock_ip_close(sock_ip_t *sock);
343 
363 
383 
413 ssize_t sock_ip_recv(sock_ip_t *sock, void *data, size_t max_len,
414  uint32_t timeout, sock_ip_ep_t *remote);
415 
448 ssize_t sock_ip_send(sock_ip_t *sock, const void *data, size_t len,
449  uint8_t proto, const sock_ip_ep_t *remote);
450 
451 #include "sock_types.h"
452 
453 #ifdef __cplusplus
454 }
455 #endif
456 
457 #endif /* NET_SOCK_IP_H */
458 
void sock_ip_close(sock_ip_t *sock)
Closes a raw IPv4/IPv6 sock object.
Raw IP sock type.
Definition: sock_types.h:60
int sock_ip_get_remote(sock_ip_t *sock, sock_ip_ep_t *ep)
Gets the remote end point of a UDP sock object.
int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local, const sock_ip_ep_t *remote, uint8_t proto, uint16_t flags)
Creates a new raw IPv4/IPv6 sock object.
POSIX.1-2008 compliant version of the assert macro.
Abstract IP end point and end point for a raw IP sock object.
Definition: sock.h:158
GNRC-specific types and function definitions.
Common sock API definitions.
uint16_t flags
option flags
Definition: sock_types.h:64
sock_ip_ep_t remote
remote end-point
Definition: sock_types.h:63
ssize_t sock_ip_send(sock_ip_t *sock, const void *data, size_t len, uint8_t proto, const sock_ip_ep_t *remote)
Sends a message over IPv4/IPv6 to remote end point.
ssize_t sock_ip_recv(sock_ip_t *sock, void *data, size_t max_len, uint32_t timeout, sock_ip_ep_t *remote)
Receives a message over IPv4/IPv6 from remote end point.
stdlib.h wrapper for MSP430
sock_ip_ep_t local
local end-point
Definition: sock_types.h:62
int sock_ip_get_local(sock_ip_t *sock, sock_ip_ep_t *ep)
Gets the local end point of a raw IPv4/IPv6 sock object.