cleanup code style

This commit is contained in:
ading2210 2025-11-07 10:23:11 -08:00 committed by Fabian
parent 081b1eaafd
commit 97cd3069ac
2 changed files with 3 additions and 5 deletions

View file

@ -45,12 +45,10 @@ const TCP_DYNAMIC_PORT_RANGE = TCP_DYNAMIC_PORT_END - TCP_DYNAMIC_PORT_START;
const ETH_HEADER_SIZE = 14;
const ETH_PAYLOAD_OFFSET = ETH_HEADER_SIZE;
const MTU_DEFAULT = 1500;
//const ETH_PAYLOAD_SIZE = 1500; //mtu
const MTU_DEFAULT = 1500;
const ETH_TRAILER_SIZE = 4;
const IPV4_HEADER_SIZE = 20;
const IPV4_PAYLOAD_OFFSET = ETH_PAYLOAD_OFFSET + IPV4_HEADER_SIZE;
//const IPV4_PAYLOAD_SIZE = ETH_PAYLOAD_SIZE - IPV4_HEADER_SIZE;
const UDP_HEADER_SIZE = 8;
const UDP_PAYLOAD_OFFSET = IPV4_PAYLOAD_OFFSET + UDP_HEADER_SIZE;
const TCP_HEADER_SIZE = 20;

View file

@ -9,7 +9,7 @@ import * as marshall from "../lib/marshall.js";
import { CPU } from "./cpu.js";
import { BusConnector } from "./bus.js";
const DEFAULT_MTU = 1500;
const MTU_DEFAULT = 1500;
const VIRTIO_NET_F_MAC = 5;
const VIRTIO_NET_F_CTRL_VQ = 17;
@ -28,7 +28,7 @@ const VIRTIO_NET_CTRL_MAC_ADDR_SET = 1;
* @param {Boolean} preserve_mac_from_state_image
* @param {number} mtu
*/
export function VirtioNet(cpu, bus, preserve_mac_from_state_image, mtu = DEFAULT_MTU)
export function VirtioNet(cpu, bus, preserve_mac_from_state_image, mtu = MTU_DEFAULT)
{
/** @const @type {BusConnector} */
this.bus = bus;