]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/WinPCap/ip6_misc.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_IoT_Libraries / jobs / jobs_notify_next / WinPCap / ip6_misc.h
diff --git a/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/WinPCap/ip6_misc.h b/FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/jobs/jobs_notify_next/WinPCap/ip6_misc.h
new file mode 100644 (file)
index 0000000..96822d0
--- /dev/null
@@ -0,0 +1,163 @@
+/*\r
+ * Copyright (c) 1993, 1994, 1997\r
+ *     The Regents of the University of California.  All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that: (1) source code distributions\r
+ * retain the above copyright notice and this paragraph in its entirety, (2)\r
+ * distributions including binary code include the above copyright notice and\r
+ * this paragraph in its entirety in the documentation or other materials\r
+ * provided with the distribution, and (3) all advertising materials mentioning\r
+ * features or use of this software display the following acknowledgement:\r
+ * ``This product includes software developed by the University of California,\r
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of\r
+ * the University nor the names of its contributors may be used to endorse\r
+ * or promote products derived from this software without specific prior\r
+ * written permission.\r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ *\r
+ * @(#) $Header: /tcpdump/master/libpcap/Win32/Include/ip6_misc.h,v 1.5 2006-01-22 18:02:18 gianluca Exp $ (LBL)\r
+ */\r
+\r
+/*\r
+ * This file contains a collage of declarations for IPv6 from FreeBSD not present in Windows\r
+ */\r
+\r
+#include <winsock2.h>\r
+\r
+#include <ws2tcpip.h>\r
+\r
+#ifndef __MINGW32__\r
+#define        IN_MULTICAST(a)         IN_CLASSD(a)\r
+#endif\r
+\r
+#define        IN_EXPERIMENTAL(a)      ((((u_int32_t) (a)) & 0xf0000000) == 0xf0000000)\r
+\r
+#define        IN_LOOPBACKNET          127\r
+\r
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)\r
+/* IPv6 address */\r
+struct in6_addr\r
+  {\r
+    union\r
+      {\r
+       u_int8_t                u6_addr8[16];\r
+       u_int16_t       u6_addr16[8];\r
+       u_int32_t       u6_addr32[4];\r
+      } in6_u;\r
+#define s6_addr                        in6_u.u6_addr8\r
+#define s6_addr16              in6_u.u6_addr16\r
+#define s6_addr32              in6_u.u6_addr32\r
+#define s6_addr64              in6_u.u6_addr64\r
+  };\r
+\r
+#define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }\r
+#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }\r
+#endif /* __MINGW32__ */\r
+\r
+\r
+#if (defined _MSC_VER) || (defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF))\r
+typedef unsigned short sa_family_t;\r
+#endif\r
+\r
+\r
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)\r
+\r
+#define        __SOCKADDR_COMMON(sa_prefix) \\r
+  sa_family_t sa_prefix##family\r
+\r
+/* Ditto, for IPv6.  */\r
+struct sockaddr_in6\r
+  {\r
+    __SOCKADDR_COMMON (sin6_);\r
+    u_int16_t sin6_port;               /* Transport layer port # */\r
+    u_int32_t sin6_flowinfo;   /* IPv6 flow information */\r
+    struct in6_addr sin6_addr; /* IPv6 address */\r
+  };\r
+\r
+#define IN6_IS_ADDR_V4MAPPED(a) \\r
+       ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \\r
+        (((u_int32_t *) (a))[2] == htonl (0xffff)))\r
+\r
+#define IN6_IS_ADDR_MULTICAST(a) (((u_int8_t *) (a))[0] == 0xff)\r
+\r
+#define IN6_IS_ADDR_LINKLOCAL(a) \\r
+       ((((u_int32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000))\r
+\r
+#define IN6_IS_ADDR_LOOPBACK(a) \\r
+       (((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \\r
+        ((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1))\r
+#endif /* __MINGW32__ */\r
+\r
+#define ip6_vfc   ip6_ctlun.ip6_un2_vfc\r
+#define ip6_flow  ip6_ctlun.ip6_un1.ip6_un1_flow\r
+#define ip6_plen  ip6_ctlun.ip6_un1.ip6_un1_plen\r
+#define ip6_nxt   ip6_ctlun.ip6_un1.ip6_un1_nxt\r
+#define ip6_hlim  ip6_ctlun.ip6_un1.ip6_un1_hlim\r
+#define ip6_hops  ip6_ctlun.ip6_un1.ip6_un1_hlim\r
+\r
+#define nd_rd_type               nd_rd_hdr.icmp6_type\r
+#define nd_rd_code               nd_rd_hdr.icmp6_code\r
+#define nd_rd_cksum              nd_rd_hdr.icmp6_cksum\r
+#define nd_rd_reserved           nd_rd_hdr.icmp6_data32[0]\r
+\r
+/*\r
+ *     IPV6 extension headers\r
+ */\r
+#define IPPROTO_HOPOPTS                0       /* IPv6 hop-by-hop options      */\r
+#define IPPROTO_IPV6           41  /* IPv6 header.  */\r
+#define IPPROTO_ROUTING                43      /* IPv6 routing header          */\r
+#define IPPROTO_FRAGMENT       44      /* IPv6 fragmentation header    */\r
+#define IPPROTO_ESP            50      /* encapsulating security payload */\r
+#define IPPROTO_AH             51      /* authentication header        */\r
+#define IPPROTO_ICMPV6         58      /* ICMPv6                       */\r
+#define IPPROTO_NONE           59      /* IPv6 no next header          */\r
+#define IPPROTO_DSTOPTS                60      /* IPv6 destination options     */\r
+#define IPPROTO_PIM                    103 /* Protocol Independent Multicast.  */\r
+\r
+#define         IPV6_RTHDR_TYPE_0 0\r
+\r
+/* Option types and related macros */\r
+#define IP6OPT_PAD1            0x00    /* 00 0 00000 */\r
+#define IP6OPT_PADN            0x01    /* 00 0 00001 */\r
+#define IP6OPT_JUMBO           0xC2    /* 11 0 00010 = 194 */\r
+#define IP6OPT_JUMBO_LEN       6\r
+#define IP6OPT_ROUTER_ALERT    0x05    /* 00 0 00101 */\r
+\r
+#define IP6OPT_RTALERT_LEN     4\r
+#define IP6OPT_RTALERT_MLD     0       /* Datagram contains an MLD message */\r
+#define IP6OPT_RTALERT_RSVP    1       /* Datagram contains an RSVP message */\r
+#define IP6OPT_RTALERT_ACTNET  2       /* contains an Active Networks msg */\r
+#define IP6OPT_MINLEN          2\r
+\r
+#define IP6OPT_BINDING_UPDATE  0xc6    /* 11 0 00110 */\r
+#define IP6OPT_BINDING_ACK     0x07    /* 00 0 00111 */\r
+#define IP6OPT_BINDING_REQ     0x08    /* 00 0 01000 */\r
+#define IP6OPT_HOME_ADDRESS    0xc9    /* 11 0 01001 */\r
+#define IP6OPT_EID             0x8a    /* 10 0 01010 */\r
+\r
+#define IP6OPT_TYPE(o)         ((o) & 0xC0)\r
+#define IP6OPT_TYPE_SKIP       0x00\r
+#define IP6OPT_TYPE_DISCARD    0x40\r
+#define IP6OPT_TYPE_FORCEICMP  0x80\r
+#define IP6OPT_TYPE_ICMP       0xC0\r
+\r
+#define IP6OPT_MUTABLE         0x20\r
+\r
+\r
+#if defined(__MINGW32__) && defined(DEFINE_ADDITIONAL_IPV6_STUFF)\r
+#ifndef EAI_ADDRFAMILY\r
+struct addrinfo {\r
+       int     ai_flags;       /* AI_PASSIVE, AI_CANONNAME */\r
+       int     ai_family;      /* PF_xxx */\r
+       int     ai_socktype;    /* SOCK_xxx */\r
+       int     ai_protocol;    /* 0 or IPPROTO_xxx for IPv4 and IPv6 */\r
+       size_t  ai_addrlen;     /* length of ai_addr */\r
+       char    *ai_canonname;  /* canonical name for hostname */\r
+       struct sockaddr *ai_addr;       /* binary address */\r
+       struct addrinfo *ai_next;       /* next structure in linked list */\r
+};\r
+#endif\r
+#endif /* __MINGW32__ */\r