@@ -64,7 +64,7 @@ assert nfv9_options_fl[NetflowOptionsFlowsetV9].options[0].optionFieldType == 36
6464nfv9_options_ds = a[4]
6565assert NetflowDataflowsetV9 in nfv9_options_ds
6666assert isinstance(nfv9_options_ds.records[0], NetflowOptionsRecordScopeV9)
67- assert nfv9_options_ds.records[0].IN_BYTES == b'\x01\x00\x00\x00'
67+ assert nfv9_options_ds.records[0].IN_BYTES == 0x01000000
6868assert nfv9_options_ds.records[1].SAMPLING_INTERVAL == 12
6969assert nfv9_options_ds.records[1].SAMPLING_ALGORITHM == 0x2
7070
@@ -114,8 +114,8 @@ dataFS = NetflowDataflowsetV9(
114114 templateID=256,
115115 records=[ # Some random data.
116116 recordClass(
117- IN_BYTES=b"\x12" ,
118- IN_PKTS=b"\0\0\0\0" ,
117+ IN_BYTES=0x12 ,
118+ IN_PKTS=0 ,
119119 PROTOCOL=6,
120120 IPV4_SRC_ADDR="192.168.0.10",
121121 IPV4_DST_ADDR="192.168.0.11"
@@ -144,7 +144,7 @@ dataflowset = NetflowDataflowsetV9(records=[NetflowRecordV9(fieldValue=b'\x14\x0
144144
145145pkt = netflowv9_defragment(list(header/flowset/dataflowset))[0]
146146assert pkt.records[0].IPV4_NEXT_HOP == "10.100.103.1"
147- assert pkt.records[0].OUTPUT_SNMP == b'\x00\x00\x02\xfb'
147+ assert pkt.records[0].OUTPUT_SNMP == 0x000002fb
148148
149149assert raw(pkt) == b'\xaa\xaa\xaa\xaa\xaa\xaa\x00\x00\x00\x00\x00\x00\x08\x00E\x00\x00\xcc\x00\x01\x00\x00@\x11|\x1e\x7f\x00\x00\x01\x7f\x00\x00\x01\x08\x07\x08\x07\x00\xb8\x86\xe7\x00\t\x00\x02\x00\x00\x00\x00\\C\x7f5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\\x01\xa8\x00\x15\x00\x08\x00\x04\x00\x0c\x00\x04\x00\x05\x00\x01\x00\x04\x00\x01\x00\x07\x00\x02\x00\x0b\x00\x02\x00 \x00\x02\x00\n\x00\x04\x00\x10\x00\x04\x00\x11\x00\x04\x00\x12\x00\x04\x00\x0e\x00\x04\x00\x01\x00\x04\x00\x02\x00\x04\x00\x16\x00\x04\x00\x15\x00\x04\x00\x0f\x00\x04\x00\t\x00\x01\x00\r\x00\x01\x00\x06\x00\x01\x00<\x00\x01\x01\xa8\x00@\x14\x00\x00\xfd\x1e\x00\x00\xfd\x00\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x03 \x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x02\xfb\x00\x15a|\x00\x00\x07\x0f$\x95x\xed$\x99\x91<\ndg\x01 \x00\x04'
150150
@@ -210,36 +210,36 @@ dataFlowset_1 = NetflowDataflowsetV9(
210210 templateID=256,
211211 records=[
212212 Record256(
213- IN_BYTES=b"\x12" ,
214- IN_PKTS=b"\0\0\0\0" ,
213+ IN_BYTES=0x12 ,
214+ IN_PKTS=0 ,
215215 PROTOCOL=1,
216216 IPV4_SRC_ADDR="192.168.0.10",
217217 IPV4_DST_ADDR="192.168.0.11"
218218 ),
219219 Record256(
220- IN_BYTES=b"\x0c" ,
221- IN_PKTS=b"\1\1\1\1" ,
220+ IN_BYTES=0x0c ,
221+ IN_PKTS=0x01010101 ,
222222 PROTOCOL=2,
223223 IPV4_SRC_ADDR="172.0.0.10",
224224 IPV4_DST_ADDR="172.0.0.11"
225225 ),
226226 Record256(
227- IN_BYTES=b"\x0c" ,
228- IN_PKTS=b"\1\1\1\1" ,
227+ IN_BYTES=0x0c ,
228+ IN_PKTS=0x01010101 ,
229229 PROTOCOL=3,
230230 IPV4_SRC_ADDR="172.0.0.10",
231231 IPV4_DST_ADDR="172.0.0.11"
232232 ),
233233 Record256(
234- IN_BYTES=b"\x0c" ,
235- IN_PKTS=b"\1\1\1\1" ,
234+ IN_BYTES=0x0c ,
235+ IN_PKTS=0x01010101 ,
236236 PROTOCOL=4,
237237 IPV4_SRC_ADDR="172.0.0.10",
238238 IPV4_DST_ADDR="172.0.0.11"
239239 ),
240240 Record256(
241- IN_BYTES=b"\x0c" ,
242- IN_PKTS=b"\1\1\1\1" ,
241+ IN_BYTES=0x0c ,
242+ IN_PKTS=0x01010101 ,
243243 PROTOCOL=5,
244244 IPV4_SRC_ADDR="172.0.0.10",
245245 IPV4_DST_ADDR="172.0.0.11"
@@ -251,15 +251,15 @@ dataFlowset_2 = NetflowDataflowsetV9(
251251 templateID=257,
252252 records=[
253253 Record257(
254- IN_BYTES=b"\x12" ,
255- IN_PKTS=b"\0\0\0\0" ,
254+ IN_BYTES=0x12 ,
255+ IN_PKTS=0 ,
256256 PROTOCOL=1,
257257 IPV6_SRC_ADDR="2001:db8:3333:4444:5555:6666:7777:8888",
258258 IPV6_DST_ADDR="2001:db8::"
259259 ),
260260 Record257(
261- IN_BYTES=b"\x0c" ,
262- IN_PKTS=b"\1\1\1\1" ,
261+ IN_BYTES=0x0c ,
262+ IN_PKTS=0x01010101 ,
263263 PROTOCOL=2,
264264 IPV6_SRC_ADDR="2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF",
265265 IPV6_DST_ADDR="2001:db8::"
@@ -400,7 +400,7 @@ pkt = netflowv9_defragment(Ether(s))[0]
400400
401401for i in range(1,3):
402402 assert pkt.getlayer(NetflowDataflowsetV9, i).templateID == 257
403- assert pkt.getlayer(NetflowDataflowsetV9, i).records[0].IN_PKTS == b'\x00\x00\x00\x00'
403+ assert pkt.getlayer(NetflowDataflowsetV9, i).records[0].IN_PKTS == 0
404404 assert pkt.getlayer(NetflowDataflowsetV9, i).records[0].PROTOCOL == 6
405405 assert pkt.getlayer(NetflowDataflowsetV9, i).records[0].IPV4_SRC_ADDR == "192.168.0.10"
406406 assert pkt.getlayer(NetflowDataflowsetV9, i).records[0].IPV4_DST_ADDR == "192.168.0.11"
@@ -430,8 +430,8 @@ dataFS = NetflowDataflowsetV9(
430430 templateID=256,
431431 records=[ # Some random data.
432432 recordClass(
433- IN_BYTES=b"\x12" ,
434- IN_PKTS=b"\0\0\0\0" ,
433+ IN_BYTES=0x12 ,
434+ IN_PKTS=0 ,
435435 PROTOCOL=6,
436436 IPV4_SRC_ADDR="192.168.0.10",
437437 IPV4_DST_ADDR="192.168.0.11"
0 commit comments