summaryrefslogtreecommitdiffstats
path: root/src/compat.h
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-27 04:44:01 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-27 04:44:01 +0200
commita0e0e9898a7c1abeb4dbf6ba188a9bcaf523e003 (patch)
tree0c2051ecd915712ef5ca4f47feb89b47394c33a9 /src/compat.h
parent556284a10e482027f741f9afe6cbaa1b4e2207f8 (diff)
downloadfastd-a0e0e9898a7c1abeb4dbf6ba188a9bcaf523e003.tar
fastd-a0e0e9898a7c1abeb4dbf6ba188a9bcaf523e003.zip
More documentation
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/compat.h b/src/compat.h
index e3d9e49..1ab8452 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -23,6 +23,12 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ \file compat.h
+
+ Portablity definitions
+*/
+
#pragma once
@@ -41,35 +47,37 @@
#include <netinet/if_ether.h>
#ifndef ETH_ALEN
-#define ETH_ALEN 6
+#define ETH_ALEN 6 /**< The length of a MAC address */
#endif
#ifndef ETH_HLEN
-#define ETH_HLEN 14
+#define ETH_HLEN 14 /**< The length of the standard ethernet header */
#endif
#ifndef HAVE_ETHHDR
+/** An ethernet header */
struct ethhdr {
- uint8_t h_dest[ETH_ALEN];
- uint8_t h_source[ETH_ALEN];
- uint16_t h_proto;
+ uint8_t h_dest[ETH_ALEN]; /**< The destination MAC address field */
+ uint8_t h_source[ETH_ALEN]; /**< The source MAC address field */
+ uint16_t h_proto; /**< The EtherType/length field */
} __attribute__((packed));
#endif
#if defined(USE_FREEBIND) && !defined(IP_FREEBIND)
-#define IP_FREEBIND 15
+#define IP_FREEBIND 15 /**< Compatiblity define for systems supporting, but not defining IP_FREEBIND */
#endif
#ifndef SOCK_NONBLOCK
-#define NO_HAVE_SOCK_NONBLOCK
-#define SOCK_NONBLOCK 0
+#define NO_HAVE_SOCK_NONBLOCK /**< Defined if SOCK_NONBLOCK doesn't have an effect */
+#define SOCK_NONBLOCK 0 /**< Compatiblity define for systems not supporting SOCK_NONBLOCK */
#endif
#ifndef HAVE_GET_CURRENT_DIR_NAME
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+/**< Replacement function for *BSD systems not supporting get_current_dir_name() */
static inline char *get_current_dir_name(void) {
return getcwd(NULL, 0);
}