constants_dep.h
来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· C头文件 代码 · 共 93 行
H
93 行
/* constants_dep.h */
#ifndef CONSTANTS_DEP_H
#define CONSTANTS_DEP_H
/* platform dependent */
#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
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?