Lines Matching refs:pinfo

76 local function setPinfo(pinfo,name,value)
77 pinfo[name] = value
80 local function getPinfo(pinfo,name)
81 local foo = pinfo[name]
97 function tap.packet(pinfo,tvb)
101 test("typeof-1", typeof(pinfo) == "Pinfo")
103 test("tostring-1", tostring(pinfo) == "a Pinfo")
133 test("Pinfo.src-set-1",not pcall(setPinfo,pinfo,"src","foobar"))
134 test("Pinfo.dst-set-1",not pcall(setPinfo,pinfo,"dst","foobar"))
135 test("Pinfo.dl_src-set-1",not pcall(setPinfo,pinfo,"dl_src","foobar"))
136 test("Pinfo.dl_dst-set-1",not pcall(setPinfo,pinfo,"dl_dst","foobar"))
137 test("Pinfo.net_src-set-1",not pcall(setPinfo,pinfo,"net_src","foobar"))
138 test("Pinfo.net_dst-set-1",not pcall(setPinfo,pinfo,"net_dst","foobar"))
139 test("Pinfo.src_port-set-1",not pcall(setPinfo,pinfo,"src_port","foobar"))
140 test("Pinfo.dst_port-set-1",not pcall(setPinfo,pinfo,"dst_port","foobar"))
142 test("Pinfo.can_desegment-set-1",not pcall(setPinfo,pinfo,"can_desegment","foobar"))
144 test("Pinfo.desegment_len-set-1",not pcall(setPinfo,pinfo,"desegment_len","foobar"))
145 test("Pinfo.desegment_offset-set-1",not pcall(setPinfo,pinfo,"desegment_offset","foobar"))
158 if pinfo.number == 1 or pinfo.number == 3 then
172 test("Pinfo.number-get-1",pinfo.number == getPktCount(FRAME))
173 test("Pinfo.len-get-1",pinfo.len == pktlen)
174 test("Pinfo.caplen-get-1",pinfo.caplen == pktlen)
175 test("Pinfo.visited-get-1",pinfo.visited == true)
176 test("Pinfo.lo-get-1",tostring(pinfo.lo) == srcip)
177 test("Pinfo.lo-get-2",typeof(pinfo.lo) == "Address")
178 test("Pinfo.hi-get-1",tostring(pinfo.hi) == dstip)
179 test("Pinfo.hi-get-2",typeof(pinfo.hi) == "Address")
180 test("Pinfo.port_type-get-1",pinfo.port_type == 3)
181 test("Pinfo.match-get-1",pinfo.match == 0)
182 test("Pinfo.curr_proto-get-1",tostring(pinfo.curr_proto) == "<Missing Protocol Name>")
183 test("Pinfo.columns-get-1",tostring(pinfo.columns) == "Columns")
184 test("Pinfo.columns-get-2",typeof(pinfo.columns) == "Columns")
185 test("Pinfo.cols-get-1",tostring(pinfo.cols) == "Columns")
186 test("Pinfo.cols-get-2",typeof(pinfo.cols) == "Columns")
187 test("Pinfo.private-get-1",type(pinfo.private) == "userdata")
188 test("Pinfo.fragmented-get-1",pinfo.fragmented == false)
190 test("Pinfo.in_error_pkt-get-1",pinfo.in_error_pkt == false)
191 test("Pinfo.match_uint-get-1",pinfo.match_uint == 0)
192 test("Pinfo.match_string-get-1",pinfo.match_string == nil)
194 test("Pinfo.src-get-1",tostring(pinfo.src) == srcip)
195 test("Pinfo.src-get-2",typeof(pinfo.src) == "Address")
196 test("Pinfo.dst-get-1",tostring(pinfo.dst) == dstip)
197 test("Pinfo.dst-get-2",typeof(pinfo.dst) == "Address")
199 test("Pinfo.dl_src-get-1",typeof(pinfo.dl_src) == "Address")
200 test("Pinfo.dl_dst-get-1",typeof(pinfo.dl_dst) == "Address")
201 test("Pinfo.net_src-get-1",tostring(pinfo.net_src) == srcip)
202 test("Pinfo.net_src-get-2",typeof(pinfo.net_src) == "Address")
203 test("Pinfo.net_dst-get-1",tostring(pinfo.net_dst) == dstip)
204 test("Pinfo.net_dst-get-2",typeof(pinfo.net_dst) == "Address")
205 test("Pinfo.src_port-get-1",pinfo.src_port == srcport)
206 test("Pinfo.dst_port-get-1",pinfo.dst_port == dstport)
208 test("Pinfo.can_desegment-get-1",pinfo.can_desegment == 0)
210 test("Pinfo.desegment_len-get-1",pinfo.desegment_len == 0)
211 test("Pinfo.desegment_offset-get-1",pinfo.desegment_offset == 0)
213 test("pinfo.p2p_dir", pinfo.p2p_dir == P2P_DIR_UNKNOWN)
215 if pinfo.number == 1 then
216 test("Pinfo.rel_ts-get-1",pinfo.rel_ts == 0)
217 test("Pinfo.delta_ts-get-1",pinfo.delta_ts == 0)
218 test("Pinfo.delta_dis_ts-get-1",pinfo.delta_dis_ts == 0)
219 elseif pinfo.number == 2 then
220 test("Pinfo.rel_ts-get-1",pinfo.rel_ts == 0.000295)
221 test("Pinfo.delta_ts-get-1",pinfo.delta_ts == 0.000295)
222 test("Pinfo.delta_dis_ts-get-1",pinfo.delta_dis_ts == 0.000295)
223 elseif pinfo.number == 3 then
224 test("Pinfo.rel_ts-get-1",pinfo.rel_ts == 0.070031)
225 test("Pinfo.delta_ts-get-1",pinfo.delta_ts == 0.069736)
226 test("Pinfo.delta_dis_ts-get-1",pinfo.delta_dis_ts == 0.069736)
227 elseif pinfo.number == 4 then
228 test("Pinfo.rel_ts-get-1",pinfo.rel_ts == 0.070345)
229 test("Pinfo.delta_ts-get-1",pinfo.delta_ts == 0.000314)
230 test("Pinfo.delta_dis_ts-get-1",pinfo.delta_dis_ts == 0.000314)
236 local tmp = pinfo.src
237 pinfo.src = pinfo.dst
238 pinfo.dst = tmp
239 test("Pinfo.src-set-1",tostring(pinfo.src) == dstip)
240 test("Pinfo.src-set-1",typeof(pinfo.src) == "Address")
241 test("Pinfo.dst-set-1",tostring(pinfo.dst) == srcip)
242 test("Pinfo.dst-set-1",typeof(pinfo.dst) == "Address")
244 local dl_dst_val = tostring(pinfo.dl_dst)
245 local dl_src_val = tostring(pinfo.dl_src)
246 tmp = pinfo.dl_src
247 pinfo.dl_src = pinfo.dl_dst
248 pinfo.dl_dst = tmp
249 test("Pinfo.dl_src-set-1",tostring(pinfo.dl_src) == dl_dst_val)
250 test("Pinfo.dl_dst-set-1",tostring(pinfo.dl_dst) == dl_src_val)
252 tmp = pinfo.net_src
253 pinfo.net_src = pinfo.net_dst
254 pinfo.net_dst = tmp
255 test("Pinfo.net_src-set-1",tostring(pinfo.net_src) == dstip)
256 test("Pinfo.net_src-set-1",typeof(pinfo.net_src) == "Address")
257 test("Pinfo.net_dst-set-1",tostring(pinfo.net_dst) == srcip)
258 test("Pinfo.net_dst-set-1",typeof(pinfo.net_dst) == "Address")
268 pinfo.src_port = pinfo.dst_port
269 test("Pinfo.src_port-set-1",pinfo.src_port == dstport)
272 pinfo.can_desegment = 12
273 test("Pinfo.can_desegment-set-1",pinfo.can_desegment == 12)
275 pinfo.desegment_len = 34
276 test("Pinfo.desegment_len-set-1",pinfo.desegment_len == 34)
277 pinfo.desegment_offset = 45
278 test("Pinfo.desegment_offset-set-1",pinfo.desegment_offset == 45)
281 test("Address-eq-1", pinfo.lo == pinfo.dst)
282 test("Address-eq-2", pinfo.lo ~= pinfo.hi)
283 test("Address-lt-1", pinfo.lo < pinfo.hi)
284 test("Address-lt-2", pinfo.hi > pinfo.lo)
285 test("Address-le-1", pinfo.lo <= pinfo.hi)
286 test("Address-le-2", pinfo.lo <= pinfo.dst)