PCS  0.4
Public Member Functions | Public Attributes
pcs.packets.tcp.tcp Class Reference
Inheritance diagram for pcs.packets.tcp.tcp:
pcs.Packet

List of all members.

Public Member Functions

def __init__
def next
def __str__
def pretty
def cksum
def calc_checksum
def calc_checksum_v4
def calc_checksum_v6
def calc_length

Public Attributes

 description
 timestamp
 data
 checksum
 off

Detailed Description

TCP

Constructor & Destructor Documentation

def pcs.packets.tcp.tcp.__init__ (   self,
  bytes = None,
  timestamp = None,
  kv 
)
initialize a TCP packet

Reimplemented from pcs.Packet.

References pcs.Packet.__init__(), pcs.packets.null.null.data, pcs.packets.http.http.data, pcs.packets.localhost.localhost.data, pcs.packets.payload.payload.data, pcs.packets.igmpv2.igmpv2.data, pcs.packets.igmp.igmp.data, pcs.packets.sctp.common.data, pcs.packets.ethernet.ethernet.data, pcs.packets.ptp_common.Common.data, pcs.packets.arp.arp.data, pcs.packets.ipv6.ipv6.data, pcs.packets.mtrace.query.data, pcs.packets.dns.dnsheader.data, pcs.packets.bgp.notification.data, pcs.packets.ieee8021d.garp.data, pcs.packets.dvmrp.dvmrp.data, pcs.packets.rtp.rtp.data, pcs.packets.netlink.nlmsg_error.data, pcs.packets.llc.llc.data, pcs.packets.mpls.ldpmsg.data, pcs.packets.sctp.payload.data, pcs.packets.mtrace.reply.data, pcs.packets.igmpv3.query.data, pcs.packets.bgp.update.data, pcs.packets.icmpv4.icmpv4echo.data, pcs.packets.ieee8023ad.lacp.data, pcs.packets.ieee8021d.stp.data, pcs.packets.ptp.Sync.data, pcs.packets.mpls.ldphdr.data, pcs.packets.rtp.rtcp.data, pcs.packets.sctp.init.data, pcs.packets.bgp.open.data, pcs.packets.icmpv4.icmpv4.data, pcs.packets.ieee8023ad.marker.data, pcs.packets.mpls.lse.data, pcs.packets.netlink.nlmsghdr.data, pcs.packets.rtp.sender.data, pcs.packets.ieee8021d.bpdu.data, pcs.packets.sctp.sack.data, pcs.packets.dhcpv4.dhcpv4.data, pcs.packets.ipv4.ipv4.data, pcs.packets.ieee8023ad.slowhdr.data, pcs.packets.bgp.header.data, pcs.packets.sctp.heartbeat.data, pcs.packets.tcp.tcp.data, pcs.packets.bsdrtmsg.if_link_msg.data, pcs.packets.sctp.abort.data, pcs.packets.ieee80211.frame.data, pcs.packets.radiotap.radiotap.data, pcs.packets.ptp.DelayRequest.data, pcs.packets.sctp.shutdown.data, pcs.packets.bsdrtmsg.if_addr_msg.data, pcs.packets.ipv4.pseudoipv4.data, pcs.packets.ptp.Followup.data, pcs.packets.sctp.shutdown_ack.data, pcs.packets.bsdrtmsg.if_maddr_msg.data, pcs.packets.ieee80211.plcp.data, pcs.packets.sctp.operation_error.data, pcs.packets.ptp.DelayResponse.data, pcs.packets.bsdrtmsg.if_state_msg.data, pcs.packets.sctp.cookie_echo.data, pcs.packets.bsdrtmsg.ieee80211_join_event.data, pcs.packets.sctp.cookie_ack.data, pcs.packets.igmpv3.report.data, pcs.packets.bsdrtmsg.ieee80211_leave_event.data, pcs.packets.sctp.shutdown_complete.data, pcs.packets.bsdrtmsg.ieee80211_replay_event.data, pcs.packets.bsdrtmsg.ieee80211_michael_event.data, pcs.packets.bsdrtmsg.if_ieee80211_msg.data, pcs.packets.rtnetlink.ifaddrmsg.data, pcs.packets.bsdrtmsg.rt_msg.data, pcs.packets.rtnetlink.ifinfomsg.data, pcs.packets.rtnetlink.prefixmsg.data, pcs.packets.bsdrtmsg.rtmsghdr.data, pcs.packets.rtnetlink.rtmsg.data, pcs.packets.null.null.description, pcs.packets.nd6.nd6_solicit.description, pcs.packets.http.http.description, pcs.packets.localhost.localhost.description, pcs.packets.igmp.igmp.description, pcs.packets.payload.payload.description, pcs.packets.ipsec.ah.description, pcs.packets.igmpv2.igmpv2.description, pcs.packets.sctp.common.description, pcs.packets.ethernet.ethernet.description, pcs.packets.ptp_common.Common.description, pcs.packets.rtp.rtp.description, pcs.packets.arp.arp.description, pcs.packets.tcp.tcp.description, pcs.packets.ipv6.ipv6.description, pcs.packets.bgp.notification.description, pcs.packets.mtrace.query.description, pcs.packets.dns.dnsheader.description, pcs.packets.ieee8021d.garp.description, pcs.packets.ipsec.esp.description, pcs.packets.igmpv3.query.description, pcs.packets.dvmrp.dvmrp.description, pcs.packets.llc.llc.description, pcs.packets.netlink.nlmsg_error.description, pcs.packets.mpls.ldpmsg.description, pcs.packets.dhcpv4.dhcpv4.description, pcs.packets.sctp.payload.description, pcs.packets.bgp.update.description, pcs.packets.mtrace.reply.description, pcs.packets.dns.dnslabel.description, pcs.packets.icmpv4.icmpv4echo.description, pcs.packets.ieee8023ad.lacp.description, pcs.packets.ieee8021d.stp.description, pcs.packets.rtp.rtcp.description, pcs.packets.dns.dnsquery.description, pcs.packets.ptp.Sync.description, pcs.packets.mpls.ldphdr.description, pcs.packets.ipv4.ipv4.description, pcs.packets.sctp.init.description, pcs.packets.bgp.open.description, pcs.packets.icmpv4.icmpv4.description, pcs.packets.netlink.nlmsghdr.description, pcs.packets.ieee8023ad.marker.description, pcs.packets.mpls.lse.description, pcs.packets.rtp.sender.description, pcs.packets.dns.dnsrr.description, pcs.packets.ieee8021d.bpdu.description, pcs.packets.sctp.sack.description, pcs.packets.bgp.header.description, pcs.packets.ieee8023ad.slowhdr.description, pcs.packets.sctp.heartbeat.description, pcs.packets.radiotap.radiotap.description, pcs.packets.ieee80211.frame.description, pcs.packets.bsdrtmsg.if_link_msg.description, pcs.packets.sctp.abort.description, pcs.packets.ptp.DelayRequest.description, pcs.packets.sctp.shutdown.description, pcs.packets.bsdrtmsg.if_addr_msg.description, pcs.packets.ptp.Followup.description, pcs.packets.ipv4.pseudoipv4.description, pcs.packets.sctp.shutdown_ack.description, pcs.packets.bsdrtmsg.if_maddr_msg.description, pcs.packets.ieee80211.plcp.description, pcs.packets.sctp.operation_error.description, pcs.packets.ptp.DelayResponse.description, pcs.packets.bsdrtmsg.if_state_msg.description, pcs.packets.sctp.cookie_echo.description, pcs.packets.bsdrtmsg.ieee80211_join_event.description, pcs.packets.igmpv3.report.description, pcs.packets.sctp.cookie_ack.description, pcs.packets.bsdrtmsg.ieee80211_leave_event.description, pcs.packets.sctp.shutdown_complete.description, pcs.packets.bsdrtmsg.ieee80211_replay_event.description, pcs.packets.bsdrtmsg.ieee80211_michael_event.description, pcs.packets.bsdrtmsg.if_ieee80211_msg.description, pcs.packets.rtnetlink.ifaddrmsg.description, pcs.packets.bsdrtmsg.rt_msg.description, pcs.packets.rtnetlink.ifinfomsg.description, pcs.packets.rtnetlink.prefixmsg.description, pcs.packets.bsdrtmsg.rtmsghdr.description, pcs.packets.rtnetlink.rtmsg.description, pcs.OptionListField.next(), pcs.Packet.next(), pcs.Packet.sizeof(), pcs.packets.null.null.timestamp, pcs.packets.nd6.nd6_solicit.timestamp, pcs.packets.http.http.timestamp, pcs.packets.payload.payload.timestamp, pcs.packets.localhost.localhost.timestamp, pcs.packets.ipsec.ah.timestamp, pcs.packets.igmp.igmp.timestamp, pcs.packets.igmpv2.igmpv2.timestamp, pcs.packets.sctp.common.timestamp, pcs.packets.ethernet.ethernet.timestamp, pcs.packets.ptp_common.Common.timestamp, pcs.packets.rtp.rtp.timestamp, pcs.packets.arp.arp.timestamp, pcs.packets.tcp.tcp.timestamp, pcs.packets.ipv6.ipv6.timestamp, pcs.packets.bgp.notification.timestamp, pcs.packets.mtrace.query.timestamp, pcs.packets.dns.dnsheader.timestamp, pcs.packets.ieee8021d.garp.timestamp, pcs.packets.ipsec.esp.timestamp, pcs.packets.dvmrp.dvmrp.timestamp, pcs.packets.igmpv3.query.timestamp, pcs.packets.llc.llc.timestamp, pcs.packets.netlink.nlmsg_error.timestamp, pcs.packets.mpls.ldpmsg.timestamp, pcs.packets.dhcpv4.dhcpv4.timestamp, pcs.packets.sctp.payload.timestamp, pcs.packets.bgp.update.timestamp, pcs.packets.mtrace.reply.timestamp, pcs.packets.icmpv4.icmpv4echo.timestamp, pcs.packets.ieee8023ad.lacp.timestamp, pcs.packets.ieee8021d.stp.timestamp, pcs.packets.ptp.Sync.timestamp, pcs.packets.rtp.rtcp.timestamp, pcs.packets.mpls.ldphdr.timestamp, pcs.packets.ipv4.ipv4.timestamp, pcs.packets.sctp.init.timestamp, pcs.packets.bgp.open.timestamp, pcs.packets.icmpv4.icmpv4.timestamp, pcs.packets.netlink.nlmsghdr.timestamp, pcs.packets.mpls.lse.timestamp, pcs.packets.ieee8023ad.marker.timestamp, pcs.packets.rtp.sender.timestamp, pcs.packets.ieee8021d.bpdu.timestamp, pcs.packets.sctp.sack.timestamp, pcs.packets.bgp.header.timestamp, pcs.packets.ieee8023ad.slowhdr.timestamp, pcs.packets.sctp.heartbeat.timestamp, pcs.packets.radiotap.radiotap.timestamp, pcs.packets.ieee80211.frame.timestamp, pcs.packets.bsdrtmsg.if_link_msg.timestamp, pcs.packets.sctp.abort.timestamp, pcs.packets.ptp.DelayRequest.timestamp, pcs.packets.sctp.shutdown.timestamp, pcs.packets.bsdrtmsg.if_addr_msg.timestamp, pcs.packets.ipv4.pseudoipv4.timestamp, pcs.packets.ptp.Followup.timestamp, pcs.packets.sctp.shutdown_ack.timestamp, pcs.packets.bsdrtmsg.if_maddr_msg.timestamp, pcs.packets.ieee80211.plcp.timestamp, pcs.packets.sctp.operation_error.timestamp, pcs.packets.ptp.DelayResponse.timestamp, pcs.packets.bsdrtmsg.if_state_msg.timestamp, pcs.packets.sctp.cookie_echo.timestamp, pcs.packets.bsdrtmsg.ieee80211_join_event.timestamp, pcs.packets.igmpv3.report.timestamp, pcs.packets.sctp.cookie_ack.timestamp, pcs.packets.bsdrtmsg.ieee80211_leave_event.timestamp, pcs.packets.sctp.shutdown_complete.timestamp, pcs.packets.bsdrtmsg.ieee80211_replay_event.timestamp, pcs.packets.bsdrtmsg.ieee80211_michael_event.timestamp, pcs.packets.bsdrtmsg.if_ieee80211_msg.timestamp, pcs.packets.rtnetlink.ifaddrmsg.timestamp, pcs.packets.bsdrtmsg.rt_msg.timestamp, pcs.packets.rtnetlink.ifinfomsg.timestamp, pcs.packets.rtnetlink.prefixmsg.timestamp, pcs.packets.bsdrtmsg.rtmsghdr.timestamp, and pcs.packets.rtnetlink.rtmsg.timestamp.


Member Function Documentation

Walk the entire packet and pretty print the values of the fields.  Addresses are printed if and only if they are set and not 0.

Reimplemented from pcs.Packet.

References pcs.Layout._layout, and pcs.Packet._layout.

Calculate and store the checksum for this TCP segment.
   The packet must be part of a chain.
   We attempt to infer whether IPv4 or IPv6 encapsulation
   is in use for the payload. The closest header wins the match.
   The network layer header must immediately precede the TCP
   segment (for now).

Reimplemented from pcs.Packet.

References pcs.Packet._head, pcs.packets.tcp.tcp.calc_checksum_v4(), pcs.packets.tcp.tcp.calc_checksum_v6(), pcs.packets.sctp.common.checksum, pcs.packets.igmp.igmp.checksum, pcs.packets.icmpv6.icmpv6.checksum, pcs.packets.icmpv4.icmpv4.checksum, pcs.packets.ipv4.ipv4.checksum, pcs.packets.tcp.tcp.checksum, and pcs.Packet.getbytes().

def pcs.packets.tcp.tcp.calc_checksum_v4 (   self,
  ip 
)
Calculate and store the checksum for the TCP segment
   when encapsulated as an IPv4 payload with the given header.

References pcs.packets.sctp.common.checksum, pcs.packets.igmp.igmp.checksum, pcs.packets.icmpv6.icmpv6.checksum, pcs.packets.icmpv4.icmpv4.checksum, pcs.packets.ipv4.ipv4.checksum, pcs.packets.tcp.tcp.checksum, and pcs.Packet.getbytes().

Referenced by pcs.packets.udp.udp.calc_checksum(), and pcs.packets.tcp.tcp.calc_checksum().

def pcs.packets.tcp.tcp.calc_checksum_v6 (   self,
  ip6 
)
Calculate and store the checksum for the TCP segment
   when encapsulated as an IPv6 payload with the given header.

References pcs.packets.sctp.common.checksum, pcs.packets.igmp.igmp.checksum, pcs.packets.icmpv6.icmpv6.checksum, pcs.packets.icmpv4.icmpv4.checksum, pcs.packets.ipv4.ipv4.checksum, pcs.packets.tcp.tcp.checksum, and pcs.Packet.getbytes().

Referenced by pcs.packets.udp.udp.calc_checksum(), and pcs.packets.tcp.tcp.calc_checksum().

Calculate and store the length field(s) for this packet.
   For TCP, we need only calculate the length of the header and
   any appended options; the length of the TCP payload is
   calculated from the length field in the outer IP/IP6 header.

Reimplemented from pcs.Packet.

References pcs.Packet.getbytes(), and pcs.packets.tcp.tcp.off.

def pcs.packets.tcp.tcp.cksum (   self,
  ip,
  data = "" 
)
Calculate the TCP segment checksum outside of a chain.
def pcs.packets.tcp.tcp.next (   self,
  bytes,
  timestamp 
)
Decode higher layer packets contained in TCP.
def pcs.packets.tcp.tcp.pretty (   self,
  attr 
)
Pretty prting a field

The documentation for this class was generated from the following file: