def __init__(self): self.constructFrame = Struct( 'parser', OptionalGreedyRange( Struct( 'packets', UBInt8('header'), UBInt16('plen'), UBInt8('functype'), UBInt64('nodeid'), UBInt8('sum'), )))
UBInt8("DL_prbs"), UBInt16("UL_earfcn"), UBInt8("UL_prbs")) CAPS_RESPONSE = Struct("caps_response", BitStruct("flags", Padding(30), Bit("ue_measure"), Bit("ue_report")), UBInt32("nof_cells"), Array(lambda ctx: ctx.nof_cells, CAPS_C)) UE_R = Struct("ues", UBInt16("pci"), Bytes("plmn_id", 4), UBInt16("rnti"), UBInt64("imsi")) UE_REPORT_RESPONSE = Struct("ue_report_response", UBInt32("nof_ues"), Array(lambda ctx: ctx.nof_ues, UE_R)) CAPS_REQUEST = Struct("caps_request", UBInt8("type"), UBInt8("version"), UBInt32("enbid"), UBInt16("cellid"), UBInt32("modid"), UBInt16("length"), UBInt32("seq"), UBInt8("action"), UBInt8("dir"),
UBInt8("dimension"), ), 2: Struct( "handshake", AlphaString("username"), ), 3: Struct( "chat", AlphaString("message"), ), 4: Struct( "time", UBInt64("timestamp"), ), 5: Struct( "entity-equipment", UBInt32("eid"), UBInt16("slot"), UBInt16("primary"), UBInt16("secondary"), ), 6: Struct( "spawn", SBInt32("x"), SBInt32("y"), SBInt32("z"),
from empower.lvapp import PT_VERSION from empower.core.module import Module from empower.core.module import ModuleLVAPPWorker from empower.main import RUNTIME PT_ADD_SUMMARY = 0x22 PT_SUMMARY = 0x23 PT_DEL_SUMMARY = 0x24 ADD_SUMMARY = Struct("add_summary", UBInt8("version"), UBInt8("type"), UBInt16("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("addrs", 6), Bytes("hwaddr", 6), UBInt8("channel"), UBInt8("band"), SBInt16("limit"), UBInt16("period")) SUMMARY_ENTRY = Sequence("frames", Bytes("addr", 6), UBInt64("tsft"), UBInt16("seq"), SBInt8("rssi"), UBInt8("rate"), UBInt8("type"), UBInt8("subtype"), UBInt32("length")) SUMMARY_TRIGGER = Struct("summary", UBInt8("version"), UBInt8("type"), UBInt16("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("wtp", 6), UBInt16("nb_entries"), Array(lambda ctx: ctx.nb_entries, SUMMARY_ENTRY)) DEL_SUMMARY = Struct("del_summary", UBInt8("version"), UBInt8("type"), UBInt16("length"), UBInt32("seq"), UBInt32("module_id")) class Summary(Module): """ Summary object. """
ADD_SUMMARY = Struct("add_summary", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("addr", 6), Bytes("hwaddr", 6), UBInt8("channel"), UBInt8("band"), SBInt16("limit"), UBInt16("period")) SUMMARY_ENTRY = Sequence("frames", Bytes("ra", 6), Bytes("ta", 6), UBInt64("tsft"), BitStruct("flags", Padding(6), Bit("mcs"), Padding(9)), UBInt16("seq"), SBInt8("rssi"), UBInt8("rate"), UBInt8("type"), UBInt8("subtype"), UBInt32("length")) SUMMARY_TRIGGER = Struct("summary", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"),
from empower.core.resourcepool import BT_L20 from empower.core.app import EmpowerApp from empower.datatypes.etheraddress import EtherAddress from empower.lvapp.lvappserver import ModuleLVAPPWorker from empower.core.module import ModulePeriodic from empower.lvapp import PT_VERSION from empower.main import RUNTIME PT_NIF_REQUEST = 0x90 PT_NIF_RESPONSE = 0x91 NIF_STATS_ENTRY = Sequence( "rates", UBInt8("rate"), BitStruct("flags", Padding(6), Bit("mcs"), Padding(9)), UBInt32("prob"), UBInt32("cur_prob"), UBInt64("hist_successes"), UBInt64("hist_attempts"), UBInt32("last_successes"), UBInt32("last_attempts"), UBInt64("last_acked_bytes"), UBInt64("hist_acked_bytes")) NIF_STATS_REQUEST = Struct("nif_request", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("sta", 6)) NIF_STATS_RESPONSE = Struct("nif_response", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("wtp", 6), UBInt16("nb_entries"), Array(lambda ctx: ctx.nb_entries, NIF_STATS_ENTRY)) class NIFStats(ModulePeriodic):
from empower.core.resourcepool import ResourceBlock from empower.core.module import ModuleScheduled from empower.main import RUNTIME PT_ADD_SUMMARY = 0x23 PT_SUMMARY = 0x24 PT_DEL_SUMMARY = 0x25 ADD_SUMMARY = Struct("add_summary", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("addr", 6), Bytes("hwaddr", 6), UBInt8("channel"), UBInt8("band"), SBInt16("limit"), UBInt16("period")) SUMMARY_ENTRY = Sequence( "frames", Bytes("ra", 6), Bytes("ta", 6), UBInt64("tsft"), BitStruct("flags", Padding(6), Bit("mcs"), Padding(9)), UBInt16("seq"), SBInt8("rssi"), UBInt8("rate"), UBInt8("type"), UBInt8("subtype"), UBInt32("length")) SUMMARY_TRIGGER = Struct("summary", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id"), Bytes("wtp", 6), UBInt16("nb_entries"), Array(lambda ctx: ctx.nb_entries, SUMMARY_ENTRY)) DEL_SUMMARY = Struct("del_summary", UBInt8("version"), UBInt8("type"), UBInt32("length"), UBInt32("seq"), UBInt32("module_id")) class Summary(ModuleScheduled):
def get_mds_parser(self): self.mdsr_timestamp = Struct( "tai_timestamp", SBInt32("day"), UBInt32("sec"), UBInt32("msec")) self.time_orbit_group = Struct( "time_orbit", self.mdsr_timestamp, UBInt16("uso_corr"), UBInt32("mode_id"), UBInt16("source_sequence_counter"), UBInt32("instrument_configuration"), UBInt32("burst_counter"), OneTenthMicroDeg(SBInt32("latitude")), OneTenthMicroDeg(SBInt32("longitude")), MilliMeter(SBInt32("altitude")), MilliMeter(SBInt32("altitude_rate")), Array(3, MilliMeter(SBInt32("satellite_velocity"))), Array(3, Micrometer(SBInt32("real_beam"))), Array(3, Micrometer(SBInt32("interferometry_baseline"))), UBInt16("star_tracker_usage"), OneTenthMicroDeg(SBInt32("antenna_roll")), OneTenthMicroDeg(SBInt32("antenna_pitch")), OneTenthMicroDeg(SBInt32("antenna_yaw")), UBInt32("fbr_confidence_flag"), Padding(4)) self.measurement_group = Struct( "measurement", PicoSecond(SBInt64("window_delay")), SBInt32("h0"), SBInt32("cor2"), SBInt32("lai"), SBInt32("fai"), OneHundredthDecibel(SBInt32("agc_1")), OneHundredthDecibel(SBInt32("agc_2")), OneHundredthDecibel(SBInt32("fixed_gain_1")), OneHundredthDecibel(SBInt32("fixed_gain_2")), MicroWatts(SBInt32("tx_power")), MilliMeter(SBInt32("doppler_range_correction")), MilliMeter(SBInt32("instrument_range_correction_txrx")), MilliMeter(SBInt32("instrument_range_correction_rx")), OneHundredthDecibel(SBInt32("instrument_gain_correction_txrx")), OneHundredthDecibel(SBInt32("instrument_gain_correction_rx")), MicroRadians(SBInt32("phase_correction_internal")), MicroRadians(SBInt32("phase_correction_external")), OneHundredthDecibel(SBInt32("noise_power")), MicroRadians(SBInt32("phase_slope_correction")), Padding(4)) self.corrections_group = Struct( "corrections", MilliMeter(SBInt32("dry_troposphere")), MilliMeter(SBInt32("wet_troposphere")), MilliMeter(SBInt32("inverse_barometric")), MilliMeter(SBInt32("dynamic_atmosphere")), MilliMeter(SBInt32("ionospheric_gim")), MilliMeter(SBInt32("ionospheric_mod")), MilliMeter(SBInt32("ocean_tide_elastic")), MilliMeter(SBInt32("ocean_tide_long_period")), MilliMeter(SBInt32("ocean_loading_tide")), MilliMeter(SBInt32("solid_earth_tide")), MilliMeter(SBInt32("geocentric_polar_tide")), UBInt32("surface_type"), Padding(4), UBInt32("correction_status"), UBInt32("correction_error"), Padding(4)) self.onehz_waveform_group = Struct( "avg_waveform", self.mdsr_timestamp, OneTenthMicroDeg(SBInt32("latitude")), OneTenthMicroDeg(SBInt32("longitude")), MilliMeter(SBInt32("altitude")), PicoSecond(UBInt64("window_delay")), Array(512, UBInt16("wfm")), SBInt32("linear_scale"), SBInt32("power_scale"), UBInt16("num_avg_echoes"), UBInt16("flags")) self.waveform_flag_group = BitStruct( "flag", Bit("approximate_beam_steering"), Bit("exact_beam_steering"), Bit("doppler_weighting_computed"), Bit("dopple_weighting_applied_before_stack"), Bit("multi_look_incomplete"), Bit("beam_angle_steering_error"), Bit("anti_aliased_power_echoes"), Bit("auto_beam_steering"), Padding(8)) self.waveform_beam_group = Struct( "beam", OneHundredth(UBInt16("stack_standard_deviation")), OneHundredth(UBInt16("stack_centre")), OneHundredthDecibel(SBInt16("stack_scaled_amplitude")), OneHundredth(SBInt16("stack_skewness")), OneHundredth(SBInt16("stack_kurtosis")), MicroRadians(SBInt16("stack_standard_deviation_boresight")), MicroRadians(SBInt16("stack_centre_angle")), OneTenthMicroRadians(SBInt32("doppler_angle_start")), OneTenthMicroRadians(SBInt32("doppler_angle_stop")), OneTenthMicroRadians(SBInt32("look_angle_start")), OneTenthMicroRadians(SBInt32("look_angle_stop")), UBInt16("n_beams_after_weighing"), UBInt16("n_beams_before_weighing"), Padding(66)) self.waveform_group = Struct( "waveform", Array(1024, UBInt16("wfm")), SBInt32("linear_scale"), SBInt32("power_scale"), UBInt16("num_avg_echoes"), self.waveform_flag_group, self.waveform_beam_group, Array(1024, UBInt16("coherence")), Array(1024, SBInt32("phase_difference"))) self.mds_record = Struct( "mds_record", Array(self.n_blocks, self.time_orbit_group), Array(self.n_blocks, self.measurement_group), self.corrections_group, self.onehz_waveform_group, Array(self.n_blocks, self.waveform_group)) self.mds = Array(self.n_records, self.mds_record) return self.mds
"ran_mac_slice_response", Bytes("plmn_id", 4), UBInt8("dscp"), Bytes("padding", 3), Rename("options", OptionalGreedyRange(OPTIONS))) UE_REPORT_REQUEST = Struct("ue_report_request", UBInt8("type"), UBInt8("version"), Bytes("enbid", 8), UBInt16("cellid"), UBInt32("xid"), BitStruct("flags", Padding(15), Bit("dir")), UBInt32("seq"), UBInt16("length"), UBInt16("action"), UBInt8("opcode"), UBInt32("dummy")) UE_REPORT_RESPONSE = Struct("ue_report_response", Rename("options", OptionalGreedyRange(OPTIONS))) UE_REPORT_IDENTITY = Struct("ue_report_identity", UBInt16("rnti"), Bytes("plmn_id", 4), UBInt64("imsi"), UBInt32("timsi")) UE_REPORT_STATE = Struct("ue_report_state", UBInt16("rnti"), UBInt8("state")) UE_HO_REQUEST = Struct("ue_ho_request", UBInt8("type"), UBInt8("version"), Bytes("enbid", 8), UBInt16("cellid"), UBInt32("xid"), BitStruct("flags", Padding(15), Bit("dir")), UBInt32("seq"), UBInt16("length"), UBInt16("action"), UBInt8("opcode"), UBInt16("rnti"), Bytes("target_enbid", 8), UBInt16("target_pci"), UBInt8("cause")) UE_HO_RESPONSE = Struct("ue_ho_response", Bytes("origin_enbid", 8), UBInt16("origin_pci"), UBInt16("origin_rnti"), UBInt16("target_rnti"))
UBInt32("protocol"), AlphaString("username"), AlphaString("password"), ), 2: Struct( "handshake", AlphaString("username"), ), 3: Struct( "chat", AlphaString("message"), ), 4: Struct("time", UBInt64("timestamp")), 5: Struct("position", position, grounded), 6: Struct("orientation", orientation, grounded), 7: Struct("location", position, orientation, grounded), 8: Struct( "animate", UBInt32("eid"), Enum( UBInt8("animation"), noop=0, arm=1, hit=2,