MCPcopy Create free account
hub / github.com/deepclause/agentvm / sendBroadcast

Method sendBroadcast

src/network.js:375–391  ·  view source on GitHub ↗
(payload, proto)

Source from the content-addressed store, hash-verified

373
374 // Send to broadcast MAC (for DHCP etc)
375 sendBroadcast(payload, proto) {
376 const broadcastMac = Buffer.from([0xff, 0xff, 0xff, 0xff, 0xff, 0xff]);
377
378 const frame = Buffer.alloc(14 + payload.length);
379 broadcastMac.copy(frame, 0); // Destination: broadcast
380 this.gatewayMac.copy(frame, 6); // Source: gateway MAC
381 frame.writeUInt16BE(proto, 12);
382 payload.copy(frame, 14);
383
384 // Wrap in QEMU framing
385 const header = Buffer.alloc(4);
386 header.writeUInt32BE(frame.length, 0);
387
388 this.txBuffer = Buffer.concat([this.txBuffer, header, frame]);
389
390 this.emit('network-activity');
391 }
392
393 receive(frame) {
394 try {

Callers 1

sendIPMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected