Commit d5c5db34 authored by Russell D's avatar Russell D

Update af_packet_parser

parent f879fe41
......@@ -19,10 +19,18 @@ def main():
print('Version: {}, Header Length: {}, TTL: {}'.format(version, header_length, ttl))
print('Protocol: {}, Source: {}, Target:{}'.format(ipprotocol, src, target))
(src_port, dest_port, sequence, acknowledgement, flag_urg, flag_ack, flag_psh, flag_rst, flag_syn, flag_fin, data) = tcp_segment(data)
print('Source_port: {}, destination_port: {}'.format(src_port, dest_port))
print('Data: {}'.format(data))
if ipprotocol == 1:
icmp_type, code, checksum, data = icmp_packet(data)
def utf8len(data):
return len(data.encode('utf-8'))
#unpack the frame
def ethernet_frame(data):
dest_mac, src_mac, proto = struct.unpack('! 6s 6s H', data[:14])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment