@joergmittaglawo/dmvconfig
Version:
DMV Configuration scripts for Lawo V__matrix Distributed Multiviewers.
457 lines (456 loc) • 18.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Enums = exports.All = exports.AgentAsNamedTableRow = exports.Agent = exports.MasterSettings = exports.SlaveSettings = exports.PortAsTableRow = exports.Port = exports.MasterAsTableRow = exports.Master = exports.lower = exports.lift = void 0;
const VScript = require("vscript");
const _Time = require("./Time");
const _NetworkInterfaces = require("./NetworkInterfaces");
const _PTP = require("./PTP");
exports.lift = {
AllGeneralSettings: (kwl, socket) => kwl ? (new AllGeneralSettings(new VScript.Subtree(socket, kwl))) : null,
Agent: (kwl, socket) => kwl ? (new Agent(new VScript.Subtree(socket, kwl))) : null,
AgentMasterStatistics: (kwl, socket) => kwl ? (new AgentMasterStatistics(new VScript.Subtree(socket, kwl))) : null,
AgentSlaveStatisticsInstantaneousEstimate: (x, _) => { return x ? { type: x[0], seconds_s: x[1], nanoseconds_s: x[2], seconds_m: x[3], nanoseconds_m: x[4], accepted: x[5] } : null; },
AgentSlaveStatisticsOneWayDelay: (x, _) => { return x ? { mean: x[0], error: x[1] } : null; },
AgentSlaveStatistics: (kwl, socket) => kwl ? (new AgentSlaveStatistics(new VScript.Subtree(socket, kwl))) : null,
MasterSettings: (kwl, socket) => kwl ? (new MasterSettings(new VScript.Subtree(socket, kwl))) : null,
MasterSettingsGrandmaster: (kwl, socket) => kwl ? (new MasterSettingsGrandmaster(new VScript.Subtree(socket, kwl))) : null,
SlaveSettings: (kwl, socket) => kwl ? (new SlaveSettings(new VScript.Subtree(socket, kwl))) : null,
Port: (kwl, socket) => kwl ? (new Port(new VScript.Subtree(socket, kwl))) : null,
PortBestMasters: (kwl, socket) => kwl ? (new PortBestMasters(new VScript.Subtree(socket, kwl))) : null,
Master: (kwl, socket) => kwl ? (new Master(new VScript.Subtree(socket, kwl))) : null,
MasterVisibleVia: (kwl, socket) => kwl ? (new MasterVisibleVia(new VScript.Subtree(socket, kwl))) : null
};
exports.lower = {
AllGeneralSettings: (ref) => ref ? ref.raw.kwl : null,
Agent: (ref) => ref ? ref.raw.kwl : null,
AgentMasterStatistics: (ref) => ref ? ref.raw.kwl : null,
AgentSlaveStatisticsInstantaneousEstimate: (x) => x ?
[x.type, x.seconds_s, x.nanoseconds_s, x.seconds_m, x.nanoseconds_m, x.accepted] : null,
AgentSlaveStatisticsOneWayDelay: (x) => x ?
[x.mean, x.error] : null,
AgentSlaveStatistics: (ref) => ref ? ref.raw.kwl : null,
MasterSettings: (ref) => ref ? ref.raw.kwl : null,
MasterSettingsGrandmaster: (ref) => ref ? ref.raw.kwl : null,
SlaveSettings: (ref) => ref ? ref.raw.kwl : null,
Port: (ref) => ref ? ref.raw.kwl : null,
PortBestMasters: (ref) => ref ? ref.raw.kwl : null,
Master: (ref) => ref ? ref.raw.kwl : null,
MasterVisibleVia: (ref) => ref ? ref.raw.kwl : null
};
class MasterVisibleVia {
constructor(raw) {
this.raw = raw;
}
get port() {
return new VScript.rKeyword(this, "port", { lift: exports.lift.Port, lower: exports.lower.Port });
}
/**
time at which an announce message from this master had last been received
via the referenced port, measured relative to process initialization time
*/
get announced_at() {
return new VScript.rKeyword(this, "announced_at");
}
}
class MasterVisibleViaAsTableRow extends MasterVisibleVia {
constructor(raw_row, enclosing_table) {
super(new VScript.Subtree(raw_row.socket, raw_row.kwl));
this.enclosing_table = enclosing_table;
this.index = raw_row.index;
}
}
class Master {
constructor(raw) {
this.raw = raw;
}
get gen_address() {
return new VScript.rKeyword(this, "gen_address");
}
get evt_address() {
return new VScript.rKeyword(this, "evt_address");
}
get visible_via() {
return new VScript.StronglyTypedTable(new VScript.Table(this.raw.socket, this.raw.full_kwl("visible_via")), (row, enclosing_table) => new MasterVisibleViaAsTableRow(row, enclosing_table));
}
/**
PTP traits as extracted from the most recently received announce message
*/
get ptp_traits() { return new _PTP.Traits(this.raw.find("ptp_traits")); }
}
exports.Master = Master;
class MasterAsTableRow extends Master {
constructor(raw_row, enclosing_table) {
super(new VScript.Subtree(raw_row.socket, raw_row.kwl));
this.enclosing_table = enclosing_table;
this.index = raw_row.index;
}
}
exports.MasterAsTableRow = MasterAsTableRow;
class PortBestMasters {
constructor(raw) {
this.raw = raw;
}
get wrapped_reference() {
return new VScript.rKeyword(this, "wrapped_reference", { lift: exports.lift.Master, lower: exports.lower.Master });
}
}
class PortBestMastersAsArrayRow extends PortBestMasters {
constructor(st, index, parent) {
super(st);
this.index = index;
this.parent = parent;
}
}
class Port {
constructor(raw) {
this.raw = raw;
}
get brief() {
return new VScript.rKeyword(this, "brief");
}
get hosting_interface() {
return new VScript.rKeyword(this, "hosting_interface", { lift: _NetworkInterfaces.lift.VirtualInterface, lower: _NetworkInterfaces.lower.VirtualInterface });
}
get lane() {
return new VScript.rKeyword(this, "lane");
}
get port_identity() {
return new VScript.rKeyword(this, "port_identity", { lift: _PTP.lift.PortIdentity, lower: _PTP.lower.PortIdentity });
}
get best_masters() {
return new VScript.StronglyTypedArray(this, "best_masters", (st, index, parent) => new PortBestMastersAsArrayRow(st, index, parent));
}
}
exports.Port = Port;
class PortAsTableRow extends Port {
constructor(raw_row, enclosing_table) {
super(new VScript.Subtree(raw_row.socket, raw_row.kwl));
this.enclosing_table = enclosing_table;
this.index = raw_row.index;
}
}
exports.PortAsTableRow = PortAsTableRow;
class SlaveSettings {
constructor(raw) {
this.raw = raw;
}
/**
base-2 logarithm of the delay request interval in seconds. E.g., a
setting of -3 will cause this agent to emit delay requests 8 times a
second; 4 times a second if this is set to -2. Delay request intervals
may not be shorter than the minimum delay request interval set by the
currently active master.
*/
get log2_delayreq_interval() {
return new VScript.duplexKeyword(this, "log2_delayreq_interval");
}
get log2_master_sync_interval() {
return new VScript.rKeyword(this, "log2_master_sync_interval");
}
/**
minimum delay request interval as set by the most recently received delay
response message
*/
get relative_min_log2_delayreq_interval() {
return new VScript.rKeyword(this, "relative_min_log2_delayreq_interval");
}
/**
unlike sync and follow-up messages, which contain no client-dependent
information and are thus useful to all clients within their PTP domain,
delay request/response messages are useful only to the inquiring client
(and perhaps to the master if it wishes to monitor its clients' timing
properties). Exchanging these messages via unicast reduces both network
traffic and local workload but yields otherwise identical results (this
mode may also be called `Hybrid` on other products). If
`delay_req_routing` is set to `Multicast`, this optimization is disabled
and all delay requests emitted by this agent will be sent to the PTP
multicast event address `224.0.1.129:319`
*/
get delay_req_routing() {
return new VScript.duplexKeyword(this, "delay_req_routing");
}
}
exports.SlaveSettings = SlaveSettings;
class MasterSettingsGrandmaster {
constructor(raw) {
this.raw = raw;
}
/**
this value will be used as `priority_1` if this agent is set to act as a
PTP master
*/
get priority_1() {
return new VScript.duplexKeyword(this, "priority_1");
}
/**
this value will be used as `priority_2` if this agent is set to act as a
PTP master
*/
get priority_2() {
return new VScript.duplexKeyword(this, "priority_2");
}
/**
this value will be used as `clock_quality` if this agent is set to act as
a PTP master
*/
get clock_quality() {
return new VScript.duplexKeyword(this, "clock_quality", { lift: _PTP.lift.ClockQuality, lower: _PTP.lower.ClockQuality });
}
/**
ClockIdentity as defined by the PTP standard, stored in big-endian order.
*/
get clock_identity() {
return new VScript.rKeyword(this, "clock_identity");
}
}
class MasterSettings {
constructor(raw) {
this.raw = raw;
}
/**
base-2 logarithm of the announce interval in seconds. E.g., a setting of
-2 will cause this agent to emit announce messages 4 times a second; 2
times a second if this is set to -1.
*/
get log2_announce_interval() {
return new VScript.duplexKeyword(this, "log2_announce_interval");
}
/**
base-2 logarithm of the sync interval in seconds. E.g., a setting of -3
will cause this agent to emit sync and followup messages 8 times a
second; 4 times a second if this is set to -2.
*/
get log2_sync_interval() {
return new VScript.duplexKeyword(this, "log2_sync_interval");
}
get delay_decimation_factor() {
return new VScript.rKeyword(this, "delay_decimation_factor");
}
/**
unlike sync and follow-up messages, which contain no client-dependent
information and are thus useful to all clients within their PTP domain,
delay request/response messages are useful only to the inquiring client
(and perhaps to the master if it wishes to monitor its clients' timing
properties). Exchanging these messages via unicast reduces both network
traffic and local workload but yields otherwise identical results (this
mode may also be called `Hybrid` on other products). If
`delay_resp_routing` is set to `Multicast`, all delay responses emitted
by this agent will be sent to the PTP multicast address `224.0.1.129`
*/
get delay_resp_routing() {
return new VScript.duplexKeyword(this, "delay_resp_routing");
}
get time_source() {
return new VScript.duplexKeyword(this, "time_source", { lift: _Time.lift.Source, lower: _Time.lower.Source });
}
get grandmaster() {
return new MasterSettingsGrandmaster(this.raw.find("grandmaster"));
}
}
exports.MasterSettings = MasterSettings;
class AgentSlaveStatistics {
constructor(raw) {
this.raw = raw;
}
get num_syncs_received() {
return new VScript.rKeyword(this, "num_syncs_received");
}
get num_followups_received() {
return new VScript.rKeyword(this, "num_followups_received");
}
/**
number of measurements performed on the basis of incoming sync/followup
messages. May be smaller than the number of received sync messages due
to, e.g., missing followup messages
*/
get num_sync_measurements() {
return new VScript.rKeyword(this, "num_sync_measurements");
}
/**
number of delay request messages handed off to the operating system. The
actual number of transmitted messages may be lower in case of network
configuration issues; check `num_delay_measurements` if you suspect this
to be the case
*/
get num_delayreqs_sent() {
return new VScript.rKeyword(this, "num_delayreqs_sent");
}
get num_delayresps_received() {
return new VScript.rKeyword(this, "num_delayresps_received");
}
/**
number of delay response messages considered for further processing. May
be smaller than the number of received delay response messages due to,
e.g., mismatching requesting source port identities (especially when
operating in multicast routing mode)
*/
get num_delayresps_considered() {
return new VScript.rKeyword(this, "num_delayresps_considered");
}
/**
number of delay response messages that were considered for processing,
but later discarded for other reasons
*/
get num_delayresps_discarded() {
return new VScript.rKeyword(this, "num_delayresps_discarded");
}
/**
number of measurements performed on the basis of delay request/response
messages. May be both smaller than the number of dispatched delay request
messages (perhaps due to network configuration issues), and smaller than
the number of received delay response messages (especially when operating
in multicast routing mode, where most incoming delay response messages
are typically intended for other PTP clients)
*/
get num_delay_measurements() {
return new VScript.rKeyword(this, "num_delay_measurements");
}
get one_way_delay() {
return new VScript.rKeyword(this, "one_way_delay", { lift: exports.lift.AgentSlaveStatisticsOneWayDelay, lower: exports.lower.AgentSlaveStatisticsOneWayDelay });
}
get estimated_jitter() {
return new VScript.rKeyword(this, "estimated_jitter");
}
get publish_instantaneous_estimates() {
return new VScript.rwKeyword(this, "publish_instantaneous_estimates");
}
get instantaneous_estimate() {
return new VScript.rKeyword(this, "instantaneous_estimate", { lift: exports.lift.AgentSlaveStatisticsInstantaneousEstimate, lower: exports.lower.AgentSlaveStatisticsInstantaneousEstimate });
}
}
class AgentMasterStatistics {
constructor(raw) {
this.raw = raw;
}
get num_announces_sent() {
return new VScript.rKeyword(this, "num_announces_sent");
}
get num_syncs_sent() {
return new VScript.rKeyword(this, "num_syncs_sent");
}
get num_followups_sent() {
return new VScript.rKeyword(this, "num_followups_sent");
}
get num_delayreqs_received() {
return new VScript.rKeyword(this, "num_delayreqs_received");
}
get num_delayresps_sent() {
return new VScript.rKeyword(this, "num_delayresps_sent");
}
}
class Agent {
constructor(raw) {
this.raw = raw;
}
get mode() {
return new VScript.rwKeyword(this, "mode");
}
get state() {
return new VScript.rKeyword(this, "state");
}
get domain() {
return new VScript.duplexKeyword(this, "domain");
}
/**
best (as defined by the Best Master Clock algorithm) PTP master visible
on this interface and within this PTP domain, excluding this agent
itself.
*/
get best_foreign_master() {
return new VScript.rKeyword(this, "best_foreign_master", { lift: exports.lift.Master, lower: exports.lower.Master });
}
get lane() {
return new VScript.rKeyword(this, "lane");
}
get hosting_port() {
return new VScript.duplexKeyword(this, "hosting_port", { lift: exports.lift.Port, lower: exports.lower.Port });
}
get slave_settings() {
return new SlaveSettings(this.raw.find("slave_settings"));
}
get master_settings() {
return new MasterSettings(this.raw.find("master_settings"));
}
get slave_statistics() {
return new AgentSlaveStatistics(this.raw.find("slave_statistics"));
}
get master_statistics() {
return new AgentMasterStatistics(this.raw.find("master_statistics"));
}
get output() { return new _Time.Source(this.raw.find("output")); }
}
exports.Agent = Agent;
class AgentAsNamedTableRow extends Agent {
constructor(raw_row, enclosing_table) {
super(new VScript.Subtree(raw_row.socket, raw_row.kwl));
this.raw_row = raw_row;
this.enclosing_table = enclosing_table;
this.index = raw_row.index;
}
async rename(name, opts) { await this.raw_row.rename(name, opts); }
async delete(opts) { await this.raw_row.delete(opts); }
}
exports.AgentAsNamedTableRow = AgentAsNamedTableRow;
class AllGeneralSettings {
constructor(raw) {
this.raw = raw;
}
/**
remove visible masters if the time elapsed since their last Announce
message exceeds *master_timeout*
*/
get master_timeout() {
return new VScript.duplexKeyword(this, "master_timeout");
}
/**
if `best_master_selection` is set to `Eager`, an incoming Announce
message will immediately register its sender as the currently accepted
PTP master if all previously registered masters are deemed inferior by
the BMC algorithm. Conversely, if `Cautious` is selected, and if the
PTPClock is currently calibrated, a previously selected PTP master will
be retained until it times out
*/
get best_master_selection() {
return new VScript.rwKeyword(this, "best_master_selection");
}
/**
offload DelayResponse generation to hardware if supported by the
currently active FPGA build
*/
get hardware_offload() {
return new VScript.duplexKeyword(this, "hardware_offload");
}
/**
if DelayResponse hardware offloading is available, delay requests will by
default not be forwarded to the CPU. If you wish to do so to, e.g.,
analyze incoming traffic using `tcpdump`, set this option to `false`
*/
get absorb_delayrequests() {
return new VScript.duplexKeyword(this, "absorb_delayrequests");
}
}
class All {
constructor(raw) {
this.raw = raw;
}
get general_settings() {
return new AllGeneralSettings(this.raw.find("general_settings"));
}
get agents() {
return new VScript.StronglyTypedNamedTable(new VScript.NamedTable(this.raw.socket, this.raw.full_kwl("agents")), (row, enclosing_table) => new AgentAsNamedTableRow(row, enclosing_table));
}
get ports() {
return new VScript.StronglyTypedTable(new VScript.Table(this.raw.socket, this.raw.full_kwl("ports")), (row, enclosing_table) => new PortAsTableRow(row, enclosing_table));
}
get visible_masters() {
return new VScript.StronglyTypedTable(new VScript.Table(this.raw.socket, this.raw.full_kwl("visible_masters")), (row, enclosing_table) => new MasterAsTableRow(row, enclosing_table));
}
}
exports.All = All;
exports.Enums = {
MeasurementFamily: ["SyncFollowUp", "DelayRespReq"],
Routing: ["Unicast", "Multicast"],
QualityAssessment: ["Convergent", "Normal", "Divergent", "None"],
MessageType: ["Sync", "Delay_Req", "Pdelay_Req", "Pdelay_Resp", "Follow_Up", "Delay_Resp", "Pdelay_Resp_Follow_Up", "Announce", "Signaling", "Management", "Invalid"],
MessageClass: ["Event", "General"]
};