diff --git a/FRAMEWORK/cardSetup.js b/FRAMEWORK/cardSetup.js index ff4cc40..11b68ff 100644 --- a/FRAMEWORK/cardSetup.js +++ b/FRAMEWORK/cardSetup.js @@ -307,6 +307,7 @@ module.exports = function () { /** * Setup function for the network interfaces * @param {object} config - The object containing the configuration parameters + * @param {string} [config.hostname] - The hostname for the module (will e.g. be used as the prompt in the terminal, the name in the V__script GUI, and the system name in LLDP) * @param {string} [config.mode] - The interface mode; "40gbe" | "10gbe" * @param {string} [config.front_mgmt] - The IP and prefix for the front management port; "A.B.C.D/X" * @param {string} [config.rear_mgmt] - The IP and prefix for the rear management port; "A.B.C.D/X" @@ -323,6 +324,10 @@ module.exports = function () { } if (config.hasOwnProperty("network_config")) { config = config.network_config; } + if (config.hasOwnProperty("hostname")) { + await this.write("network_interfaces.hostname", "ip_address", config.hostname, { ip: this.ip }); + } + let numInterfaces; // Set the number of interfaces to configure based on 40GbE/10GbE if (!(config.hasOwnProperty("mode") && config.hasOwnProperty("addresses"))) { return -1; } @@ -404,7 +409,17 @@ module.exports = function () { if (this.running_is_newer_than_or_same_as([1,8,232])) { await this.write("time_flows.combinators[0]", "quorum_command", 1, { ip: this.ip }); } await this.write("p_t_p_clock", "input_command", "time_flows.combinators[0].output", { ip: this.ip }); } // + + await this.write("system_clock", "input", "p_t_p_clock.output", { ip: this.ip }); + if (config.utc === "Ignore") { + await vscript.create_table_row("time_flows.shifters", { desired_name: "UTC_shifter", ip: this.ip} ); + await this.write("time_flows.shifters[0]", "input_command", "p_t_p_clock.output", { ip: this.ip }); + await this.write("time_flows.shifters[0]", "shift", -37000000000, { ip: this.ip }); + await this.write("system_clock", "input", "time_flows.shifters[0].output", { ip: this.ip }); + } + if (config.hasOwnProperty("BB")) { + await this.write("system_clock", "input", null, { ip: this.ip }); await this.write("p_t_p_clock", "input_command", config.BB, { ip: this.ip }); } this.verbose("Finished ptp_setup()...", 20); diff --git a/FRAMEWORK/routing/routing.js b/FRAMEWORK/routing/routing.js index 03295d6..74ff4a8 100644 --- a/FRAMEWORK/routing/routing.js +++ b/FRAMEWORK/routing/routing.js @@ -461,6 +461,7 @@ let _generateJSON = function() { config.system_config.fpga = _readParameter(el, "fpga"); config.network_config.mode = (config.system_config.fpga.endsWith("40GbE") ? "40gbe" : "10gbe"); if (_readParameter(el, "update-ips")) { + config.network_config.hostname = _readParameter(el, "hostname"); config.network_config.front_mgmt = _readParameter(el, "front-mgmt"); config.network_config.rear_mgmt = _readParameter(el, "rear-mgmt"); config.network_config.addresses = []; @@ -637,6 +638,7 @@ let _createFromJSON = function(obj) { _setParameter(el, "reset", obj.system_config.reset); _setParameter(el, "fpga", obj.system_config.fpga); if (obj.network_config.hasOwnProperty("addresses")) { + _setParameter(el, "hostname", obj.network_config.hostname); _setParameter(el, "front-mgmt", obj.network_config.front_mgmt); _setParameter(el, "rear-mgmt", obj.network_config.rear_mgmt); _setParameter(el, "left-qsfp", obj.network_config.addresses.slice(0,(obj.network_config.addresses.length / 2)).join(",")); @@ -726,6 +728,7 @@ let blockProto = { {id: "fpga", name: "FPGA", type: "select", value: ["STREAMING_40GbE", "STREAMING","MULTIVIEWER_40GbE", "MULTIVIEWER"], text: ["Streaming (40GbE)", "Streaming (4x10GbE)","Multiviewer (40GbE)", "Multiviewer (4x10GbE)"]}, {id: "reset", name: "Reset card before configuration", type: "checkbox", value: false}, {id: "update-ips", name: "Change IP addresses", type: "checkbox", value: false}, + {id: "hostname", name: "Hostname", type: "text", value:"V__matrix"}, {id: "front-mgmt", name: "Front management IP", type: "text", value:"10.3.143.33/20"}, {id: "rear-mgmt", name: "Rear management IP", type: "text", value: "10.3.143.34/20"}, {id: "left-qsfp", name: "Left QSFP IPs", type: "text", value: "192.168.50.43/16,10.0.0.2/24,10.0.0.3/24,10.0.0.4/24"},