PT_WIFI_SLICE_STATS_REQUEST = 0x4C PT_WIFI_SLICE_STATS_RESPONSE = 0x4D WIFI_SLICE_STATS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "ssid" / Bytes(WIFI_NWID_MAXSIZE + 1), "slice_id" / Int8ub, ) WIFI_SLICE_STATS_REQUEST.name = "wifi_slice_stats_request" SLICE_STATS_ENTRY = Struct( "iface_id" / Int32ub, "deficit_used" / Int32ub, "max_queue_length" / Int32ub, "tx_packets" / Int32ub, "tx_bytes" / Int32ub, ) SLICE_STATS_ENTRY.name = "slice_stats_entry" WIFI_SLICE_STATS_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub,
PACKET = Struct( "version" / Int8ub, "flags" / BitStruct("padding" / Padding(7), "msg_type" / Flag), "tsrc" / BitStruct( "crud_result" / BitsInteger(2), "action" / BitsInteger(14), ), "length" / Int32ub, "padding" / Bytes(2), "device" / Bytes(6), "seq" / Int32ub, "xid" / Int32ub, "tlvs" / GreedyRange(TLVS)) # TLV dicts PT_HELLO_SERVICE_PERIOD = 0x04 PT_CAPABILITIES_SERVICE_CELL = 0x06 HELLO_SERVICE_PERIOD = Struct("period" / Int32ub) HELLO_SERVICE_PERIOD.name = "hello_service_period" CAPABILITIES_SERVICE_CELL = Struct("pci" / Int16ub, "dl_earfcn" / Int32ub, "ul_earfcn" / Int32ub, "n_prbs" / Int8ub) CAPABILITIES_SERVICE_CELL.name = "capabilities_service_cell" TLVS = { PT_HELLO_SERVICE_PERIOD: HELLO_SERVICE_PERIOD, PT_CAPABILITIES_SERVICE_CELL: CAPABILITIES_SERVICE_CELL, } # Packet types PT_TYPES = { PT_DEVICE_DOWN: None, PT_DEVICE_UP: None,
PT_UCQM_REQUEST = 0x26 PT_UCQM_RESPONSE = 0x27 PT_NCQM_REQUEST = 0x28 PT_NCQM_RESPONSE = 0x29 CQM_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub, ) CQM_REQUEST.name = "cqm_request" CQM_ENTRY = Struct( "addr" / Bytes(6), "last_rssi_std" / Int8ub, "last_rssi_avg" / Int8ub, "last_packets" / Int32ub, "hist_packets" / Int32ub, "mov_rssi" / Int8ub ) CQM_ENTRY.name = "ucqm_entry" CQM_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub,
from empower.core.app import EApp from empower.core.app import EVERY PT_BIN_COUNTERS_REQUEST = 0x18 PT_BIN_COUNTERS_RESPONSE = 0x19 BIN_COUNTERS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "sta" / Bytes(6), ) BIN_COUNTERS_REQUEST.name = "bin_counters_request" COUNTERS_ENTRY = Struct( "size" / Int16ub, "count" / Int32ub, ) COUNTERS_ENTRY.name = "counters_entry" BIN_COUNTERS_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "sta" / Bytes(6),
PT_DEL_SLICE = 0x1A PT_SLICE_STATUS_RESPONSE = 0x1B PT_SLICE_STATUS_REQUEST = 0x1C PT_IGMP_REPORT = 0xE0 PT_INCOMING_MCAST_ADDR = 0xE1 HEADER = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), ) HEADER.name = "header" HELLO_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "period" / Int32ub, ) HELLO_REQUEST.name = "hello_request" HELLO_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub,
from empower.core.worker import EWorker PT_WSS_REQUEST = 0x59 PT_WSS_RESPONSE = 0x60 WSS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub, ) WSS_REQUEST.name = "wss_request" WSS_ENTRY = Struct( "slice_id" / Int8ub, "ssid" / Bytes(WIFI_NWID_MAXSIZE + 1), "deficit_used" / Int32ub, "max_queue_length" / Int32ub, "tx_packets" / Int32ub, "tx_bytes" / Int32ub, ) WSS_ENTRY.name = "wss_entry" WSS_RESPONSE = Struct("version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub, "nb_entries" / Int16ub, "entries" / Array(lambda ctx: ctx.nb_entries, WSS_ENTRY))
from empower.managers.ranmanager.lvapp.wifiapp import EWApp from empower.core.app import EVERY PT_WIFI_RC_STATS_REQUEST = 0x80 PT_WIFI_RC_STATS_RESPONSE = 0x81 WIFI_RC_STATS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "sta" / Bytes(6), ) WIFI_RC_STATS_REQUEST.name = "wifi_rc_stats_request" RC_ENTRY = Struct("rate" / Int8ub, "prob" / Int32ub, "cur_prob" / Int32ub, "cur_tp" / Int32ub, "last_attempts" / Int32ub, "last_successes" / Int32ub, "hist_attempts" / Int32ub, "hist_successes" / Int32ub) RC_ENTRY.name = "rc_entry" WIFI_RC_STATS_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub,
import empower.managers.ranmanager.vbsp as vbsp from empower.managers.ranmanager.vbsp.lteworker import ELTEWorker from empower_core.app import EVERY PT_MAC_PRB_UTILIZATION_SERVICE = 0x04 TLV_MAC_PRB_UTILIZATION = 0x0A MAC_PRB_UTILIZATION_SERVICE_REPORT = Struct( "prb" / Int16ub, "dl_prb_counter" / Int32ub, "ul_prb_counter" / Int32ub, "pci" / Int16ub, ) MAC_PRB_UTILIZATION_SERVICE_REPORT.name = "mac_prb_utilization_report" class MACPrbUtilization(ELTEWorker): """MAC PRB Utilization Reports. Collect the MAC level PRB utilization reports Parameters: every: the loop period in ms (optional, default 2000ms) Example: POST /api/v1/projects/52313ecb-9d00-4b7d-b873-b55d3d9ada26/apps { "name": "empower.workers.macprbutilization.macprbutilization", "params": {
PT_DEVICE_UP = "device_up" PT_CLIENT_JOIN = "client_join" PT_CLIENT_LEAVE = "client_leave" PT_HELLO_REQUEST = 0x01 PT_HELLO_RESPONSE = 0x02 HEADER = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "wtp" / Bytes(6), ) HEADER.name = "header" HELLO_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "wtp" / Bytes(6), ) HELLO_REQUEST.name = "hello_request" HELLO_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub,
from empower.core.worker import EWorker PT_WCS_REQUEST = 0x4A PT_WCS_RESPONSE = 0x4B WCS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub, ) WCS_REQUEST.name = "wcs_request" WCS_ENTRY = Struct( "type" / Int8ub, "timestamp" / Int64ub, "sample" / Int32ub, ) WCS_ENTRY.name = "wcs_entry" WCS_RESPONSE = Struct("version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "iface_id" / Int32ub, "nb_entries" / Int16ub, "entries" / Array(lambda ctx: ctx.nb_entries, WCS_ENTRY)) WCS_RESPONSE.name = "wcs_response"
) # TLV dicts PT_HELLO_SERVICE_PERIOD = 0x05 PT_CAPABILITIES_SERVICE_CELL = 0x06 PT_UE_REPORTS_SERVICE_IDENTITY = 0x07 TLV_MEASUREMENTS_SERVICE_CONFIG = 0x08 TLV_MEASUREMENTS_SERVICE_REPORT = 0x09 TLV_MEASUREMENTS_SERVICE_MEAS_ID = 0x0B HELLO_SERVICE_PERIOD = Struct( "period" / Int32ub ) HELLO_SERVICE_PERIOD.name = "hello_service_period" CAPABILITIES_SERVICE_CELL = Struct( "pci" / Int16ub, "dl_earfcn" / Int32ub, "ul_earfcn" / Int32ub, "n_prbs" / Int8ub ) CAPABILITIES_SERVICE_CELL.name = "capabilities_service_cell" UE_REPORTS_SERVICE_IDENTITY = Struct( "imsi" / Int64ub, "tmsi" / Int32ub, "rnti" / Int16ub, "status" / Int8ub, "pci" / Int16ub,
from empower.managers.ranmanager.vbsp.lteapp import ELTEApp from empower.managers.ranmanager.vbsp import MSG_TYPE_RESPONSE, RESULT_FAIL PT_UE_MEASUREMENTS_SERVICE = 0x03 TLV_MEASUREMENTS_SERVICE_CONFIG = 0x08 TLV_MEASUREMENTS_SERVICE_REPORT = 0x09 TLV_MEASUREMENTS_SERVICE_MEAS_ID = 0x0B UE_MEASUREMENTS_SERVICE_CONFIG = Struct( "rnti" / Int16ub, "meas_id" / Int8ub, "interval" / Int8ub, "amount" / Int8ub, ) UE_MEASUREMENTS_SERVICE_CONFIG.name = "ue_measurements_service_request" UE_MEASUREMENTS_SERVICE_MEAS_ID = Struct( "rnti" / Int16ub, "meas_id" / Int8ub, ) UE_MEASUREMENTS_SERVICE_MEAS_ID.name = "ue_measurements_service_meas_id" UE_MEASUREMENTS_SERVICE_REPORT = Struct( "rnti" / Int16ub, "meas_id" / Int8ub, "rsrp" / Int8ub, "rsrq" / Int8ub, ) UE_MEASUREMENTS_SERVICE_REPORT.name = "ue_measurements_service_report"
from empower.apps.wifinetworkstats.lvaprcstats import LvapRCStats PT_BIN_COUNTERS_REQUEST = 0x82 PT_BIN_COUNTERS_RESPONSE = 0x83 BIN_COUNTERS_REQUEST = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "sta" / Bytes(6), ) BIN_COUNTERS_REQUEST.name = "bin_counters_request" COUNTERS_ENTRY = Struct( "size" / Int16ub, "count" / Int32ub, ) COUNTERS_ENTRY.name = "counters_entry" BIN_COUNTERS_RESPONSE = Struct( "version" / Int8ub, "type" / Int8ub, "length" / Int32ub, "seq" / Int32ub, "xid" / Int32ub, "device" / Bytes(6), "sta" / Bytes(6),
"version" / Int8ub, "flags" / BitStruct("msg_type" / Flag, "padding" / Padding(7)), "tsrc" / BitStruct( "crud_result" / BitsInteger(2), "action" / BitsInteger(14), ), "length" / Int32ub, "padding" / Bytes(2), "device" / Bytes(6), "seq" / Int32ub, "xid" / Int32ub, "tlvs" / GreedyRange(TLVS)) # TLV dicts PT_HELLO_SERVICE_PERIOD = 0x05 PT_CAPABILITIES_SERVICE_CELL = 0x06 PT_UE_REPORTS_SERVICE_IDENTITY = 0x07 HELLO_SERVICE_PERIOD = Struct("period" / Int32ub) HELLO_SERVICE_PERIOD.name = "hello_service_period" CAPABILITIES_SERVICE_CELL = Struct("pci" / Int16ub, "dl_earfcn" / Int32ub, "ul_earfcn" / Int32ub, "n_prbs" / Int8ub) CAPABILITIES_SERVICE_CELL.name = "capabilities_service_cell" UE_REPORTS_SERVICE_IDENTITY = Struct( "imsi" / Int64ub, "tmsi" / Int32ub, "rnti" / Int16ub, "status" / Int8ub, "pci" / Int16ub, ) UE_REPORTS_SERVICE_IDENTITY.name = "ue_reports_service_identity" TLVS = {