.\" DO NOT MODIFY THIS FILE! It was generated by setup.py 1.2. .TH TCP 3 "21 March 2023" "NFStest 3.2" "tcp 1.7" .SH NAME packet.transport.tcp - TCP module .SH DESCRIPTION Decode TCP layer. RFC 793 TRANSMISSION CONTROL PROTOCOL RFC 2018 TCP Selective Acknowledgment Options RFC 7323 TCP Extensions for High Performance .SH CLASSES .SS class Flags(packet.utils.OptionFlags) .nf TCP Option flags .P .B Methods defined here: --------------------- .P .B __str__ = str_flags(self) .fi .SS class Option(baseobj.BaseObj) .nf Option object .P .B Methods defined here: --------------------- .P .B __init__(self, unpack) Constructor which takes an unpack object as input .fi .SS class Stream(baseobj.BaseObj) .nf TCP stream buffer object .P .B Methods defined here: --------------------- .P .B __init__(self, seqno) Constructor Initialize object's private data according to the arguments given. Arguments can be given as positional, named arguments or a combination of both. .P .B add_fragment(self, data, seq) Add fragment data to stream buffer .P .B missing_fragment(self, seq) Check if given sequence number is within a missing fragment .fi .SS class TCP(baseobj.BaseObj) .nf TCP object Usage: from packet.transport.tcp import TCP x = TCP(pktt) Object definition: TCP( src_port = int, # Source port dst_port = int, # Destination port seq_number = int, # Sequence number ack_number = int, # Acknowledgment number hl = int, # Data offset or header length (32bit words) header_size = int, # Data offset or header length in bytes flags = Flags( # TCP flags: rawflags = int,# Raw flags FIN = int, # No more data from sender SYN = int, # Synchronize sequence numbers RST = int, # Synchronize sequence numbers PSH = int, # Push function. Asks to push the buffered # data to the receiving application ACK = int, # Acknowledgment field is significant URG = int, # Urgent pointer field is significant ECE = int, # ECN-Echo has a dual role: # SYN=1, the TCP peer is ECN capable. # SYN=0, packet with Congestion Experienced # flag in IP header set is received during # normal transmission CWR = int, # Congestion Window Reduced NS = int, # ECN-nonce concealment protection ), window_size = int, # Window size checksum = int, # Checksum urgent_ptr = int, # Urgent pointer seq = int, # Relative sequence number options = list, # List of TCP options psize = int, # Payload data size data = string, # Raw data of payload if unable to decode ) .P .B Methods defined here: --------------------- .P .B __init__(self, pktt) Constructor Initialize object's private data. .RS .TP .B pktt: Packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers. .RE .P .B __str__(self) String representation of object The representation depends on the verbose level set by debug_repr(). If set to 0 the generic object representation is returned. If set to 1 the representation of the object is condensed: 'TCP 708 -> 2049, seq: 0xc4592255, ack: 0xca66dda1, ACK,FIN' If set to 2 the representation of the object also includes the length of payload and a little bit more verbose: 'src port 708 -> dst port 2049, seq: 0xc4592255, ack: 0xca66dda1, len: 0, flags: FIN,ACK' .fi .SH SEE ALSO .BR baseobj(3), .BR packet.application.dns(3), .BR packet.application.krb5(3), .BR packet.application.rpc(3), .BR packet.transport.mpa(3), .BR packet.unpack(3), .BR packet.utils(3) .SH BUGS No known bugs. .SH AUTHOR Jorge Mora (mora@netapp.com)