error.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 
20 #ifndef NET_GNRC_ICMPV6_ERROR_H
21 #define NET_GNRC_ICMPV6_ERROR_H
22 
23 #include <errno.h>
24 #include <stdint.h>
25 
26 #include "net/icmpv6.h"
27 #include "net/ipv6/hdr.h"
28 #include "net/gnrc/ipv6.h"
29 #include "net/gnrc/netapi.h"
30 #include "net/gnrc/pkt.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
46 
57 
68 
79 gnrc_pktsnip_t *gnrc_icmpv6_error_param_prob_build(uint8_t code, void *ptr,
80  gnrc_pktsnip_t *orig_pkt);
81 
88 static inline void gnrc_icmpv6_error_dst_unr_send(uint8_t code, gnrc_pktsnip_t *orig_pkt)
89 {
90  gnrc_pktsnip_t *pkt = gnrc_icmpv6_error_dst_unr_build(code, orig_pkt);
91 
92  if (pkt != NULL) {
94  }
95 #ifdef MODULE_GNRC_PKTBUF
97 #else
98  (void)orig_pkt;
99 #endif
100 }
101 
108 static inline void gnrc_icmpv6_error_pkt_too_big_send(uint32_t mtu, gnrc_pktsnip_t *orig_pkt)
109 {
111 
112  if (pkt != NULL) {
114  }
115 #ifdef MODULE_GNRC_PKTBUF
117 #else
118  (void)orig_pkt;
119 #endif
120 }
121 
128 static inline void gnrc_icmpv6_error_time_exc_send(uint8_t code, gnrc_pktsnip_t *orig_pkt)
129 {
130  gnrc_pktsnip_t *pkt = gnrc_icmpv6_error_time_exc_build(code, orig_pkt);
131 
132  if (pkt != NULL) {
134  }
135 #ifdef MODULE_GNRC_PKTBUF
137 #else
138  (void)orig_pkt;
139 #endif
140 }
141 
149 static inline void gnrc_icmpv6_error_param_prob_send(uint8_t code, void *ptr,
150  gnrc_pktsnip_t *orig_pkt)
151 {
152  gnrc_pktsnip_t *pkt = gnrc_icmpv6_error_param_prob_build(code, ptr, orig_pkt);
153 
154  if (pkt != NULL) {
156  }
157 #ifdef MODULE_GNRC_PKTBUF
159 #else
160  (void)orig_pkt;
161 #endif
162 }
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif /* NET_GNRC_ICMPV6_ERROR_H */
169 
#define EHOSTUNREACH
Host is unreachable.
Definition: errno.h:92
General definitions for network packets and their helper functions.
#define EMSGSIZE
Message too large.
Definition: errno.h:104
gnrc_pktsnip_t * gnrc_icmpv6_error_pkt_too_big_build(uint32_t mtu, gnrc_pktsnip_t *orig_pkt)
Builds an ICMPv6 packet too big message for sending.
Generic interface to communicate with GNRC modules.
IPv6 header type and helper function definitions.
#define EINVAL
Invalid argument.
Definition: errno.h:97
Definitions for GNRC&#39;s IPv6 implementation.
gnrc_pktsnip_t * gnrc_icmpv6_error_time_exc_build(uint8_t code, gnrc_pktsnip_t *orig_pkt)
Builds an ICMPv6 time exceeded message for sending.
void gnrc_pktbuf_release_error(gnrc_pktsnip_t *pkt, uint32_t err)
Decreases gnrc_pktsnip_t::users of pkt atomically and removes it if it reaches 0 and reports a possib...
int gnrc_netapi_send(kernel_pid_t pid, gnrc_pktsnip_t *pkt)
Shortcut function for sending GNRC_NETAPI_MSG_TYPE_SND messages.
static void gnrc_icmpv6_error_time_exc_send(uint8_t code, gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 time exceeded message for sending.
Definition: error.h:128
static void gnrc_icmpv6_error_param_prob_send(uint8_t code, void *ptr, gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 parameter problem message for sending.
Definition: error.h:149
ICMPv6 type and function definitions.
gnrc_pktsnip_t * gnrc_icmpv6_error_param_prob_build(uint8_t code, void *ptr, gnrc_pktsnip_t *orig_pkt)
Builds an ICMPv6 parameter problem message for sending.
gnrc_pktsnip_t * gnrc_icmpv6_error_dst_unr_build(uint8_t code, gnrc_pktsnip_t *orig_pkt)
Builds an ICMPv6 destination unreachable message for sending.
Type to represent parts (either headers or payload) of a packet, called snips.
static void gnrc_icmpv6_error_pkt_too_big_send(uint32_t mtu, gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 packet too big message for sending.
Definition: error.h:108
kernel_pid_t gnrc_ipv6_pid
The PID to the IPv6 thread.
static void gnrc_icmpv6_error_dst_unr_send(uint8_t code, gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 destination unreachable message for sending.
Definition: error.h:88
#define ETIMEDOUT
Connection timed out.
Definition: errno.h:147