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 
36 #if defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN)
37 
48 void gnrc_icmpv6_error_dst_unr_send(uint8_t code, const gnrc_pktsnip_t *orig_pkt);
49 
61 void gnrc_icmpv6_error_pkt_too_big_send(uint32_t mtu,
62  const gnrc_pktsnip_t *orig_pkt);
63 
75 void gnrc_icmpv6_error_time_exc_send(uint8_t code,
76  const gnrc_pktsnip_t *orig_pkt);
77 
91 void gnrc_icmpv6_error_param_prob_send(uint8_t code, void *ptr,
92  const gnrc_pktsnip_t *orig_pkt);
93 #else /* defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN) */
94 /* NOPs to make the usage code more readable */
95 #define gnrc_icmpv6_error_dst_unr_send(code, orig_pkt) \
96  (void)code; (void)orig_pkt
97 #define gnrc_icmpv6_error_pkt_too_big_send(mtu, orig_pkt) \
98  (void)mtu; (void)orig_pkt
99 #define gnrc_icmpv6_error_time_exc_send(code, orig_pkt) \
100  (void)code; (void)orig_pkt
101 #define gnrc_icmpv6_error_param_prob_send(code, ptr, orig_pkt) \
102  (void)code; (void)ptr, (void)orig_pkt
103 #endif /* defined(MODULE_GNRC_ICMPV6_ERROR) || defined(DOXYGEN) */
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* NET_GNRC_ICMPV6_ERROR_H */
110 
General definitions for network packets and their helper functions.
void gnrc_icmpv6_error_pkt_too_big_send(uint32_t mtu, const gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 packet too big message for sending.
void gnrc_icmpv6_error_dst_unr_send(uint8_t code, const gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 destination unreachable message for sending.
void gnrc_icmpv6_error_time_exc_send(uint8_t code, const gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 time exceeded message for sending.
Generic interface to communicate with GNRC modules.
Definitions for GNRC&#39;s IPv6 implementation.
IPv6 header type and helper function definitions.
ICMPv6 type and function definitions.
Type to represent parts (either headers or payload) of a packet, called snips.
void gnrc_icmpv6_error_param_prob_send(uint8_t code, void *ptr, const gnrc_pktsnip_t *orig_pkt)
Sends an ICMPv6 parameter problem message for sending.