aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-08-28 15:38:33 -0700
committerAnders Broman <a.broman58@gmail.com>2018-08-31 05:25:17 +0000
commitef013598494e8a6571d042bc73c2dab393934b2f (patch)
tree81c642e80868d852c8022f4caeea747e11bcd1ab /test
parent9a71ec042e68743ad709ae1b8b718985d4c79450 (diff)
Add support for protocol aliases. Switch BOOTP to DHCP.
Add support for aliasing one protocol name to another and for filtering using aliased fields. Mark aliased fields as deprecated. Rename the BOOTP dissector to DHCP and alias "bootp" to "dhcp". This lets you use both "dhcp.type" and "bootp.type" as display filter fields without having to duplicate all 500+ DHCP/BOOTP fields. To do: - Add checks to proto.c:check_valid_filter_name_or_fail? - Transition SSL to TLS. - Rename packet-bootp.c to packet-dhcp.c? Change-Id: I29977859995e8347d80b8e83f1618db441b10279 Ping-Bug: 14922 Reviewed-on: https://code.wireshark.org/review/29327 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/lua/field.lua8
-rw-r--r--test/lua/listener.lua46
-rw-r--r--test/lua/nstime.lua2
-rw-r--r--test/lua/pinfo.lua2
-rw-r--r--test/lua/proto.lua2
5 files changed, 30 insertions, 30 deletions
diff --git a/test/lua/field.lua b/test/lua/field.lua
index 2e9d1c62bb..008a9bc942 100644
--- a/test/lua/field.lua
+++ b/test/lua/field.lua
@@ -67,8 +67,8 @@ local f_ip_src = Field.new("ip.src")
local f_ip_dst = Field.new("ip.dst")
local f_udp_srcport = Field.new("udp.srcport")
local f_udp_dstport = Field.new("udp.dstport")
-local f_bootp_hw = Field.new("bootp.hw.mac_addr")
-local f_bootp_opt = Field.new("bootp.option.type")
+local f_dhcp_hw = Field.new("dhcp.hw.mac_addr")
+local f_dhcp_opt = Field.new("dhcp.option.type")
test("Field__tostring-1", tostring(f_frame_proto) == "frame.protocols")
@@ -82,7 +82,7 @@ test("Field.type-1", f_frame_proto.type == ftypes.STRING)
test("Field.type-2", f_eth_src.type == ftypes.ETHER)
test("Field.type-3", f_ip_src.type == ftypes.IPv4)
test("Field.type-4", f_udp_srcport.type == ftypes.UINT16)
-test("Field.type-5", f_bootp_opt.type == ftypes.UINT8)
+test("Field.type-5", f_dhcp_opt.type == ftypes.UINT8)
-- make sure can't create a FieldInfo outside tap
test("Field__call-1",not pcall(makeFieldInfo,f_eth_src))
@@ -112,7 +112,7 @@ function tap.packet(pinfo,tvb)
test("Field.type-7", f_eth_src.type == ftypes.ETHER)
test("Field.type-8", f_ip_src.type == ftypes.IPv4)
test("Field.type-9", f_udp_srcport.type == ftypes.UINT16)
- test("Field.type-10", f_bootp_opt.type == ftypes.UINT8)
+ test("Field.type-10", f_dhcp_opt.type == ftypes.UINT8)
testing("FieldInfo")
diff --git a/test/lua/listener.lua b/test/lua/listener.lua
index 55873fbbab..f3cf83276d 100644
--- a/test/lua/listener.lua
+++ b/test/lua/listener.lua
@@ -6,7 +6,7 @@
local FRAME = "frame"
local ETH = "eth"
local IP = "ip"
-local BOOTP = "bootp"
+local DHCP = "dhcp"
local OTHER = "other"
local PDISS = "postdissector"
@@ -33,9 +33,9 @@ end
-- expected number of runs per type
-- note ip only runs 3 times because it gets removed
--- and bootp only runs twice because the filter makes it run
+-- and dhcp only runs twice because the filter makes it run
-- once and then it gets replaced with a different one for the second time
-local taptests = { [FRAME]=4, [ETH]=4, [IP]=3, [BOOTP]=2, [OTHER]=16 }
+local taptests = { [FRAME]=4, [ETH]=4, [IP]=3, [DHCP]=2, [OTHER]=16 }
local function getResults()
print("\n-----------------------------\n")
for k,v in pairs(taptests) do
@@ -165,13 +165,13 @@ local f_eth_dst = Field.new("eth.dst")
local f_eth_mac = Field.new("eth.addr")
local f_ip_src = Field.new("ip.src")
local f_ip_dst = Field.new("ip.dst")
-local f_bootp_hw = Field.new("bootp.hw.mac_addr")
-local f_bootp_opt = Field.new("bootp.option.type")
+local f_dhcp_hw = Field.new("dhcp.hw.mac_addr")
+local f_dhcp_opt = Field.new("dhcp.option.type")
local tap_frame = Listener.new(nil,nil,true)
local tap_eth = Listener.new("eth")
-local tap_ip = Listener.new("ip","bootp")
-local tap_bootp = Listener.new("bootp","bootp.option.dhcp == 1")
+local tap_ip = Listener.new("ip","dhcp")
+local tap_dhcp = Listener.new("dhcp","dhcp.option.dhcp == 1")
local second_time = false
@@ -198,13 +198,13 @@ end
function tap_eth.packet(pinfo,tvb,eth)
incPktCount(ETH)
- -- on the 4th run of eth, remove the ip one and add a new bootp one
+ -- on the 4th run of eth, remove the ip one and add a new dhcp one
if getPktCount(ETH) == 4 then
- testing(ETH,"removing ip tap, replacing bootp tap")
+ testing(ETH,"removing ip tap, replacing dhcp tap")
tap_ip:remove()
- tap_bootp:remove()
- tap_bootp = Listener.new("bootp")
- tap_bootp.packet = bootp_packet
+ tap_dhcp:remove()
+ tap_dhcp = Listener.new("dhcp")
+ tap_dhcp.packet = dhcp_packet
second_time = true
end
@@ -242,28 +242,28 @@ function tap_ip.packet(pinfo,tvb,ip)
setPassed(IP)
end
-bootp_packet = function (pinfo,tvb,bootp)
- incPktCount(BOOTP)
- testing(BOOTP,"Bootp")
+dhcp_packet = function (pinfo,tvb,dhcp)
+ incPktCount(DHCP)
+ testing(DHCP,"DHCP")
- test(BOOTP,"arg-1", typeof(pinfo) == "Pinfo")
- test(BOOTP,"arg-2", typeof(tvb) == "Tvb")
- test(BOOTP,"arg-3", bootp == nil)
+ test(DHCP,"arg-1", typeof(pinfo) == "Pinfo")
+ test(DHCP,"arg-2", typeof(tvb) == "Tvb")
+ test(DHCP,"arg-3", dhcp == nil)
if not second_time then
- test(BOOTP,"pinfo.number-1",pinfo.number == getPktCount(BOOTP))
+ test(DHCP,"pinfo.number-1",pinfo.number == getPktCount(DHCP))
else
- test(BOOTP,"pinfo.number-1",pinfo.number == 4)
+ test(DHCP,"pinfo.number-1",pinfo.number == 4)
end
-- check ether addr
local eth_src1 = tostring(f_eth_src().range)
local eth_src2 = tostring(tvb:range(6,6))
- test(BOOTP,"FieldInfo.range-1", eth_src1 == eth_src2)
+ test(DHCP,"FieldInfo.range-1", eth_src1 == eth_src2)
- setPassed(BOOTP)
+ setPassed(DHCP)
end
-tap_bootp.packet = bootp_packet
+tap_dhcp.packet = dhcp_packet
function tap_frame.reset()
-- reset never gets called in tshark (sadly)
diff --git a/test/lua/nstime.lua b/test/lua/nstime.lua
index 00daa3e40e..a6ac8a3403 100644
--- a/test/lua/nstime.lua
+++ b/test/lua/nstime.lua
@@ -29,7 +29,7 @@ end
-- expected number of runs per type
-- note ip only runs 3 times because it gets removed
--- and bootp only runs twice because the filter makes it run
+-- and dhcp only runs twice because the filter makes it run
-- once and then it gets replaced with a different one for the second time
local taptests = { [FRAME]=4, [OTHER]=44 }
local function getResults()
diff --git a/test/lua/pinfo.lua b/test/lua/pinfo.lua
index 220bb7d484..4cc9f0b95d 100644
--- a/test/lua/pinfo.lua
+++ b/test/lua/pinfo.lua
@@ -39,7 +39,7 @@ end
-- expected number of runs per type
-- note ip only runs 3 times because it gets removed
--- and bootp only runs twice because the filter makes it run
+-- and dhcp only runs twice because the filter makes it run
-- once and then it gets replaced with a different one for the second time
local taptests = { [FRAME]=4, [OTHER]=0 }
local function getResults()
diff --git a/test/lua/proto.lua b/test/lua/proto.lua
index 157c4b2a9c..e24a439acb 100644
--- a/test/lua/proto.lua
+++ b/test/lua/proto.lua
@@ -45,7 +45,7 @@ end
-- expected number of runs per type
-- note ip only runs 3 times because it gets removed
--- and bootp only runs twice because the filter makes it run
+-- and dhcp only runs twice because the filter makes it run
-- once and then it gets replaced with a different one for the second time
local taptests = { [FRAME]=4, [OTHER]=48 }
local function getResults()