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

Function createEthFrame

test/network/stack.test.js:27–34  ·  view source on GitHub ↗
(srcMac, dstMac, etherType, payload)

Source from the content-addressed store, hash-verified

25
26// Helper to create Ethernet frame
27function createEthFrame(srcMac, dstMac, etherType, payload) {
28 const frame = Buffer.alloc(14 + payload.length);
29 dstMac.copy(frame, 0);
30 srcMac.copy(frame, 6);
31 frame.writeUInt16BE(etherType, 12);
32 payload.copy(frame, 14);
33 return frame;
34}
35
36// Helper to create IP header
37function createIPHeader(net, srcIP, dstIP, protocol, payloadLen) {

Callers 1

stack.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected