獲取報文信息
Address
Address.ip(hostname)
創建一個表示IPv4地址的地址對象。
參數:
hostname:IP主機的地址或名稱。
返回值:地址對象。
Address.ipv6(hostname)
創建一個表示IPv6地址的地址對象。
參數:
hostname:IP主機的地址或名稱。
返回值:地址對象。
Address.ether(eth)
創建一個代表以太網地址的地址對象。
參數:
eth:以太網地址
返回值:地址對象
address:__tostring()
返回值: 代表地址的字符串。
address:__eq()
比較兩個地址。
address:__le()
比較兩個地址。
address:__lt()
比較兩個地址。
列
數據包的一列。
column:__tostring()
返回值:列的字符串文本(如果沒有括號,則用括號括起來)。
column:clear()
清除列。
column:set(text)
設置列的文本。
參數:
text:設置列的文本
column:append(text)
將文本添加到列。
參數:
text:設置列的文本
column:prepend(text)
將文本添加到列中。
參數:
text:設置列的文本。
column:fence()
設置“列”文本fence,以防止覆蓋。
column:clear_fence()
清除列文字fence
Columns
columns:__tostring()
返回值:字符串“列”。除了調試,這沒有實際用途。
columns:__newindex(column, text)
設置特定列的文本。某些列無法修改,并且如果嘗試則不會引發錯誤。已知允許修改的列是“ info”和“ protocol”。
參數:
要設置的列名稱。有效值為:
| Name | Description |
|---|---|
| number | Frame number |
| abs_time | Absolute timestamp |
| utc_time | UTC timestamp |
| cls_time | CLS timestamp |
| rel_time | Relative timestamp |
| date | Absolute date and time |
| date_doy | Absolute year, day of year, and time |
| utc_date | UTC date and time |
| utc_date_doy | UTC year, day of year, and time |
| delta_time | Delta time from previous packet |
| delta_time_displayed | Delta time from previous displayed packet |
| src | Source address |
| src_res | Resolved source address |
| src_unres | Numeric source address |
| dl_src | Source data link address |
| dl_src_res | Resolved source data link address |
| dl_src_unres | Numeric source data link address |
| net_src | Source network address |
| net_src_res | Resolved source network address |
| net_src_unres | Numeric source network address |
| dst | Destination address |
| dst_res | Resolve destination address |
| dst_unres | Numeric destination address |
| dl_dst | Destination data link address |
| dl_dst_res | Resolved destination data link address |
| dl_dst_unres | Numeric destination data link address |
| net_dst | Destination network address |
| net_dst_res | Resolved destination network address |
| net_dst_unres | Numeric destination network address |
| src_port | Source port |
| src_port_res | Resolved source port |
| src_port_unres | Numeric source port |
| dst_port | Destination port |
| dst_port_res | Resolved destination port |
| dst_port_unres | Numeric destination port |
| protocol | Protocol name |
| info | General packet information |
| packet_len | Packet length |
| cumulative_bytes | Cumulative bytes in the capture |
| direction | Packet direction |
| vsan | Virtual SAN |
| tx_rate | Transmit rate |
| rssi | RSSI value |
| dce_call | DCE call |
例:pinfo.cols[‘info’] = ‘foo bar’
columns:__index()
得到一個具體的Column。
NSTime
NSTime表示一個nstime_t。這是一個具有秒和納秒數的對象。
NSTime.new([seconds], [nseconds])
創建一個新的NSTime對象。
參數:
seconds (optional):秒
nseconds (optional):納秒
返回值:一個新的NSTime對象
nstime:__call([seconds], [nseconds])
創建一個NSTime對象。
參數:
seconds (optional):秒
nseconds (optional):納秒
返回值:一個新的NSTime對象
nstime:tonumber()
返回NSTime代表紀元的Lua數
返回值:Lua 數
nstime:__tostring()
返回值:代表nstime的字符串。
nstime:__add()
計算兩個NSTime的總和。
nstime:__sub()
計算兩個NSTime的差異。
nstime:__unm()
計算負數NSTime。
nstime:__eq()
比較兩個NSTimes。
nstime:__le()
比較兩個NSTimes。
nstime:__lt()
比較兩個NSTimes。
nstime.secs
模式:檢索或分配。
NSTime秒。
nstime.nsecs
模式:檢索或分配。
NSTime納秒。
Pinfo
包的信息。
pinfo.visited
模式:僅檢索。
此數據包是否已被訪問。
pinfo.len
模式:僅檢索。
框架的長度。
pinfo.caplen
模式:僅檢索。
捕獲的幀長度。
pinfo.abs_ts
模式:僅檢索。
數據包何時被捕獲。
pinfo.rel_ts
模式:僅檢索。
自開始捕獲以來經過的秒數。
pinfo.delta_ts
模式:僅檢索。
自上次捕獲的數據包以來經過的秒數。
pinfo.delta_dis_ts
模式:僅檢索。
自上次顯示的數據包以來經過的秒數。
pinfo.curr_proto
模式:僅檢索。
我們要剖析哪個協議。
pinfo.can_desegment
模式:檢索或分配。
設置是否可以細分此段。
pinfo.desegment_len
模式:檢索或分配。
完成PDU所需的估計額外字節數。
pinfo.desegment_offset
模式:檢索或分配。
tvbuff中的偏移量,解剖器將在下一次調用時繼續處理。
pinfo.fragmented
模式:僅檢索。
如果協議只是一個片段。
pinfo.in_error_pkt
模式:僅檢索。
如果我們在錯誤包中。
pinfo.match_uint
模式:僅檢索。
匹配的uint,用于從表中調用子解析器。
pinfo.match_string
模式:僅檢索。
從表中調用子分解器的匹配字符串。
pinfo.port_type
模式:檢索或分配。
.src_port和.dst_port的端口類型。
pinfo.src_port
模式:檢索或分配。
該數據包的目標端口。
pinfo.dl_src
模式:檢索或分配。
該數據包的數據鏈路源地址。
pinfo.dl_dst
模式:檢索或分配。
該數據包的數據鏈路目標地址。
pinfo.net_src
模式:檢索或分配。
該數據包的網絡層源地址。
pinfo.net_dst
模式:檢索或分配。
該數據包的網絡層目標地址。
pinfo.net_dst
模式:檢索或分配。
該數據包的網絡層目標地址。
pinfo.dst
模式:檢索或分配。
該數據包的目標地址。
pinfo.match
模式:僅檢索。
我們匹配的端口/數據。
pinfo.columns
模式:僅檢索。
訪問數據包列表列。
pinfo.cols
模式:僅檢索。
訪問數據包列表列(相當于pinfo.columns)。
pinfo.cols
模式:僅檢索。
訪問數據包列表列(相當于pinfo.columns)。
pinfo.hi
模式:檢索或分配。
此數據包的較高地址。
pinfo.lo
模式:僅檢索。
此數據包的低位地址。
pinfo.conversation
模式:僅分配。
將數據包對話設置為給定的Proto對象。
PrivateTable
PrivateTable表示pinfo→private_table。
privatetable:__ tostring()
獲取有關專用表的調試類型信息。
返回值:具有表中所有鍵的字符串,主要用于調試。
Wireshark中文使用教程(開發版)