summaryrefslogtreecommitdiff
path: root/third_party/ptpd-1.1.0/src/dep/constants_dep.h
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-08-08 14:42:07 +0300
commita6163888f3c56123b1db313743c6147ba498732c (patch)
treeff7d15d991d1d09ba6cbc0cec80924f57445bfdd /third_party/ptpd-1.1.0/src/dep/constants_dep.h
parentc3e4c9a25c2910d2d66d52215b3406b13d5b23d5 (diff)
Add third_party libs
Diffstat (limited to 'third_party/ptpd-1.1.0/src/dep/constants_dep.h')
-rw-r--r--third_party/ptpd-1.1.0/src/dep/constants_dep.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/third_party/ptpd-1.1.0/src/dep/constants_dep.h b/third_party/ptpd-1.1.0/src/dep/constants_dep.h
new file mode 100644
index 0000000..54afaf1
--- /dev/null
+++ b/third_party/ptpd-1.1.0/src/dep/constants_dep.h
@@ -0,0 +1,99 @@
+/**
+ * @file constants_dep.h
+ * @date Tue Jul 20 16:16:23 2010
+ *
+ * @brief Platform dependent constants
+ *
+ *
+ */
+
+#ifndef CONSTANTS_DEP_H
+#define CONSTANTS_DEP_H
+
+#include <limits.h>
+
+#if !defined(linux) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+#error Not ported to this architecture, please update.
+#endif
+
+#ifdef linux
+#include<netinet/in.h>
+#include<net/if.h>
+#include<net/if_arp.h>
+#define IFACE_NAME_LENGTH IF_NAMESIZE
+#define NET_ADDRESS_LENGTH INET_ADDRSTRLEN
+
+#define IFCONF_LENGTH 10
+
+#include<endian.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define PTPD_LSBF
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define PTPD_MSBF
+#endif
+#endif /* linux */
+
+
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#if defined(__FreeBSD__)
+#include <net/ethernet.h>
+#include <sys/uio.h>
+#else
+#include <net/if_ether.h>
+#endif
+#include <ifaddrs.h>
+#define IFACE_NAME_LENGTH IF_NAMESIZE
+#define NET_ADDRESS_LENGTH INET_ADDRSTRLEN
+
+#define IFCONF_LENGTH 10
+
+#define adjtimex ntp_adjtime
+
+#include <machine/endian.h>
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define PTPD_LSBF
+#elif BYTE_ORDER == BIG_ENDIAN
+#define PTPD_MSBF
+#endif
+#endif
+
+
+#define ADJ_FREQ_MAX 512000
+
+/* UDP/IPv4 dependent */
+
+#define SUBDOMAIN_ADDRESS_LENGTH 4
+#define PORT_ADDRESS_LENGTH 2
+
+#define PACKET_SIZE 300
+
+#define PTP_EVENT_PORT 319
+#define PTP_GENERAL_PORT 320
+
+#define DEFAULT_PTP_DOMAIN_ADDRESS "224.0.1.129"
+#define ALTERNATE_PTP_DOMAIN1_ADDRESS "224.0.1.130"
+#define ALTERNATE_PTP_DOMAIN2_ADDRESS "224.0.1.131"
+#define ALTERNATE_PTP_DOMAIN3_ADDRESS "224.0.1.132"
+
+#define HEADER_LENGTH 40
+#define SYNC_PACKET_LENGTH 124
+#define DELAY_REQ_PACKET_LENGTH 124
+#define FOLLOW_UP_PACKET_LENGTH 52
+#define DELAY_RESP_PACKET_LENGTH 60
+#define MANAGEMENT_PACKET_LENGTH 136
+
+#define MM_STARTING_BOUNDARY_HOPS 0x7fff
+
+/* others */
+
+#define SCREEN_BUFSZ 128
+#define SCREEN_MAXSZ 80
+
+#define MAXTIMESTR 32
+#endif