more log tags

This commit is contained in:
Mikayla Fischler
2025-10-26 13:39:58 -04:00
parent 18a488f1b9
commit 7ddd6f32c5
3 changed files with 43 additions and 41 deletions

View File

@@ -49,7 +49,7 @@ function network.init_mac(passkey)
c_eng.hmac.setKey(c_eng.key)
local init_time = util.time_ms() - start
log.info("network.init_mac completed in " .. init_time .. "ms")
log.info("NET: network.init_mac completed in " .. init_time .. "ms")
return init_time
end
@@ -71,7 +71,7 @@ local function compute_hmac(message)
local hash = c_eng.hmac.asHex()
-- log.debug("compute_hmac(): hmac-md5 = " .. util.strval(hash) .. " (took " .. (util.time_ms() - start) .. "ms)")
-- log.debug("NET: compute_hmac(): hmac-md5 = " .. util.strval(hash) .. " (took " .. (util.time_ms() - start) .. "ms)")
return hash
end
@@ -190,13 +190,13 @@ function network.nic(modem)
---@cast tx_packet authd_packet
tx_packet.make(packet, compute_hmac)
-- log.debug("network.modem.transmit: data processing took " .. (util.time_ms() - start) .. "ms")
-- log.debug("NET: network.modem.transmit: data processing took " .. (util.time_ms() - start) .. "ms")
end
---@diagnostic disable-next-line: need-check-nil
modem.transmit(dest_channel, local_channel, tx_packet.raw_sendable())
else
log.debug("network.transmit tx dropped, link is down")
log.debug("NET: network.transmit tx dropped, link is down")
end
end
@@ -227,10 +227,10 @@ function network.nic(modem)
local computed_hmac = compute_hmac(textutils.serialize(s_packet.raw_header(), { allow_repetitions = true, compact = true }))
if a_packet.mac() == computed_hmac then
-- log.debug("network.modem.receive: HMAC verified in " .. (util.time_ms() - start) .. "ms")
-- log.debug("NET: network.modem.receive: HMAC verified in " .. (util.time_ms() - start) .. "ms")
s_packet.stamp_authenticated()
else
-- log.debug("network.modem.receive: HMAC failed verification in " .. (util.time_ms() - start) .. "ms")
-- log.debug("NET: network.modem.receive: HMAC failed verification in " .. (util.time_ms() - start) .. "ms")
end
end
end