From 661b03b88aad1ceb1b84ed9897c1564342bb9ee5 Mon Sep 17 00:00:00 2001 From: authmillenon <authmill@datalove.me> Date: Thu, 8 Aug 2013 13:22:24 +0200 Subject: [PATCH] Move error codes to public includes --- sys/net/sixlowpan/border.c | 2 +- sys/net/sixlowpan/bordermultiplex.c | 2 +- sys/net/sixlowpan/error.h | 16 ---------------- sys/net/sixlowpan/icmp.c | 4 +++- sys/net/sixlowpan/include/ipv6.h | 1 - sys/net/sixlowpan/include/sixlowpan.h | 1 - sys/net/sixlowpan/include/sixlowpan/error.h | 15 +++++++++++++++ 7 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 sys/net/sixlowpan/error.h diff --git a/sys/net/sixlowpan/border.c b/sys/net/sixlowpan/border.c index 67ecd75cda..72ab711055 100644 --- a/sys/net/sixlowpan/border.c +++ b/sys/net/sixlowpan/border.c @@ -25,6 +25,7 @@ #include <posix_io.h> #include <board_uart0.h> +#include "sixlowpan/error.h" #include "bordermultiplex.h" #include "flowcontrol.h" @@ -32,7 +33,6 @@ #include "ip.h" #include "icmp.h" #include "serialnumber.h" -#include "error.h" #include "sys/net/ieee802154/ieee802154_frame.h" #include "sys/net/net_help/net_help.h" diff --git a/sys/net/sixlowpan/bordermultiplex.c b/sys/net/sixlowpan/bordermultiplex.c index 2dcaa1f5fe..02ca89b568 100644 --- a/sys/net/sixlowpan/bordermultiplex.c +++ b/sys/net/sixlowpan/bordermultiplex.c @@ -20,12 +20,12 @@ #include <string.h> #include <board_uart0.h> +#include "sixlowpan/error.h" #include "flowcontrol.h" #include "lowpan.h" #include "icmp.h" #include "border.h" -#include "error.h" #include "bordermultiplex.h" diff --git a/sys/net/sixlowpan/error.h b/sys/net/sixlowpan/error.h deleted file mode 100644 index 9159cba85a..0000000000 --- a/sys/net/sixlowpan/error.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _SIXLOWPAN_ERROR_H -#define _SIXLOWPAN_ERROR_H - -#define SUCCESS 0 -#define SIXLOWERROR_ARRAYFULL 132 // array is full -#define SIXLOWERROR_NULLPTR 133 // null pointer error -#define SIXLOWERROR_VALUE 134 // illegal value -#define SIXLOWERROR_ADDRESS 135 // illegal address -#define SIXLOWERROR_DISPATCH 136 // lowpan dispatch unknown -#define SIXLOWERROR_FSTFRAG 137 // first lowpan fragment not received -#define SIXLOWERROR_INVFRAG 138 // invalid fragment received -#define SIXLOWERROR_SCI 139 // source context not found -#define SIXLOWERROR_DCI 140 // destination context not found -#define SIXLOWERROR_CSUM 141 // wrong checksum - -#endif /* _SIXLOWPAN_ERROR_H*/ diff --git a/sys/net/sixlowpan/icmp.c b/sys/net/sixlowpan/icmp.c index 41447db2a5..ad72164dc1 100644 --- a/sys/net/sixlowpan/icmp.c +++ b/sys/net/sixlowpan/icmp.c @@ -20,11 +20,13 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> + +#include "sixlowpan/error.h" + #include "ip.h" #include "icmp.h" #include "mac.h" #include "lowpan.h" -#include "error.h" #include "serialnumber.h" #include "sys/net/net_help/net_help.h" #include "vtimer.h" diff --git a/sys/net/sixlowpan/include/ipv6.h b/sys/net/sixlowpan/include/ipv6.h index 0dad0d3806..1cb0dd7661 100644 --- a/sys/net/sixlowpan/include/ipv6.h +++ b/sys/net/sixlowpan/include/ipv6.h @@ -23,7 +23,6 @@ #include "sixlowpan/icmp.h" #include "sixlowpan/ndp.h" -#include "../error.h" /* TODO: remove if not needed anymore */ #include "../ip.h" /* TODO: remove if not needed anymore */ #include "../icmp.h" /* TODO: remove if not needed anymore */ diff --git a/sys/net/sixlowpan/include/sixlowpan.h b/sys/net/sixlowpan/include/sixlowpan.h index 03fa4faa55..908e9ec56a 100644 --- a/sys/net/sixlowpan/include/sixlowpan.h +++ b/sys/net/sixlowpan/include/sixlowpan.h @@ -24,7 +24,6 @@ #include "sixlowpan/lowpan.h" #include "sixlowpan/mac.h" -#include "../error.h" /* TODO: remove if not needed anymore */ #include "../border.h" /* TODO: remove if not needed anymore */ #include "../lowpan.h" /* TODO: remove if not needed anymore */ #include "../mac.h" /* TODO: remove if not needed anymore */ diff --git a/sys/net/sixlowpan/include/sixlowpan/error.h b/sys/net/sixlowpan/include/sixlowpan/error.h index ddecf54051..f3e4390609 100644 --- a/sys/net/sixlowpan/include/sixlowpan/error.h +++ b/sys/net/sixlowpan/include/sixlowpan/error.h @@ -18,4 +18,19 @@ #ifndef SIXLOWPAN_ERROR_H #define SIXLOWPAN_ERROR_H +#ifndef SUCCESS +#define SUCCESS (0) +#endif + +#define SIXLOWERROR_ARRAYFULL (132) // array is full +#define SIXLOWERROR_NULLPTR (133) // null pointer error +#define SIXLOWERROR_VALUE (134) // illegal value +#define SIXLOWERROR_ADDRESS (135) // illegal address +#define SIXLOWERROR_DISPATCH (136) // lowpan dispatch unknown +#define SIXLOWERROR_FSTFRAG (137) // first lowpan fragment not received +#define SIXLOWERROR_INVFRAG (138) // invalid fragment received +#define SIXLOWERROR_SCI (139) // source context not found +#define SIXLOWERROR_DCI (140) // destination context not found +#define SIXLOWERROR_CSUM (141) // wrong checksum + #endif /* SIXLOWPAN_ERROR_H */ -- GitLab