Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dripcap03

h2so5
September 24, 2016

 Dripcap03

h2so5

September 24, 2016
Tweet

More Decks by h2so5

Other Decks in Programming

Transcript

  1. (6*ͷϓϥάΠϯεΫϦϓτʢൈਮʣ import $ from 'jquery'; import riot from 'riot'; import

    Component from 'dripcap/component'; import { Package } from 'dripcap'; export default class PacketFilterView { async activate() { let pkg = await Package.load('main-view'); let wrapper = $('<div/>'); this.comp = new Component(`${__dirname}/../tag/*.tag`); this.view = riot.mount(wrapper[0], 'packet-filter-view')[0]; pkg.root.panel.leftSouthFixed(wrapper); } async deactivate() { let pkg = await Package.load('main-view'); pkg.root.panel.leftSouthFixed(); this.view.unmount(); this.comp.destroy(); } }
  2. import { Layer, Buffer } from 'dripcap'; import MACAddress from

    'dripcap/mac'; import EthEnum from 'dripcap/eth/type'; export default class EthrenetDissector { analyze(packet, parentLayer) { let layer = new Layer(); layer.name = 'Ethernet'; layer.namespace = '::Ethernet'; let destination = parentLayer.payload.slice(0, 6); layer.fields.push({ name: 'MAC destination', attr: 'dst', data: destination }); layer.attrs.dst = new MACAddress(destination); let source = parentLayer.payload.slice(6, 12); layer.fields.push({ name: 'MAC source', attr: 'src', data: source }); layer.attrs.src = new MACAddress(source); ղੳثͷϓϥάΠϯεΫϦϓτʢൈਮʣ
  3. /PEFKTͷ"1*ͱͷޓ׵ੑͷ໰୊ w ղੳث EJTTFDUPS ͷ࣮ߦ؀ڥ͸/PEFKTͰ ͸ͳ͘ɺૉͷ+BWB4DSJQU 7  /PEFKT ෩#V⒎FS

    w /PEFKTͷ"1*͸جຊతʹ࢖͑ͳ͍ͷͰɺ मਖ਼͠ͳ͍ͱར༻Ͱ͖ͳ͍OQNϞδϡʔϧ ΋͋Δ