#! /bin/luavar
require("libluadsl")
g_data={}
g_data.port = {}
g_data.port[1] = {}
g_data.port[2] = {}
g_data.port[1].ds_negotiated= luadsl.getNegotiatedValues(1, "DS")
for i = 1, g_data.port[1].ds_negotiated.PORTS, 1 do
g_data.port[i] = {}
g_data.port[i].ds_negotiated= luadsl.getNegotiatedValues(i, "DS")
g_data.port[i].us_negotiated = luadsl.getNegotiatedValues(i, "US")
g_data.port[i].ds_errors = luadsl.getErrorCounters(i, "DS")
g_data.port[i].us_errors = luadsl.getErrorCounters(i, "US")
g_data.port[i].ds_overview = luadsl.getOverviewStatus(i, "DS")
g_data.port[i].us_overview = luadsl.getOverviewStatus(i, "US")
end
print("ds_state :",g_data.port[1].ds_overview.STATE);
print("us_state :",g_data.port[1].us_overview.STATE);
print("ds_timeinstate :",g_data.port[1].ds_overview.TIME_IN_STATE);
print("us_timeinstate :",g_data.port[1].us_overview.TIME_IN_STATE);
print("ds_showtime :",g_data.port[1].ds_overview.SHOWTIME);
print("us_showtime :",g_data.port[1].us_overview.SHOWTIME);
print("ds_mode :",g_data.port[1].ds_overview.MODE);
print("us_mode :",g_data.port[1].us_overview.MODE);
print("ds_attain_dr :",g_data.port[1].ds_negotiated.ATTAIN_DR);
print("us_attain_dr :",g_data.port[1].us_negotiated.ATTAIN_DR);
print("ds_actual_dr :",g_data.port[1].ds_negotiated.ACTUAL_DR);
print("us_actual_dr :",g_data.port[1].us_negotiated.ACTUAL_DR);
print("ds_margin :",g_data.port[1].ds_negotiated.MARGIN);
print("us_margin :",g_data.port[1].us_negotiated.MARGIN);
print("ds_attenuation :",g_data.port[1].ds_negotiated.ATTENUATION);
print("us_attenuation :",g_data.port[1].us_negotiated.ATTENUATION);
print("ds_delay :",g_data.port[1].ds_negotiated.DELAY);
print("us_delay :",g_data.port[1].us_negotiated.DELAY);
print("ds_es :",g_data.port[1].ds_errors.ES);
print("us_es :",g_data.port[1].us_errors.ES);
print("ds_ses :",g_data.port[1].ds_errors.SES);
print("us_ses :",g_data.port[1].us_errors.SES);
print("ds_crc_min :",g_data.port[1].ds_errors.CRC_MIN);
print("us_crc_min :",g_data.port[1].us_errors.CRC_MIN);
print("ds_crc_15min :",g_data.port[1].ds_errors.CRC_15MIN);
print("us_crc_15min :",g_data.port[1].us_errors.CRC_15MIN);