이더넷의 유형 필드를 기반으로 자신의 해부학자에게 전화하는 방법은 무엇입니까? 이더넷 프레임에서 Type 값을 가져온 후 일부 추가 된 필드로 사용자 정의 이더넷 프레임을 분석하고 정상적인 해부를 진행합니다.레이어 2에 Wireshark 해부 체 추가하기
특정 UDP/TCP 포트에서 패킷을 해독 할 수는 있지만 지정된 이더넷 유형에서는 수행하지 못하는 해부학자를 쓸 수 있습니다.
이더넷의 유형 필드를 기반으로 자신의 해부학자에게 전화하는 방법은 무엇입니까? 이더넷 프레임에서 Type 값을 가져온 후 일부 추가 된 필드로 사용자 정의 이더넷 프레임을 분석하고 정상적인 해부를 진행합니다.레이어 2에 Wireshark 해부 체 추가하기
특정 UDP/TCP 포트에서 패킷을 해독 할 수는 있지만 지정된 이더넷 유형에서는 수행하지 못하는 해부학자를 쓸 수 있습니다.
다음 코드는 vlan_dissector를 이더넷 802.1Q 프레임의 해부로 등록합니다.
-- subscribe for Ethernet packets on type 33024(0x8100).
local eth_table = Dissector.get("ethertype")
eth_table:add(33024, vlan_dissector)
지금 당장 스 니펫 작업을하고 있습니다. 그것은 단지 프로토 타입 일뿐입니다.
-- create myproto protocol and its fields
p_myproto = Proto ("myproto","My Protocol")
local f_command = ProtoField.uint16("myproto.command", "Command", base.HEX)
local f_data = ProtoField.string("myproto.data", "Data", FT_STRING)
p_myproto.fields = {f_command}
-- myproto dissector function
function p_myproto.dissector (buf, pkt, root)
-- validate packet length is adequate, otherwise quit
if buf:len() == 0 then return end
pkt.cols.protocol = p_myproto.name
-- create subtree for myproto
subtree = root:add(p_myproto, buf(0))
-- add protocol fields to subtree
subtree:add(f_command, buf(0,2)):append_text(" [Command text]")
-- description of payload
subtree:append_text(", Command details here or in the tree below")
end
-- Initialization routine
function p_myproto.init()
end
-- subscribe for Ethernet packets on type 5212 (0x145c).
local eth_table = DissectorTable.get("ethertype")
eth_table:add(5212, p_myproto)