Commit 1a952a93 authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Aurelio Colosimo

constants: some cleanup (more is needed)

This moves some constants from pptp.h to constansts.h and
adds DEFAULT_ETHERNET_MODE, so archs can activate it by default for them

Note that default management is awfully broken (we inherited from the
other ptpd). For example DEFAULT_INBOUND_LATENCY is not used, and if
you change it you have no effect.
parent ae155c0b
......@@ -13,6 +13,7 @@
#define PP_DEFAULT_INBOUND_LATENCY 0 /* in nsec */
#define PP_DEFAULT_OUTBOUND_LATENCY 0 /* in nsec */
#define PP_DEFAULT_NO_RESET_CLOCK 0
#define PP_DEFAULT_ETHERNET_MODE 0
#define PP_DEFAULT_DOMAIN_NUMBER 0
#define PP_DEFAULT_DELAY_MECHANISM P2P
#define PP_DEFAULT_AP 10
......@@ -77,6 +78,13 @@
#define PP_PEER_DOMAIN_ADDRESS "224.0.0.107"
#define PP_MM_STARTING_BOUNDARY_HOPS 0x7fff
/* Raw ethernet dependent */
#ifndef ETH_P_1588
#define ETH_P_1588 0x88F7
#endif
#define PP_MCAST_MACADDRESS "\x01\x1B\x19\x00\x00\x00"
#define PP_PEER_MACADDRESS "\x01\x80\xC2\x00\x00\x0E"
#endif /* __PTP_CONSTANTS_H__ */
......@@ -12,12 +12,6 @@
#include <pptp/ieee1588_types.h>
#include <pptp/constants.h>
#ifndef ETH_P_1588
#define ETH_P_1588 0x88F7
#endif
#define PP_MCAST_MACADDRESS "\x01\x1B\x19\x00\x00\x00" /* we don't peer-req */
#define __weak __attribute__((weak))
/* Macros for diagnostic prints. Set pp_diag_verbosity as 0 or 1 (PP_V macros
......
......@@ -14,19 +14,20 @@
*/
struct pp_runtime_opts default_rt_opts = {
.no_adjust = TRUE,
.no_rst_clk = PP_DEFAULT_NO_RESET_CLOCK,
.ap = PP_DEFAULT_AP,
.ai = PP_DEFAULT_AI,
.s = PP_DEFAULT_DELAY_S,
.max_foreign_records = PP_DEFAULT_MAX_FOREIGN_RECORDS,
.cur_utc_ofst = PP_DEFAULT_UTC_OFFSET,
.announce_intvl = PP_DEFAULT_ANNOUNCE_INTERVAL,
.sync_intvl = PP_DEFAULT_SYNC_INTERVAL,
.prio1 = PP_DEFAULT_PRIORITY1,
.prio2 = PP_DEFAULT_PRIORITY2,
.domain_number = PP_DEFAULT_DOMAIN_NUMBER,
.ttl = 1,
.no_adjust = TRUE,
.no_rst_clk = PP_DEFAULT_NO_RESET_CLOCK,
.ap = PP_DEFAULT_AP,
.ai = PP_DEFAULT_AI,
.s = PP_DEFAULT_DELAY_S,
.ethernet_mode = PP_DEFAULT_ETHERNET_MODE,
.max_foreign_records = PP_DEFAULT_MAX_FOREIGN_RECORDS,
.cur_utc_ofst = PP_DEFAULT_UTC_OFFSET,
.announce_intvl = PP_DEFAULT_ANNOUNCE_INTERVAL,
.sync_intvl = PP_DEFAULT_SYNC_INTERVAL,
.prio1 = PP_DEFAULT_PRIORITY1,
.prio2 = PP_DEFAULT_PRIORITY2,
.domain_number = PP_DEFAULT_DOMAIN_NUMBER,
.ttl = 1,
};
int pp_open_instance(struct pp_instance *ppi, struct pp_runtime_opts *rt_opts)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment