UNPKG

ethernet

Version:
27 lines (26 loc) 629 B
/// <reference types="node" /> export interface EthernetTCI { pcp: number; dei: number; vid: number; } export interface EthernetTag { tpid: number; tci: EthernetTCI; } export interface EthernetHeader { destination: string; source: string; tag?: EthernetTag; stag?: EthernetTag; ctag?: EthernetTag; ethertype: number; payload: string; } /** * Decode an Ethernet frame * @param {string | Buffer} frame The raw frame data as a hex string or Node.js Buffer * @returns {EthernetHeader} */ declare const ethernet: (frame: string | Buffer) => EthernetHeader; export default ethernet;